On Tue, 2017-03-28 at 13:58 +0200, Peter Krempa wrote:
[...]
@@ -196,6 +192,30 @@ mymain(void)
} \
} while (0)
+#define DO_TEST_FILE(sch, xmlfile) \
+ do { \
+ data.schema = sch; \
+ data.xml_path = xmlfile; \
+ if (virTestRun("test schema grammar file: "
sch, \
+ testSchemaGrammar, &data) == 0) { \
+ /* initialize the validator even if the schema test \
+ * was skipped because of VIR_TEST_RANGE */ \
+ if (!data.validator && testSchemaGrammar(&data) < 0)
{ \
+ ret = -1; \
+ break; \
+ } \
+ if (virTestRun("Checking " xmlfile " against "
sch, \
+ testSchemaFile, &data) < 0) \
+ ret = -1; \
+ \
+ virXMLValidatorFree(data.validator); \
+ data.validator = NULL; \
+ } else { \
+ ret = -1; \
+ } \
+ } while (0)
+
+
Only one empty line here, please.
Now that you've introduced DO_TEST_FILE(), I think it would
make sense to rename DO_TEST() to DO_TEST_DIRS() for clarity.
ACK whether you feel the same or not.
--
Andrea Bolognani / Red Hat / Virtualization