xref: /sqlite-3.40.0/ext/rtree/rtreeB.test (revision 1917e92f)
1befd5f3cSdrh# 2011 March 2
2befd5f3cSdrh#
3befd5f3cSdrh# The author disclaims copyright to this source code.  In place of
4befd5f3cSdrh# a legal notice, here is a blessing:
5befd5f3cSdrh#
6befd5f3cSdrh#    May you do good and not evil.
7befd5f3cSdrh#    May you find forgiveness for yourself and forgive others.
8befd5f3cSdrh#    May you share freely, never taking more than you give.
9befd5f3cSdrh#
10befd5f3cSdrh#***********************************************************************
11befd5f3cSdrh# Make sure the rtreenode() testing function can handle entries with
12befd5f3cSdrh# 64-bit rowids.
13befd5f3cSdrh#
14befd5f3cSdrh
15befd5f3cSdrhif {![info exists testdir]} {
16befd5f3cSdrh  set testdir [file join [file dirname [info script]] .. .. test]
17befd5f3cSdrh}
18*1917e92fSdansource [file join [file dirname [info script]] rtree_util.tcl]
19befd5f3cSdrhsource $testdir/tester.tcl
20befd5f3cSdrhifcapable !rtree { finish_test ; return }
21befd5f3cSdrh
22f439fbdaSdrhifcapable rtree_int_only {
23f439fbdaSdrh  do_test rtreeB-1.1-intonly {
24f439fbdaSdrh    db eval {
25f439fbdaSdrh      CREATE VIRTUAL TABLE t1 USING rtree(ii, x0, y0, x1, y1);
26f439fbdaSdrh      INSERT INTO t1 VALUES(1073741824, 0.0, 0.0, 100.0, 100.0);
27f439fbdaSdrh      INSERT INTO t1 VALUES(2147483646, 0.0, 0.0, 200.0, 200.0);
28f439fbdaSdrh      INSERT INTO t1 VALUES(4294967296, 0.0, 0.0, 300.0, 300.0);
29f439fbdaSdrh      INSERT INTO t1 VALUES(8589934592, 20.0, 20.0, 150.0, 150.0);
30f439fbdaSdrh      INSERT INTO t1 VALUES(9223372036854775807, 150, 150, 400, 400);
31f439fbdaSdrh      SELECT rtreenode(2, data) FROM t1_node;
32f439fbdaSdrh    }
33f439fbdaSdrh  } {{{1073741824 0 0 100 100} {2147483646 0 0 200 200} {4294967296 0 0 300 300} {8589934592 20 20 150 150} {9223372036854775807 150 150 400 400}}}
34f439fbdaSdrh} else {
35befd5f3cSdrh  do_test rtreeB-1.1 {
36befd5f3cSdrh    db eval {
37befd5f3cSdrh      CREATE VIRTUAL TABLE t1 USING rtree(ii, x0, y0, x1, y1);
38befd5f3cSdrh      INSERT INTO t1 VALUES(1073741824, 0.0, 0.0, 100.0, 100.0);
39befd5f3cSdrh      INSERT INTO t1 VALUES(2147483646, 0.0, 0.0, 200.0, 200.0);
40befd5f3cSdrh      INSERT INTO t1 VALUES(4294967296, 0.0, 0.0, 300.0, 300.0);
41befd5f3cSdrh      INSERT INTO t1 VALUES(8589934592, 20.0, 20.0, 150.0, 150.0);
42befd5f3cSdrh      INSERT INTO t1 VALUES(9223372036854775807, 150, 150, 400, 400);
43befd5f3cSdrh      SELECT rtreenode(2, data) FROM t1_node;
44befd5f3cSdrh    }
4565e6b0ddSdrh  } {{{1073741824 0 0 100 100} {2147483646 0 0 200 200} {4294967296 0 0 300 300} {8589934592 20 20 150 150} {9223372036854775807 150 150 400 400}}}
46f439fbdaSdrh}
47befd5f3cSdrh
48*1917e92fSdando_rtree_integrity_test rtreeB-1.2 t1
49*1917e92fSdan
50befd5f3cSdrhfinish_test
51