Andrew Nguyen : ntdll/tests: Add tests to examine output file part pointer behavior for RtlGetFullPathName_U .

Alexandre Julliard julliard at winehq.org
Thu Jun 17 11:17:15 CDT 2010


Module: wine
Branch: master
Commit: bdf583b349a6c721a968ccee66358fc59f24e3fc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bdf583b349a6c721a968ccee66358fc59f24e3fc

Author: Andrew Nguyen <anguyen at codeweavers.com>
Date:   Wed Jun 16 23:40:04 2010 -0500

ntdll/tests: Add tests to examine output file part pointer behavior for RtlGetFullPathName_U.

---

 dlls/ntdll/tests/path.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c
index 9d39cdc..90db536 100644
--- a/dlls/ntdll/tests/path.c
+++ b/dlls/ntdll/tests/path.c
@@ -226,6 +226,9 @@ static void test_RtlIsNameLegalDOS8Dot3(void)
 }
 static void test_RtlGetFullPathName_U(void)
 {
+    static const WCHAR emptyW[] = {0};
+    static const WCHAR deadbeefW[] = {'d','e','a','d','b','e','e','f',0};
+
     struct test
     {
         const char *path;
@@ -269,6 +272,26 @@ static void test_RtlGetFullPathName_U(void)
     DWORD reslen;
     UINT len;
 
+    file_part = (WCHAR *)0xdeadbeef;
+    lstrcpyW(rbufferW, deadbeefW);
+    ret = pRtlGetFullPathName_U(NULL, MAX_PATH, rbufferW, &file_part);
+    ok(!ret, "Expected RtlGetFullPathName_U to return 0, got %u\n", ret);
+    ok(!lstrcmpW(rbufferW, deadbeefW),
+       "Expected the output buffer to be untouched, got %s\n", wine_dbgstr_w(rbufferW));
+    ok(file_part == (WCHAR *)0xdeadbeef ||
+       file_part == NULL, /* Win7 */
+       "Expected file part pointer to be untouched, got %p\n", file_part);
+
+    file_part = (WCHAR *)0xdeadbeef;
+    lstrcpyW(rbufferW, deadbeefW);
+    ret = pRtlGetFullPathName_U(emptyW, MAX_PATH, rbufferW, &file_part);
+    ok(!ret, "Expected RtlGetFullPathName_U to return 0, got %u\n", ret);
+    ok(!lstrcmpW(rbufferW, deadbeefW),
+       "Expected the output buffer to be untouched, got %s\n", wine_dbgstr_w(rbufferW));
+    ok(file_part == (WCHAR *)0xdeadbeef ||
+       file_part == NULL, /* Win7 */
+       "Expected file part pointer to be untouched, got %p\n", file_part);
+
     for (test = tests; test->path; test++)
     {
         len= strlen(test->rname) * sizeof(WCHAR);




More information about the wine-cvs mailing list