Commit 52fcae99 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

inetmib1: Fix test failures on some systems.

parent d659e63d
...@@ -157,7 +157,7 @@ static void testQuery(void) ...@@ -157,7 +157,7 @@ static void testQuery(void)
SnmpUtilOidCpy(&vars2[2].name, &vars[2].name); SnmpUtilOidCpy(&vars2[2].name, &vars[2].name);
list.list = vars2; list.list = vars2;
moreData = TRUE; moreData = TRUE;
entry = 1; entry = 0;
do { do {
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
error = 0xdeadbeef; error = 0xdeadbeef;
...@@ -182,28 +182,33 @@ static void testQuery(void) ...@@ -182,28 +182,33 @@ static void testQuery(void)
moreData = FALSE; moreData = FALSE;
if (moreData) if (moreData)
{ {
UINT lastID;
/* Check the OIDs. For these types of values (display strings and /* Check the OIDs. For these types of values (display strings and
* integers) they increase by 1 for each element of the table. * integers) they should increase by 1 for each element of the table
* according to RFC 1158. Windows sometimes has a weird value in the
* table, so allow any value as long as it's greater than the previous
* value on Windows.
*/ */
ok(vars2[0].name.idLength == vars[0].name.idLength + 1, ok(vars2[0].name.idLength == vars[0].name.idLength + 1,
"expected length %d, got %d\n", vars[0].name.idLength + 1, "expected length %d, got %d\n", vars[0].name.idLength + 1,
vars2[0].name.idLength); vars2[0].name.idLength);
ok(vars2[0].name.ids[vars2[0].name.idLength - 1] == entry, lastID = vars2[0].name.ids[vars2[0].name.idLength - 1];
"expected %d, got %d\n", entry, ok(lastID == entry + 1 || broken(lastID > entry),
vars2[0].name.ids[vars2[0].name.idLength - 1]); "expected %d, got %d\n", entry + 1, lastID);
ok(vars2[1].name.idLength == vars[1].name.idLength + 1, ok(vars2[1].name.idLength == vars[1].name.idLength + 1,
"expected length %d, got %d\n", vars[1].name.idLength + 1, "expected length %d, got %d\n", vars[1].name.idLength + 1,
vars2[1].name.idLength); vars2[1].name.idLength);
ok(vars2[1].name.ids[vars2[1].name.idLength - 1] == entry, lastID = vars2[1].name.ids[vars2[1].name.idLength - 1];
"expected %d, got %d\n", entry, ok(lastID == entry + 1 || broken(lastID > entry),
vars2[1].name.ids[vars2[1].name.idLength - 1]); "expected %d, got %d\n", entry + 1, lastID);
ok(vars2[2].name.idLength == vars[2].name.idLength + 1, ok(vars2[2].name.idLength == vars[2].name.idLength + 1,
"expected length %d, got %d\n", vars[2].name.idLength + 1, "expected length %d, got %d\n", vars[2].name.idLength + 1,
vars2[2].name.idLength); vars2[2].name.idLength);
ok(vars2[2].name.ids[vars2[2].name.idLength - 1] == entry, lastID = vars2[2].name.ids[vars2[2].name.idLength - 1];
"expected %d, got %d\n", entry, ok(lastID == entry + 1 || broken(lastID > entry),
vars2[2].name.ids[vars2[2].name.idLength - 1]); "expected %d, got %d\n", entry + 1, lastID);
++entry; entry = lastID;
/* Check the types while we're at it */ /* Check the types while we're at it */
ok(vars2[0].value.asnType == ASN_OCTETSTRING, ok(vars2[0].value.asnType == ASN_OCTETSTRING,
"expected ASN_OCTETSTRING, got %02x\n", vars2[0].value.asnType); "expected ASN_OCTETSTRING, got %02x\n", vars2[0].value.asnType);
......
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