136 lines
4.8 KiB
Plaintext
136 lines
4.8 KiB
Plaintext
|
|
#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
|
||
|
|
|
||
|
|
#########################################################################
|
||
|
|
# Testing the TemporalUnitAlgebra
|
||
|
|
#
|
||
|
|
# Here: testing operators on moving datatypes
|
||
|
|
#
|
||
|
|
# Written Sept 2006 by Chrstian Duentgen
|
||
|
|
#
|
||
|
|
# run with : TestRunner -c SecondoConfig.ini < temporalunit.test
|
||
|
|
#########################################################################
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
# clean up what may be left over from e.g. a segfault
|
||
|
|
delete database tempunittest;
|
||
|
|
|
||
|
|
########################
|
||
|
|
# set up test database #
|
||
|
|
########################
|
||
|
|
|
||
|
|
#setup
|
||
|
|
create database tempunittest;
|
||
|
|
open database tempunittest;
|
||
|
|
|
||
|
|
let up1 = [const upoint value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (2000.0 2000.0 1000.0 1000.0))];
|
||
|
|
let up2 = [const upoint value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (1000.0 1000.0 2000.0 2000.0))];
|
||
|
|
let up3 = [const upoint value undef];
|
||
|
|
let up4 = [const upoint value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (0.0 0.0 0.0 1000.0))];
|
||
|
|
let up5 = [const upoint value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (0.0 0.0 0.0 -1000.0))];
|
||
|
|
let up6 = [const upoint value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (1500.0 1500.0 1500.0 1500.0))];
|
||
|
|
|
||
|
|
|
||
|
|
let mp1 = [const mpoint value ((("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (-100.0 -100.0 100.0 100.0)))];
|
||
|
|
let mp2 = [const mpoint value ((("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (100.0 100.0 -100.0 -100.0)))];
|
||
|
|
|
||
|
|
let p = [const point value (1500.0 1500.0)];
|
||
|
|
|
||
|
|
let ui1 = [const uint value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) 1500)];
|
||
|
|
let ui2 = [const uint value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) 1000)];
|
||
|
|
let ui3 = [const uint value undef];
|
||
|
|
let ui4 = [const uint value (("2003-11-20-06:30" "2003-11-20-07:30" TRUE FALSE) 1000)];
|
||
|
|
|
||
|
|
let i = [const int value 1000];
|
||
|
|
let i1 = [const int value 100];
|
||
|
|
|
||
|
|
let ur1 = [const ureal value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (0.01 0.0 -0.00001 FALSE))];
|
||
|
|
let ur2 = [const ureal value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (-1.0 -1.0 -1.0 FALSE))];
|
||
|
|
let ur3 = [const ureal value undef];
|
||
|
|
let ur4 = [const ureal value (("2003-11-20-06:00" "2003-11-20-07:00" TRUE FALSE) (1.0 1.0 1.0 TRUE))];
|
||
|
|
|
||
|
|
let r = [const real value 0.0];
|
||
|
|
|
||
|
|
(create ten : (rel(tuple((No int)))));
|
||
|
|
(update ten := ((rel(tuple((No int))))((1)(2)(3)(4)(5)(6)(7)(8)(9)(10))));
|
||
|
|
|
||
|
|
restore zug5 from '$(SECONDO_BUILD_DIR)/Tests/Testspecs/tempunitalg/zug5';
|
||
|
|
|
||
|
|
###########################
|
||
|
|
# moving object operators #
|
||
|
|
###########################
|
||
|
|
|
||
|
|
#testcase speed_mp
|
||
|
|
#tolerance_real 0.001
|
||
|
|
#yields @$(SECONDO_BUILD_DIR)/Tests/Testspecs/tempunitalg/zug5_speed
|
||
|
|
query speed(zug5)
|
||
|
|
|
||
|
|
#testcase speed_mp empty-mp
|
||
|
|
#yields (mreal ( ) )
|
||
|
|
query speed([const mpoint value ( ) ])
|
||
|
|
|
||
|
|
#testcase velocity_mp
|
||
|
|
#tolerance_real 0.001
|
||
|
|
#yields @$(SECONDO_BUILD_DIR)/Tests/Testspecs/tempunitalg/zug5_velocity
|
||
|
|
query velocity(zug5)
|
||
|
|
|
||
|
|
#testcase velocity_mp empty-mp
|
||
|
|
#yields (mpoint ( ) )
|
||
|
|
query velocity([const mpoint value ( ) ])
|
||
|
|
|
||
|
|
#testcase derivable_mr
|
||
|
|
#tolerance_real 0.001
|
||
|
|
#yields (mbool ( ( ("2003-11-20-06:00" "2003-11-20-06:34:10" TRUE FALSE) TRUE)))
|
||
|
|
query derivable(speed(zug5))
|
||
|
|
|
||
|
|
#testcase derivable_mr empty-mr
|
||
|
|
#yields (mbool ( ) )
|
||
|
|
query derivable([const mreal value ( ) ])
|
||
|
|
|
||
|
|
#testcase derivative_mr
|
||
|
|
#tolerance_real 0.001
|
||
|
|
#yields (mreal ( ( ("2003-11-20-06:00" "2003-11-20-06:34:10" TRUE FALSE) (0.0 0.0 0.0 FALSE))))
|
||
|
|
query derivative(speed(zug5))
|
||
|
|
|
||
|
|
#testcase derivative_mr empty-mr
|
||
|
|
#yields (mreal ( ) )
|
||
|
|
query derivative([const mreal value ( ) ])
|
||
|
|
|
||
|
|
#testcase get_duration_periods empty
|
||
|
|
#yields (duration (0 0))
|
||
|
|
query get_duration([const periods value ( )])
|
||
|
|
|
||
|
|
#testcase get_duration_periods single
|
||
|
|
#yields (duration (0 60000))
|
||
|
|
query get_duration([const periods value (("2000-03-01-06:30:30" "2000-03-01-06:31:30" TRUE TRUE))])
|
||
|
|
|
||
|
|
#testcase get_duration_periods double
|
||
|
|
#yields (duration (0 60250))
|
||
|
|
query get_duration([const periods value (("2000-03-01-06:30:30" "2000-03-01-06:31:30" TRUE TRUE) ("2005-07-11-21:10:00" "2005-07-11-21:10:00.250" FALSE FALSE))])
|
||
|
|
|
||
|
|
|
||
|
|
############################
|
||
|
|
# mopping up test database #
|
||
|
|
############################
|
||
|
|
|
||
|
|
#teardown
|
||
|
|
close database;
|
||
|
|
delete database tempunittest
|