From dd75176d3459adf54cdb62920e72d8bd8070d074 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Fri, 13 Feb 2009 09:38:29 -0800 Subject: [PATCH] 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 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/snmpapi/tests/util.c b/dlls/snmpapi/tests/util.c index f8067c2c412..7ef36fbaed3 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)