[APITEST:NTDLL]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 7 Oct 2012 14:17:37 +0000 (14:17 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 7 Oct 2012 14:17:37 +0000 (14:17 +0000)
Add a parameter for displaying the current test number when something fails.

svn path=/trunk/; revision=57515

rostests/apitests/ntdll/NtQuerySystemEnvironmentValue.c

index 5d04e79..0c64051 100644 (file)
@@ -49,7 +49,8 @@ static TEST_CASE TestCases[] =
     {STATUS_SUCCESS           , RTL_CONSTANT_STRING(L"LastKnownGood"), TRUE , MAX_BUFFER_LENGTH, MIN_BUFFER_LENGTH, MAX_BUFFER_LENGTH},
 };
 
-static void Test_API(IN PTEST_CASE TestCase)
+static void Test_API(IN ULONG TestNumber,
+                     IN PTEST_CASE TestCase)
 {
     NTSTATUS Status = STATUS_SUCCESS;
     BOOLEAN  WasEnabled = FALSE;
@@ -66,7 +67,7 @@ static void Test_API(IN PTEST_CASE TestCase)
                                     TRUE,
                                     FALSE,
                                     &WasEnabled);
-        ok(NT_SUCCESS(Status), "RtlAdjustPrivilege failed : 0x%08lx\n", Status);
+        ok(NT_SUCCESS(Status), "RtlAdjustPrivilege(%lu) failed : 0x%08lx\n", TestNumber, Status);
     }
 
     //
@@ -89,12 +90,14 @@ static void Test_API(IN PTEST_CASE TestCase)
     // Now check the results.
     //
     ok(Status == TestCase->Result,
-       "NtQuerySystemEnvironmentValue failed, returned 0x%08lx, expected 0x%08lx\n",
+       "NtQuerySystemEnvironmentValue(%lu) failed : returned 0x%08lx, expected 0x%08lx\n",
+       TestNumber,
        Status,
        TestCase->Result);
 
     ok( ((TestCase->MinimalExpectedReturnedLength <= ReturnedLength) && (ReturnedLength <= TestCase->MaximalExpectedReturnedLength)),
-        "Returned length %lu, expected between %lu and %lu\n",
+        "NtQuerySystemEnvironmentValue(%lu) failed : returned length %lu, expected between %lu and %lu\n",
+        TestNumber,
         ReturnedLength,
         TestCase->MinimalExpectedReturnedLength,
         TestCase->MaximalExpectedReturnedLength);
@@ -106,7 +109,7 @@ START_TEST(NtQuerySystemEnvironmentValue)
 
     for (i = 0 ; i < COUNT_OF(TestCases) ; ++i)
     {
-        Test_API(&TestCases[i]);
+        Test_API(i, &TestCases[i]);
     }
 }