/*
- $Id: test.c,v 1.1.2.1 2010-02-01 10:56:08 franklahm Exp $
Copyright (c) 2010 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
int reti;
uint16_t vid;
struct vol *vol;
- struct dir *dir;
struct dir *retdir;
struct path *path;
TEST_expr(vid = openvol(&configs->obj, "test"), vid != 0);
TEST_expr(vol = getvolbyvid(vid), vol != NULL);
- /* test dircache.c stuff*/
- TEST_expr(dir = dir_new("dir", "dir", vol, DIRDID_ROOT, htonl(20), bfromcstr(vol->v_path)),
- dir != NULL);
- TEST_int(dircache_add(dir), 0);
- TEST_expr(retdir = dircache_search_by_did(vol, dir->d_did ),
- retdir != NULL && retdir == dir && bstrcmp(retdir->d_u_name, dir->d_u_name) == 0);
- TEST_expr(retdir = dircache_search_by_name(vol, vol->v_root, "dir", strlen("dir")),
- retdir != NULL && retdir == dir && bstrcmp(retdir->d_u_name, dir->d_u_name) == 0);
- TEST_int(dir_remove(vol, dir), 0);
- TEST_int(test001_add_x_dirs(vol, 100, 100000), 0);
- TEST_int(test002_rem_x_dirs(vol, 100, 100000), 0);
-
/* test directory.c stuff */
TEST_expr(retdir = dirlookup(vol, DIRDID_ROOT_PARENT), retdir != NULL);
TEST_expr(retdir = dirlookup(vol, DIRDID_ROOT), retdir != NULL);