diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-18 23:37:03 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-18 23:37:03 +0000 |
commit | e33cba46498a40774bc6d33a9258afbd5fa059e6 (patch) | |
tree | 4ce6b22f4f7b2b245b2d89bb9209a53e3274b263 /third_party/sqlite/src/ext/rtree/rtree3.test | |
parent | aaf6472fd01db928919d4dc13687bde2a4b5c7b9 (diff) | |
download | chromium_src-e33cba46498a40774bc6d33a9258afbd5fa059e6.zip chromium_src-e33cba46498a40774bc6d33a9258afbd5fa059e6.tar.gz chromium_src-e33cba46498a40774bc6d33a9258afbd5fa059e6.tar.bz2 |
Move bundled copy of sqlite one level deeper to better separate it
from our patches, READMEs, etc.
Also, add a shim header so we can use it for building
with system sqlite.
TEST=compile
BUG=22208
Review URL: http://codereview.chromium.org/3108030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/sqlite/src/ext/rtree/rtree3.test')
-rwxr-xr-x | third_party/sqlite/src/ext/rtree/rtree3.test | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/third_party/sqlite/src/ext/rtree/rtree3.test b/third_party/sqlite/src/ext/rtree/rtree3.test new file mode 100755 index 0000000..b83ceeb4 --- /dev/null +++ b/third_party/sqlite/src/ext/rtree/rtree3.test @@ -0,0 +1,74 @@ +# 2008 Feb 19 +# +# 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. +# +#*********************************************************************** +# +# The focus of this file is testing that the r-tree correctly handles +# out-of-memory conditions. +# +# $Id: rtree3.test,v 1.2 2008/06/23 15:55:52 danielk1977 Exp $ +# + +if {![info exists testdir]} { + set testdir [file join [file dirname $argv0] .. .. test] +} +source $testdir/tester.tcl + +ifcapable !rtree { + finish_test + return +} + +# Only run these tests if memory debugging is turned on. +# +source $testdir/malloc_common.tcl +if {!$MEMDEBUG} { + puts "Skipping malloc tests: not compiled with -DSQLITE_MEMDEBUG..." + finish_test + return +} + +do_malloc_test rtree3-1 -sqlbody { + BEGIN TRANSACTION; + CREATE VIRTUAL TABLE rt USING rtree(ii, x1, x2, y1, y2); + INSERT INTO rt VALUES(NULL, 3, 5, 7, 9); + INSERT INTO rt VALUES(NULL, 13, 15, 17, 19); + DELETE FROM rt WHERE ii = 1; + SELECT * FROM rt; + SELECT ii FROM rt WHERE ii = 2; + COMMIT; +} +do_malloc_test rtree3-2 -sqlprep { + CREATE VIRTUAL TABLE rt USING rtree(ii, x1, x2, y1, y2); + INSERT INTO rt VALUES(NULL, 3, 5, 7, 9); +} -sqlbody { + DROP TABLE rt; +} + + +do_malloc_test rtree3-3 -sqlprep { + CREATE VIRTUAL TABLE rt USING rtree(ii, x1, x2, y1, y2); + INSERT INTO rt VALUES(NULL, 3, 5, 7, 9); +} -tclbody { + db eval BEGIN + for {set ii 0} {$ii < 100} {incr ii} { + set f [expr rand()] + db eval {INSERT INTO rt VALUES(NULL, $f*10.0, $f*10.0, $f*15.0, $f*15.0)} + } + db eval COMMIT + db eval BEGIN + for {set ii 0} {$ii < 100} {incr ii} { + set f [expr rand()] + db eval { DELETE FROM rt WHERE x1<($f*10.0) AND x1>($f*10.5) } + } + db eval COMMIT +} + +finish_test + |