Enhance testing support for the Win32 VFS dynamic extension loading facilities.
FossilOrigin-Name: 53081e7202fb55f792a78e73627466eb0200f11c
This commit is contained in:
@@ -1319,6 +1319,10 @@ testfixture.exe: $(TESTFIXTURE_SRC) $(LIBRESOBJS) $(HDR)
|
||||
$(TESTFIXTURE_SRC) \
|
||||
/link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
|
||||
|
||||
extensiontest: testfixture.exe testloadext.dll
|
||||
.\testfixture.exe $(TOP)\test\loadext.test
|
||||
.\testfixture.exe $(TOP)\test\loadext2.test
|
||||
|
||||
fulltest: testfixture.exe sqlite3.exe
|
||||
.\testfixture.exe $(TOP)\test\all.test
|
||||
|
||||
@@ -1345,6 +1349,12 @@ sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
|
||||
$(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
|
||||
/link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
|
||||
|
||||
testloadext.lo: $(TOP)\src\test_loadext.c
|
||||
$(LTCOMPILE) -c $(TOP)\src\test_loadext.c
|
||||
|
||||
testloadext.dll: testloadext.lo
|
||||
$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /OUT:$@ testloadext.lo
|
||||
|
||||
showdb.exe: $(TOP)\tool\showdb.c $(SQLITE3C)
|
||||
$(LTLINK) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -Fe$@ \
|
||||
$(TOP)\tool\showdb.c $(SQLITE3C)
|
||||
@@ -1371,6 +1381,7 @@ clean:
|
||||
-rmdir /Q/S tsrc
|
||||
del /Q .target_source
|
||||
del /Q tclsqlite3.exe tclsqlite3.exp
|
||||
del /Q testloadext.dll testloadext.exp
|
||||
del /Q testfixture.exe testfixture.exp test.db
|
||||
del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
|
||||
del /Q sqlite3.c sqlite3-*.c
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
C Close\ssome\sstray\sconnections\sin\swalro.test.
|
||||
D 2014-02-24T19:49:36.852
|
||||
C Enhance\stesting\ssupport\sfor\sthe\sWin32\sVFS\sdynamic\sextension\sloading\sfacilities.
|
||||
D 2014-02-24T21:20:25.412
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
F Makefile.msc 371a17ef9cd011b103cfa1964119a8528f5427c9
|
||||
F Makefile.msc 4b39e17eb244d2fd3fb825d896380b38b782e69a
|
||||
F Makefile.vxworks db21ed42a01d5740e656b16f92cb5d8d5e5dd315
|
||||
F README.md 64f270c43c38c46de749e419c22f0ae2f4499fe8
|
||||
F VERSION 0dc30ad5cf90736d5fd9e540c9f05c542658abe7
|
||||
@@ -203,7 +203,7 @@ F src/os.c 1b147e4cf7cc39e618115c14a086aed44bc91ace
|
||||
F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f
|
||||
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
|
||||
F src/os_unix.c 18f7f95dc6bcb9cf4d4a238d8e2de96611bc2ae5
|
||||
F src/os_win.c d4284f003445054a26689f1264b1b9bf7261bd1b
|
||||
F src/os_win.c 166d2f195ea0b7b4ea948229f727f0a293dd3c65
|
||||
F src/pager.c 0ffa313a30ed6d061d9c6601b7b175cc50a1cab7
|
||||
F src/pager.h ffd5607f7b3e4590b415b007a4382f693334d428
|
||||
F src/parse.y 2613ca5d609c2f3d71dd297351f010bcec16e1e0
|
||||
@@ -249,7 +249,7 @@ F src/test_init.c 66b33120ffe9cd853b5a905ec850d51151337b32
|
||||
F src/test_intarray.c 87847c71c3c36889c0bcc9c4baf9d31881665d61
|
||||
F src/test_intarray.h 2ece66438cfd177b78d1bfda7a4180cd3a10844d
|
||||
F src/test_journal.c f5c0a05b7b3d5930db769b5ee6c3766dc2221a64
|
||||
F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
|
||||
F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4
|
||||
F src/test_malloc.c 1ff5b1243d96124c9a180f3b89424820a1f337f3
|
||||
F src/test_multiplex.c 9f304bf04170c91c0318238d512df2da039eb1c8
|
||||
F src/test_multiplex.h 110a8c4d356e0aa464ca8730375608a9a0b61ae1
|
||||
@@ -647,7 +647,7 @@ F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
|
||||
F test/like.test e191e536d0fcd722a6b965e7cd1ee0bfd12a5991
|
||||
F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
|
||||
F test/limit.test cc0ab63385239b63c72452b0e93700bf5e8f0b99
|
||||
F test/loadext.test 92e6dfefd1229c3ef4aaabd87419efd8fa57a7a5
|
||||
F test/loadext.test 648cb95f324d1775c54a55c12271b2d1156b633b
|
||||
F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7
|
||||
F test/lock.test 87af515b0c4cf928576d0f89946d67d7c265dfb4
|
||||
F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff
|
||||
@@ -1151,7 +1151,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
|
||||
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
|
||||
P ba5f0a5599dece6d8f3dfe652800c28875c74a24
|
||||
R 55b5056ebfab7e0aa95c7fc2968f106d
|
||||
U dan
|
||||
Z 43d53118dac35420ad2faa5a259188da
|
||||
P d6746cabaa22429644c956a4b5fd91896376de2d
|
||||
R 92acab9fb5e448fe2bef6b9a7d9bb046
|
||||
U mistachkin
|
||||
Z 2600b243b92aaa5b75c087148e5db2b4
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
d6746cabaa22429644c956a4b5fd91896376de2d
|
||||
53081e7202fb55f792a78e73627466eb0200f11c
|
||||
+8
-5
@@ -5135,15 +5135,12 @@ static int winFullPathname(
|
||||
** Interfaces for opening a shared library, finding entry points
|
||||
** within the shared library, and closing the shared library.
|
||||
*/
|
||||
/*
|
||||
** Interfaces for opening a shared library, finding entry points
|
||||
** within the shared library, and closing the shared library.
|
||||
*/
|
||||
static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
|
||||
HANDLE h;
|
||||
void *zConverted = winConvertFromUtf8Filename(zFilename);
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
if( zConverted==0 ){
|
||||
OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
|
||||
return 0;
|
||||
}
|
||||
if( osIsNT() ){
|
||||
@@ -5158,6 +5155,7 @@ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
|
||||
h = osLoadLibraryA((char*)zConverted);
|
||||
}
|
||||
#endif
|
||||
OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)h));
|
||||
sqlite3_free(zConverted);
|
||||
return (void*)h;
|
||||
}
|
||||
@@ -5166,12 +5164,17 @@ static void winDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){
|
||||
winGetLastErrorMsg(osGetLastError(), nBuf, zBufOut);
|
||||
}
|
||||
static void (*winDlSym(sqlite3_vfs *pVfs,void *pH,const char *zSym))(void){
|
||||
FARPROC pProc;
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
return (void(*)(void))osGetProcAddressA((HANDLE)pH, zSym);
|
||||
pProc = osGetProcAddressA((HANDLE)pH, zSym);
|
||||
OSTRACE(("DLSYM handle=%p, symbol=%s, proc=%p\n",
|
||||
(void*)pH, zSym, (void*)pProc));
|
||||
return (void(*)(void))pProc;
|
||||
}
|
||||
static void winDlClose(sqlite3_vfs *pVfs, void *pHandle){
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
osFreeLibrary((HANDLE)pHandle);
|
||||
OSTRACE(("DLCLOSE handle=%p\n", (void*)pHandle));
|
||||
}
|
||||
#else /* if SQLITE_OMIT_LOAD_EXTENSION is defined: */
|
||||
#define winDlOpen 0
|
||||
|
||||
@@ -91,6 +91,9 @@ static void statusFunc(
|
||||
/*
|
||||
** Extension load function.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int testloadext_init(
|
||||
sqlite3 *db,
|
||||
char **pzErrMsg,
|
||||
@@ -109,6 +112,9 @@ int testloadext_init(
|
||||
/*
|
||||
** Another extension entry point. This one always fails.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int testbrokenext_init(
|
||||
sqlite3 *db,
|
||||
char **pzErrMsg,
|
||||
|
||||
+14
-1
@@ -66,6 +66,12 @@ if {$::tcl_platform(os) eq "Darwin"} {
|
||||
set dlerror_nosymbol {dlsym(XXX, %2$s): symbol not found}
|
||||
}
|
||||
|
||||
if {$::tcl_platform(platform) eq "windows"} {
|
||||
set dlerror_nosuchfile {The specified module could not be found.*}
|
||||
set dlerror_notadll {%%1 is not a valid Win32 application.*}
|
||||
set dlerror_nosymbol {The specified procedure could not be found.*}
|
||||
}
|
||||
|
||||
# Make sure the test extension actually exists. If it does not
|
||||
# exist, try to create it. If unable to create it, then skip this
|
||||
# test file.
|
||||
@@ -167,7 +173,7 @@ do_test loadext-2.3 {
|
||||
regsub {0x[1234567890abcdefABCDEF]*} $msg XXX msg
|
||||
}
|
||||
list $rc $msg
|
||||
} [list 1 [format $dlerror_nosymbol $testextension icecream]]
|
||||
} /[list 1 [format $dlerror_nosymbol $testextension icecream]]/
|
||||
|
||||
# Try to load an extension for which the entry point fails (returns non-zero)
|
||||
#
|
||||
@@ -267,10 +273,17 @@ do_malloc_test loadext-5 -tclprep {
|
||||
} -tclbody {
|
||||
if {[autoinstall_test_functions]==7} {error "out of memory"}
|
||||
}
|
||||
|
||||
# On Windows, this malloc test must be skipped because the winDlOpen
|
||||
# function itself can fail due to "out of memory" conditions.
|
||||
#
|
||||
if {$::tcl_platform(platform) ne "windows"} {
|
||||
do_malloc_test loadext-6 -tclbody {
|
||||
db enable_load_extension 1
|
||||
sqlite3_load_extension db $::testextension testloadext_init
|
||||
}
|
||||
}
|
||||
|
||||
autoinstall_test_functions
|
||||
|
||||
finish_test
|
||||
|
||||
Reference in New Issue
Block a user