Author: akhaldi Date: Sun Jul 19 23:09:55 2015 New Revision: 68468
URL: http://svn.reactos.org/svn/reactos?rev=68468&view=rev Log: [ODBCCP32_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
Modified: trunk/rostests/winetests/odbccp32/CMakeLists.txt trunk/rostests/winetests/odbccp32/misc.c
Modified: trunk/rostests/winetests/odbccp32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/odbccp32/CMakeLi... ============================================================================== --- trunk/rostests/winetests/odbccp32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/odbccp32/CMakeLists.txt [iso-8859-1] Sun Jul 19 23:09:55 2015 @@ -1,5 +1,5 @@
add_executable(odbccp32_winetest misc.c testlist.c) set_module_type(odbccp32_winetest win32cui) -add_importlibs(odbccp32_winetest odbccp32 msvcrt kernel32) +add_importlibs(odbccp32_winetest odbccp32 advapi32 msvcrt kernel32) add_cd_file(TARGET odbccp32_winetest DESTINATION reactos/bin FOR all)
Modified: trunk/rostests/winetests/odbccp32/misc.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/odbccp32/misc.c?... ============================================================================== --- trunk/rostests/winetests/odbccp32/misc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/odbccp32/misc.c [iso-8859-1] Sun Jul 19 23:09:55 2015 @@ -21,6 +21,7 @@
#include "windef.h" #include "winbase.h" +#include "winreg.h" #include "odbcinst.h"
static void test_SQLConfigMode(void) @@ -129,9 +130,68 @@ ok(path_out != 0xcafe, "Expected path_out to show the correct amount of bytes\n"); }
+static void test_SQLWritePrivateProfileString(void) +{ + static const WCHAR odbc_key[] = {'S','o','f','t','w','a','r','e','\','O','D','B','C','\','O','D','B','C','.','I','N','I','\','w','i','n','e','o','d','b','c',0}; + static const WCHAR abcd_key[] = {'S','o','f','t','w','a','r','e','\','O','D','B','C','\','a','b','c','d','.','I','N','I','\','w','i','n','e','o','d','b','c',0}; + static const WCHAR abcdini_key[] = {'S','o','f','t','w','a','r','e','\','O','D','B','C','\','a','b','c','d','.','I','N','I',0 }; + BOOL ret; + LONG reg_ret; + DWORD error_code; + + ret = SQLWritePrivateProfileString("wineodbc", "testing" , "value", ""); + ok(!ret, "SQLWritePrivateProfileString passed\n"); + SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(error_code == ODBC_ERROR_INVALID_STR, "SQLInstallerErrorW ret: %d\n", error_code); + + ret = SQLWritePrivateProfileString("wineodbc", "testing" , "value", NULL); + ok(!ret, "SQLWritePrivateProfileString passed\n"); + SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(error_code == ODBC_ERROR_INVALID_STR, "SQLInstallerErrorW ret: %d\n", error_code); + + ret = SQLWritePrivateProfileString("wineodbc", "testing" , "value", "odbc.ini"); + ok(ret, "SQLWritePrivateProfileString failed\n"); + if(ret) + { + HKEY hkey; + + reg_ret = RegOpenKeyExW(HKEY_CURRENT_USER, odbc_key, 0, KEY_READ, &hkey); + ok(reg_ret == ERROR_SUCCESS, "RegOpenKeyExW failed\n"); + if(reg_ret == ERROR_SUCCESS) + { + reg_ret = RegDeleteKeyW(HKEY_CURRENT_USER, odbc_key); + ok(reg_ret == ERROR_SUCCESS, "RegDeleteKeyW failed\n"); + + RegCloseKey(hkey); + } + } + + ret = SQLWritePrivateProfileString("wineodbc", "testing" , "value", "abcd.ini"); + ok(ret, "SQLWritePrivateProfileString failed\n"); + if(ret) + { + HKEY hkey; + + reg_ret = RegOpenKeyExW(HKEY_CURRENT_USER, abcd_key, 0, KEY_READ, &hkey); + ok(reg_ret == ERROR_SUCCESS, "RegOpenKeyExW failed\n"); + if(reg_ret == ERROR_SUCCESS) + { + reg_ret = RegDeleteKeyW(HKEY_CURRENT_USER, abcd_key); + ok(reg_ret == ERROR_SUCCESS, "RegDeleteKeyW failed\n"); + + RegCloseKey(hkey); + } + + /* Cleanup key */ + reg_ret = RegDeleteKeyW(HKEY_CURRENT_USER, abcdini_key); + ok(reg_ret == ERROR_SUCCESS, "RegDeleteKeyW failed\n"); + } +} + START_TEST(misc) { test_SQLConfigMode(); test_SQLInstallerError(); test_SQLInstallDriverManager(); + test_SQLWritePrivateProfileString(); }