summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2007-07-16 21:30:30 +0000
committerDaniel P. Berrange <berrange@redhat.com>2007-07-16 21:30:30 +0000
commit67c346b1029cbbd39425fcd707b0bef181a1a7bc (patch)
tree17066aa21cb4459620c1b857f375194015a72806 /tests/sexpr2xmltest.c
parent* src/xml.c: applied modified patch from Masayuki Sunou for (diff)
downloadlibvirt-67c346b1029cbbd39425fcd707b0bef181a1a7bc.tar.gz
libvirt-67c346b1029cbbd39425fcd707b0bef181a1a7bc.tar.bz2
libvirt-67c346b1029cbbd39425fcd707b0bef181a1a7bc.zip
Added new <clock/> element in XML for choosing utc/localtime
Diffstat (limited to 'tests/sexpr2xmltest.c')
-rw-r--r--tests/sexpr2xmltest.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c
index 1f0af7c93..4e385dc6e 100644
--- a/tests/sexpr2xmltest.c
+++ b/tests/sexpr2xmltest.c
@@ -28,12 +28,13 @@ static int testCompareFiles(const char *xml, const char *sexpr, int xendConfigVe
if (!(gotxml = xend_parse_domain_sexp(NULL, sexprData, xendConfigVersion)))
goto fail;
- if (getenv("DEBUG_TESTS")) {
- printf("Expect %d '%s'\n", (int)strlen(xmlData), xmlData);
- printf("Actual %d '%s'\n", (int)strlen(gotxml), gotxml);
- }
- if (strcmp(xmlData, gotxml))
+ if (strcmp(xmlData, gotxml)) {
+ if (getenv("DEBUG_TESTS")) {
+ printf("Expect %d '%s'\n", (int)strlen(xmlData), xmlData);
+ printf("Actual %d '%s'\n", (int)strlen(gotxml), gotxml);
+ }
goto fail;
+ }
ret = 0;
@@ -136,6 +137,19 @@ static int testCompareNoSourceCDRom(void *data ATTRIBUTE_UNUSED) {
1);
}
+static int testCompareFVclockUTC(void *data ATTRIBUTE_UNUSED) {
+ return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-utc.xml",
+ "sexpr2xmldata/sexpr2xml-fv-utc.sexpr",
+ 1);
+}
+
+static int testCompareFVclockLocaltime(void *data ATTRIBUTE_UNUSED) {
+ return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-localtime.xml",
+ "sexpr2xmldata/sexpr2xml-fv-localtime.sexpr",
+ 1);
+}
+
+
int
main(int argc, char **argv)
@@ -209,6 +223,14 @@ main(int argc, char **argv)
1, testCompareNoSourceCDRom, NULL) != 0)
ret = -1;
+ if (virtTestRun("SEXPR-2-XML clock UTC",
+ 1, testCompareFVclockUTC, NULL) != 0)
+ ret = -1;
+
+ if (virtTestRun("SEXPR-2-XML clock Localtime",
+ 1, testCompareFVclockLocaltime, NULL) != 0)
+ ret = -1;
+
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
#else /* WITHOUT_XEN */