Commit dd75176d authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

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.
parent 5d16361f
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment