aboutsummaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-01-23 02:25:56 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-01-23 02:25:56 +0000
commit33bea767ebd0bbf11867fe1af31dc345e9f816af (patch)
tree4c7d01783220f9e8b79c0239562af5d63d833359 /tests/server
parent9ab7cda0105cd926ab67c31508c5d835466ce8e7 (diff)
Convert (most of) the test data files into genuine XML. A handful still
are not, due mainly to the lack of support for XML character entities (e.g. & => &amp; ). This will make it easier to validate test files using tools like xmllint, as well as edit and view them using XML tools.
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/getpart.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/server/getpart.c b/tests/server/getpart.c
index 5a839b122..3453bf313 100644
--- a/tests/server/getpart.c
+++ b/tests/server/getpart.c
@@ -120,6 +120,7 @@ const char *spitout(FILE *stream,
enum {
STATE_OUTSIDE,
+ STATE_OUTER,
STATE_INMAIN,
STATE_INSUB,
STATE_ILLEGAL
@@ -173,6 +174,10 @@ const char *spitout(FILE *stream,
cmain[0]=0; /* no main anymore */
display=0;
}
+ else if(state == STATE_OUTER) {
+ /* this is the end of the outermost file section */
+ state--;
+ }
}
else if(!display) {
/* this is the beginning of a section */
@@ -182,6 +187,10 @@ const char *spitout(FILE *stream,
*end = 0;
switch(state) {
case STATE_OUTSIDE:
+ /* Ignore the outermost <testcase> element */
+ state = STATE_OUTER;
+ break;
+ case STATE_OUTER:
strcpy(cmain, ptr);
state = STATE_INMAIN;
break;
@@ -214,6 +223,10 @@ const char *spitout(FILE *stream,
show(("* (%d bytes) %s\n", stringlen, buffer));
display = 1; /* start displaying */
}
+ else if ((*cmain == '!') || (*csub == '!')) {
+ /* This is just a comment, not a new section */
+ state--;
+ }
else {
show(("%d (%s/%s): %s\n", state, cmain, csub, buffer));
display = 0; /* no display */