ntdll/tests: Add proper skips in tests.

This commit is contained in:
Nikolay Sivov 2013-09-25 10:36:33 +04:00 committed by Alexandre Julliard
parent 12e0b0577c
commit 437c84655a
1 changed files with 31 additions and 10 deletions

View File

@ -30,7 +30,7 @@ static BOOLEAN (WINAPI *pRtlIsNameLegalDOS8Dot3)(const UNICODE_STRING*,POEM_STRI
static DWORD (WINAPI *pRtlGetFullPathName_U)(const WCHAR*,ULONG,WCHAR*,WCHAR**);
static void test_RtlDetermineDosPathNameType(void)
static void test_RtlDetermineDosPathNameType_U(void)
{
struct test
{
@ -75,6 +75,12 @@ static void test_RtlDetermineDosPathNameType(void)
WCHAR buffer[MAX_PATH];
UINT ret;
if (!pRtlDetermineDosPathNameType_U)
{
win_skip("RtlDetermineDosPathNameType_U is not available\n");
return;
}
for (test = tests; test->path; test++)
{
pRtlMultiByteToUnicodeN( buffer, sizeof(buffer), NULL, test->path, strlen(test->path)+1 );
@ -84,7 +90,7 @@ static void test_RtlDetermineDosPathNameType(void)
}
static void test_RtlIsDosDeviceName(void)
static void test_RtlIsDosDeviceName_U(void)
{
struct test
{
@ -142,6 +148,12 @@ static void test_RtlIsDosDeviceName(void)
WCHAR buffer[2000];
ULONG ret;
if (!pRtlIsDosDeviceName_U)
{
win_skip("RtlIsDosDeviceName_U is not available\n");
return;
}
for (test = tests; test->path; test++)
{
pRtlMultiByteToUnicodeN( buffer, sizeof(buffer), NULL, test->path, strlen(test->path)+1 );
@ -195,6 +207,12 @@ static void test_RtlIsNameLegalDOS8Dot3(void)
char buff2[12];
BOOLEAN ret, spaces;
if (!pRtlIsNameLegalDOS8Dot3)
{
win_skip("RtlIsNameLegalDOS8Dot3 is not available\n");
return;
}
ustr.MaximumLength = sizeof(buffer);
ustr.Buffer = buffer;
for (test = tests; test->path; test++)
@ -272,6 +290,12 @@ static void test_RtlGetFullPathName_U(void)
DWORD reslen;
UINT len;
if (!pRtlGetFullPathName_U)
{
win_skip("RtlGetFullPathName_U is not available\n");
return;
}
file_part = (WCHAR *)0xdeadbeef;
lstrcpyW(rbufferW, deadbeefW);
ret = pRtlGetFullPathName_U(NULL, MAX_PATH, rbufferW, &file_part);
@ -334,12 +358,9 @@ START_TEST(path)
pRtlOemStringToUnicodeString = (void *)GetProcAddress(mod,"RtlOemStringToUnicodeString");
pRtlIsNameLegalDOS8Dot3 = (void *)GetProcAddress(mod,"RtlIsNameLegalDOS8Dot3");
pRtlGetFullPathName_U = (void *)GetProcAddress(mod,"RtlGetFullPathName_U");
if (pRtlDetermineDosPathNameType_U)
test_RtlDetermineDosPathNameType();
if (pRtlIsDosDeviceName_U)
test_RtlIsDosDeviceName();
if (pRtlIsNameLegalDOS8Dot3)
test_RtlIsNameLegalDOS8Dot3();
if (pRtlGetFullPathName_U && pRtlMultiByteToUnicodeN)
test_RtlGetFullPathName_U();
test_RtlDetermineDosPathNameType_U();
test_RtlIsDosDeviceName_U();
test_RtlIsNameLegalDOS8Dot3();
test_RtlGetFullPathName_U();
}