Author: tfaber Date: Thu Dec 19 21:39:09 2013 New Revision: 61303
URL: http://svn.reactos.org/svn/reactos?rev=61303&view=rev Log: [KERNEL32_TEST] - Move ROS-only tests into apitest
Added: trunk/rostests/apitests/kernel32/dosdev.c - copied unchanged from r61297, trunk/rostests/winetests/kernel32/dosdev.c trunk/rostests/apitests/kernel32/interlck.c - copied, changed from r61297, trunk/rostests/winetests/kernel32/interlck.c Removed: trunk/rostests/winetests/kernel32/dosdev.c trunk/rostests/winetests/kernel32/interlck.c Modified: trunk/rostests/apitests/kernel32/CMakeLists.txt trunk/rostests/apitests/kernel32/testlist.c trunk/rostests/winetests/kernel32/CMakeLists.txt trunk/rostests/winetests/kernel32/testlist.c
Modified: trunk/rostests/apitests/kernel32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/CMakeLis... ============================================================================== --- trunk/rostests/apitests/kernel32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/kernel32/CMakeLists.txt [iso-8859-1] Thu Dec 19 21:39:09 2013 @@ -1,9 +1,11 @@
list(APPEND SOURCE + dosdev.c FindFiles.c GetCurrentDirectory.c GetDriveType.c GetModuleFileName.c + interlck.c lstrcpynW.c MultiByteToWideChar.c SetCurrentDirectory.c
Copied: trunk/rostests/apitests/kernel32/interlck.c (from r61297, trunk/rostests/winetests/kernel32/interlck.c) URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/interlck... ============================================================================== --- trunk/rostests/winetests/kernel32/interlck.c [iso-8859-1] (original) +++ trunk/rostests/apitests/kernel32/interlck.c [iso-8859-1] Thu Dec 19 21:39:09 2013 @@ -20,7 +20,6 @@
#include <stdarg.h>
-#undef __ROS_LONG64__ #include "wine/test.h" #include "windef.h" #include "winbase.h"
Modified: trunk/rostests/apitests/kernel32/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/testlist... ============================================================================== --- trunk/rostests/apitests/kernel32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/kernel32/testlist.c [iso-8859-1] Thu Dec 19 21:39:09 2013 @@ -3,10 +3,12 @@ #define STANDALONE #include <apitest.h>
+extern void func_dosdev(void); extern void func_FindFiles(void); extern void func_GetCurrentDirectory(void); extern void func_GetDriveType(void); extern void func_GetModuleFileName(void); +extern void func_interlck(void); extern void func_lstrcpynW(void); extern void func_MultiByteToWideChar(void); extern void func_SetCurrentDirectory(void); @@ -14,15 +16,16 @@
const struct test winetest_testlist[] = { + { "dosdev", func_dosdev }, { "FindFiles", func_FindFiles }, { "GetCurrentDirectory", func_GetCurrentDirectory }, { "GetDriveType", func_GetDriveType }, { "GetModuleFileName", func_GetModuleFileName }, + { "interlck", func_interlck }, { "lstrcpynW", func_lstrcpynW }, { "MultiByteToWideChar", func_MultiByteToWideChar }, { "SetCurrentDirectory", func_SetCurrentDirectory }, { "SetUnhandledExceptionFilter", func_SetUnhandledExceptionFilter}, - { 0, 0 } };
Modified: trunk/rostests/winetests/kernel32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/CMakeLi... ============================================================================== --- trunk/rostests/winetests/kernel32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/CMakeLists.txt [iso-8859-1] Thu Dec 19 21:39:09 2013 @@ -21,7 +21,6 @@ format_msg.c #generated.c heap.c - interlck.c loader.c locale.c mailslot.c @@ -39,7 +38,6 @@ version.c virtual.c volume.c - dosdev.c testlist.c)
add_executable(kernel32_winetest
Removed: trunk/rostests/winetests/kernel32/dosdev.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/dosdev.... ============================================================================== --- trunk/rostests/winetests/kernel32/dosdev.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/dosdev.c (removed) @@ -1,384 +0,0 @@ -/* - * Unit test suite for virtual substituted drive functions. - * - * Copyright 2011 Sam Arun Raj - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include <stdarg.h> -#include <stdio.h> - -#include "wine/test.h" -#include "windef.h" -#include "winbase.h" -#include "winerror.h" - -#define SUBST_DRIVE_LETTER 'M' -#define SUBST_DRIVE "M:" -#define SUBST_DRIVE_NON_EXIST_DIR "M:\deadbeef" -#define SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR "M:\" -#define SUBST_DRIVE_SEARCH "M:\*" -#define SUBST_DRIVE_LOWERCASE "m:" -#define SUBST_DRIVE_LOWERCASE_SEARCH "m:\*" -#define SUBST_DRIVE2_LETTER 'R' -#define SUBST_DRIVE2 "R:" -#define SUBST_DRIVE2_WITH_TRAILING_PATH_SEPERATOR "R:\" -#define SUBST_DRIVE2_SEARCH "R:\*" - -static void test_DefineDosDeviceA(void) -{ - CHAR Buffer[MAX_PATH], Target[MAX_PATH]; - BOOL Result; - UINT CharCount; - HANDLE hnd; - WIN32_FIND_DATAA Data; - UINT SystemDriveType, DriveType1, DriveType2; - DWORD dwMaskPrev, dwMaskCur; - CHAR c; - - /* Choose the symbolic link target */ - CharCount = GetSystemWindowsDirectoryA(Target, MAX_PATH); - ok(CharCount > 0, "Failed to get windows directory\n"); - c = Target[3]; - Target[3] = '\0'; - SystemDriveType = GetDriveTypeA(Target); - Target[3] = c; - - /* Test with a subst drive pointing to another substed drive */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE, Target); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - Result = DefineDosDeviceA(0, SUBST_DRIVE2, SUBST_DRIVE); - ok(Result, "Failed to subst drive\n"); - DriveType2 = GetDriveTypeA(SUBST_DRIVE2_WITH_TRAILING_PATH_SEPERATOR); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE2_LETTER - 'A'))), "Drive bit is not set\n"); - hnd = FindFirstFileA(SUBST_DRIVE2_SEARCH, &Data); - ok(hnd != INVALID_HANDLE_VALUE, "Failed to open subst drive\n"); - if (hnd) FindClose(hnd); - ok(DriveType1 == DriveType2, "subst drive types don't match\n"); - ok(DriveType1 == SystemDriveType, "subst drive types don't match\n"); - ok(DriveType2 == SystemDriveType, "subst drive types don't match\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, Target); - ok(Result, "Failed to remove subst drive using NULL Target name\n"); - hnd = FindFirstFileA(SUBST_DRIVE2_SEARCH, &Data); - ok(hnd == INVALID_HANDLE_VALUE, "Opened subst drive when it should fail, we removed the target\n"); - if (hnd) FindClose(hnd); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE2, SUBST_DRIVE); - ok(Result, "Failed to remove subst drive using NULL Target name\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - Result = QueryDosDeviceA(SUBST_DRIVE2, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test using lowercase drive letter */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE_LOWERCASE, Target); - ok(Result, "Failed to subst drive using lowercase drive letter\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 == SystemDriveType, "subst drive types don't match\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data); - ok(hnd != INVALID_HANDLE_VALUE, "Failed to open subst drive\n"); - if (hnd) FindClose(hnd); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE_LOWERCASE, Target); - ok(Result, "Failed to remove subst drive using lowercase drive letter\n"); - Result = QueryDosDeviceA(SUBST_DRIVE_LOWERCASE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test remove without using DDD_EXACT_MATCH_ON_REMOVE */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE, Target); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 == SystemDriveType, "subst drive types don't match\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data); - ok(hnd != INVALID_HANDLE_VALUE, "Failed to open subst drive\n"); - if (hnd) FindClose(hnd); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION, SUBST_DRIVE, NULL); - ok(Result, "Failed to remove subst drive using NULL Target name\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test multiple adds and multiple removes in add order */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp1"); - ok(Result, "Failed to subst drive\n"); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp2"); - ok(Result, "Failed to subst drive\n"); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp3"); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp1"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "Failed to query subst drive\n"); - if (Result) ok((_stricmp(Buffer, "\??\C:\temp3") == 0), "Subst drive is not pointing to correct target\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp2"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "Failed to query subst drive\n"); - if (Result) ok((_stricmp(Buffer, "\??\C:\temp3") == 0), "Subst drive is not pointing to correct target\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp3"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test multiple adds and multiple removes in reverse order */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp1"); - ok(Result, "Failed to subst drive\n"); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp2"); - ok(Result, "Failed to subst drive\n"); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp3"); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp3"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "Failed to query subst drive\n"); - if (Result) ok((_stricmp(Buffer, "\??\C:\temp2") == 0), "Subst drive is not pointing to correct target\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp2"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "Failed to query subst drive\n"); - if (Result) ok((_stricmp(Buffer, "\??\C:\temp1") == 0), "Subst drive is not pointing to correct target\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp1"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test multiple adds and multiple removes out of order */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp1"); - ok(Result, "Failed to subst drive\n"); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp2"); - ok(Result, "Failed to subst drive\n"); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp3"); - ok(Result, "Failed to subst drive\n"); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp4"); - ok(Result, "Failed to subst drive\n"); - Result = DefineDosDeviceA(0, SUBST_DRIVE, "C:\temp5"); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp2"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "Failed to query subst drive\n"); - if (Result) ok((_stricmp(Buffer, "\??\C:\temp5") == 0), "Subst drive is not pointing to correct target\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp5"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "Failed to query subst drive\n"); - if (Result) ok((_stricmp(Buffer, "\??\C:\temp4") == 0), "Subst drive is not pointing to correct target\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp1"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "Failed to query subst drive\n"); - if (Result) ok((_stricmp(Buffer, "\??\C:\temp4") == 0), "Subst drive is not pointing to correct target\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp3"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "Failed to query subst drive\n"); - if (Result) ok((_stricmp(Buffer, "\??\C:\temp4") == 0), "Subst drive is not pointing to correct target"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, "C:\temp4"); - ok(Result, "Failed to remove subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test with trailing '' appended to TargetPath */ - dwMaskPrev = GetLogicalDrives(); - snprintf(Buffer, sizeof(Buffer), "%s\\\", Target); - Result = DefineDosDeviceA(0, SUBST_DRIVE, Buffer); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 == SystemDriveType, "subst drive types don't match\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data); - ok(hnd != INVALID_HANDLE_VALUE, "Failed to open subst drive\n"); - if (hnd) FindClose(hnd); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, Buffer); - ok(Result, "Failed to remove subst drive using NULL Target name\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test with trailing '' appended to TargetPath and DDD_RAW_TARGET_PATH flag */ - dwMaskPrev = GetLogicalDrives(); - snprintf(Buffer, sizeof(Buffer), "\??\%s\\\", Target); - Result = DefineDosDeviceA(DDD_RAW_TARGET_PATH, SUBST_DRIVE, Buffer); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 != SystemDriveType, "subst drive types match when they shouldn't\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data); - ok(hnd == INVALID_HANDLE_VALUE, "Opened subst drive when it should fail\n"); - ok(GetLastError() == ERROR_INVALID_NAME, "GetLastError() reports unexpected error code\n"); - if (hnd) FindClose(hnd); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION, SUBST_DRIVE, NULL); - ok(Result, "Failed to remove subst drive using NULL Target name\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test using trailing \ against drive letter */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR, Target); - ok(!Result, "Subst drive using trailing path seperator, this should not happen\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - ok(!(dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is set when it shouldn't\n"); - hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data); - ok(hnd == INVALID_HANDLE_VALUE, "Opened subst drive when it should fail\n"); - if (hnd) FindClose(hnd); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR, Target); - ok(!Result, "Removing Subst drive using trailing path seperator passed when it should fail\n"); - Result = QueryDosDeviceA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present when it should not be created in the first place\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test using arbitary string, not necessarily a DOS drive letter */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, "!QHello:", Target); - ok(Result, "Failed to subst drive using non-DOS drive name\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, "!QHello:", Target); - ok(Result, "Failed to subst drive using non-DOS drive name\n"); - Result = QueryDosDeviceA("!QHello:", Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test by subst a drive to itself */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE, SUBST_DRIVE); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data); - ok(hnd == INVALID_HANDLE_VALUE, "Opened subst drive when it should fail\n"); - if (hnd) FindClose(hnd); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, SUBST_DRIVE); - ok(Result, "Failed to remove subst drive using lowercase drive letter\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); - - /* Test by subst a drive to an non-existent folder under itself */ - dwMaskPrev = GetLogicalDrives(); - Result = DefineDosDeviceA(0, SUBST_DRIVE, SUBST_DRIVE_NON_EXIST_DIR); - ok(Result, "Failed to subst drive\n"); - DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); - ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); - ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); - hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data); - ok(hnd == INVALID_HANDLE_VALUE, "Opened subst drive when it should fail\n"); - if (hnd) FindClose(hnd); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, SUBST_DRIVE_NON_EXIST_DIR); - ok(Result, "Failed to remove subst drive using lowercase drive letter\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(!Result, "Subst drive is present even after remove attempt\n"); - dwMaskCur = GetLogicalDrives(); - ok(dwMaskCur == dwMaskPrev, "Drive masks don't match\n"); -} - -static void test_QueryDosDeviceA(void) -{ - CHAR Buffer[MAX_PATH], Target[MAX_PATH]; - BOOL Result; - UINT CharCount; - - /* Choose the symbolic link target */ - CharCount = GetSystemWindowsDirectoryA(Target, MAX_PATH); - ok(CharCount > 0, "Failed to get windows directory\n"); - - Result = DefineDosDeviceA(0, SUBST_DRIVE, Target); - ok(Result, "Failed to subst drive\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, 0); - ok(!Result, "Should fail as the buffer passed is supposed to be small\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() reports unexpected error code\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - ok(Result, "failed to get target path\n"); - ok(_strnicmp(Buffer, "\??\", 4) == 0, "The target returned does have correct prefix set\n"); - ok(stricmp(&Buffer[4], Target) == 0, "The target returned does not match the one set\n"); - Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, SUBST_DRIVE, Target); - ok(Result, "Failed to remove subst drive using lowercase drive letter\n"); - Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); - - /* This will try to retrieve all existing MS-DOS device names */ - Result = QueryDosDeviceA(NULL, Buffer, 0); - ok(!Result, "Should fail as the buffer passed is supposed to be small\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() reports unexpected error code\n"); -} - -START_TEST(dosdev) -{ - test_DefineDosDeviceA(); - test_QueryDosDeviceA(); -}
Removed: trunk/rostests/winetests/kernel32/interlck.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/interlc... ============================================================================== --- trunk/rostests/winetests/kernel32/interlck.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/interlck.c (removed) @@ -1,131 +0,0 @@ -/* - * Unit test suite for interlocked functions. - * - * Copyright 2006 Hervé Poussineau - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <stdarg.h> - -#undef __ROS_LONG64__ -#include "wine/test.h" -#include "windef.h" -#include "winbase.h" -#include "winerror.h" - -static void test_InterlockedCompareExchange(void) -{ - LONG dest, res; - - dest = 0; - res = InterlockedCompareExchange( &dest, 1, 0 ); - ok( res == 0 && dest == 1, - "Expected 0 and 1, got %ld and %ld", res, dest ); - - dest = 1; - res = InterlockedCompareExchange( &dest, 2, 0 ); - ok( res == 1 && dest == 1, - "Expected 1 and 1, got %ld and %ld", res, dest ); -} - -static void test_InterlockedDecrement(void) -{ - LONG dest, res; - - dest = 1; - res = InterlockedDecrement( &dest ); - ok( res == 0 && dest == 0, - "Expected 0 and 0, got %ld and %ld", res, dest ); - - dest = 0; - res = InterlockedDecrement( &dest ); - ok( res == -1 && dest == -1, - "Expected -1 and -1, got %ld and %ld", res, dest ); - - dest = -1; - res = InterlockedDecrement( &dest ); - ok( res == -2 && dest == -2, - "Expected -2 and -2, got %ld and %ld", res, dest ); -} - -static void test_InterlockedExchange(void) -{ - LONG dest, res; - - dest = 0; - res = InterlockedExchange( &dest, 1 ); - ok( res == 0 && dest == 1, - "Expected 0 and 1, got %ld and %ld", res, dest ); - - dest = 1; - res = InterlockedExchange( &dest, 2 ); - ok( res == 1 && dest == 2, - "Expected 1 and 2, got %ld and %ld", res, dest ); - - dest = 1; - res = InterlockedExchange( &dest, -1 ); - ok( res == 1 && dest == -1, - "Expected 1 and -1, got %ld and %ld", res, dest ); -} - -static void test_InterlockedExchangeAdd(void) -{ - LONG dest, res; - - dest = 0; - res = InterlockedExchangeAdd( &dest, 1 ); - ok( res == 0 && dest == 1, - "Expected 0 and 1, got %ld and %ld", res, dest ); - - dest = 1; - res = InterlockedExchangeAdd( &dest, 2 ); - ok( res == 1 && dest == 3, - "Expected 1 and 3, got %ld and %ld", res, dest ); - - dest = 1; - res = InterlockedExchangeAdd( &dest, -1 ); - ok( res == 1 && dest == 0, - "Expected 1 and 0, got %ld and %ld", res, dest ); -} - -static void test_InterlockedIncrement(void) -{ - LONG dest, res; - - dest = -2; - res = InterlockedIncrement( &dest ); - ok( res == -1 && dest == -1, - "Expected -1 and -1, got %ld and %ld", res, dest ); - - dest = -1; - res = InterlockedIncrement( &dest ); - ok( res == 0 && dest == 0, - "Expected 0 and 0, got %ld and %ld", res, dest ); - - dest = 0; - res = InterlockedIncrement( &dest ); - ok( res == 1 && dest == 1, - "Expected 1 and 1, got %ld and %ld", res, dest ); -} - -START_TEST(interlck) -{ - test_InterlockedCompareExchange(); - test_InterlockedDecrement(); - test_InterlockedExchange(); - test_InterlockedExchangeAdd(); - test_InterlockedIncrement(); -}
Modified: trunk/rostests/winetests/kernel32/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/testlis... ============================================================================== --- trunk/rostests/winetests/kernel32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/testlist.c [iso-8859-1] Thu Dec 19 21:39:09 2013 @@ -80,8 +80,5 @@ { "version", func_version }, { "virtual", func_virtual }, { "volume", func_volume }, - /* ReactOS */ - { "dosdev", func_dosdev }, - { "interlck", func_interlck }, { 0, 0 } };