summaryrefslogtreecommitdiff
path: root/server/src/macroparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/macroparser.cc')
-rw-r--r--server/src/macroparser.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/server/src/macroparser.cc b/server/src/macroparser.cc
index 2bd482e..bf6ff13 100644
--- a/server/src/macroparser.cc
+++ b/server/src/macroparser.cc
@@ -358,6 +358,10 @@ Macro *MacroParser::getMacro()
}
#ifdef TEST_MACROPARSER
+//deps: debug.cc log.cc saxparser.cc exception.cc
+//cflags: -I.. $(EXPAT_CFLAGS)
+//libs: $(EXPAT_LIBS)
+#include <test.h>
#define XMLFILE "/tmp/test_macroheaderparser.xml"
@@ -368,6 +372,7 @@ Macro *MacroParser::getMacro()
#include <stdio.h>
#include <memory.h>
+/*
static char xml[] =
"<?xml version='1.0' encoding='UTF-8'?>\n"
"<macro name=\"testmacro\" version=\"1.0\">\n"
@@ -394,15 +399,20 @@ static char xml_fail[] =
" <someothertag/>\n"
"</macro>"
;
+*/
-int main()
-{
+TEST_BEGIN;
+
+// TODO: Put some testcode here (see test.h for usable macros).
+TEST_TRUE(false, "No tests yet!");
+
+/*
FILE *fp = fopen(XMLFILE, "w");
if(!fp) {
printf("Could not write to %s\n", XMLFILE);
return 1;
}
- fprintf(fp, xml);
+fprintf(fp, "%s", xml);
fclose(fp);
{
@@ -421,7 +431,7 @@ int main()
printf("Could not write to %s\n", XMLFILE);
return 1;
}
- fprintf(fp, xml_nonmacro);
+fprintf(fp, "%s", xml_nonmacro);
fclose(fp);
// Test parsing of correct xml data, but not macro (should throw an exception).
@@ -442,7 +452,7 @@ int main()
printf("Could not write to %s\n", XMLFILE);
return 1;
}
- fprintf(fp, xml_fail);
+fprintf(fp, "%s", xml_fail);
fclose(fp);
// Test parsing of invalid xml data (should throw an exception).
@@ -459,8 +469,8 @@ int main()
yetonandon:
unlink(XMLFILE);
+*/
- return 0;
-}
+TEST_END;
#endif/*TEST_MACROPARSER*/