Fixed bug #687: Missing log lines. Immediate logging (i.e. flush) is no
[yaz-moved-to-github.git] / test / tst_filepath.c
1 /*
2  * Copyright (C) 1995-2006, Index Data ApS
3  * See the file LICENSE for details.
4  *
5  * $Id: tst_filepath.c,v 1.1 2006-04-26 09:40:43 adam Exp $
6  */
7
8 #if HAVE_CONFIG_H
9 #include <config.h>
10 #endif
11
12 #include <errno.h>
13 #include <string.h>
14 #include <stdlib.h>
15 #include <ctype.h>
16
17 #include <yaz/tpath.h>
18 #include <yaz/test.h>
19
20 void tst(void)
21 {
22     char fullpath[1024];
23     YAZ_CHECK(yaz_filepath_resolve("tst_filepath", ".", 0, fullpath));
24     YAZ_CHECK(strcmp(fullpath, "./tst_filepath") == 0);
25     YAZ_CHECK(!yaz_filepath_resolve("tst_filepath1", ".", 0, fullpath));
26     YAZ_CHECK(!yaz_filepath_resolve("tst_filepath", "bogus", 0, fullpath));
27     YAZ_CHECK(yaz_filepath_resolve("tst_filepath", "bogus:.", 0, fullpath));
28 }
29
30 int main (int argc, char **argv)
31 {
32     YAZ_CHECK_INIT(argc, argv);
33     tst();
34     YAZ_CHECK_TERM;
35 }
36 /*
37  * Local variables:
38  * c-basic-offset: 4
39  * indent-tabs-mode: nil
40  * End:
41  * vim: shiftwidth=4 tabstop=8 expandtab
42  */
43