From cc2cdb3324d16df30477e9b75956672be6549a5e Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 20 Oct 2022 10:30:00 +0200 Subject: [PATCH] virschematest: Construct path to the schema in the SCHEMAS_PATH MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 'abs_top_srcdir' can be prepended to the schema in the macro. Apart from removing one needless string copy it will also allow pointing to schema files in the builddir which will come handy in upcoming patches. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tests/virschematest.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/virschematest.c b/tests/virschematest.c index 3c91bd37bb..2a89f6a1c0 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -151,13 +151,10 @@ testSchemaGrammarReport(const void *opaque) static virXMLValidator * testSchemaGrammarLoad(const char *schema) { - g_autofree char *schema_path = NULL; g_autofree char *testname = NULL; virXMLValidator *ret; - schema_path = g_strdup_printf("%s/%s", abs_top_srcdir, schema); - - ret = virXMLValidatorInit(schema_path); + ret = virXMLValidatorInit(schema); testname = g_strdup_printf("test schema grammar file: '%s'", schema); @@ -335,7 +332,7 @@ mymain(void) { int ret = 0; -#define SCHEMAS_PATH "src/conf/schemas/" +#define SCHEMAS_PATH abs_top_srcdir "/src/conf/schemas/" #define DO_TEST(sch, ent) \ if (testSchemaEntries((sch), (ent), G_N_ELEMENTS(ent)) < 0) \ -- 2.47.2