Module: wine Branch: master Commit: 24ab4453d7acadca427fb165c4f71fc1fcb1218a URL: http://source.winehq.org/git/wine.git/?a=commit;h=24ab4453d7acadca427fb165c4...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Jul 4 13:43:11 2013 +0900
kernel32/tests: Add a test for GetShortPathName called for a non-existent short file name.
---
dlls/kernel32/tests/path.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c index 41650f5..d703aa9 100644 --- a/dlls/kernel32/tests/path.c +++ b/dlls/kernel32/tests/path.c @@ -1275,7 +1275,17 @@ static void test_GetShortPathNameW(void) ok( length, "GetShortPathNameW returned 0.\n" ); ret = GetShortPathNameW( path, short_path, length ); ok( ret, "GetShortPathNameW returned 0.\n" ); + lstrcatW( short_path, name ); + + /* GetShortPathName for a non-existent short file name should fail */ + SetLastError(0xdeadbeef); + length = GetShortPathNameW( short_path, path, 0 ); +todo_wine + ok(!length, "GetShortPathNameW should fail\n"); +todo_wine + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + file = CreateFileW( short_path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); ok( file != INVALID_HANDLE_VALUE, "File was not created.\n" );