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

inetmib1/tests: Trace the SNMP error code and index rather than GetLastError on failure.

parent 00160719
...@@ -88,7 +88,7 @@ static void testQuery(void) ...@@ -88,7 +88,7 @@ static void testQuery(void)
error = 0xdeadbeef; error = 0xdeadbeef;
index = 0xdeadbeef; index = 0xdeadbeef;
ret = pQuery(SNMP_PDU_GET, &list, &error, &index); ret = pQuery(SNMP_PDU_GET, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
ok(error == SNMP_ERRORSTATUS_NOERROR, ok(error == SNMP_ERRORSTATUS_NOERROR,
"expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error);
ok(index == 0, "expected index 0, got %d\n", index); ok(index == 0, "expected index 0, got %d\n", index);
...@@ -105,7 +105,7 @@ static void testQuery(void) ...@@ -105,7 +105,7 @@ static void testQuery(void)
error = 0xdeadbeef; error = 0xdeadbeef;
index = 0xdeadbeef; index = 0xdeadbeef;
ret = pQuery(SNMP_PDU_GET, &list, &error, &index); ret = pQuery(SNMP_PDU_GET, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
ok(error == SNMP_ERRORSTATUS_NOERROR || ok(error == SNMP_ERRORSTATUS_NOERROR ||
error == ERROR_FILE_NOT_FOUND /* Win9x */, error == ERROR_FILE_NOT_FOUND /* Win9x */,
"expected SNMP_ERRORSTATUS_NOERROR or ERROR_FILE_NOT_FOUND, got %d\n", "expected SNMP_ERRORSTATUS_NOERROR or ERROR_FILE_NOT_FOUND, got %d\n",
...@@ -125,7 +125,7 @@ static void testQuery(void) ...@@ -125,7 +125,7 @@ static void testQuery(void)
error = 0xdeadbeef; error = 0xdeadbeef;
index = 0xdeadbeef; index = 0xdeadbeef;
ret = pQuery(SNMP_PDU_GET, &list, &error, &index); ret = pQuery(SNMP_PDU_GET, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
ok(error == SNMP_ERRORSTATUS_NOSUCHNAME, ok(error == SNMP_ERRORSTATUS_NOSUCHNAME,
"expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d\n", error); "expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d\n", error);
/* The index is 1-based rather than 0-based */ /* The index is 1-based rather than 0-based */
...@@ -147,7 +147,7 @@ static void testQuery(void) ...@@ -147,7 +147,7 @@ static void testQuery(void)
error = 0xdeadbeef; error = 0xdeadbeef;
index = 0xdeadbeef; index = 0xdeadbeef;
ret = pQuery(SNMP_PDU_GET, &list, &error, &index); ret = pQuery(SNMP_PDU_GET, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
ok(error == SNMP_ERRORSTATUS_NOSUCHNAME, ok(error == SNMP_ERRORSTATUS_NOSUCHNAME,
"expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d\n", error); "expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d\n", error);
ok(index == 1, "expected index 1, got %d\n", index); ok(index == 1, "expected index 1, got %d\n", index);
...@@ -169,7 +169,7 @@ static void testQuery(void) ...@@ -169,7 +169,7 @@ static void testQuery(void)
error = 0xdeadbeef; error = 0xdeadbeef;
index = 0xdeadbeef; index = 0xdeadbeef;
ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
ok(error == SNMP_ERRORSTATUS_NOERROR, ok(error == SNMP_ERRORSTATUS_NOERROR,
"expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error);
ok(index == 0, "expected index 0, got %d\n", index); ok(index == 0, "expected index 0, got %d\n", index);
...@@ -252,7 +252,7 @@ static void testQuery(void) ...@@ -252,7 +252,7 @@ static void testQuery(void)
moreData = TRUE; moreData = TRUE;
noChange = FALSE; noChange = FALSE;
ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
ok(error == SNMP_ERRORSTATUS_NOERROR, ok(error == SNMP_ERRORSTATUS_NOERROR,
"expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error);
ok(index == 0, "expected index 0, got %d\n", index); ok(index == 0, "expected index 0, got %d\n", index);
...@@ -274,7 +274,7 @@ static void testQuery(void) ...@@ -274,7 +274,7 @@ static void testQuery(void)
moreData = TRUE; moreData = TRUE;
do { do {
ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
ok(error == SNMP_ERRORSTATUS_NOERROR, ok(error == SNMP_ERRORSTATUS_NOERROR,
"expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error);
ok(index == 0, "expected index 0, got %d\n", index); ok(index == 0, "expected index 0, got %d\n", index);
...@@ -340,7 +340,7 @@ static void testQuery(void) ...@@ -340,7 +340,7 @@ static void testQuery(void)
noChange = FALSE; noChange = FALSE;
do { do {
ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
ok(error == SNMP_ERRORSTATUS_NOERROR, ok(error == SNMP_ERRORSTATUS_NOERROR,
"expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error); "expected SNMP_ERRORSTATUS_NOERROR, got %d\n", error);
ok(index == 0, "expected index 0, got %d\n", index); ok(index == 0, "expected index 0, got %d\n", index);
...@@ -406,7 +406,7 @@ static void testQuery(void) ...@@ -406,7 +406,7 @@ static void testQuery(void)
noChange = FALSE; noChange = FALSE;
do { do {
ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index); ret = pQuery(SNMP_PDU_GETNEXT, &list, &error, &index);
ok(ret, "SnmpExtensionQuery failed: %d\n", GetLastError()); ok(ret, "SnmpExtensionQuery failed: %d, %d\n", error, index);
/* FIXME: error and index aren't checked here because the UDP table is /* FIXME: error and index aren't checked here because the UDP table is
* the last OID currently supported by Wine, so the last GetNext fails. * the last OID currently supported by Wine, so the last GetNext fails.
* todo_wine is also not effective because it will succeed for all but * todo_wine is also not effective because it will succeed for all but
......
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