X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftst_filepath.c;fp=test%2Ftst_filepath.c;h=58c37d07d20f9bbb052fbbdb97a0474038c845c9;hp=0000000000000000000000000000000000000000;hb=68db5d6050f959bd126eec404447019b6176d2a1;hpb=23403c6f31b26b0e819a47980c42f3fc8c57d84d diff --git a/test/tst_filepath.c b/test/tst_filepath.c new file mode 100644 index 0000000..58c37d0 --- /dev/null +++ b/test/tst_filepath.c @@ -0,0 +1,43 @@ +/* + * Copyright (C) 1995-2006, Index Data ApS + * See the file LICENSE for details. + * + * $Id: tst_filepath.c,v 1.1 2006-04-26 09:40:43 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include +#include + +void tst(void) +{ + char fullpath[1024]; + YAZ_CHECK(yaz_filepath_resolve("tst_filepath", ".", 0, fullpath)); + YAZ_CHECK(strcmp(fullpath, "./tst_filepath") == 0); + YAZ_CHECK(!yaz_filepath_resolve("tst_filepath1", ".", 0, fullpath)); + YAZ_CHECK(!yaz_filepath_resolve("tst_filepath", "bogus", 0, fullpath)); + YAZ_CHECK(yaz_filepath_resolve("tst_filepath", "bogus:.", 0, fullpath)); +} + +int main (int argc, char **argv) +{ + YAZ_CHECK_INIT(argc, argv); + tst(); + YAZ_CHECK_TERM; +} +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +