summaryrefslogtreecommitdiff
path: root/server/src/templateparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/templateparser.cc')
-rw-r--r--server/src/templateparser.cc26
1 files changed, 17 insertions, 9 deletions
diff --git a/server/src/templateparser.cc b/server/src/templateparser.cc
index b34f280..20270c6 100644
--- a/server/src/templateparser.cc
+++ b/server/src/templateparser.cc
@@ -161,6 +161,10 @@ Template *TemplateParser::getTemplate()
}
#ifdef TEST_TEMPLATEPARSER
+//deps: saxparser.cc debug.cc log.cc exception.cc
+//cflags: -I.. $(EXPAT_CFLAGS)
+//libs: $(EXPAT_LIBS)
+#include <test.h>
#define XMLFILE "/tmp/test_templateparser.xml"
@@ -170,7 +174,7 @@ Template *TemplateParser::getTemplate()
#include <string.h>
#include <stdio.h>
#include <memory.h>
-
+/*
static char xml[] =
"<?xml version='1.0' encoding='UTF-8'?>\n"
"<template name=\"testtemplate\" version=\"1.0\">\n"
@@ -194,15 +198,20 @@ static char xml_fail[] =
" <someothertag/>\n"
"</template>"
;
+*/
-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);
{
@@ -221,7 +230,7 @@ int main()
printf("Could not write to %s\n", XMLFILE);
return 1;
}
- fprintf(fp, xml_nontemplate);
+fprintf(fp, "%s", xml_nontemplate);
fclose(fp);
// Test parsing of correct xml data, but not template (should throw an exception).
@@ -242,7 +251,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).
@@ -259,8 +268,7 @@ int main()
yetonandon:
unlink(XMLFILE);
-
- return 0;
-}
+*/
+TEST_END;
#endif/*TEST_TEMPLATEPARSER*/