summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-06-27 09:13:11 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-06-27 09:13:11 +0200
commitb5faa3c4cef4d8a076a2de9953806ea90c9052d7 (patch)
tree8366c860ce6ec437ed1f3ddf6d97dccd8b526c7f /tests
parent2c46f3de7de4cdcfeac895a9711e1e99765b6a38 (diff)
downloadrsyslog-b5faa3c4cef4d8a076a2de9953806ea90c9052d7.tar.gz
rsyslog-b5faa3c4cef4d8a076a2de9953806ea90c9052d7.tar.xz
rsyslog-b5faa3c4cef4d8a076a2de9953806ea90c9052d7.zip
misc small changes: corrected version, removed some debug output,
..., restructured makefile, added some troubleshooting to test case (program rscript-parse.c has problem due to different structure alignment, where I do not yet know the reason)
Diffstat (limited to 'tests')
-rw-r--r--tests/rscript-parse.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/rscript-parse.c b/tests/rscript-parse.c
index e9c11a47..ba4a3dea 100644
--- a/tests/rscript-parse.c
+++ b/tests/rscript-parse.c
@@ -52,35 +52,44 @@ BEGINTest
/* the string below is an expression as defined up to 3.19.x - note that the
* then and the space after it MUST be present!
*/
- uchar szExpr[] = "$msg contains 'test' then ";
+ uchar szExpr[] = " $msg contains 'test' then ";
/*uchar szSynErr[] = "$msg == 1 and syntaxerror ";*/
CODESTARTTest
+printf("entering test, init done\n");
/* we first need a tokenizer... */
CHKiRet(ctok.Construct(&tok));
CHKiRet(ctok.Setpp(tok, szExpr));
CHKiRet(ctok.ConstructFinalize(tok));
+printf("done tokenizer\n");
/* now construct our expression */
CHKiRet(expr.Construct(&pExpr));
CHKiRet(expr.ConstructFinalize(pExpr));
+printf("done expr construct\n");
/* ready to go... */
CHKiRet(expr.Parse(pExpr, tok));
+printf("done parse\n");
/* we now need to parse off the "then" - and note an error if it is
* missing...
*/
CHKiRet(ctok.GetToken(tok, &pToken));
+printf("pToken->tok addr %p\n", &(pToken->tok));
+printf("token received %d\n", pToken->tok);
if(pToken->tok != ctok_THEN) {
+printf("invalid token\n");
ctok_token.Destruct(&pToken);
ABORT_FINALIZE(RS_RET_SYNTAX_ERROR);
}
+printf("token destructed\n");
ctok_token.Destruct(&pToken); /* no longer needed */
/* we are done, so we now need to restore things */
CHKiRet(ctok.Destruct(&tok));
finalize_it:
+printf("exiting test, iRet %d\n", iRet);
/* here we may do custom error reporting */
if(iRet != RS_RET_OK) {
uchar *pp;