1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Further fuzzer test cases. Fix a case in the fuzzer where an error code was being dropped.

FossilOrigin-Name: 8b77d3953f082e6fa42e42fe903ea9eddf99dd91
This commit is contained in:
dan
2012-02-21 14:11:12 +00:00
parent 766348febe
commit 4965ebceb7
5 changed files with 168 additions and 11 deletions

47
test/fuzzerfault.test Normal file
View File

@ -0,0 +1,47 @@
# 2012 February 21
#
# 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.
#
#***********************************************************************
# This file implements regression tests for TCL interface to the
# SQLite library.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !vtab { finish_test ; return }
set ::testprefix fuzzerfault
register_fuzzer_module db
do_test 1-pre1 {
execsql {
CREATE TABLE x1_rules(ruleset, cFrom, cTo, cost);
INSERT INTO x1_rules VALUES(0, 'a', 'b', 1);
INSERT INTO x1_rules VALUES(0, 'a', 'c', 2);
INSERT INTO x1_rules VALUES(0, 'a', 'd', 3);
}
faultsim_save_and_close
} {}
do_faultsim_test 1 -faults oom-t* -prep {
faultsim_restore_and_reopen
register_fuzzer_module db
} -body {
execsql {
CREATE VIRTUAL TABLE x1 USING fuzzer(x1_rules);
SELECT word FROM x1 WHERE word MATCH 'xax';
}
} -test {
faultsim_test_result {0 {xax xbx xcx xdx}} \
{1 {vtable constructor failed: x1}}
}
finish_test