Add tests for the new code on this branch.
FossilOrigin-Name: 351d46b2373f08bc8033d0902d9f67cd6c8bcc16c0d9f787e4fb279c0a76da87
This commit is contained in:
parent
645f21f15b
commit
ee299cc7d4
45
ext/intck/intckfault.test
Normal file
45
ext/intck/intckfault.test
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# 2024 February 24
|
||||||
|
#
|
||||||
|
# The author disclaims copyright to this source code. In place of
|
||||||
|
# a legal notice, here is a blessing:
|
||||||
|
#
|
||||||
|
# May you do good and not evil.
|
||||||
|
# May you find forgiveness for yourself and forgive others.
|
||||||
|
# May you share freely, never taking more than you give.
|
||||||
|
#
|
||||||
|
#***********************************************************************
|
||||||
|
#
|
||||||
|
|
||||||
|
source [file join [file dirname [info script]] intck_common.tcl]
|
||||||
|
set testprefix intckfault
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
do_execsql_test 1.0 {
|
||||||
|
CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
|
||||||
|
INSERT INTO t1 VALUES(1, 2, 3);
|
||||||
|
INSERT INTO t1 VALUES(2, 'two', 'three');
|
||||||
|
INSERT INTO t1 VALUES(3, NULL, NULL);
|
||||||
|
CREATE INDEX i1 ON t1(b, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
do_faultsim_test 1 -faults oom-t* -prep {
|
||||||
|
} -body {
|
||||||
|
set ::ic [sqlite3_intck db main]
|
||||||
|
set nStep 0
|
||||||
|
while {"SQLITE_OK"==[$::ic step]} {
|
||||||
|
incr nStep
|
||||||
|
if {$nStep==3} { $::ic unlock }
|
||||||
|
}
|
||||||
|
set res [$::ic error]
|
||||||
|
$::ic close
|
||||||
|
set res
|
||||||
|
} -test {
|
||||||
|
catch { $::ic close }
|
||||||
|
puts $testresult
|
||||||
|
puts $testnfail
|
||||||
|
faultsim_test_result {0 {SQLITE_OK {}}} {0 {SQLITE_NOMEM {}}} {0 {SQLITE_NOMEM {out of memory}}}
|
||||||
|
}
|
||||||
|
|
||||||
|
finish_test
|
||||||
|
|
@ -159,10 +159,12 @@ static void *intckMalloc(sqlite3_intck *p, sqlite3_int64 nByte){
|
|||||||
*/
|
*/
|
||||||
static char *intckStrdup(sqlite3_intck *p, const char *zIn){
|
static char *intckStrdup(sqlite3_intck *p, const char *zIn){
|
||||||
char *zOut = 0;
|
char *zOut = 0;
|
||||||
int nIn = strlen(zIn);
|
if( zIn ){
|
||||||
zOut = (char*)intckMalloc(p, nIn+1);
|
int nIn = strlen(zIn);
|
||||||
if( zOut ){
|
zOut = (char*)intckMalloc(p, nIn+1);
|
||||||
memcpy(zOut, zIn, nIn+1);
|
if( zOut ){
|
||||||
|
memcpy(zOut, zIn, nIn+1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return zOut;
|
return zOut;
|
||||||
}
|
}
|
||||||
@ -815,13 +817,17 @@ int sqlite3_intck_open(
|
|||||||
if( pNew==0 ){
|
if( pNew==0 ){
|
||||||
rc = SQLITE_NOMEM;
|
rc = SQLITE_NOMEM;
|
||||||
}else{
|
}else{
|
||||||
sqlite3_create_function(db, "parse_create_index",
|
|
||||||
2, SQLITE_UTF8, 0, intckParseCreateIndexFunc, 0, 0
|
|
||||||
);
|
|
||||||
memset(pNew, 0, sizeof(*pNew));
|
memset(pNew, 0, sizeof(*pNew));
|
||||||
pNew->db = db;
|
pNew->db = db;
|
||||||
pNew->zDb = (const char*)&pNew[1];
|
pNew->zDb = (const char*)&pNew[1];
|
||||||
memcpy(&pNew[1], zDb, nDb+1);
|
memcpy(&pNew[1], zDb, nDb+1);
|
||||||
|
rc = sqlite3_create_function(db, "parse_create_index",
|
||||||
|
2, SQLITE_UTF8, 0, intckParseCreateIndexFunc, 0, 0
|
||||||
|
);
|
||||||
|
if( rc!=SQLITE_OK ){
|
||||||
|
sqlite3_intck_close(pNew);
|
||||||
|
pNew = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*ppOut = pNew;
|
*ppOut = pNew;
|
||||||
|
13
manifest
13
manifest
@ -1,5 +1,5 @@
|
|||||||
C Add\sthe\s".intck\s?STEPS_PER_UNLOCK?"\scommand\sto\sthe\sshell\stool.
|
C Add\stests\sfor\sthe\snew\scode\son\sthis\sbranch.
|
||||||
D 2024-02-23T18:21:51.131
|
D 2024-02-23T20:51:06.837
|
||||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||||
@ -252,7 +252,8 @@ F ext/intck/intck1.test e73c4f87b54176291b9a01b52dbc9dd88f42f3ec8aea48c8e0bd7f87
|
|||||||
F ext/intck/intck2.test 97daaf43b8a3c870ba7c2fd421dc1887053f5b30188896fa64677ce8174c206f
|
F ext/intck/intck2.test 97daaf43b8a3c870ba7c2fd421dc1887053f5b30188896fa64677ce8174c206f
|
||||||
F ext/intck/intck_common.tcl 9e51458126576783f11051ac0fd25bea3f6b17f570a55884223737f3200b214b
|
F ext/intck/intck_common.tcl 9e51458126576783f11051ac0fd25bea3f6b17f570a55884223737f3200b214b
|
||||||
F ext/intck/intckcorrupt.test 3211ef68ac53e83951b6c8f6a8d2396506d123fe5898f97f848a25837744ec56
|
F ext/intck/intckcorrupt.test 3211ef68ac53e83951b6c8f6a8d2396506d123fe5898f97f848a25837744ec56
|
||||||
F ext/intck/sqlite3intck.c c8515c1ed1bc725e156fc5053e8f9c8cff3c440f3bca47a8309e76d2411fc73d
|
F ext/intck/intckfault.test ba0213c9c8dce08d519d5251268a3bab076a184b4d07acdea23b65e89c9ae03c
|
||||||
|
F ext/intck/sqlite3intck.c 642f57a4604580513547df9d8489cdb49b8f5f3af1981c7ffb87bc37e5ce1439
|
||||||
F ext/intck/sqlite3intck.h 2b40c38e7063ab822c974c0bd4aed97dabb579ccfe2e180a4639bb3bbef0f1c9
|
F ext/intck/sqlite3intck.h 2b40c38e7063ab822c974c0bd4aed97dabb579ccfe2e180a4639bb3bbef0f1c9
|
||||||
F ext/intck/test_intck.c dec07fc82e2626a1450e58be474e351643627b04ee08ce8fae6495a533b87e85
|
F ext/intck/test_intck.c dec07fc82e2626a1450e58be474e351643627b04ee08ce8fae6495a533b87e85
|
||||||
F ext/jni/GNUmakefile 59eb05f2a363bdfac8d15d66bed624bfe1ff289229184f3861b95f98a19cf4b2
|
F ext/jni/GNUmakefile 59eb05f2a363bdfac8d15d66bed624bfe1ff289229184f3861b95f98a19cf4b2
|
||||||
@ -2169,8 +2170,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P 5f310fb7be450c96f01c21e6fd1377d4a274784377d0bd811922ab63e612bd11
|
P cfd051836b72f7d4e38cc9614f6ae5c003de4ce377359fd391adf06fe1ddf6b9
|
||||||
R 86a36a81ccd4a5a3ded74d8234b0250a
|
R aa9167c841a6524a2987fc0088c3a9be
|
||||||
U dan
|
U dan
|
||||||
Z 39f7083bcdb0c03c315a581938028ce8
|
Z 2a1b98d11090580141aae0cbd3e3021e
|
||||||
# Remove this line to create a well-formed Fossil manifest.
|
# Remove this line to create a well-formed Fossil manifest.
|
||||||
|
@ -1 +1 @@
|
|||||||
cfd051836b72f7d4e38cc9614f6ae5c003de4ce377359fd391adf06fe1ddf6b9
|
351d46b2373f08bc8033d0902d9f67cd6c8bcc16c0d9f787e4fb279c0a76da87
|
Loading…
Reference in New Issue
Block a user