summaryrefslogtreecommitdiff
path: root/server/src/templateheaderparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/templateheaderparser.cc')
-rw-r--r--server/src/templateheaderparser.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/server/src/templateheaderparser.cc b/server/src/templateheaderparser.cc
index 2cb3e84..e549035 100644
--- a/server/src/templateheaderparser.cc
+++ b/server/src/templateheaderparser.cc
@@ -143,6 +143,10 @@ Template *TemplateHeaderParser::getTemplate()
}
#ifdef TEST_TEMPLATEHEADERPARSER
+//deps: saxparser.cc exception.cc debug.cc log.cc
+//cflags: -I.. $(EXPAT_CFLAGS)
+//libs: $(EXPAT_LIBS)
+#include <test.h>
#define XMLFILE "/tmp/test_templateheaderparser.xml"
@@ -152,7 +156,7 @@ Template *TemplateHeaderParser::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"
@@ -176,15 +180,19 @@ static char xml_fail[] =
" <someothertag/>\n"
"</template>"
;
+*/
+TEST_BEGIN;
-int main()
-{
+// 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);
{
@@ -203,7 +211,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).
@@ -224,7 +232,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).
@@ -241,8 +249,7 @@ int main()
yetonandon:
unlink(XMLFILE);
-
- return 0;
-}
+*/
+TEST_END;
#endif/*TEST_TEMPLATEHEADERPARSER*/