sqlite/test/fuzzerfault.test

48 lines
1.2 KiB
Plaintext
Raw Normal View History

# 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