test-path-util.c revision c9d954b27ee125c3c90a6d2951c62eec4abb160b
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2013 Zbigniew Jędrzejewski-Szmek
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdio.h>
#include "path-util.h"
#include "util.h"
#include "macro.h"
static void test_path(void) {
#define test_parent(x, y) { \
char _cleanup_free_ *z = NULL; \
int r = path_get_parent(x, &z); \
}
{
char p2[] = "//aaa/.////ccc";
char p3[] = "/./";
}
}
static void test_find_binary(void) {
char *p;
puts(p);
free(p);
puts(p);
assert(path_is_absolute(p));
free(p);
puts(p);
assert(path_is_absolute(p));
free(p);
}
int main(void) {
test_path();
return 0;
}