Module: wine Branch: master Commit: 1975ba276f094b789c6e0bc4c8ab5568e4fec397 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1975ba276f094b789c6e0bc4c8...
Author: Nicolas Le Cam niko.lecam@gmail.com Date: Mon Jul 13 20:09:37 2009 +0200
kernel32/tests: Test GetVolumeInformation when current directory is a root directory.
---
dlls/kernel32/tests/volume.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index 4f8c1c0..09aa4b3 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -299,6 +299,7 @@ static void test_GetVolumeInformationA(void) DWORD vol_name_size=MAX_PATH+1, vol_serial_num=-1, max_comp_len=0, fs_flags=0, fs_name_len=MAX_PATH+1; char vol_name_buf[MAX_PATH+1], fs_name_buf[MAX_PATH+1]; char windowsdir[MAX_PATH+10]; + char currentdir[MAX_PATH+1];
if (!pGetVolumeInformationA) { win_skip("GetVolumeInformationA not found\n"); @@ -328,6 +329,29 @@ static void test_GetVolumeInformationA(void) ok(!ret && GetLastError() == ERROR_INVALID_NAME, "GetVolumeInformationA w/o '\' did not fail, last error %u\n", GetLastError());
+ result = GetCurrentDirectory(MAX_PATH, currentdir); + ok(result, "GetCurrentDirectory: error %d\n", GetLastError()); + + /* check for error on no trailing \ when current dir is root dir */ + ret = SetCurrentDirectory(Root_Dir1); + ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ret = pGetVolumeInformationA(Root_Dir0, vol_name_buf, vol_name_size, NULL, + NULL, NULL, fs_name_buf, fs_name_len); + todo_wine + ok(ret, "GetVolumeInformationA failed, last error %u\n", GetLastError()); + + /* check for error on no trailing \ when current dir is windows dir */ + ret = SetCurrentDirectory(windowsdir); + ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ret = pGetVolumeInformationA(Root_Dir0, vol_name_buf, vol_name_size, NULL, + NULL, NULL, fs_name_buf, fs_name_len); + ok(!ret && GetLastError() == ERROR_INVALID_NAME, + "GetVolumeInformationA did not fail, last error %u\n", GetLastError()); + + /* reset current directory */ + ret = SetCurrentDirectory(currentdir); + ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + /* try null root directory to return "root of the current directory" */ ret = pGetVolumeInformationA(NULL, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len);