Commit 36f4c784 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Adjust cube.out expected output for new test queries.

Previous commit modified the test case, but I didn't update cube.out
expected output file in previous commit because it was not needed by the
platforms I have easy access to. Buildfarm animal 'dugong', running
"Debian 4.0 icc 10.1.011 ia64", has now gone red because of that, so update
it now.

Also adjust cube_3.out. According to git history, it was added to support
64-bit MinGW. There is no such animal in the buildfarm, so I'm doing this
blindly, but it was added quite recently so maybe someone still cares.
parent 28858811
...@@ -473,8 +473,85 @@ SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]); ...@@ -473,8 +473,85 @@ SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
(5, 3, 1, 1),(8, 7, 6, 6) (5, 3, 1, 1),(8, 7, 6, 6)
(1 row) (1 row)
SELECT cube_subset(cube('(1,3,5),(1,3,5)'), ARRAY[3,2,1,1]);
cube_subset
--------------
(5, 3, 1, 1)
(1 row)
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]); SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
ERROR: Index out of bounds ERROR: Index out of bounds
SELECT cube_subset(cube('(6,7,8),(6,7,8)'), ARRAY[4,0]);
ERROR: Index out of bounds
--
-- Test point processing
--
SELECT cube('(1,2),(1,2)'); -- cube_in
cube
--------
(1, 2)
(1 row)
SELECT cube('{0,1,2}'::float[], '{0,1,2}'::float[]); -- cube_a_f8_f8
cube
-----------
(0, 1, 2)
(1 row)
SELECT cube('{5,6,7,8}'::float[]); -- cube_a_f8
cube
--------------
(5, 6, 7, 8)
(1 row)
SELECT cube(1.37); -- cube_f8
cube
--------
(1.37)
(1 row)
SELECT cube(1.37, 1.37); -- cube_f8_f8
cube
--------
(1.37)
(1 row)
SELECT cube(cube(1,1), 42); -- cube_c_f8
cube
---------
(1, 42)
(1 row)
SELECT cube(cube(1,2), 42); -- cube_c_f8
cube
-----------------
(1, 42),(2, 42)
(1 row)
SELECT cube(cube(1,1), 42, 42); -- cube_c_f8_f8
cube
---------
(1, 42)
(1 row)
SELECT cube(cube(1,1), 42, 24); -- cube_c_f8_f8
cube
-----------------
(1, 42),(1, 24)
(1 row)
SELECT cube(cube(1,2), 42, 42); -- cube_c_f8_f8
cube
-----------------
(1, 42),(2, 42)
(1 row)
SELECT cube(cube(1,2), 42, 24); -- cube_c_f8_f8
cube
-----------------
(1, 42),(2, 24)
(1 row)
-- --
-- Testing limit of CUBE_MAX_DIM dimensions check in cube_in. -- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
-- --
...@@ -878,6 +955,24 @@ SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube); ...@@ -878,6 +955,24 @@ SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube);
0.5 0.5
(1 row) (1 row)
SELECT cube_distance('(2,3,4)'::cube,'(2,3,4)'::cube);
cube_distance
---------------
0
(1 row)
SELECT cube_distance('(42,42,42,42)'::cube,'(137,137,137,137)'::cube);
cube_distance
---------------
190
(1 row)
SELECT cube_distance('(42,42,42)'::cube,'(137,137)'::cube);
cube_distance
------------------
140.762210837994
(1 row)
-- Test of cube function (text to cube) -- Test of cube function (text to cube)
-- --
SELECT cube('(1,1.2)'::text); SELECT cube('(1,1.2)'::text);
...@@ -912,6 +1007,18 @@ SELECT cube_dim('(0,0,0)'::cube); ...@@ -912,6 +1007,18 @@ SELECT cube_dim('(0,0,0)'::cube);
3 3
(1 row) (1 row)
SELECT cube_dim('(42,42,42),(42,42,42)'::cube);
cube_dim
----------
3
(1 row)
SELECT cube_dim('(4,8,15,16,23),(4,8,15,16,23)'::cube);
cube_dim
----------
5
(1 row)
-- Test of cube_ll_coord function (retrieves LL coodinate values) -- Test of cube_ll_coord function (retrieves LL coodinate values)
-- --
SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 1); SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 1);
...@@ -932,6 +1039,42 @@ SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 3); ...@@ -932,6 +1039,42 @@ SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 3);
0 0
(1 row) (1 row)
SELECT cube_ll_coord('(1,2),(1,2)'::cube, 1);
cube_ll_coord
---------------
1
(1 row)
SELECT cube_ll_coord('(1,2),(1,2)'::cube, 2);
cube_ll_coord
---------------
2
(1 row)
SELECT cube_ll_coord('(1,2),(1,2)'::cube, 3);
cube_ll_coord
---------------
0
(1 row)
SELECT cube_ll_coord('(42,137)'::cube, 1);
cube_ll_coord
---------------
42
(1 row)
SELECT cube_ll_coord('(42,137)'::cube, 2);
cube_ll_coord
---------------
137
(1 row)
SELECT cube_ll_coord('(42,137)'::cube, 3);
cube_ll_coord
---------------
0
(1 row)
-- Test of cube_ur_coord function (retrieves UR coodinate values) -- Test of cube_ur_coord function (retrieves UR coodinate values)
-- --
SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 1); SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 1);
...@@ -952,6 +1095,42 @@ SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 3); ...@@ -952,6 +1095,42 @@ SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 3);
0 0
(1 row) (1 row)
SELECT cube_ur_coord('(1,2),(1,2)'::cube, 1);
cube_ur_coord
---------------
1
(1 row)
SELECT cube_ur_coord('(1,2),(1,2)'::cube, 2);
cube_ur_coord
---------------
2
(1 row)
SELECT cube_ur_coord('(1,2),(1,2)'::cube, 3);
cube_ur_coord
---------------
0
(1 row)
SELECT cube_ur_coord('(42,137)'::cube, 1);
cube_ur_coord
---------------
42
(1 row)
SELECT cube_ur_coord('(42,137)'::cube, 2);
cube_ur_coord
---------------
137
(1 row)
SELECT cube_ur_coord('(42,137)'::cube, 3);
cube_ur_coord
---------------
0
(1 row)
-- Test of cube_is_point -- Test of cube_is_point
-- --
SELECT cube_is_point('(0)'::cube); SELECT cube_is_point('(0)'::cube);
...@@ -1100,6 +1279,108 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2); ...@@ -1100,6 +1279,108 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2);
(-0.5, 1),(-0.5, 4) (-0.5, 1),(-0.5, 4)
(1 row) (1 row)
SELECT cube_enlarge('(42,-23,-23),(42,23,23)'::cube, -23, 5);
cube_enlarge
--------------
(42, 0, 0)
(1 row)
SELECT cube_enlarge('(42,-23,-23),(42,23,23)'::cube, -24, 5);
cube_enlarge
--------------
(42, 0, 0)
(1 row)
-- Test of cube_union (MBR for two cubes)
--
SELECT cube_union('(1,2),(3,4)'::cube, '(5,6,7),(8,9,10)'::cube);
cube_union
----------------------
(1, 2, 0),(8, 9, 10)
(1 row)
SELECT cube_union('(1,2)'::cube, '(4,2,0,0)'::cube);
cube_union
---------------------------
(1, 2, 0, 0),(4, 2, 0, 0)
(1 row)
SELECT cube_union('(1,2),(1,2)'::cube, '(4,2),(4,2)'::cube);
cube_union
---------------
(1, 2),(4, 2)
(1 row)
SELECT cube_union('(1,2),(1,2)'::cube, '(1,2),(1,2)'::cube);
cube_union
------------
(1, 2)
(1 row)
SELECT cube_union('(1,2),(1,2)'::cube, '(1,2,0),(1,2,0)'::cube);
cube_union
------------
(1, 2, 0)
(1 row)
-- Test of cube_inter
--
SELECT cube_inter('(1,2),(10,11)'::cube, '(3,4), (16,15)'::cube); -- intersects
cube_inter
-----------------
(3, 4),(10, 11)
(1 row)
SELECT cube_inter('(1,2),(10,11)'::cube, '(3,4), (6,5)'::cube); -- includes
cube_inter
---------------
(3, 4),(6, 5)
(1 row)
SELECT cube_inter('(1,2),(10,11)'::cube, '(13,14), (16,15)'::cube); -- no intersection
cube_inter
-------------------
(13, 14),(10, 11)
(1 row)
SELECT cube_inter('(1,2),(10,11)'::cube, '(3,14), (16,15)'::cube); -- no intersection, but one dimension intersects
cube_inter
------------------
(3, 14),(10, 11)
(1 row)
SELECT cube_inter('(1,2),(10,11)'::cube, '(10,11), (16,15)'::cube); -- point intersection
cube_inter
------------
(10, 11)
(1 row)
SELECT cube_inter('(1,2,3)'::cube, '(1,2,3)'::cube); -- point args
cube_inter
------------
(1, 2, 3)
(1 row)
SELECT cube_inter('(1,2,3)'::cube, '(5,6,3)'::cube); -- point args
cube_inter
---------------------
(5, 6, 3),(1, 2, 3)
(1 row)
-- Test of cube_size
--
SELECT cube_size('(4,8),(15,16)'::cube);
cube_size
-----------
88
(1 row)
SELECT cube_size('(42,137)'::cube);
cube_size
-----------
0
(1 row)
-- Load some example data and build the index -- Load some example data and build the index
-- --
CREATE TABLE test_cube (c cube); CREATE TABLE test_cube (c cube);
......
...@@ -473,8 +473,85 @@ SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]); ...@@ -473,8 +473,85 @@ SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
(5, 3, 1, 1),(8, 7, 6, 6) (5, 3, 1, 1),(8, 7, 6, 6)
(1 row) (1 row)
SELECT cube_subset(cube('(1,3,5),(1,3,5)'), ARRAY[3,2,1,1]);
cube_subset
--------------
(5, 3, 1, 1)
(1 row)
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]); SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
ERROR: Index out of bounds ERROR: Index out of bounds
SELECT cube_subset(cube('(6,7,8),(6,7,8)'), ARRAY[4,0]);
ERROR: Index out of bounds
--
-- Test point processing
--
SELECT cube('(1,2),(1,2)'); -- cube_in
cube
--------
(1, 2)
(1 row)
SELECT cube('{0,1,2}'::float[], '{0,1,2}'::float[]); -- cube_a_f8_f8
cube
-----------
(0, 1, 2)
(1 row)
SELECT cube('{5,6,7,8}'::float[]); -- cube_a_f8
cube
--------------
(5, 6, 7, 8)
(1 row)
SELECT cube(1.37); -- cube_f8
cube
--------
(1.37)
(1 row)
SELECT cube(1.37, 1.37); -- cube_f8_f8
cube
--------
(1.37)
(1 row)
SELECT cube(cube(1,1), 42); -- cube_c_f8
cube
---------
(1, 42)
(1 row)
SELECT cube(cube(1,2), 42); -- cube_c_f8
cube
-----------------
(1, 42),(2, 42)
(1 row)
SELECT cube(cube(1,1), 42, 42); -- cube_c_f8_f8
cube
---------
(1, 42)
(1 row)
SELECT cube(cube(1,1), 42, 24); -- cube_c_f8_f8
cube
-----------------
(1, 42),(1, 24)
(1 row)
SELECT cube(cube(1,2), 42, 42); -- cube_c_f8_f8
cube
-----------------
(1, 42),(2, 42)
(1 row)
SELECT cube(cube(1,2), 42, 24); -- cube_c_f8_f8
cube
-----------------
(1, 42),(2, 24)
(1 row)
-- --
-- Testing limit of CUBE_MAX_DIM dimensions check in cube_in. -- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
-- --
...@@ -878,6 +955,24 @@ SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube); ...@@ -878,6 +955,24 @@ SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube);
0.5 0.5
(1 row) (1 row)
SELECT cube_distance('(2,3,4)'::cube,'(2,3,4)'::cube);
cube_distance
---------------
0
(1 row)
SELECT cube_distance('(42,42,42,42)'::cube,'(137,137,137,137)'::cube);
cube_distance
---------------
190
(1 row)
SELECT cube_distance('(42,42,42)'::cube,'(137,137)'::cube);
cube_distance
------------------
140.762210837994
(1 row)
-- Test of cube function (text to cube) -- Test of cube function (text to cube)
-- --
SELECT cube('(1,1.2)'::text); SELECT cube('(1,1.2)'::text);
...@@ -912,6 +1007,18 @@ SELECT cube_dim('(0,0,0)'::cube); ...@@ -912,6 +1007,18 @@ SELECT cube_dim('(0,0,0)'::cube);
3 3
(1 row) (1 row)
SELECT cube_dim('(42,42,42),(42,42,42)'::cube);
cube_dim
----------
3
(1 row)
SELECT cube_dim('(4,8,15,16,23),(4,8,15,16,23)'::cube);
cube_dim
----------
5
(1 row)
-- Test of cube_ll_coord function (retrieves LL coodinate values) -- Test of cube_ll_coord function (retrieves LL coodinate values)
-- --
SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 1); SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 1);
...@@ -932,6 +1039,42 @@ SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 3); ...@@ -932,6 +1039,42 @@ SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 3);
0 0
(1 row) (1 row)
SELECT cube_ll_coord('(1,2),(1,2)'::cube, 1);
cube_ll_coord
---------------
1
(1 row)
SELECT cube_ll_coord('(1,2),(1,2)'::cube, 2);
cube_ll_coord
---------------
2
(1 row)
SELECT cube_ll_coord('(1,2),(1,2)'::cube, 3);
cube_ll_coord
---------------
0
(1 row)
SELECT cube_ll_coord('(42,137)'::cube, 1);
cube_ll_coord
---------------
42
(1 row)
SELECT cube_ll_coord('(42,137)'::cube, 2);
cube_ll_coord
---------------
137
(1 row)
SELECT cube_ll_coord('(42,137)'::cube, 3);
cube_ll_coord
---------------
0
(1 row)
-- Test of cube_ur_coord function (retrieves UR coodinate values) -- Test of cube_ur_coord function (retrieves UR coodinate values)
-- --
SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 1); SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 1);
...@@ -952,6 +1095,42 @@ SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 3); ...@@ -952,6 +1095,42 @@ SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 3);
0 0
(1 row) (1 row)
SELECT cube_ur_coord('(1,2),(1,2)'::cube, 1);
cube_ur_coord
---------------
1
(1 row)
SELECT cube_ur_coord('(1,2),(1,2)'::cube, 2);
cube_ur_coord
---------------
2
(1 row)
SELECT cube_ur_coord('(1,2),(1,2)'::cube, 3);
cube_ur_coord
---------------
0
(1 row)
SELECT cube_ur_coord('(42,137)'::cube, 1);
cube_ur_coord
---------------
42
(1 row)
SELECT cube_ur_coord('(42,137)'::cube, 2);
cube_ur_coord
---------------
137
(1 row)
SELECT cube_ur_coord('(42,137)'::cube, 3);
cube_ur_coord
---------------
0
(1 row)
-- Test of cube_is_point -- Test of cube_is_point
-- --
SELECT cube_is_point('(0)'::cube); SELECT cube_is_point('(0)'::cube);
...@@ -1100,6 +1279,108 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2); ...@@ -1100,6 +1279,108 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2);
(-0.5, 1),(-0.5, 4) (-0.5, 1),(-0.5, 4)
(1 row) (1 row)
SELECT cube_enlarge('(42,-23,-23),(42,23,23)'::cube, -23, 5);
cube_enlarge
--------------
(42, 0, 0)
(1 row)
SELECT cube_enlarge('(42,-23,-23),(42,23,23)'::cube, -24, 5);
cube_enlarge
--------------
(42, 0, 0)
(1 row)
-- Test of cube_union (MBR for two cubes)
--
SELECT cube_union('(1,2),(3,4)'::cube, '(5,6,7),(8,9,10)'::cube);
cube_union
----------------------
(1, 2, 0),(8, 9, 10)
(1 row)
SELECT cube_union('(1,2)'::cube, '(4,2,0,0)'::cube);
cube_union
---------------------------
(1, 2, 0, 0),(4, 2, 0, 0)
(1 row)
SELECT cube_union('(1,2),(1,2)'::cube, '(4,2),(4,2)'::cube);
cube_union
---------------
(1, 2),(4, 2)
(1 row)
SELECT cube_union('(1,2),(1,2)'::cube, '(1,2),(1,2)'::cube);
cube_union
------------
(1, 2)
(1 row)
SELECT cube_union('(1,2),(1,2)'::cube, '(1,2,0),(1,2,0)'::cube);
cube_union
------------
(1, 2, 0)
(1 row)
-- Test of cube_inter
--
SELECT cube_inter('(1,2),(10,11)'::cube, '(3,4), (16,15)'::cube); -- intersects
cube_inter
-----------------
(3, 4),(10, 11)
(1 row)
SELECT cube_inter('(1,2),(10,11)'::cube, '(3,4), (6,5)'::cube); -- includes
cube_inter
---------------
(3, 4),(6, 5)
(1 row)
SELECT cube_inter('(1,2),(10,11)'::cube, '(13,14), (16,15)'::cube); -- no intersection
cube_inter
-------------------
(13, 14),(10, 11)
(1 row)
SELECT cube_inter('(1,2),(10,11)'::cube, '(3,14), (16,15)'::cube); -- no intersection, but one dimension intersects
cube_inter
------------------
(3, 14),(10, 11)
(1 row)
SELECT cube_inter('(1,2),(10,11)'::cube, '(10,11), (16,15)'::cube); -- point intersection
cube_inter
------------
(10, 11)
(1 row)
SELECT cube_inter('(1,2,3)'::cube, '(1,2,3)'::cube); -- point args
cube_inter
------------
(1, 2, 3)
(1 row)
SELECT cube_inter('(1,2,3)'::cube, '(5,6,3)'::cube); -- point args
cube_inter
---------------------
(5, 6, 3),(1, 2, 3)
(1 row)
-- Test of cube_size
--
SELECT cube_size('(4,8),(15,16)'::cube);
cube_size
-----------
88
(1 row)
SELECT cube_size('(42,137)'::cube);
cube_size
-----------
0
(1 row)
-- Load some example data and build the index -- Load some example data and build the index
-- --
CREATE TABLE test_cube (c cube); CREATE TABLE test_cube (c cube);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment