X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ft8.c;fp=test%2Fapi%2Ft8.c;h=0000000000000000000000000000000000000000;hb=965cbd297cf8de73cfe01d55983b8161ae7cf67e;hp=31e17ac5a4e911d13e4025b6bc987bb782ab0244;hpb=1922579d92e1a9559d4c3ab4f1cf461f56c83c3b;p=idzebra-moved-to-github.git diff --git a/test/api/t8.c b/test/api/t8.c deleted file mode 100644 index 31e17ac..0000000 --- a/test/api/t8.c +++ /dev/null @@ -1,113 +0,0 @@ -/* This file is part of the Zebra server. - Copyright (C) 1995-2008 Index Data - -Zebra 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, or (at your option) any later -version. - -Zebra 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 this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - -/** t8: test numeric attributes */ - -#include "testlib.h" - -const char *recs[] = { - "\n" - " My title\n" - " test record with single coordset, negatives\n" - " \n" - " -120 \n" - " -102 \n" - " 49 \n" - " 31 \n" - " " - "\n", - - "\n" - " Another title\n" - " second test with two coord sets\n" - " \n" - " -120 \n" - " -102 \n" - " 49 \n" - " 31 \n" - " " - " \n" - " -125 \n" - " -108 \n" - " 41 \n" - " 25 \n" - " " - "\n", - 0}; - - -static void tst(int argc, char **argv) -{ - ZebraService zs = tl_start_up("zebra8.cfg", argc, argv); - ZebraHandle zh = zebra_open (zs, 0); - - YAZ_CHECK(tl_init_data(zh, recs)); - - /* couple of simple queries just to see that we have indexed the stuff */ - YAZ_CHECK(tl_query(zh, "@attr 1=4 title", 2)); - - /* 1=2038: West-Bounding-Coordinate 2039: East: 2040: North: 2041 South*/ - /* 4=109: numeric string */ - /* 2=3: equal 2=1: less, 2=4: greater or equal 2=5 greater */ - - /* N>=25, search attributes work */ - YAZ_CHECK(tl_query(zh, "@attr 2=4 @attr gils 1=2040 @attr 4=109 25", 2)); - - /* N>49, search attributes work */ - YAZ_CHECK(tl_query(zh, "@attr 2=5 @attr gils 1=2040 @attr 4=109 49", 0)); - - /* N>=49, search attributes work */ - YAZ_CHECK(tl_query(zh, "@attr 2=4 @attr gils 1=2040 @attr 4=109 49", 2)); - - /* N>48, search attributes work */ - YAZ_CHECK(tl_query(zh, "@attr 2=5 @attr gils 1=2040 @attr 4=109 48", 2)); - - /* N<48, search attributes work */ - YAZ_CHECK(tl_query(zh, "@attr 2=1 @attr gils 1=2040 @attr 4=109 48", 1)); - - /* N<=48, search attributes work */ - YAZ_CHECK(tl_query(zh, "@attr 2=2 @attr gils 1=2040 @attr 4=109 48", 1)); - - /* N=41, get rec1 only */ - YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2040 @attr 4=109 41", 1)); - - /* N=49, get both records */ - YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2040 @attr 4=109 49", 2)); - - /* W=-120 get both records */ - YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2038 @attr 4=109 -120", 2)); - - /* W<-122 get only rec1 */ - YAZ_CHECK(tl_query(zh, "@attr 2=1 @attr gils 1=2038 @attr 4=109 '-120' ", 1)); - - /* N=41 and N=49 get only rec2 */ - YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2040 @attr 4=109 \"41 49\" ", 1)); - - YAZ_CHECK(tl_close_down(zh, zs)); -} - -TL_MAIN -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ -