-C Remove\suse\sof\smalloc\sand\sfree\sfrom\sthe\sWindows\sVFS.\s\sAlso,\sprevent\ssqlite3BtreeOpen\sfrom\sassuming\sthat\ssqlite3OsFullPathname\scannot\sfail.
-D 2011-11-11T23:31:04.676
+C Make\ssure\sto\sflag\sbenign\smalloc\sfailures\sin\sthe\sWindows\sVFS\sas\ssuch.\s\sExpand\suse\sof\sthe\sDO_OS_MALLOC_TEST\sto\scover\sthe\sVFS\sfunctions\sthat\scan\snow\sreturn\san\sout\sof\smemory\serror.\s\sSupport\san\sexperimental\s--match\soption\sto\sthe\stest\ssuite\sthat\swill\srun\sonly\sthose\stests\smatching\sthe\sspecified\spattern.
+D 2011-11-12T03:17:40.954
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/mutex_unix.c b4f4e923bb8de93ec3f251fadb50855f23df9579
F src/mutex_w32.c 5e54f3ba275bcb5d00248b8c23107df2e2f73e33
F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30
-F src/os.c 5d9b02782ed36345348d6fe21d7762ed3a9cfd2a
+F src/os.c 28bbdab2170dfce84d86c45456a18eab1d0f99a9
F src/os.h 9dbed8c2b9c1f2f2ebabc09e49829d4777c26bf9
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440
F src/os_unix.c 4fbb91726165e105c1679a2660f49a3f4c376e4f
-F src/os_win.c ee8ba0846294f154e0822095512a665cdb197c8a
+F src/os_win.c a22b88d2c088c09a678a471abafa8d60dbf56803
F src/pager.c db33d4bf1e3e019c34c220971cc6c3aa07c30f54
F src/pager.h 9f81b08efb06db4ba8be69446e10b005c351373d
F src/parse.y 12b7ebd61ea54f0e1b1083ff69cc2c8ce9353d58
F src/test_syscall.c a992d8c80ea91fbf21fb2dd570db40e77dd7e6ae
F src/test_tclvar.c f4dc67d5f780707210d6bb0eb6016a431c04c7fa
F src/test_thread.c 35022393dd54d147b998b6b7f7e945b01114d666
-F src/test_vfs.c b0baec983bd6f872715a4b44c8f39104fec333af
+F src/test_vfs.c 27b7d9de40630f603b9e2cf9ef2a7c81d31c4515
F src/test_vfstrace.c 0b884e06094a746da729119a2cabdc7aa790063d
F src/test_wholenumber.c 6129adfbe7c7444f2e60cc785927f3aa74e12290
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c
F test/temptable.test 51edd31c65ed1560dd600b1796e8325df96318e2
F test/temptrigger.test 26670ed7a39cf2296a7f0a9e0a1d7bdb7abe936d
-F test/tester.tcl 0b2999b578964297663de4870babbbee29225622
+F test/tester.tcl 001051eaf28c1040800f588a64c63e0bd0e1f36b
F test/thread001.test 7cc2ce08f9cde95964736d11e91f9ab610f82f91
F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
-P ed88fb00240de75457c0da19e87c12082622ca17
-R a35825c17aca6258f92039304b464c67
+P 8966ec1797be63d1305628d459bdad5be08cf3ca
+R b05037fbfa7e2180ed81bf446e380e48
U mistachkin
-Z 93813e17596e2d1608777ccc9fc54b6a
+Z 1660438f613633eeb0e91d69e2a176bd
-8966ec1797be63d1305628d459bdad5be08cf3ca
\ No newline at end of file
+76dec8aa9dbbc39e0a7c3b358b58ce7f7a477a2b
\ No newline at end of file
** The following functions are instrumented for malloc() failure
** testing:
**
-** sqlite3OsOpen()
** sqlite3OsRead()
** sqlite3OsWrite()
** sqlite3OsSync()
+** sqlite3OsFileSize()
** sqlite3OsLock()
+** sqlite3OsCheckReservedLock()
+** sqlite3OsFileControl()
+** sqlite3OsShmMap()
+** sqlite3OsOpen()
+** sqlite3OsDelete()
+** sqlite3OsAccess()
+** sqlite3OsFullPathname()
**
*/
#if defined(SQLITE_TEST)
return id->pMethods->xCheckReservedLock(id, pResOut);
}
int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
+ DO_OS_MALLOC_TEST(id);
return id->pMethods->xFileControl(id, op, pArg);
}
int sqlite3OsSectorSize(sqlite3_file *id){
int bExtend, /* True to extend file if necessary */
void volatile **pp /* OUT: Pointer to mapping */
){
+ DO_OS_MALLOC_TEST(id);
return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp);
}
return rc;
}
int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
+ DO_OS_MALLOC_TEST(0);
return pVfs->xDelete(pVfs, zPath, dirSync);
}
int sqlite3OsAccess(
int nPathOut,
char *zPathOut
){
+ DO_OS_MALLOC_TEST(0);
zPathOut[0] = 0;
return pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut);
}
/*
** The following variable is (normally) set once and never changes
-** thereafter. It records whether the operating system is Win95
+** thereafter. It records whether the operating system is Win9x
** or WinNT.
**
** 0: Operating system unknown.
-** 1: Operating system is Win95.
+** 1: Operating system is Win9x.
** 2: Operating system is WinNT.
**
** In order to facilitate testing on a WinNT system, the test fixture
}
/*
-** Convert an ansi string to Microsoft Unicode, based on the
+** Convert an ANSI string to Microsoft Unicode, based on the
** current codepage settings for file apis.
**
** Space to hold the returned string is obtained
0);
if( dwLen > 0 ){
/* allocate a buffer and convert to UTF8 */
+ sqlite3BeginBenignMalloc();
zOut = unicodeToUtf8(zTempWide);
+ sqlite3EndBenignMalloc();
/* free the system buffer allocated by FormatMessage */
osLocalFree(zTempWide);
}
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
-** Since the ASCII version of these Windows API do not exist for WINCE,
+** Since the ANSI version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
0);
if( dwLen > 0 ){
/* allocate a buffer and convert to UTF8 */
+ sqlite3BeginBenignMalloc();
zOut = sqlite3_win32_mbcs_to_utf8(zTemp);
+ sqlite3EndBenignMalloc();
/* free the system buffer allocated by FormatMessage */
osLocalFree(zTemp);
}
/*
** Acquire a reader lock.
** Different API routines are called depending on whether or not this
-** is Win95 or WinNT.
+** is Win9x or WinNT.
*/
static int getReadLock(winFile *pFile){
int res;
return SQLITE_IOERR_NOMEM;
}
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
-** Since the ASCII version of these Windows API do not exist for WINCE,
+** Since the ANSI version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
NULL))==INVALID_HANDLE_VALUE &&
retryIoerr(&cnt) ){}
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
-** Since the ASCII version of these Windows API do not exist for WINCE,
+** Since the ANSI version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
(rc = osDeleteFileW(zConverted))==0 && retryIoerr(&cnt) ){}
rc = rc ? SQLITE_OK : SQLITE_ERROR;
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
-** Since the ASCII version of these Windows API do not exist for WINCE,
+** Since the ANSI version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
}
}
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
-** Since the ASCII version of these Windows API do not exist for WINCE,
+** Since the ANSI version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
zOut = unicodeToUtf8(zTemp);
sqlite3_free(zTemp);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
-** Since the ASCII version of these Windows API do not exist for WINCE,
+** Since the ANSI version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
** size.
*/
SimulateIOErrorBenign(1);
+ sqlite3BeginBenignMalloc();
rc = winFullPathname(pVfs, zRelative, MAX_PATH, zFullpath);
+ sqlite3EndBenignMalloc();
SimulateIOErrorBenign(0);
if( rc == SQLITE_OK )
{
- void *zConverted = convertUtf8Filename(zFullpath);
+ void *zConverted;
+ sqlite3BeginBenignMalloc();
+ zConverted = convertUtf8Filename(zFullpath);
+ sqlite3EndBenignMalloc();
if( zConverted ){
if( isNT() ){
/* trim path to just drive reference */
if( isNT() ){
h = osLoadLibraryW((LPCWSTR)zConverted);
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
-** Since the ASCII version of these Windows API do not exist for WINCE,
+** Since the ANSI version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
return getLastErrorMsg(osGetLastError(), nBuf, zBuf);
}
-
-
/*
** Initialize and deinitialize the operating system interface.
*/
sqlite3_vfs_register(&winVfs, 1);
return SQLITE_OK;
}
+
int sqlite3_os_end(void){
return SQLITE_OK;
}
switch( aSubcmd[i].eCmd ){
case CMD_SHM: {
Tcl_Obj *pObj;
- int i;
+ int i, rc;
TestvfsBuffer *pBuffer;
char *zName;
if( objc!=3 && objc!=4 ){
return TCL_ERROR;
}
zName = ckalloc(p->pParent->mxPathname);
- p->pParent->xFullPathname(
+ rc = p->pParent->xFullPathname(
p->pParent, Tcl_GetString(objv[2]),
p->pParent->mxPathname, zName
);
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, "failed to get full path: ",
+ Tcl_GetString(objv[2]), 0);
+ ckfree(zName);
+ return TCL_ERROR;
+ }
for(pBuffer=p->pBuffer; pBuffer; pBuffer=pBuffer->pNext){
if( 0==strcmp(pBuffer->zFile, zName) ) break;
}
# Commands providing a lower level interface to the global test counters:
#
# set_test_counter COUNTER ?VALUE?
-# omit_test TESTNAME REASON
+# omit_test TESTNAME REASON ?APPEND?
# fail_test TESTNAME
# incr_ntest
#
# --file-retries=N
# --file-retry-delay=N
# --start=[$permutation:]$testfile
+ # --match=$pattern
#
set cmdlinearg(soft-heap-limit) 0
set cmdlinearg(maxerror) 1000
set cmdlinearg(soak) 0
set cmdlinearg(file-retries) 0
set cmdlinearg(file-retry-delay) 0
- set cmdlinearg(start) ""
+ set cmdlinearg(start) ""
+ set cmdlinearg(match) ""
set leftover [list]
foreach a $argv {
}
if {$::G(start:file) == ""} {unset ::G(start:file)}
}
+ {^-+match=.+$} {
+ foreach {dummy cmdlinearg(match)} [split $a =] break
+
+ set ::G(match) $cmdlinearg(match)
+ if {$::G(match) == ""} {unset ::G(match)}
+ }
default {
lappend leftover $a
}
# Record the fact that a sequence of tests were omitted.
#
-proc omit_test {name reason} {
+proc omit_test {name reason {append 1}} {
set omitList [set_test_counter omit_list]
- lappend omitList [list $name $reason]
+ if {$append} {
+ lappend omitList [list $name $reason]
+ }
set_test_counter omit_list $omitList
}
incr_ntest
puts -nonewline $name...
flush stdout
- if {[catch {uplevel #0 "$cmd;\n"} result]} {
- puts "\nError: $result"
- fail_test $name
- } elseif {[string compare $result $expected]} {
- puts "\nExpected: \[$expected\]\n Got: \[$result\]"
- fail_test $name
+
+ if {![info exists ::G(match)] || [string match $::G(match) $name]} {
+ if {[catch {uplevel #0 "$cmd;\n"} result]} {
+ puts "\nError: $result"
+ fail_test $name
+ } elseif {[string compare $result $expected]} {
+ puts "\nExpected: \[$expected\]\n Got: \[$result\]"
+ fail_test $name
+ } else {
+ puts " Ok"
+ }
} else {
- puts " Ok"
+ puts " Omitted"
+ omit_test $name "pattern mismatch" 0
}
flush stdout
}