From: danielk1977 Date: Mon, 30 Jun 2008 15:09:29 +0000 (+0000) Subject: Changes to loadext.test so that it works on osx as well as linux. (CVS 5329) X-Git-Tag: version-3.6.10~848 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63703a42f10cdee7fb3f60b2b7f8b61cc06c30cd;p=thirdparty%2Fsqlite.git Changes to loadext.test so that it works on osx as well as linux. (CVS 5329) FossilOrigin-Name: 189cd85413a2e00696752bb82e7a442e86e621ac --- diff --git a/manifest b/manifest index b330f34018..b4bdc68a0a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\smalloc()\sfailure\srelated\sproblem\sin\sos_unix.c.\s(CVS\s5328) -D 2008-06-30T10:16:05 +C Changes\sto\sloadext.test\sso\sthat\sit\sworks\son\sosx\sas\swell\sas\slinux.\s(CVS\s5329) +D 2008-06-30T15:09:29 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 325dfac0a0dd1cb4d975f1ace6453157892e6042 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -143,7 +143,7 @@ F src/random.c 5c754319d38abdd6acd74601ee0105504adc508a F src/select.c 5b213de002382aeaac5c9c2d3be7c98900bc3056 F src/shell.c 484e7297e066f22830f9c15d7abbcdd2acb097b0 F src/sqlite.h.in 76c144d23f8824e8811e837e9396b9f1361f5902 -F src/sqlite3ext.h 7bf1651c6fb7183831e5113b4b91662bbe67e5bf +F src/sqlite3ext.h 1e3887c9bd3ae66cb599e922824b04cd0d0f2c3e F src/sqliteInt.h 35e420ced9e27af5ee387cd40f2e7a431665f858 F src/sqliteLimit.h f435e728c6b620ef7312814d660a81f9356eb5c8 F src/status.c 6cb10377992505bd69f1ca1d75c1240a65f25a58 @@ -372,7 +372,7 @@ F test/laststmtchanges.test 18ead86c8a87ade949a1d5658f6dc4bb111d1b02 F test/like.test 2a3ddbd5d91503f914eabae67a47c4196fe33a58 F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da F test/limit.test ca61a9fc520f54470edb3a771167fe4b68abc247 -F test/loadext.test de9ff1f3db6377b42cb001a2ca93cc9ebd254784 +F test/loadext.test 5f4354b3eb22584563a51ff74329f06e48dfae33 F test/loadext2.test 0bcaeb4d81cd5b6e883fdfea3c1bdbe1f173cbca F test/lock.test 6825aea0b5885578b1b63a3b178803842c4ee9f1 F test/lock2.test 018b846f6f3b3b695fad07e317b7988442b556f4 @@ -595,7 +595,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 1a711249c25aafbaf08057ffdcbb9cf2f872f13d -R c8878f1758bd99bd85efdf3716dd1356 +P ba8819a6f3dbc45d88346789de42971aacc0d246 +R d9ae76ff4c185320bbb89c9f9139919a U danielk1977 -Z c7f565849ca23e8adcec51fdeb05acd5 +Z 00e6f564f2a763edcec24b97ea9019b8 diff --git a/manifest.uuid b/manifest.uuid index fb60787c40..1902737b61 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ba8819a6f3dbc45d88346789de42971aacc0d246 \ No newline at end of file +189cd85413a2e00696752bb82e7a442e86e621ac \ No newline at end of file diff --git a/src/sqlite3ext.h b/src/sqlite3ext.h index 05e8fac82c..5071eef3be 100644 --- a/src/sqlite3ext.h +++ b/src/sqlite3ext.h @@ -15,7 +15,7 @@ ** as extensions by SQLite should #include this file instead of ** sqlite3.h. ** -** @(#) $Id: sqlite3ext.h,v 1.23 2008/06/27 00:52:45 drh Exp $ +** @(#) $Id: sqlite3ext.h,v 1.24 2008/06/30 15:09:29 danielk1977 Exp $ */ #ifndef _SQLITE3EXT_H_ #define _SQLITE3EXT_H_ @@ -366,7 +366,7 @@ struct sqlite3_api_routines { #define sqlite3_status sqlite3_api->status #endif /* SQLITE_CORE */ -#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api; +#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0; #define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v; #endif /* _SQLITE3EXT_H_ */ diff --git a/test/loadext.test b/test/loadext.test index 9ea3e1da40..56aeefafdc 100644 --- a/test/loadext.test +++ b/test/loadext.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is extension loading. # -# $Id: loadext.test,v 1.12 2008/06/19 15:44:00 drh Exp $ +# $Id: loadext.test,v 1.13 2008/06/30 15:09:29 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -28,6 +28,10 @@ if {$::tcl_platform(platform) eq "windows"} { } else { set testextension ./libtestloadext.so } +set gcc_shared -shared +if {$::tcl_platform(os) eq "Darwin"} { + set gcc_shared -dynamiclib +} # The error messages tested by this file are operating system dependent # (because they are returned by sqlite3OsDlError()). For now, they only @@ -56,6 +60,13 @@ set dlerror_nosuchfile \ set dlerror_notadll {%s: file too short} set dlerror_nosymbol {%s: undefined symbol: %s} +if {$::tcl_platform(os) eq "Darwin"} { + set dlerror_nosuchfile {dlopen(%s, 10): image not found} + set dlerror_notadll {dlopen(%1$s, 10): no suitable image found. Did find: + %1$s: file to short} + set dlerror_nosymbol {dlsym(XXX, %2$s): symbol not 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. @@ -64,7 +75,7 @@ if {![file exists $testextension]} { set srcdir [file dir $testdir]/src set testextsrc $srcdir/test_loadext.c if {[catch { - exec gcc -Wall -I$srcdir -I. -g -shared $testextsrc -o $testextension + exec gcc $gcc_shared -Wall -I$srcdir -I. -g $testextsrc -o $testextension } msg]} { puts "Skipping loadext tests: Test extension not built..." puts $msg @@ -148,6 +159,9 @@ do_test loadext-2.3 { set rc [catch { sqlite3_load_extension db $testextension icecream } msg] + if {$::tcl_platform(os) eq "Darwin"} { + regsub {0x[1234567890abcdefABCDEF]*} $msg XXX msg + } list $rc $msg } [list 1 [format $dlerror_nosymbol $testextension icecream]] @@ -173,9 +187,13 @@ do_test loadext-3.1 { } } {1 {no such function: half}} do_test loadext-3.2 { - catchsql { + set res [catchsql { SELECT load_extension($::testextension) + }] + if {$::tcl_platform(os) eq "Darwin"} { + regsub {0x[1234567890abcdefABCDEF]*} $res XXX res } + set res } [list 1 [format $dlerror_nosymbol $testextension sqlite3_extension_init]] do_test loadext-3.3 { catchsql {