mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:36:11 +00:00
[APITEST:NTDLL]
Add a parameter for displaying the current test number when something fails. svn path=/trunk/; revision=57515
This commit is contained in:
parent
ee0de5e843
commit
9050f658d1
1 changed files with 8 additions and 5 deletions
|
@ -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},
|
{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;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
BOOLEAN WasEnabled = FALSE;
|
BOOLEAN WasEnabled = FALSE;
|
||||||
|
@ -66,7 +67,7 @@ static void Test_API(IN PTEST_CASE TestCase)
|
||||||
TRUE,
|
TRUE,
|
||||||
FALSE,
|
FALSE,
|
||||||
&WasEnabled);
|
&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.
|
// Now check the results.
|
||||||
//
|
//
|
||||||
ok(Status == TestCase->Result,
|
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,
|
Status,
|
||||||
TestCase->Result);
|
TestCase->Result);
|
||||||
|
|
||||||
ok( ((TestCase->MinimalExpectedReturnedLength <= ReturnedLength) && (ReturnedLength <= TestCase->MaximalExpectedReturnedLength)),
|
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,
|
ReturnedLength,
|
||||||
TestCase->MinimalExpectedReturnedLength,
|
TestCase->MinimalExpectedReturnedLength,
|
||||||
TestCase->MaximalExpectedReturnedLength);
|
TestCase->MaximalExpectedReturnedLength);
|
||||||
|
@ -106,7 +109,7 @@ START_TEST(NtQuerySystemEnvironmentValue)
|
||||||
|
|
||||||
for (i = 0 ; i < COUNT_OF(TestCases) ; ++i)
|
for (i = 0 ; i < COUNT_OF(TestCases) ; ++i)
|
||||||
{
|
{
|
||||||
Test_API(&TestCases[i]);
|
Test_API(i, &TestCases[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue