/* Copyright (c) 2016-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "path-util.h"
#include "unlink-directory.h"
#include "str.h"
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
static const char *tmpdir;
static const char *cwd;
static const char *link1;
static const char *link2;
static const char *link3;
static const char *link4;
static void test_local_path(void)
{
}
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(void)
{
}
static void test_link1(void)
{
}
static void test_link4(void)
{
}
static void test_link_loop(void)
{
errno = 0;
}
static void test_abspath_vs_normpath(void)
{
}
{
if (fd == -1)
i_close_fd(&fd);
/* link2 and link3 point to each other to create a loop */
/* link4 points to link1 */
}
static void test_link_alloc(void)
{
const char *o_tmpdir;
/* idea here is to make sure component-component
would optimally hit to the nearest_power value.
it has to be big enough to cause requirement for
allocation in t_realpath. */
}
test_link1();
}
static void test_link_alloc2(void)
{
const char *o_tmpdir;
/* try enough different sized base directory lengths so the code
hits the different reallocations and tests for off-by-one errors */
/* path_normalize() initially allocates 128 bytes, so we'll test paths
up to that length+1. */
test_link1();
}
}
static void test_cleanup(void)
{
const char *error;
}
static void test_init(void)
{
const char *error;
test_cleanup();
i_fatal("mkdir: %m");
}
}
void test_path_util(void)
{
test_begin("test_path_util");
alarm(20);
test_init();
test_link1();
test_link4();
test_cleanup();
alarm(0);
test_end();
}