| OLD | NEW | 
 | (Empty) | 
|   1 # 2008 Jul 14 |  | 
|   2 # |  | 
|   3 # The author disclaims copyright to this source code.  In place of |  | 
|   4 # a legal notice, here is a blessing: |  | 
|   5 # |  | 
|   6 #    May you do good and not evil. |  | 
|   7 #    May you find forgiveness for yourself and forgive others. |  | 
|   8 #    May you share freely, never taking more than you give. |  | 
|   9 # |  | 
|  10 #*********************************************************************** |  | 
|  11 # |  | 
|  12 # The focus of this file is testing the r-tree extension when it is |  | 
|  13 # configured to store values as 32 bit integers. |  | 
|  14 # |  | 
|  15 # $Id: rtree5.test,v 1.1 2008/07/14 15:37:01 danielk1977 Exp $ |  | 
|  16 # |  | 
|  17  |  | 
|  18 if {![info exists testdir]} { |  | 
|  19   set testdir [file join [file dirname $argv0] .. .. test] |  | 
|  20 }  |  | 
|  21 source $testdir/tester.tcl |  | 
|  22  |  | 
|  23 ifcapable !rtree { |  | 
|  24   finish_test |  | 
|  25   return |  | 
|  26 } |  | 
|  27  |  | 
|  28 do_test rtree5-1.0 { |  | 
|  29   execsql { CREATE VIRTUAL TABLE t1 USING rtree_i32(id, x1, x2, y1, y2) } |  | 
|  30 } {} |  | 
|  31 do_test rtree5-1.1 { |  | 
|  32   execsql { INSERT INTO t1 VALUES(1, 5, 10, 4, 11.2) } |  | 
|  33 } {} |  | 
|  34 do_test rtree5-1.2 {  |  | 
|  35   execsql { SELECT * FROM t1 } |  | 
|  36 } {1 5 10 4 11} |  | 
|  37 do_test rtree5-1.3 {  |  | 
|  38   execsql { SELECT typeof(x1) FROM t1 } |  | 
|  39 } {integer} |  | 
|  40  |  | 
|  41 do_test rtree5-1.4 {  |  | 
|  42   execsql { SELECT x1==5 FROM t1 } |  | 
|  43 } {1} |  | 
|  44 do_test rtree5-1.5 {  |  | 
|  45   execsql { SELECT x1==5.2 FROM t1 } |  | 
|  46 } {0} |  | 
|  47 do_test rtree5-1.6 {  |  | 
|  48   execsql { SELECT x1==5.0 FROM t1 } |  | 
|  49 } {1} |  | 
|  50  |  | 
|  51 do_test rtree5-1.7 {  |  | 
|  52   execsql { SELECT count(*) FROM t1 WHERE x1==5 } |  | 
|  53 } {1} |  | 
|  54 do_test rtree5-1.8 {  |  | 
|  55   execsql { SELECT count(*) FROM t1 WHERE x1==5.2 } |  | 
|  56 } {0} |  | 
|  57 do_test rtree5-1.9 {  |  | 
|  58   execsql { SELECT count(*) FROM t1 WHERE x1==5.0 } |  | 
|  59 } {1} |  | 
|  60  |  | 
|  61 do_test rtree5-1.10 {  |  | 
|  62   execsql { SELECT (1<<31)-5, (1<<31)-1, -1*(1<<31), -1*(1<<31)+5 } |  | 
|  63 } {2147483643 2147483647 -2147483648 -2147483643} |  | 
|  64 do_test rtree5-1.10 {  |  | 
|  65   execsql {  |  | 
|  66     INSERT INTO t1 VALUES(2, (1<<31)-5, (1<<31)-1, -1*(1<<31), -1*(1<<31)+5)  |  | 
|  67   } |  | 
|  68 } {} |  | 
|  69 do_test rtree5-1.12 {  |  | 
|  70   execsql { SELECT * FROM t1 WHERE id=2 } |  | 
|  71 } {2 2147483643 2147483647 -2147483648 -2147483643} |  | 
|  72 do_test rtree5-1.13 {  |  | 
|  73   execsql {  |  | 
|  74     SELECT * FROM t1 WHERE  |  | 
|  75         x1=2147483643 AND x2=2147483647 AND  |  | 
|  76         y1=-2147483648 AND y2=-2147483643 |  | 
|  77   } |  | 
|  78 } {2 2147483643 2147483647 -2147483648 -2147483643} |  | 
|  79  |  | 
|  80 finish_test |  | 
| OLD | NEW |