diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
|---|---|---|
| committer | <> | 2015-03-17 16:26:24 +0000 |
| commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
| tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /lang/sql/sqlite/test/capi3c.test | |
| parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
| download | berkeleydb-master.tar.gz | |
Diffstat (limited to 'lang/sql/sqlite/test/capi3c.test')
| -rw-r--r-- | lang/sql/sqlite/test/capi3c.test | 65 |
1 files changed, 40 insertions, 25 deletions
diff --git a/lang/sql/sqlite/test/capi3c.test b/lang/sql/sqlite/test/capi3c.test index af979438..6388717e 100644 --- a/lang/sql/sqlite/test/capi3c.test +++ b/lang/sql/sqlite/test/capi3c.test @@ -169,16 +169,18 @@ do_test capi3c-3.4 { do_test capi3c-3.5 { sqlite3_close $db2 } {SQLITE_OK} -do_test capi3c-3.6.1-misuse { - sqlite3_close $db2 -} {SQLITE_MISUSE} -do_test capi3c-3.6.2-misuse { - sqlite3_errmsg $db2 -} {library routine called out of sequence} -ifcapable {utf16} { - do_test capi3c-3.6.3-misuse { - utf8 [sqlite3_errmsg16 $db2] +if {[clang_sanitize_address]==0} { + do_test capi3c-3.6.1-misuse { + sqlite3_close $db2 + } {SQLITE_MISUSE} + do_test capi3c-3.6.2-misuse { + sqlite3_errmsg $db2 } {library routine called out of sequence} + ifcapable {utf16} { + do_test capi3c-3.6.3-misuse { + utf8 [sqlite3_errmsg16 $db2] + } {library routine called out of sequence} + } } # rename sqlite3_open "" @@ -627,13 +629,17 @@ check_data $STMT capi3c-6.3 {INTEGER} {1} {1.0} {1} do_test capi3c-6.3 { sqlite3_finalize $STMT } {SQLITE_OK} -do_test capi3c-6.4 { - db cache flush - sqlite3_close $DB -} {SQLITE_OK} -do_test capi3c-6.99-misuse { +if {[clang_sanitize_address]==0} { + do_test capi3c-6.4 { + db cache flush + sqlite3_close $DB + } {SQLITE_OK} + do_test capi3c-6.99-misuse { + db close + } {} +} else { db close -} {} +} # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. @@ -670,7 +676,7 @@ if {![sqlite3 -has-codec]} { # Now test that the library correctly handles bogus entries in the # sqlite_master table (schema corruption). do_test capi3c-8.1 { - file delete -force test.db test.db-journal + forcedelete test.db test.db-journal sqlite3 db test.db execsql { CREATE TABLE t1(a); @@ -695,7 +701,7 @@ if {![sqlite3 -has-codec]} { # Build a 5-field row record. The first field is a string 'table', and # subsequent fields are all NULL. db close - file delete -force test.db test.db-journal + forcedelete test.db test.db-journal sqlite3 db test.db execsql { CREATE TABLE t1(a); @@ -712,8 +718,8 @@ if {![sqlite3 -has-codec]} { } {1 {malformed database schema (?)}} db close } -file delete -force test.db -file delete -force test.db-journal +forcedelete test.db +forcedelete test.db-journal # Test the english language string equivalents for sqlite error codes @@ -751,6 +757,7 @@ foreach {code english} $code2english { } # Test the error message when a "real" out of memory occurs. +if { [permutation] != "nofaultsim" } { ifcapable memdebug { do_test capi3c-10-1 { sqlite3 db test.db @@ -771,6 +778,7 @@ ifcapable memdebug { db close sqlite3_memdebug_fail -1 } +} # The following tests - capi3c-11.* - test that a COMMIT or ROLLBACK # statement issued while there are still outstanding VMs that are part of @@ -849,18 +857,25 @@ do_test capi3c-11.9.2 { catchsql { ROLLBACK; } -} {1 {cannot rollback transaction - SQL statements in progress}} +} {0 {}} do_test capi3c-11.9.3 { sqlite3_get_autocommit $DB -} 0 +} 1 do_test capi3c-11.10 { sqlite3_step $STMT -} {SQLITE_ROW} +} {SQLITE_ABORT} +ifcapable !autoreset { + # If SQLITE_OMIT_AUTORESET is defined, then the statement must be + # reset() before it can be passed to step() again. + do_test capi3-11.11a { sqlite3_step $STMT } {SQLITE_MISUSE} + do_test capi3-11.11b { sqlite3_reset $STMT } {SQLITE_ABORT} +} do_test capi3c-11.11 { sqlite3_step $STMT } {SQLITE_ROW} do_test capi3c-11.12 { sqlite3_step $STMT + sqlite3_step $STMT } {SQLITE_DONE} do_test capi3c-11.13 { sqlite3_finalize $STMT @@ -869,15 +884,15 @@ do_test capi3c-11.14 { execsql { SELECT a FROM t2; } -} {1 2 3} +} {1 2} do_test capi3c-11.14.1 { sqlite3_get_autocommit $DB -} 0 +} 1 do_test capi3c-11.15 { catchsql { ROLLBACK; } -} {0 {}} +} {1 {cannot rollback - no transaction is active}} do_test capi3c-11.15.1 { sqlite3_get_autocommit $DB } 1 |
