1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-24 14:17:58 +03:00

Run (a subset of) the rtree tests from quick.test. (CVS 5282)

FossilOrigin-Name: e872c78c72eb5976e72123485692a76409bd857f
This commit is contained in:
danielk1977
2008-06-23 15:55:52 +00:00
parent 950292fbb8
commit b13dee9900
10 changed files with 84 additions and 47 deletions

View File

@@ -12,7 +12,7 @@
** This file contains code for implementations of the r-tree and r*-tree
** algorithms packaged as an SQLite virtual table module.
**
** $Id: rtree.c,v 1.4 2008/05/27 00:06:02 drh Exp $
** $Id: rtree.c,v 1.5 2008/06/23 15:55:52 danielk1977 Exp $
*/
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RTREE)
@@ -66,11 +66,9 @@
#include <string.h>
#include <assert.h>
#ifndef SQLITE_CORE
typedef sqlite3_int64 i64;
typedef unsigned char u8;
typedef unsigned int u32;
#endif
typedef sqlite3_int64 i64;
typedef unsigned char u8;
typedef unsigned int u32;
typedef struct Rtree Rtree;
typedef struct RtreeCursor RtreeCursor;

View File

@@ -1,43 +0,0 @@
#
# 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 runs all rtree related tests.
#
# $Id: rtree.test,v 1.1 2008/05/26 18:41:54 danielk1977 Exp $
set testdir [file join [file dirname $argv0] .. .. test]
source $testdir/tester.tcl
rename finish_test really_finish_test
proc finish_test {} {}
set ISQUICK 1
set EXCLUDE {
rtree.test
}
# Files to include in the test. If this list is empty then everything
# that is not in the EXCLUDE list is run.
#
set INCLUDE {
}
foreach testfile [lsort -dictionary [glob [file dirname $argv0]/*.test]] {
set tail [file tail $testfile]
if {[lsearch -exact $EXCLUDE $tail]>=0} continue
if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
source $testfile
catch {db close}
if {$sqlite_open_file_count>0} {
puts "$tail did not close all files: $sqlite_open_file_count"
incr nErr
lappend ::failList $tail
set sqlite_open_file_count 0
}
}
set sqlite_open_file_count 0
really_finish_test

View File

@@ -11,10 +11,12 @@
#
# The focus of this file is testing the r-tree extension.
#
# $Id: rtree1.test,v 1.2 2008/05/26 20:49:04 drh Exp $
# $Id: rtree1.test,v 1.3 2008/06/23 15:55:52 danielk1977 Exp $
#
set testdir [file join [file dirname $argv0] .. .. test]
if {![info exists testdir]} {
set testdir [file join [file dirname $argv0] .. .. test]
}
source $testdir/tester.tcl
# Test plan:

View File

@@ -11,12 +11,14 @@
#
# The focus of this file is testing the r-tree extension.
#
# $Id: rtree2.test,v 1.2 2008/05/27 00:06:02 drh Exp $
# $Id: rtree2.test,v 1.3 2008/06/23 15:55:52 danielk1977 Exp $
#
set testdir [file join [file dirname $argv0] .. .. test]
if {![info exists testdir]} {
set testdir [file join [file dirname $argv0] .. .. test]
}
source [file join [file dirname [info script]] rtree_util.tcl]
source $testdir/tester.tcl
source [file join [file dirname $argv0] rtree_util.tcl]
ifcapable !rtree {
finish_test
@@ -27,6 +29,11 @@ set ::NROW 1000
set ::NDEL 10
set ::NSELECT 100
if {[info exists ISQUICK] && $ISQUICK} {
set ::NROW 100
set ::NSELECT 10
}
for {set nDim 1} {$nDim <= 5} {incr nDim} {
do_test rtree2-$nDim.1 {

View File

@@ -12,10 +12,12 @@
# The focus of this file is testing that the r-tree correctly handles
# out-of-memory conditions.
#
# $Id: rtree3.test,v 1.1 2008/05/26 18:41:54 danielk1977 Exp $
# $Id: rtree3.test,v 1.2 2008/06/23 15:55:52 danielk1977 Exp $
#
set testdir [file join [file dirname $argv0] .. .. test]
if {![info exists testdir]} {
set testdir [file join [file dirname $argv0] .. .. test]
}
source $testdir/tester.tcl
ifcapable !rtree {

View File

@@ -11,10 +11,12 @@
#
# Randomized test cases for the rtree extension.
#
# $Id: rtree4.test,v 1.2 2008/05/28 13:49:35 drh Exp $
# $Id: rtree4.test,v 1.3 2008/06/23 15:55:52 danielk1977 Exp $
#
set testdir [file join [file dirname $argv0] .. .. test]
if {![info exists testdir]} {
set testdir [file join [file dirname $argv0] .. .. test]
}
source $testdir/tester.tcl
ifcapable !rtree {
@@ -22,6 +24,11 @@ ifcapable !rtree {
return
}
set ::NROW 2500
if {[info exists ISQUICK] && $ISQUICK} {
set ::NROW 250
}
# Return a floating point number between -X and X.
#
proc rand {X} {
@@ -85,7 +92,7 @@ for {set nDim 1} {$nDim<=5} {incr nDim} {
# is well.
#
unset -nocomplain where
for {set i 1} {$i<2500} {incr i} {
for {set i 1} {$i<$::NROW} {incr i} {
# Do a random insert
#
do_test rtree-$nDim.2.$i.1 {