]> xenbits.xensource.com Git - libvirt.git/commitdiff
avoid many mingw-specific warnings
authorJim Meyering <meyering@redhat.com>
Tue, 28 Oct 2008 17:48:01 +0000 (17:48 +0000)
committerJim Meyering <meyering@redhat.com>
Tue, 28 Oct 2008 17:48:01 +0000 (17:48 +0000)
* tests/virshtest.c (mymain): Use only one definition of this function.
[WIN32]: Call exit(77) to skip the test.
* tests/nodeinfotest.c: Likewise.

ChangeLog
tests/nodeinfotest.c
tests/virshtest.c

index 4fb4173d6abaa1b1d014a135afa5ddbbb973d94e..dda2563569cfa519c047be9a73612befb5555e73 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Oct 28 13:29:14 +0100 2008 Jim Meyering <meyering@redhat.com>
+
+       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.
+
 Tue Oct 28 13:29:14 +0100 2008 Jim Meyering <meyering@redhat.com>
 
        cvsignore mingw build artifacts: *.exe
index 66f60d9e78e9313943292ba69ef38f9db4cda330..ea7819a9350da59e896b39abea23a368b4e85100 100644 (file)
@@ -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);
 }
index c080362b2c2a53e3f1e56a79788557224d43e1ec..c9ba6b23ab7206173ffab4b61cf51b80be7ca7d2 100644 (file)
@@ -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)