X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=test%2Fapi%2Ft8.c;h=d1edd0e8b617e12168119a53480fc82ca675ed61;hp=df74fd611ed901f69e6f332953bd1d8d99b2964a;hb=4478d785b7769691261005c98063b98a5a5971b3;hpb=f84ad20a7a6a45d02da7f162fa6bb1137e79a07f diff --git a/test/api/t8.c b/test/api/t8.c index df74fd6..d1edd0e 100644 --- a/test/api/t8.c +++ b/test/api/t8.c @@ -1,6 +1,6 @@ -/* $Id: t8.c,v 1.5 2004-10-29 13:02:39 heikki Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 - Index Data Aps +/* $Id: t8.c,v 1.12 2006-08-14 10:40:22 adam Exp $ + Copyright (C) 1995-2006 + Index Data ApS This file is part of the Zebra server. @@ -15,17 +15,15 @@ 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 Zebra; see the file LICENSE.zebra. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. +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" @@ -57,41 +55,47 @@ const char *recs[] = { 0}; - - -int main(int argc, char **argv) +static void tst(int argc, char **argv) { - ZebraService zs = start_up("zebra8.cfg", argc, argv); - ZebraHandle zh = zebra_open (zs); + ZebraService zs = tl_start_up("zebra8.cfg", argc, argv); + ZebraHandle zh = zebra_open (zs, 0); - init_data(zh, recs); + YAZ_CHECK(tl_init_data(zh, recs)); -#define Q(q,n) do_query(__LINE__,zh,q,n) /* couple of simple queries just to see that we have indexed the stuff */ - Q( "@attr 1=4 title",2 ); - Q( "title",2 ); + 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 */ - Q( "@attr 2=4 @attr gils 1=2040 @attr 4=109 25",2); + YAZ_CHECK(tl_query(zh, "@attr 2=4 @attr gils 1=2040 @attr 4=109 25", 2)); /* N=41, get rec1 only */ - Q( "@attr 2=3 @attr gils 1=2040 @attr 4=109 41",1); + YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2040 @attr 4=109 41", 1)); /* N=49, get both records */ - Q( "@attr 2=3 @attr gils 1=2040 @attr 4=109 49",2); + YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2040 @attr 4=109 49", 2)); /* W=-120 get both records */ - Q( "@attr 2=3 @attr gils 1=2038 @attr 4=109 -120",2); + YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2038 @attr 4=109 -120", 2)); /* W<-122 get only rec1 */ - Q( "@attr 2=1 @attr gils 1=2038 @attr 4=109 '-120' ",1); + 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 */ - Q( "@attr 2=3 @attr gils 1=2040 @attr 4=109 \"41 49\" ",1); + YAZ_CHECK(tl_query(zh, "@attr 2=3 @attr gils 1=2040 @attr 4=109 \"41 49\" ", 1)); - return close_down(zh,zs,0); + 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 + */ +