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

Unified Diff: third_party/sqlite/test/capi3d.test

Issue 3108030: Move bundled copy of sqlite one level deeper to better separate it... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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/test/capi3c.test ('k') | third_party/sqlite/test/cast.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/test/capi3d.test
===================================================================
--- third_party/sqlite/test/capi3d.test (revision 56608)
+++ third_party/sqlite/test/capi3d.test (working copy)
@@ -1,93 +0,0 @@
-# 2008 June 18
-#
-# 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.
-#
-# This file is devoted to testing the sqlite3_next_stmt interface.
-#
-# $Id: capi3d.test,v 1.2 2008/07/14 15:11:20 drh Exp $
-#
-
-set testdir [file dirname $argv0]
-source $testdir/tester.tcl
-
-# Create N prepared statements against database connection db
-# and return a list of all the generated prepared statements.
-#
-proc make_prepared_statements {N} {
- set plist {}
- for {set i 0} {$i<$N} {incr i} {
- set sql "SELECT $i FROM sqlite_master WHERE name LIKE '%$i%'"
- if {rand()<0.33} {
- set s [sqlite3_prepare_v2 db $sql -1 notused]
- } else {
- ifcapable utf16 {
- if {rand()<0.5} {
- set sql [encoding convertto unicode $sql]\x00\x00
- set s [sqlite3_prepare16 db $sql -1 notused]
- } else {
- set s [sqlite3_prepare db $sql -1 notused]
- }
- }
- ifcapable !utf16 {
- set s [sqlite3_prepare db $sql -1 notused]
- }
- }
- lappend plist $s
- }
- return $plist
-}
-
-
-# Scramble the $inlist into a random order.
-#
-proc scramble {inlist} {
- set y {}
- foreach x $inlist {
- lappend y [list [expr {rand()}] $x]
- }
- set y [lsort $y]
- set outlist {}
- foreach x $y {
- lappend outlist [lindex $x 1]
- }
- return $outlist
-}
-
-# Database initially has no prepared statements.
-#
-do_test capi3d-1.1 {
- db cache flush
- sqlite3_next_stmt db 0
-} {}
-
-# Run the following tests for between 1 and 100 prepared statements.
-#
-for {set i 1} {$i<=100} {incr i} {
- set stmtlist [make_prepared_statements $i]
- do_test capi3d-1.2.$i.1 {
- set p [sqlite3_next_stmt db 0]
- set x {}
- while {$p!=""} {
- lappend x $p
- set p [sqlite3_next_stmt db $p]
- }
- lsort $x
- } [lsort $stmtlist]
- do_test capi3-1.2.$i.2 {
- foreach p [scramble $::stmtlist] {
- sqlite3_finalize $p
- }
- sqlite3_next_stmt db 0
- } {}
-}
-
-
-finish_test
« no previous file with comments | « third_party/sqlite/test/capi3c.test ('k') | third_party/sqlite/test/cast.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698