diff options
author | 2008-10-28 17:48:01 +0000 | |
---|---|---|
committer | 2008-10-28 17:48:01 +0000 | |
commit | a6c7f474ebcbacf05a49e9a480cf504572cc96f5 (patch) | |
tree | 18bbc0a1f6c222a48b91921551a7265fc1336969 /tests | |
parent | cvsignore mingw build artifacts: *.exe (diff) | |
download | libvirt-a6c7f474ebcbacf05a49e9a480cf504572cc96f5.tar.gz libvirt-a6c7f474ebcbacf05a49e9a480cf504572cc96f5.tar.bz2 libvirt-a6c7f474ebcbacf05a49e9a480cf504572cc96f5.zip |
avoid many mingw-specific warnings
* tests/virshtest.c (mymain): Use only one definition of this function.
[WIN32]: Call exit(77) to skip the test.
* tests/nodeinfotest.c: Likewise.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nodeinfotest.c | 8 | ||||
-rw-r--r-- | tests/virshtest.c | 11 |
2 files changed, 7 insertions, 12 deletions
diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index 66f60d9e7..ea7819a93 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -15,8 +15,6 @@ static char *abs_srcdir; #define MAX_FILE 4096 -#ifdef __linux__ - extern int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr nodeinfo); static int linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile) { @@ -64,14 +62,12 @@ static int linuxTestNodeInfo(const void *data) { abs_srcdir, (const char*)data); return linuxTestCompareFiles(cpuinfo, output); } -#endif static int mymain(int argc, char **argv) { int ret = 0; -#ifdef __linux__ int i; const char *nodeData[] = { "nodeinfo-1", @@ -82,6 +78,9 @@ mymain(int argc, char **argv) "nodeinfo-6", }; char cwd[PATH_MAX]; +#ifndef __linux__ + exit (77); /* means 'test skipped' for automake */ +#endif abs_srcdir = getenv("abs_srcdir"); if (!abs_srcdir) @@ -99,7 +98,6 @@ mymain(int argc, char **argv) for (i = 0 ; i < ARRAY_CARDINALITY(nodeData); i++) if (virtTestRun(nodeData[i], 1, linuxTestNodeInfo, nodeData[i]) != 0) ret = -1; -#endif return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/tests/virshtest.c b/tests/virshtest.c index c080362b2..c9ba6b23a 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -265,8 +265,6 @@ static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) { argv); } - -#ifndef WIN32 static int mymain(int argc, char **argv) { @@ -278,6 +276,10 @@ mymain(int argc, char **argv) if (!abs_srcdir) abs_srcdir = getcwd(cwd, sizeof(cwd)); +#ifdef WIN32 + exit (77); /* means 'test skipped' for automake */ +#endif + snprintf(buffer, PATH_MAX-1, "test://%s/../docs/testnode.xml", abs_srcdir); buffer[PATH_MAX-1] = '\0'; progname = argv[0]; @@ -354,10 +356,5 @@ mymain(int argc, char **argv) return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); } -#else /* ! WIN32 */ - -static int mymain (void) { exit (77); /* means 'test skipped' for automake */ } - -#endif /* WIN32 */ VIRT_TEST_MAIN(mymain) |