Files
secondo/Tests/Testspecs/binfile.test
2026-01-23 17:03:45 +08:00

82 lines
1.9 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
#
# a test for the BinaryFile Algebra
# clean up what may be left over from e.g. a segfault
delete database binfiletest;
#setup
create database binfiletest;
open database binfiletest;
(create a : binfile);
(update a := (binfile <file>$(SECONDO_BUILD_DIR)/bin/JNI.ini</file--->));
(create b : binfile);
(update b := (binfile <file>$(SECONDO_BUILD_DIR)/lib/libRelation-C++Algebra.a</file--->));
(create relFile :
(rel
(tuple
(
(No int)
(File binfile)
(Name string)
)
)
)
);
(update relFile :=
(
(rel
(tuple
(
(No int)
(File binfile)
(Name string)
)
)
)
(
(1 <file>$(SECONDO_BUILD_DIR)/bin/JNI.ini</file---> "JNI.ini")
(2 <file>$(SECONDO_BUILD_DIR)/lib/libRelation-C++Algebra.a</file--->
"libRelation-C++Algebra.a")
)
) );
#testcase binfile1
#yields (bool TRUE)
query a saveto "tmp/a.tmp";
#testcase binfile1
#yields (bool TRUE)
query b saveto "tmp/b.tmp";
#testcase binfile2
#yields (int 2)
query relFile feed filter[.File saveto ("tmp/" + .Name)] count;
#teardown
close database;
delete database binfiletest;