OLD | NEW |
1 # 2010 August 28 | 1 # 2010 August 28 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
11 # This file contains tests for the r-tree module. Specifically, it tests | 11 # This file contains tests for the r-tree module. Specifically, it tests |
12 # that custom r-tree queries (geometry callbacks) work. | 12 # that custom r-tree queries (geometry callbacks) work. |
13 # | 13 # |
14 | 14 |
15 if {![info exists testdir]} { | 15 if {![info exists testdir]} { |
16 set testdir [file join [file dirname [info script]] .. .. test] | 16 set testdir [file join [file dirname [info script]] .. .. test] |
17 } | 17 } |
18 source $testdir/tester.tcl | 18 source $testdir/tester.tcl |
19 ifcapable !rtree { finish_test ; return } | 19 ifcapable !rtree { finish_test ; return } |
| 20 ifcapable rtree_int_only { finish_test; return } |
20 | 21 |
21 register_cube_geom db | 22 register_cube_geom db |
22 | 23 |
23 do_execsql_test rtree9-1.1 { | 24 do_execsql_test rtree9-1.1 { |
24 CREATE VIRTUAL TABLE rt USING rtree(id, x1, x2, y1, y2, z1, z2); | 25 CREATE VIRTUAL TABLE rt USING rtree(id, x1, x2, y1, y2, z1, z2); |
25 INSERT INTO rt VALUES(1, 1, 2, 1, 2, 1, 2); | 26 INSERT INTO rt VALUES(1, 1, 2, 1, 2, 1, 2); |
26 } {} | 27 } {} |
27 do_execsql_test rtree9-1.2 { | 28 do_execsql_test rtree9-1.2 { |
28 SELECT * FROM rt WHERE id MATCH cube(0, 0, 0, 2, 2, 2); | 29 SELECT * FROM rt WHERE id MATCH cube(0, 0, 0, 2, 2, 2); |
29 } {1 1.0 2.0 1.0 2.0 1.0 2.0} | 30 } {1 1.0 2.0 1.0 2.0 1.0 2.0} |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 do_execsql_test rtree9-5.2 { | 117 do_execsql_test rtree9-5.2 { |
117 SELECT id FROM rt2 WHERE id MATCH circle(0.0, 0.0, 2.0); | 118 SELECT id FROM rt2 WHERE id MATCH circle(0.0, 0.0, 2.0); |
118 } {1 2 3 4 13 14 15 16 17} | 119 } {1 2 3 4 13 14 15 16 17} |
119 | 120 |
120 do_execsql_test rtree9-5.3 { | 121 do_execsql_test rtree9-5.3 { |
121 UPDATE rt2 SET xmin=xmin+5, ymin=ymin+5, xmax=xmax+5, ymax=ymax+5; | 122 UPDATE rt2 SET xmin=xmin+5, ymin=ymin+5, xmax=xmax+5, ymax=ymax+5; |
122 SELECT id FROM rt2 WHERE id MATCH circle(5.0, 5.0, 2.0); | 123 SELECT id FROM rt2 WHERE id MATCH circle(5.0, 5.0, 2.0); |
123 } {1 2 3 4 13 14 15 16 17} | 124 } {1 2 3 4 13 14 15 16 17} |
124 | 125 |
125 finish_test | 126 finish_test |
OLD | NEW |