Renamed files for sort tests.
[idzebra-moved-to-github.git] / test / api / t8.c
index 484cccf..31e17ac 100644 (file)
@@ -1,8 +1,5 @@
-/* $Id: t8.c,v 1.9 2006-03-31 15:58:05 adam Exp $
-   Copyright (C) 1995-2005
-   Index Data ApS
-
-This file is part of the Zebra server.
+/* 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
@@ -15,9 +12,9 @@ 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 */
@@ -64,15 +61,29 @@ static void tst(int argc, char **argv)
 
     /* couple of simple queries just to see that we have indexed the stuff */
     YAZ_CHECK(tl_query(zh,  "@attr 1=4 title", 2));
-    YAZ_CHECK(tl_query(zh,  "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 */
+    /* 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));
 
@@ -92,3 +103,11 @@ static void tst(int argc, char **argv)
 }
 
 TL_MAIN
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+