Files
secondo/Tests/Testspecs/polygon.test

88 lines
2.9 KiB
Plaintext
Raw Normal View History

2026-01-23 17:03:45 +08:00
#This file is part of SECONDO.
#
#Copyright (C) 2004, University in Hagen, Department of Computer Science,
#Database Systems for New Applications.
#
#SECONDO is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#SECONDO is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with SECONDO; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# a test for the polygon algebra
# run with : Runner -c MyConfig.config < polygontest
# (Runner can be found in directory UserInterfaces)
# clean up what may be left over from e.g. a segfault
delete database polytest;
#setup
create database polytest;
open database polytest;
create polysmall: polygon;
update polysmall := [const polygon value ((0 0)(1 1)(2 2)(3 3))];
create polybig: polygon;
update polybig := [const polygon value (
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)
(0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3) (0 0)(1 1)(2 2)(3 3)) ];
let polyrel = [const rel(tuple([Id: int, Obj: polygon])) value ((1 ((0 0)(1 1)(2 2)(3 3)))) ];
let ten = [const rel(tuple([No: int])) value ((1)(2)(3)(4)(5)(6)(7)(8)(9)(10))];
let hundred = ten feed ten feed {arg2} product project[No] consume;
#testcase out-1
#yields success
query polybig;
#testcase feed-count-1
#yields (int 1)
query polyrel feed consume count;
#testcase product-1
#yields success
let poly_100 = hundred feed polyrel feed product consume;
#testcase extend-1
#yields (int 100)
query poly_100 feed extend[Obj2: polybig] project[Obj2] consume count;
#testcase Sort-Merge-Join-1
#yields (int 10000)
query poly_100 feed poly_100 feed {arg2} sortmergejoin[Obj, Obj_arg2] count;
# testcase Hash-Join-1 (known to crash)
# yields (int 100)
# query poly_100 feed poly_100 feed {arg2} hashjoin[Obj, Obj_arg2, 9997] count;
#
# Type polygon should not be in kind DATA. Functionality of the classes Attribute and
# StandardAttribute should be revised! Some properties of Attribute should be moved to
# StandardAttribute.
#teardown
close database;
delete database polytest;