X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fxpath%2Fxpath3.c;h=853ad43b20ae999a3a2ee20652a7394f70b86561;hb=6d2a90b3e3802726c044e128d1a34f5f892f9f3f;hp=5238633e8053bd0c6534236b339b6d5ffff3a2d6;hpb=6c9fcd3b5d3108702fa1ffc92dab4ab6060f9a19;p=idzebra-moved-to-github.git diff --git a/test/xpath/xpath3.c b/test/xpath/xpath3.c index 5238633..853ad43 100644 --- a/test/xpath/xpath3.c +++ b/test/xpath/xpath3.c @@ -1,6 +1,6 @@ -/* $Id: xpath3.c,v 1.4 2005-01-15 19:38:40 adam Exp $ - Copyright (C) 1995-2005 +/* $Id: xpath3.c,v 1.9 2007-01-15 15:10:25 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -16,9 +16,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 + */ #include "../api/testlib.h" @@ -36,20 +36,28 @@ const char *myrec[] = { 0}; -int main(int argc, char **argv) +static void tst(int argc, char **argv) { - ZebraService zs = start_up(0, argc, argv); - ZebraHandle zh = zebra_open(zs); - init_data(zh, myrec); - -#define q(qry,hits) do_query(__LINE__,zh,qry,hits) - - q("@attr 1=/root content",1); - q("@attr 1=/root/first content",1); - q("@attr {1=/root/first[@attr='danish']} content",1); - q("@attr {1=/root/second[@attr='danish lake']} content",1); - q("@attr {1=/root/third[@attr='dansk s\xc3\xb8']} content",1); + ZebraService zs = tl_start_up(0, argc, argv); + ZebraHandle zh = zebra_open(zs, 0); + YAZ_CHECK(tl_init_data(zh, myrec)); + + YAZ_CHECK(tl_query(zh, "@attr 1=/root content",1)); + YAZ_CHECK(tl_query(zh, "@attr 1=/root/first content",1)); + YAZ_CHECK(tl_query(zh, "@attr {1=/root/first[@attr='danish']} content",1)); + YAZ_CHECK(tl_query(zh, "@attr {1=/root/second[@attr='danish lake']} content",1)); + YAZ_CHECK(tl_query(zh, "@attr {1=/root/third[@attr='dansk s\xc3\xb8']} content",1)); /* FIXME - This triggers bug200 */ - 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 + */ +