Juan Lang : snmpapi: Relax tests to fix some failures.

Alexandre Julliard julliard at winehq.org
Mon Feb 16 09:34:51 CST 2009


Module: wine
Branch: master
Commit: dd75176d3459adf54cdb62920e72d8bd8070d074
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dd75176d3459adf54cdb62920e72d8bd8070d074

Author: Juan Lang <juan.lang at gmail.com>
Date:   Fri Feb 13 09:38:29 2009 -0800

snmpapi: Relax tests to fix some failures.

The tests were overly restrictive.  The functions are supposed to
return values less than 0, 0, or greater than 0, whereas the tests
restricted the return values to -1, 0, or 1.  Using less than
0/greater than 0 comparisons rather than == -1 or == 1 should fix a
few failing tests, and match the API descriptions better.

---

 dlls/snmpapi/tests/util.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/snmpapi/tests/util.c b/dlls/snmpapi/tests/util.c
index f8067c2..7ef36fb 100644
--- a/dlls/snmpapi/tests/util.c
+++ b/dlls/snmpapi/tests/util.c
@@ -330,7 +330,7 @@ static void test_SnmpUtilOctetsCmp(void)
     ok(ret == 1, "SnmpUtilOctetsCmp failed\n");
 
     ret = pSnmpUtilOctetsCmp(&octets1, &octets2);
-    ok(ret == -1, "SnmpUtilOctetsCmp failed\n");
+    ok(ret < 0, "SnmpUtilOctetsCmp failed\n");
 }
 
 static void test_SnmpUtilOidNCmp(void)
@@ -370,19 +370,19 @@ static void test_SnmpUtilOidNCmp(void)
     ok(!ret, "SnmpUtilOidNCmp failed\n");
 
     ret = SnmpUtilOidNCmp(&oid1, &oid2, 4);
-    ok(ret == -1, "SnmpUtilOidNCmp failed: %d\n", ret);
+    ok(ret < 0, "SnmpUtilOidNCmp failed: %d\n", ret);
 
     ret = SnmpUtilOidNCmp(&oid2, &oid1, 4);
-    ok(ret == 1, "SnmpUtilOidNCmp failed: %d\n", ret);
+    ok(ret > 0, "SnmpUtilOidNCmp failed: %d\n", ret);
 
     oid1.idLength = 3;
     memcpy(oid1.ids, oid2.ids, sizeof(UINT) * 4);
     ret = SnmpUtilOidNCmp(&oid1, &oid1, 4);
     ok(!ret, "SnmpUtilOidNCmp failed: %d\n", ret);
     ret = SnmpUtilOidNCmp(&oid2, &oid1, 4);
-    ok(ret == 1, "SnmpUtilOidNCmp failed: %d\n", ret);
+    ok(ret > 0, "SnmpUtilOidNCmp failed: %d\n", ret);
     ret = SnmpUtilOidNCmp(&oid1, &oid2, 4);
-    ok(ret == -1, "SnmpUtilOidNCmp failed: %d\n", ret);
+    ok(ret < 0, "SnmpUtilOidNCmp failed: %d\n", ret);
 
     ret = SnmpUtilOidNCmp(&oid1, &oid2, 2);
     ok(!ret, "SnmpUtilOidNCmp failed: %d\n", ret);
@@ -410,10 +410,10 @@ static void test_SnmpUtilOidCmp(void)
     }
 
     ret = SnmpUtilOidCmp(&oid2, &oid1);
-    ok(ret == 1, "SnmpUtilOidCmp failed\n");
+    ok(ret > 0, "SnmpUtilOidCmp failed\n");
 
     ret = SnmpUtilOidCmp(&oid1, &oid2);
-    ok(ret == -1, "SnmpUtilOidCmp failed\n");
+    ok(ret < 0, "SnmpUtilOidCmp failed\n");
 }
 
 static void test_SnmpUtilOidAppend(void)




More information about the wine-cvs mailing list