Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Unified Diff: third_party/sqlite/src/test/safety.test

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/rtree.test ('k') | third_party/sqlite/src/test/savepoint.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/safety.test
diff --git a/third_party/sqlite/src/test/safety.test b/third_party/sqlite/src/test/safety.test
deleted file mode 100644
index 9cca57c1c497ccfaab682db2a48eb6377fa2ed1f..0000000000000000000000000000000000000000
--- a/third_party/sqlite/src/test/safety.test
+++ /dev/null
@@ -1,93 +0,0 @@
-# 2005 January 11
-#
-# 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 SQLite library. The
-# focus of this file is testing the sqlite3SafetyOn and sqlite3SafetyOff
-# functions. Those routines are not strictly necessary - they are
-# designed to detect misuse of the library.
-#
-# $Id: safety.test,v 1.4 2008/03/18 13:46:53 drh Exp $
-
-set testdir [file dirname $argv0]
-source $testdir/tester.tcl
-
-ifcapable !debug {
- puts "Skipping safety tests since SQLITE_DEBUG is off"
- finish_test
- return
-}
-
-# Return the UTF-8 representation of the supplied UTF-16 string $str.
-proc utf8 {str} {
- # If $str ends in two 0x00 0x00 bytes, knock these off before
- # converting to UTF-8 using TCL.
- binary scan $str \c* vals
- if {[lindex $vals end]==0 && [lindex $vals end-1]==0} {
- set str [binary format \c* [lrange $vals 0 end-2]]
- }
-
- set r [encoding convertfrom unicode $str]
- return $r
-}
-
-
-do_test safety-1.1 {
- set DB [sqlite3_connection_pointer db]
- db eval {CREATE TABLE t1(a)}
- sqlite_set_magic $DB SQLITE_MAGIC_BUSY
- catchsql {
- SELECT name FROM sqlite_master;
- }
-} {1 {library routine called out of sequence}}
-do_test safety-1.2 {
- sqlite_set_magic $DB SQLITE_MAGIC_OPEN
- catchsql {
- SELECT name FROM sqlite_master
- }
-} {0 t1}
-
-do_test safety-2.1 {
- proc safety_on {} "sqlite_set_magic $DB SQLITE_MAGIC_BUSY"
- db function safety_on safety_on
- catchsql {
- SELECT safety_on(), name FROM sqlite_master
- }
-} {1 {library routine called out of sequence}}
-ifcapable {utf16} {
- do_test safety-2.1.1 {
- utf8 [sqlite3_errmsg16 db]
- } {library routine called out of sequence}
-}
-do_test safety-2.2 {
- catchsql {
- SELECT 'hello'
- }
-} {1 {library routine called out of sequence}}
-do_test safety-2.3 {
- sqlite3_close $DB
-} {SQLITE_MISUSE}
-do_test safety-2.4 {
- sqlite_set_magic $DB SQLITE_MAGIC_OPEN
- execsql {
- SELECT name FROM sqlite_master
- }
-} {t1}
-
-do_test safety-3.1 {
- set rc [catch {
- db eval {SELECT name FROM sqlite_master} {
- sqlite_set_magic $DB SQLITE_MAGIC_BUSY
- }
- } msg]
- lappend rc $msg
-} {1 {library routine called out of sequence}}
-sqlite_set_magic $DB SQLITE_MAGIC_OPEN
-
-finish_test
« no previous file with comments | « third_party/sqlite/src/test/rtree.test ('k') | third_party/sqlite/src/test/savepoint.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698