source: yaz/trunk/fuentes/test/test_filepath.c @ 255

Last change on this file since 255 was 255, checked in by mabarracus, 4 years ago

added trusty code to xenial

File size: 919 bytes
Line 
1/* This file is part of the YAZ toolkit.
2 * Copyright (C) Index Data
3 * See the file LICENSE for details.
4 */
5
6#if HAVE_CONFIG_H
7#include <config.h>
8#endif
9
10#include <errno.h>
11#include <string.h>
12#include <stdlib.h>
13
14#include <yaz/tpath.h>
15#include <yaz/test.h>
16
17void tst(void)
18{
19    char fullpath[1024];
20    YAZ_CHECK(yaz_filepath_resolve("test_filepath", ".", 0, fullpath));
21    YAZ_CHECK(strcmp(fullpath, "./test_filepath") == 0);
22    YAZ_CHECK(!yaz_filepath_resolve("test_filepath1", ".", 0, fullpath));
23    YAZ_CHECK(!yaz_filepath_resolve("test_filepath", "bogus", 0, fullpath));
24    YAZ_CHECK(yaz_filepath_resolve("test_filepath", "bogus:.", 0, fullpath));
25}
26
27int main (int argc, char **argv)
28{
29    YAZ_CHECK_INIT(argc, argv);
30    tst();
31    YAZ_CHECK_TERM;
32}
33/*
34 * Local variables:
35 * c-basic-offset: 4
36 * c-file-style: "Stroustrup"
37 * indent-tabs-mode: nil
38 * End:
39 * vim: shiftwidth=4 tabstop=8 expandtab
40 */
41
Note: See TracBrowser for help on using the repository browser.