Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c0b6ae58
Commit
c0b6ae58
authored
Mar 02, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odbccp32/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
82ad9054
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
38 deletions
+37
-38
Makefile.in
dlls/odbccp32/tests/Makefile.in
+0
-1
misc.c
dlls/odbccp32/tests/misc.c
+37
-37
No files found.
dlls/odbccp32/tests/Makefile.in
View file @
c0b6ae58
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
odbccp32.dll
TESTDLL
=
odbccp32.dll
IMPORTS
=
odbccp32 advapi32
IMPORTS
=
odbccp32 advapi32
...
...
dlls/odbccp32/tests/misc.c
View file @
c0b6ae58
...
@@ -33,7 +33,7 @@ static void check_error_(int line, DWORD expect)
...
@@ -33,7 +33,7 @@ static void check_error_(int line, DWORD expect)
DWORD
err
;
DWORD
err
;
ret
=
SQLInstallerError
(
1
,
&
err
,
NULL
,
0
,
NULL
);
ret
=
SQLInstallerError
(
1
,
&
err
,
NULL
,
0
,
NULL
);
ok_
(
__FILE__
,
line
)(
ret
==
SQL_SUCCESS_WITH_INFO
,
"got %d
\n
"
,
ret
);
ok_
(
__FILE__
,
line
)(
ret
==
SQL_SUCCESS_WITH_INFO
,
"got %d
\n
"
,
ret
);
ok_
(
__FILE__
,
line
)(
err
==
expect
,
"expected %u, got %u
\n
"
,
expect
,
ret
);
ok_
(
__FILE__
,
line
)(
err
==
expect
,
"expected %
l
u, got %u
\n
"
,
expect
,
ret
);
}
}
#define check_error(a) check_error_(__LINE__, a)
#define check_error(a) check_error_(__LINE__, a)
...
@@ -126,7 +126,7 @@ static void test_SQLInstallDriverManager(void)
...
@@ -126,7 +126,7 @@ static void test_SQLInstallDriverManager(void)
win_skip
(
"not enough privileges
\n
"
);
win_skip
(
"not enough privileges
\n
"
);
return
;
return
;
}
}
ok
(
bool_ret
,
"SQLInstallDriverManager unexpectedly failed: %d
\n
"
,
ok
(
bool_ret
,
"SQLInstallDriverManager unexpectedly failed: %
l
d
\n
"
,
error_code
);
error_code
);
if
(
bool_ret
)
if
(
bool_ret
)
ok
(
sql_ret
==
SQL_NO_DATA
,
"Expected SQL_NO_DATA, got %d
\n
"
,
sql_ret
);
ok
(
sql_ret
==
SQL_NO_DATA
,
"Expected SQL_NO_DATA, got %d
\n
"
,
sql_ret
);
...
@@ -137,7 +137,7 @@ static void test_SQLInstallDriverManager(void)
...
@@ -137,7 +137,7 @@ static void test_SQLInstallDriverManager(void)
path_out
=
0xcafe
;
path_out
=
0xcafe
;
bool_ret
=
SQLInstallDriverManager
(
target_path
,
MAX_PATH
,
&
path_out
);
bool_ret
=
SQLInstallDriverManager
(
target_path
,
MAX_PATH
,
&
path_out
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
bool_ret
,
"SQLInstallDriverManager unexpectedly failed: %d
\n
"
,
ok
(
bool_ret
,
"SQLInstallDriverManager unexpectedly failed: %
l
d
\n
"
,
error_code
);
error_code
);
if
(
bool_ret
)
if
(
bool_ret
)
ok
(
sql_ret
==
SQL_NO_DATA
,
"Expected SQL_NO_DATA, got %d
\n
"
,
sql_ret
);
ok
(
sql_ret
==
SQL_NO_DATA
,
"Expected SQL_NO_DATA, got %d
\n
"
,
sql_ret
);
...
@@ -158,12 +158,12 @@ static void test_SQLWritePrivateProfileString(void)
...
@@ -158,12 +158,12 @@ static void test_SQLWritePrivateProfileString(void)
ret
=
SQLWritePrivateProfileString
(
"wineodbc"
,
"testing"
,
"value"
,
""
);
ret
=
SQLWritePrivateProfileString
(
"wineodbc"
,
"testing"
,
"value"
,
""
);
ok
(
!
ret
,
"SQLWritePrivateProfileString passed
\n
"
);
ok
(
!
ret
,
"SQLWritePrivateProfileString passed
\n
"
);
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
error_code
==
ODBC_ERROR_INVALID_STR
,
"SQLInstallerErrorW ret: %d
\n
"
,
error_code
);
ok
(
error_code
==
ODBC_ERROR_INVALID_STR
,
"SQLInstallerErrorW ret: %
l
d
\n
"
,
error_code
);
ret
=
SQLWritePrivateProfileString
(
"wineodbc"
,
"testing"
,
"value"
,
NULL
);
ret
=
SQLWritePrivateProfileString
(
"wineodbc"
,
"testing"
,
"value"
,
NULL
);
ok
(
!
ret
,
"SQLWritePrivateProfileString passed
\n
"
);
ok
(
!
ret
,
"SQLWritePrivateProfileString passed
\n
"
);
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
error_code
==
ODBC_ERROR_INVALID_STR
,
"SQLInstallerErrorW ret: %d
\n
"
,
error_code
);
ok
(
error_code
==
ODBC_ERROR_INVALID_STR
,
"SQLInstallerErrorW ret: %
l
d
\n
"
,
error_code
);
ret
=
SQLWritePrivateProfileString
(
"wineodbc"
,
"testing"
,
"value"
,
"odbc.ini"
);
ret
=
SQLWritePrivateProfileString
(
"wineodbc"
,
"testing"
,
"value"
,
"odbc.ini"
);
ok
(
ret
,
"SQLWritePrivateProfileString failed
\n
"
);
ok
(
ret
,
"SQLWritePrivateProfileString failed
\n
"
);
...
@@ -440,7 +440,7 @@ static void test_SQLInstallDriverEx(void)
...
@@ -440,7 +440,7 @@ static void test_SQLInstallDriverEx(void)
ret
=
SQLConfigDriver
(
NULL
,
ODBC_CONFIG_DRIVER
,
"WINE ODBC Driver"
,
"CPTimeout=59"
,
error
,
sizeof
(
error
),
NULL
);
ret
=
SQLConfigDriver
(
NULL
,
ODBC_CONFIG_DRIVER
,
"WINE ODBC Driver"
,
"CPTimeout=59"
,
error
,
sizeof
(
error
),
NULL
);
ok
(
!
ret
,
"SQLConfigDriver returned %d
\n
"
,
ret
);
ok
(
!
ret
,
"SQLConfigDriver returned %d
\n
"
,
ret
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
sql_ret
&&
error_code
==
ODBC_ERROR_COMPONENT_NOT_FOUND
,
"SQLConfigDriver returned %d, %u
\n
"
,
sql_ret
,
error_code
);
ok
(
sql_ret
&&
error_code
==
ODBC_ERROR_COMPONENT_NOT_FOUND
,
"SQLConfigDriver returned %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
ret
=
SQLInstallDriverEx
(
"WINE ODBC Driver
\0
Driver=sample.dll
\0
Setup=sample.dll
\0\0
"
,
NULL
,
ret
=
SQLInstallDriverEx
(
"WINE ODBC Driver
\0
Driver=sample.dll
\0
Setup=sample.dll
\0\0
"
,
NULL
,
path
,
MAX_PATH
,
&
size
,
ODBC_INSTALL_COMPLETE
,
NULL
);
path
,
MAX_PATH
,
&
size
,
ODBC_INSTALL_COMPLETE
,
NULL
);
...
@@ -451,7 +451,7 @@ static void test_SQLInstallDriverEx(void)
...
@@ -451,7 +451,7 @@ static void test_SQLInstallDriverEx(void)
win_skip
(
"not enough privileges
\n
"
);
win_skip
(
"not enough privileges
\n
"
);
return
;
return
;
}
}
ok
(
sql_ret
==
SQL_NO_DATA
||
(
sql_ret
&&
error_code
==
SQL_SUCCESS
),
"SQLInstallDriverEx failed %d, %u
\n
"
,
sql_ret
,
error_code
);
ok
(
sql_ret
==
SQL_NO_DATA
||
(
sql_ret
&&
error_code
==
SQL_SUCCESS
),
"SQLInstallDriverEx failed %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
ok
(
!
strcmp
(
path
,
syspath
),
"invalid path %s
\n
"
,
path
);
ok
(
!
strcmp
(
path
,
syspath
),
"invalid path %s
\n
"
,
path
);
if
(
0
)
/* Crashes on XP. */
if
(
0
)
/* Crashes on XP. */
...
@@ -464,23 +464,23 @@ if (0) /* Crashes on XP. */
...
@@ -464,23 +464,23 @@ if (0) /* Crashes on XP. */
ret
=
SQLConfigDriver
(
NULL
,
ODBC_CONFIG_DRIVER
,
"WINE ODBC Driver"
,
"CPTimeout=59
\0
NoWrite=60
\0
"
,
error
,
sizeof
(
error
),
NULL
);
ret
=
SQLConfigDriver
(
NULL
,
ODBC_CONFIG_DRIVER
,
"WINE ODBC Driver"
,
"CPTimeout=59
\0
NoWrite=60
\0
"
,
error
,
sizeof
(
error
),
NULL
);
ok
(
ret
,
"SQLConfigDriver failed
\n
"
);
ok
(
ret
,
"SQLConfigDriver failed
\n
"
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
sql_ret
==
SQL_NO_DATA
||
(
sql_ret
&&
error_code
==
SQL_SUCCESS
),
"SQLConfigDriver failed %d, %u
\n
"
,
sql_ret
,
error_code
);
ok
(
sql_ret
==
SQL_NO_DATA
||
(
sql_ret
&&
error_code
==
SQL_SUCCESS
),
"SQLConfigDriver failed %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
ret
=
SQLInstallDriverEx
(
"WINE ODBC Driver Path
\0
Driver=sample.dll
\0
Setup=sample.dll
\0\0
"
,
"c:
\\
temp"
,
path
,
MAX_PATH
,
&
size
,
ODBC_INSTALL_COMPLETE
,
NULL
);
ret
=
SQLInstallDriverEx
(
"WINE ODBC Driver Path
\0
Driver=sample.dll
\0
Setup=sample.dll
\0\0
"
,
"c:
\\
temp"
,
path
,
MAX_PATH
,
&
size
,
ODBC_INSTALL_COMPLETE
,
NULL
);
ok
(
ret
,
"SQLInstallDriverEx failed
\n
"
);
ok
(
ret
,
"SQLInstallDriverEx failed
\n
"
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
sql_ret
==
SQL_NO_DATA
||
(
sql_ret
&&
error_code
==
SQL_SUCCESS
),
"SQLInstallDriverEx failed %d, %u
\n
"
,
sql_ret
,
error_code
);
ok
(
sql_ret
==
SQL_NO_DATA
||
(
sql_ret
&&
error_code
==
SQL_SUCCESS
),
"SQLInstallDriverEx failed %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
ok
(
!
strcmp
(
path
,
"c:
\\
temp"
),
"invalid path %s
\n
"
,
path
);
ok
(
!
strcmp
(
path
,
"c:
\\
temp"
),
"invalid path %s
\n
"
,
path
);
ret
=
SQLConfigDriver
(
NULL
,
ODBC_CONFIG_DRIVER
,
"WINE ODBC Driver Path"
,
"empty"
,
error
,
sizeof
(
error
),
NULL
);
ret
=
SQLConfigDriver
(
NULL
,
ODBC_CONFIG_DRIVER
,
"WINE ODBC Driver Path"
,
"empty"
,
error
,
sizeof
(
error
),
NULL
);
ok
(
!
ret
,
"SQLConfigDriver successful
\n
"
);
ok
(
!
ret
,
"SQLConfigDriver successful
\n
"
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
sql_ret
&&
error_code
==
ODBC_ERROR_INVALID_KEYWORD_VALUE
,
"SQLConfigDriver failed %d, %u
\n
"
,
sql_ret
,
error_code
);
ok
(
sql_ret
&&
error_code
==
ODBC_ERROR_INVALID_KEYWORD_VALUE
,
"SQLConfigDriver failed %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
ret
=
SQLConfigDriver
(
NULL
,
ODBC_CONFIG_DRIVER
,
"WINE ODBC Driver Path"
,
"NoWrite=60;xxxx=555"
,
error
,
sizeof
(
error
),
NULL
);
ret
=
SQLConfigDriver
(
NULL
,
ODBC_CONFIG_DRIVER
,
"WINE ODBC Driver Path"
,
"NoWrite=60;xxxx=555"
,
error
,
sizeof
(
error
),
NULL
);
ok
(
ret
,
"SQLConfigDriver failed
\n
"
);
ok
(
ret
,
"SQLConfigDriver failed
\n
"
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
sql_ret
==
SQL_NO_DATA
||
(
sql_ret
&&
error_code
==
SQL_SUCCESS
),
"SQLConfigDriver failed %d, %u
\n
"
,
sql_ret
,
error_code
);
ok
(
sql_ret
==
SQL_NO_DATA
||
(
sql_ret
&&
error_code
==
SQL_SUCCESS
),
"SQLConfigDriver failed %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
if
(
ret
)
if
(
ret
)
{
{
...
@@ -497,19 +497,19 @@ if (0) /* Crashes on XP. */
...
@@ -497,19 +497,19 @@ if (0) /* Crashes on XP. */
memset
(
path
,
0
,
sizeof
(
path
));
memset
(
path
,
0
,
sizeof
(
path
));
res
=
RegQueryValueExA
(
hkey
,
"Driver"
,
NULL
,
&
type
,
(
BYTE
*
)
path
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"Driver"
,
NULL
,
&
type
,
(
BYTE
*
)
path
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"got %
l
d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"got %u
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"got %
l
u
\n
"
,
type
);
ok
(
size
==
strlen
(
driverpath
)
+
1
,
"got %u
\n
"
,
size
);
ok
(
size
==
strlen
(
driverpath
)
+
1
,
"got %
l
u
\n
"
,
size
);
ok
(
!
strcmp
(
path
,
driverpath
),
"invalid path %s
\n
"
,
path
);
ok
(
!
strcmp
(
path
,
driverpath
),
"invalid path %s
\n
"
,
path
);
res
=
RegQueryValueExA
(
hkey
,
"CPTimeout"
,
NULL
,
&
type
,
(
BYTE
*
)
&
path
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"CPTimeout"
,
NULL
,
&
type
,
(
BYTE
*
)
&
path
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"got %
l
d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"got %u
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"got %
l
u
\n
"
,
type
);
ok
(
size
==
strlen
(
"59"
)
+
1
,
"got %u
\n
"
,
size
);
ok
(
size
==
strlen
(
"59"
)
+
1
,
"got %
l
u
\n
"
,
size
);
ok
(
!
strcmp
(
path
,
"59"
),
"invalid value %s
\n
"
,
path
);
ok
(
!
strcmp
(
path
,
"59"
),
"invalid value %s
\n
"
,
path
);
res
=
RegQueryValueExA
(
hkey
,
"NoWrite"
,
NULL
,
&
type
,
(
BYTE
*
)
&
path
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"NoWrite"
,
NULL
,
&
type
,
(
BYTE
*
)
&
path
,
&
size
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
res
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"got %
l
d
\n
"
,
res
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
}
}
...
@@ -520,13 +520,13 @@ if (0) /* Crashes on XP. */
...
@@ -520,13 +520,13 @@ if (0) /* Crashes on XP. */
{
{
size
=
sizeof
(
path
);
size
=
sizeof
(
path
);
res
=
RegQueryValueExA
(
hkey
,
"NoWrite"
,
NULL
,
&
type
,
(
BYTE
*
)
&
path
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"NoWrite"
,
NULL
,
&
type
,
(
BYTE
*
)
&
path
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"got %
l
d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"got %u
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"got %
l
u
\n
"
,
type
);
ok
(
size
==
strlen
(
"60;xxxx=555"
)
+
1
,
"got %u
\n
"
,
size
);
ok
(
size
==
strlen
(
"60;xxxx=555"
)
+
1
,
"got %
l
u
\n
"
,
size
);
ok
(
!
strcmp
(
path
,
"60;xxxx=555"
),
"invalid value %s
\n
"
,
path
);
ok
(
!
strcmp
(
path
,
"60;xxxx=555"
),
"invalid value %s
\n
"
,
path
);
res
=
RegQueryValueExA
(
hkey
,
"CPTimeout"
,
NULL
,
&
type
,
(
BYTE
*
)
&
path
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"CPTimeout"
,
NULL
,
&
type
,
(
BYTE
*
)
&
path
,
&
size
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
res
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"got %
l
d
\n
"
,
res
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
}
}
}
}
...
@@ -534,12 +534,12 @@ if (0) /* Crashes on XP. */
...
@@ -534,12 +534,12 @@ if (0) /* Crashes on XP. */
cnt
=
100
;
cnt
=
100
;
ret
=
SQLRemoveDriver
(
"WINE ODBC Driver"
,
FALSE
,
&
cnt
);
ret
=
SQLRemoveDriver
(
"WINE ODBC Driver"
,
FALSE
,
&
cnt
);
ok
(
ret
,
"SQLRemoveDriver failed
\n
"
);
ok
(
ret
,
"SQLRemoveDriver failed
\n
"
);
ok
(
cnt
==
0
,
"SQLRemoveDriver failed %d
\n
"
,
cnt
);
ok
(
cnt
==
0
,
"SQLRemoveDriver failed %
l
d
\n
"
,
cnt
);
cnt
=
100
;
cnt
=
100
;
ret
=
SQLRemoveDriver
(
"WINE ODBC Driver Path"
,
FALSE
,
&
cnt
);
ret
=
SQLRemoveDriver
(
"WINE ODBC Driver Path"
,
FALSE
,
&
cnt
);
ok
(
ret
,
"SQLRemoveDriver failed
\n
"
);
ok
(
ret
,
"SQLRemoveDriver failed
\n
"
);
ok
(
cnt
==
0
,
"SQLRemoveDriver failed %d
\n
"
,
cnt
);
ok
(
cnt
==
0
,
"SQLRemoveDriver failed %
l
d
\n
"
,
cnt
);
}
}
static
void
test_SQLInstallTranslatorEx
(
void
)
static
void
test_SQLInstallTranslatorEx
(
void
)
...
@@ -562,14 +562,14 @@ static void test_SQLInstallTranslatorEx(void)
...
@@ -562,14 +562,14 @@ static void test_SQLInstallTranslatorEx(void)
win_skip
(
"not enough privileges
\n
"
);
win_skip
(
"not enough privileges
\n
"
);
return
;
return
;
}
}
ok
(
sql_ret
&&
error_code
==
SQL_SUCCESS
,
"SQLInstallDriverEx failed %d, %u
\n
"
,
sql_ret
,
error_code
);
ok
(
sql_ret
&&
error_code
==
SQL_SUCCESS
,
"SQLInstallDriverEx failed %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
ok
(
!
strcmp
(
path
,
syspath
),
"invalid path %s
\n
"
,
path
);
ok
(
!
strcmp
(
path
,
syspath
),
"invalid path %s
\n
"
,
path
);
ok
(
size
==
strlen
(
path
),
"invalid length %d
\n
"
,
size
);
ok
(
size
==
strlen
(
path
),
"invalid length %d
\n
"
,
size
);
ret
=
SQLInstallTranslatorEx
(
"WINE ODBC Translator Path
\0
Translator=sample.dll
\0
Setup=sample.dll
\0
"
,
ret
=
SQLInstallTranslatorEx
(
"WINE ODBC Translator Path
\0
Translator=sample.dll
\0
Setup=sample.dll
\0
"
,
"c:
\\
temp"
,
path
,
MAX_PATH
,
&
size
,
ODBC_INSTALL_COMPLETE
,
NULL
);
"c:
\\
temp"
,
path
,
MAX_PATH
,
&
size
,
ODBC_INSTALL_COMPLETE
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
sql_ret
&&
error_code
==
SQL_SUCCESS
,
"SQLInstallTranslatorEx failed %d, %u
\n
"
,
sql_ret
,
error_code
);
ok
(
sql_ret
&&
error_code
==
SQL_SUCCESS
,
"SQLInstallTranslatorEx failed %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
ok
(
!
strcmp
(
path
,
"c:
\\
temp"
),
"invalid path %s
\n
"
,
path
);
ok
(
!
strcmp
(
path
,
"c:
\\
temp"
),
"invalid path %s
\n
"
,
path
);
ok
(
size
==
strlen
(
path
),
"invalid length %d
\n
"
,
size
);
ok
(
size
==
strlen
(
path
),
"invalid length %d
\n
"
,
size
);
...
@@ -589,8 +589,8 @@ static void test_SQLInstallTranslatorEx(void)
...
@@ -589,8 +589,8 @@ static void test_SQLInstallTranslatorEx(void)
memset
(
path
,
0
,
sizeof
(
path
));
memset
(
path
,
0
,
sizeof
(
path
));
res
=
RegQueryValueExA
(
hkey
,
"Translator"
,
NULL
,
&
type
,
(
BYTE
*
)
path
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"Translator"
,
NULL
,
&
type
,
(
BYTE
*
)
path
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
type
==
REG_SZ
,
"got %u
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"got %
l
u
\n
"
,
type
);
ok
(
size
==
strlen
(
driverpath
)
+
1
,
"got %u
\n
"
,
size
);
ok
(
size
==
strlen
(
driverpath
)
+
1
,
"got %
l
u
\n
"
,
size
);
ok
(
!
strcmp
(
path
,
driverpath
),
"invalid path %s
\n
"
,
path
);
ok
(
!
strcmp
(
path
,
driverpath
),
"invalid path %s
\n
"
,
path
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
...
@@ -600,20 +600,20 @@ static void test_SQLInstallTranslatorEx(void)
...
@@ -600,20 +600,20 @@ static void test_SQLInstallTranslatorEx(void)
cnt
=
100
;
cnt
=
100
;
ret
=
SQLRemoveTranslator
(
"WINE ODBC Translator"
,
&
cnt
);
ret
=
SQLRemoveTranslator
(
"WINE ODBC Translator"
,
&
cnt
);
ok
(
ret
,
"SQLRemoveTranslator failed
\n
"
);
ok
(
ret
,
"SQLRemoveTranslator failed
\n
"
);
ok
(
cnt
==
0
,
"SQLRemoveTranslator failed %d
\n
"
,
cnt
);
ok
(
cnt
==
0
,
"SQLRemoveTranslator failed %
l
d
\n
"
,
cnt
);
cnt
=
100
;
cnt
=
100
;
ret
=
SQLRemoveTranslator
(
"WINE ODBC Translator Path"
,
&
cnt
);
ret
=
SQLRemoveTranslator
(
"WINE ODBC Translator Path"
,
&
cnt
);
ok
(
ret
,
"SQLRemoveTranslator failed
\n
"
);
ok
(
ret
,
"SQLRemoveTranslator failed
\n
"
);
ok
(
cnt
==
0
,
"SQLRemoveTranslator failed %d
\n
"
,
cnt
);
ok
(
cnt
==
0
,
"SQLRemoveTranslator failed %
l
d
\n
"
,
cnt
);
cnt
=
100
;
cnt
=
100
;
ret
=
SQLRemoveTranslator
(
"WINE ODBC Translator NonExist"
,
&
cnt
);
ret
=
SQLRemoveTranslator
(
"WINE ODBC Translator NonExist"
,
&
cnt
);
ok
(
!
ret
,
"SQLRemoveTranslator succeeded
\n
"
);
ok
(
!
ret
,
"SQLRemoveTranslator succeeded
\n
"
);
ok
(
cnt
==
100
,
"SQLRemoveTranslator succeeded %d
\n
"
,
cnt
);
ok
(
cnt
==
100
,
"SQLRemoveTranslator succeeded %
l
d
\n
"
,
cnt
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
sql_ret
=
SQLInstallerErrorW
(
1
,
&
error_code
,
NULL
,
0
,
NULL
);
ok
(
sql_ret
&&
error_code
==
ODBC_ERROR_COMPONENT_NOT_FOUND
,
ok
(
sql_ret
&&
error_code
==
ODBC_ERROR_COMPONENT_NOT_FOUND
,
"SQLInstallTranslatorEx failed %d, %u
\n
"
,
sql_ret
,
error_code
);
"SQLInstallTranslatorEx failed %d, %
l
u
\n
"
,
sql_ret
,
error_code
);
}
}
...
@@ -763,7 +763,7 @@ static void test_SQLConfigDataSource(void)
...
@@ -763,7 +763,7 @@ static void test_SQLConfigDataSource(void)
DWORD
err
;
DWORD
err
;
ret
=
SQLInstallerError
(
1
,
&
err
,
NULL
,
0
,
NULL
);
ret
=
SQLInstallerError
(
1
,
&
err
,
NULL
,
0
,
NULL
);
ok
(
ret
==
SQL_SUCCESS_WITH_INFO
,
"got %d
\n
"
,
ret
);
ok
(
ret
==
SQL_SUCCESS_WITH_INFO
,
"got %d
\n
"
,
ret
);
todo_wine
ok
(
err
==
ODBC_ERROR_INVALID_DSN
,
"got %u
\n
"
,
err
);
todo_wine
ok
(
err
==
ODBC_ERROR_INVALID_DSN
,
"got %
l
u
\n
"
,
err
);
}
}
ret
=
SQLConfigDataSource
(
0
,
ODBC_ADD_DSN
,
"ODBC driver"
,
"DSN=ODBC data source
\0\0
"
);
ret
=
SQLConfigDataSource
(
0
,
ODBC_ADD_DSN
,
"ODBC driver"
,
"DSN=ODBC data source
\0\0
"
);
...
@@ -803,7 +803,7 @@ static void test_SQLWriteDSNToIni(void)
...
@@ -803,7 +803,7 @@ static void test_SQLWriteDSNToIni(void)
memset
(
buffer
,
0
,
sizeof
(
buffer
));
memset
(
buffer
,
0
,
sizeof
(
buffer
));
res
=
RegQueryValueExA
(
hkey
,
"wine_dbs"
,
NULL
,
&
type
,
(
BYTE
*
)
buffer
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"wine_dbs"
,
NULL
,
&
type
,
(
BYTE
*
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
type
==
REG_SZ
,
"got %u
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"got %
l
u
\n
"
,
type
);
ok
(
!
strcmp
(
buffer
,
"SQL Server"
),
"incorrect string '%s'
\n
"
,
buffer
);
ok
(
!
strcmp
(
buffer
,
"SQL Server"
),
"incorrect string '%s'
\n
"
,
buffer
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
...
@@ -820,7 +820,7 @@ static void test_SQLWriteDSNToIni(void)
...
@@ -820,7 +820,7 @@ static void test_SQLWriteDSNToIni(void)
memset
(
path
,
0
,
sizeof
(
path
));
memset
(
path
,
0
,
sizeof
(
path
));
res
=
RegQueryValueExA
(
hkey
,
"driver"
,
NULL
,
&
type
,
(
BYTE
*
)
path
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"driver"
,
NULL
,
&
type
,
(
BYTE
*
)
path
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
type
==
REG_SZ
,
"got %u
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"got %
l
u
\n
"
,
type
);
/* WINE doesn't have a 'SQL Server' driver available */
/* WINE doesn't have a 'SQL Server' driver available */
todo_wine
ok
(
strlen
(
path
)
!=
0
,
"Invalid value
\n
"
);
todo_wine
ok
(
strlen
(
path
)
!=
0
,
"Invalid value
\n
"
);
...
@@ -850,7 +850,7 @@ static void test_SQLWriteDSNToIni(void)
...
@@ -850,7 +850,7 @@ static void test_SQLWriteDSNToIni(void)
memset
(
buffer
,
0
,
sizeof
(
buffer
));
memset
(
buffer
,
0
,
sizeof
(
buffer
));
res
=
RegQueryValueExA
(
hkey
,
"wine_mis"
,
NULL
,
&
type
,
(
BYTE
*
)
buffer
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"wine_mis"
,
NULL
,
&
type
,
(
BYTE
*
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
type
==
REG_SZ
,
"got %u
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"got %
l
u
\n
"
,
type
);
ok
(
!
strcmp
(
buffer
,
"Missing Access Driver (*.mis)"
),
"incorrect string '%s'
\n
"
,
buffer
);
ok
(
!
strcmp
(
buffer
,
"Missing Access Driver (*.mis)"
),
"incorrect string '%s'
\n
"
,
buffer
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
...
@@ -867,7 +867,7 @@ static void test_SQLWriteDSNToIni(void)
...
@@ -867,7 +867,7 @@ static void test_SQLWriteDSNToIni(void)
memset
(
path
,
0
,
sizeof
(
path
));
memset
(
path
,
0
,
sizeof
(
path
));
res
=
RegQueryValueExA
(
hkey
,
"driver"
,
NULL
,
&
type
,
(
BYTE
*
)
path
,
&
size
);
res
=
RegQueryValueExA
(
hkey
,
"driver"
,
NULL
,
&
type
,
(
BYTE
*
)
path
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
res
==
ERROR_SUCCESS
,
"RegGetValueA failed
\n
"
);
ok
(
type
==
REG_SZ
,
"got %u
\n
"
,
type
);
ok
(
type
==
REG_SZ
,
"got %
l
u
\n
"
,
type
);
ok
(
strlen
(
path
)
==
0
,
"Invalid value
\n
"
);
ok
(
strlen
(
path
)
==
0
,
"Invalid value
\n
"
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment