odbccp32: Add tests structure.

This commit is contained in:
Bill Medland 2007-01-09 08:41:04 -08:00 committed by Alexandre Julliard
parent 13dfa9a711
commit cf6e0d8270
9 changed files with 82 additions and 1 deletions

4
.gitignore vendored
View File

@ -356,6 +356,9 @@ dlls/ntdsapi/libntdsapi.def
dlls/objsel/objsel.res
dlls/odbc32/libodbc32.def
dlls/odbccp32/libodbccp32.def
dlls/odbccp32/tests/*.ok
dlls/odbccp32/tests/odbccp32_crosstest.exe
dlls/odbccp32/tests/testlist.c
dlls/ole2.dll16
dlls/ole2conv.dll16
dlls/ole2disp.dll16
@ -751,6 +754,7 @@ programs/winetest/msvcrtd_test.exe
programs/winetest/msxml3_test.exe
programs/winetest/netapi32_test.exe
programs/winetest/ntdll_test.exe
programs/winetest/odbccp32_test.exe
programs/winetest/ole32_test.exe
programs/winetest/oleaut32_test.exe
programs/winetest/psapi_test.exe

View File

@ -301,6 +301,7 @@ ALL_MAKEFILES = \
dlls/objsel/Makefile \
dlls/odbc32/Makefile \
dlls/odbccp32/Makefile \
dlls/odbccp32/tests/Makefile \
dlls/ole32/Makefile \
dlls/ole32/tests/Makefile \
dlls/oleacc/Makefile \
@ -626,6 +627,7 @@ dlls/ntdsapi/Makefile: dlls/ntdsapi/Makefile.in dlls/Makedll.rules
dlls/objsel/Makefile: dlls/objsel/Makefile.in dlls/Makedll.rules
dlls/odbc32/Makefile: dlls/odbc32/Makefile.in dlls/Makedll.rules
dlls/odbccp32/Makefile: dlls/odbccp32/Makefile.in dlls/Makedll.rules
dlls/odbccp32/tests/Makefile: dlls/odbccp32/tests/Makefile.in dlls/Maketest.rules
dlls/ole32/Makefile: dlls/ole32/Makefile.in dlls/Makedll.rules
dlls/ole32/tests/Makefile: dlls/ole32/tests/Makefile.in dlls/Maketest.rules
dlls/oleacc/Makefile: dlls/oleacc/Makefile.in dlls/Makedll.rules

3
configure vendored

File diff suppressed because one or more lines are too long

View File

@ -1672,6 +1672,7 @@ dlls/ntdsapi/Makefile
dlls/objsel/Makefile
dlls/odbc32/Makefile
dlls/odbccp32/Makefile
dlls/odbccp32/tests/Makefile
dlls/ole32/Makefile
dlls/ole32/tests/Makefile
dlls/oleacc/Makefile

View File

@ -248,6 +248,7 @@ TESTSUBDIRS = \
msxml3/tests \
netapi32/tests \
ntdll/tests \
odbccp32/tests \
ole32/tests \
oleaut32/tests \
psapi/tests \

View File

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = odbccp32.dll
IMPORTS = odbccp32 user32 kernel32
CTESTS = \
misc.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

View File

@ -0,0 +1,55 @@
/*
* Copyright 2007 Bill Medland
*
* 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 <wine/test.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "odbcinst.h"
static void test_SQLInstallerError(void)
{
RETCODE sql_ret;
/* MSDN states that the error number should be between 1 and 8. Passing 0 is an error */
sql_ret = SQLInstallerError(0, NULL, NULL, 0, NULL);
todo_wine
ok(sql_ret == SQL_ERROR, "SQLInstallerError(0...) failed with %d instead of SQL_ERROR\n", sql_ret);
/* However numbers greater than 8 do not return SQL_ERROR.
* I am currenly unsure as to whether it should return SQL_NO_DATA or "the same as for error 8";
* I have never been able to generate 8 errors to test it
*/
sql_ret = SQLInstallerError(65535, NULL, NULL, 0, NULL);
ok(sql_ret == SQL_NO_DATA, "SQLInstallerError(>8...) failed with %d instead of SQL_NO_DATA\n", sql_ret);
/* Force an error to work with. This should generate ODBC_ERROR_INVALID_BUFF_LEN */
ok(!SQLGetInstalledDrivers(0, 0, 0), "Failed to force an error for testing\n");
sql_ret = SQLInstallerError(2, NULL, NULL, 0, NULL);
ok(sql_ret == SQL_NO_DATA, "Too many errors when forcing an error for testing\n");
/* Null pointers are acceptable in all obvious places */
sql_ret = SQLInstallerError(1, NULL, NULL, 0, NULL);
todo_wine
ok(sql_ret == SQL_SUCCESS_WITH_INFO, "SQLInstallerError(null addresses) failed with %d instead of SQL_SUCCESS_WITH_INFO\n", sql_ret);
}
START_TEST(misc)
{
test_SQLInstallerError();
}

View File

@ -55,6 +55,7 @@ TESTBINS = \
msxml3_test.exe \
netapi32_test.exe \
ntdll_test.exe \
odbccp32_test.exe \
ole32_test.exe \
oleaut32_test.exe \
psapi_test.exe \
@ -143,6 +144,8 @@ netapi32_test.exe: $(DLLDIR)/netapi32/tests/netapi32_test.exe$(DLLEXT)
cp $(DLLDIR)/netapi32/tests/netapi32_test.exe$(DLLEXT) $@ && $(STRIP) $@
ntdll_test.exe: $(DLLDIR)/ntdll/tests/ntdll_test.exe$(DLLEXT)
cp $(DLLDIR)/ntdll/tests/ntdll_test.exe$(DLLEXT) $@ && $(STRIP) $@
odbccp32_test.exe: $(DLLDIR)/odbccp32/tests/odbccp32_test.exe$(DLLEXT)
cp $(DLLDIR)/odbccp32/tests/odbccp32_test.exe$(DLLEXT) $@ && $(STRIP) $@
ole32_test.exe: $(DLLDIR)/ole32/tests/ole32_test.exe$(DLLEXT)
cp $(DLLDIR)/ole32/tests/ole32_test.exe$(DLLEXT) $@ && $(STRIP) $@
oleaut32_test.exe: $(DLLDIR)/oleaut32/tests/oleaut32_test.exe$(DLLEXT)

View File

@ -178,6 +178,7 @@ msvcrtd_test.exe TESTRES "msvcrtd_test.exe"
msxml3_test.exe TESTRES "msxml3_test.exe"
netapi32_test.exe TESTRES "netapi32_test.exe"
ntdll_test.exe TESTRES "ntdll_test.exe"
odbccp32_test.exe TESTRES "odbccp32_test.exe"
ole32_test.exe TESTRES "ole32_test.exe"
oleaut32_test.exe TESTRES "oleaut32_test.exe"
psapi_test.exe TESTRES "psapi_test.exe"