test-path-util.c revision 9b5576a265cbadb1f0b3c3d5e40e928e1fed1ec9
/* Copyright (c) 2016 Dovecot authors, see the included COPYING file */
#include <unistd.h>
#include <stdlib.h>
#include <libgen.h>
#include "test-lib.h"
#include "path-util.h"
static char tmpdir[64];
static const char *cwd;
static const char *link1;
static const char *link2;
static const char *link3;
static void test_local_path() {
}
static void test_absolute_path_no_change(void) {
}
static int path_height(const char* p) {
int n;
for (n = 0; *p != '\0'; ++p)
n += *p == '/';
return n;
}
static void test_travel_to_root(void) {
int l = path_height(cwd);
const char *error;
}
}
static void test_extra_slashes(void) {
}
static void test_nonexistent_path(void) {
}
static void test_relative_dotdot() {
}
static void test_link1() {
}
static void test_link_loop() {
errno = 0;
}
static void test_abspath_vs_normpath() {
}
static void test_init(void) {
const char *error;
i_fatal("mkdtemp: %m");
}
i_fatal("symlink: %m");
}
/* link2 and link3 point to each other to create a loop */
i_fatal("symlink: %m");
}
i_fatal("symlink: %m");
}
}
static void test_deinit(void) {
i_fatal("unlink: %m");
i_fatal("unlink: %m");
i_fatal("unlink: %m");
i_fatal("rmdir: %m");
}
}
void test_path_util(void) {
test_begin("test_path_util");
test_init();
test_link1();
test_deinit();
test_end();
}