Module: wine Branch: master Commit: 437c84655a1f132ef56c094ac999c36f21e665c7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=437c84655a1f132ef56c094ac9...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Wed Sep 25 10:36:33 2013 +0400
ntdll/tests: Add proper skips in tests.
---
dlls/ntdll/tests/path.c | 41 +++++++++++++++++++++++++++++++---------- 1 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c index 90db536..442dd82 100644 --- a/dlls/ntdll/tests/path.c +++ b/dlls/ntdll/tests/path.c @@ -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(); }