X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Ftstcharmap.c;fp=util%2Ftstcharmap.c;h=edff882d0a2b9511b7ed18c2cc0e5eab03d96147;hb=be32b4e5c154545c2b91b76144d6cbf1238f969a;hp=0000000000000000000000000000000000000000;hpb=14796de1db54c523990409333ee84bd403116caf;p=idzebra-moved-to-github.git diff --git a/util/tstcharmap.c b/util/tstcharmap.c new file mode 100644 index 0000000..edff882 --- /dev/null +++ b/util/tstcharmap.c @@ -0,0 +1,59 @@ +/* $Id: tstcharmap.c,v 1.1 2005-06-15 21:31:45 adam Exp $ + Copyright (C) 1995-2005 + Index Data ApS + +This file is part of the Zebra server. + +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 Zebra; see the file LICENSE.zebra. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +*/ + +#include +#include +#include +#include + +void tst1() +{ + /* open existing map chrmaptab.chr */ + chrmaptab tab = chrmaptab_create(0 /* tabpath */, + "tstcharmap.chr" /* file */, + 0 /* tabroot */ ); + assert(tab); + + chrmaptab_destroy(tab); +} + +void tst2() +{ + /* open non-existing nonexist.chr */ + chrmaptab tab = chrmaptab_create(0 /* tabpath */, + "nonexist.chr" /* file */, + 0 /* tabroot */ ); + assert(!tab); +} + +int main(int argc, char **argv) +{ + char logname[2048]; + sprintf(logname, "%s.log", argv[0]); + yaz_log_init_file(logname); + + tst1(); + tst2(); + + exit(0); +} +