>From f16ca39acfa4bc9c581b73f8a4a0e1855a5f0287 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Mon, 13 Jun 2011 20:34:41 -0400 Subject: [PATCH] squash into txt record 2/5 --- src/Makefile.am | 4 ---- tests/networkxml2argvtest.c | 28 +++++++++++++++------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index edaedec..cba8cae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -530,10 +530,6 @@ libvirt_driver_la_LIBADD = $(NUMACTL_LIBS) $(GNUTLS_LIBS) $(DLOPEN_LIBS) USED_SYM_FILES = libvirt_private.syms -if WITH_NETWORK -USED_SYM_FILES += libvirt_network.syms -endif - if WITH_TEST if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_test.la diff --git a/tests/networkxml2argvtest.c b/tests/networkxml2argvtest.c index 5e7f455..021539a 100644 --- a/tests/networkxml2argvtest.c +++ b/tests/networkxml2argvtest.c @@ -39,7 +39,7 @@ static int testCompareXMLToArgvFiles(const char *inxml, const char *outargv) { obj->def = dev; - if (networkBuildDhcpDaemonCommandLine(obj, &cmd, pidfile) != 0) + if (networkBuildDhcpDaemonCommandLine(obj, &cmd, pidfile) < 0) goto fail; if (!(actual = virCommandToString(cmd))) @@ -61,13 +61,20 @@ static int testCompareXMLToArgvFiles(const char *inxml, const char *outargv) { } static int testCompareXMLToArgvHelper(const void *data) { - char inxml[PATH_MAX]; - char outargv[PATH_MAX]; - snprintf(inxml, PATH_MAX, "%s/networkxml2argvdata/%s.xml", - abs_srcdir, (const char*)data); - snprintf(outargv, PATH_MAX, "%s/networkxml2argvdata/%s.argv", - abs_srcdir, (const char*)data); - return testCompareXMLToArgvFiles(inxml, outargv); + int result = -1; + char *inxml = NULL; + char *outargv = NULL; + if (virAsprintf(&inxml, "%s/networkxml2argvdata/%s.xml", + abs_srcdir, (const char*)data) < 0 || + virAsprintf(&outargv, "%s/networkxml2argvdata/%s.argv", + abs_srcdir, (const char*)data) < 0) + goto cleanup; + result = testCompareXMLToArgvFiles(inxml, outargv); + +cleanup: + VIR_FREE(inxml); + VIR_FREE(outargv); + return result; } @@ -75,11 +82,6 @@ static int mymain(void) { int ret = 0; - char cwd[PATH_MAX]; - - abs_srcdir = getenv("abs_srcdir"); - if (!abs_srcdir) - abs_srcdir = getcwd(cwd, sizeof(cwd)); #define DO_TEST(name) \ if (virtTestRun("Network XML-2-Argv " name, \ -- 1.7.3.4