[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] Fix compiler warnings in test code



# HG changeset patch
# User john levon sun com
# Date 1229399267 28800
# Node ID 1b81ac255ad765ab782829e7fe0a55dc7bab72ab
# Parent  ee6ccfc062f49f514d7ae8924d5a596b18441fee
Fix compiler warnings in test code

Signed-off-by: John Levon <john levon sun com>

diff --git a/src/test.c b/src/test.c
--- a/src/test.c
+++ b/src/test.c
@@ -1299,7 +1299,7 @@ static unsigned long testGetMaxMemory(vi
 static unsigned long testGetMaxMemory(virDomainPtr domain) {
     testConnPtr privconn = domain->conn->privateData;
     virDomainObjPtr privdom;
-    unsigned long ret = -1;
+    unsigned long ret = (unsigned long)-1;
 
     testDriverLock(privconn);
     privdom = virDomainFindByName(&privconn->domains,
diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c
--- a/tests/nodeinfotest.c
+++ b/tests/nodeinfotest.c
@@ -9,6 +9,16 @@
 #include "internal.h"
 #include "nodeinfo.h"
 #include "util.h"
+
+#ifndef __linux__
+
+static int
+mymain(int argc, char **argv)
+{
+    exit (77); /* means 'test skipped' for automake */
+}
+
+#else
 
 static char *progname;
 static char *abs_srcdir;
@@ -78,9 +88,6 @@ 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)
@@ -102,4 +109,7 @@ mymain(int argc, char **argv)
     return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
+#endif /* __linux__ */
+
 VIRT_TEST_MAIN(mymain)
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]