#if !defined(__GNUC__)
#include <crtdbg.h>
#endif
+#include <io.h>
#include <windows.h>
#include <winbase.h>
+#ifndef F_OK
+#define F_OK (0)
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(m) ((m) & _S_IFDIR)
+#endif
+#ifndef S_ISREG
+#define S_ISREG(m) ((m) & _S_IFREG)
+#endif
+#define access _access
+#define chdir _chdir
+#ifndef fileno
+#define fileno _fileno
+#endif
+//#define fstat _fstat64
+#define getcwd _getcwd
+#define lstat stat
+//#define lstat _stat64
+//#define stat _stat64
+#define rmdir _rmdir
+#define strdup _strdup
+#define umask _umask
#endif
/*
msg[0] = '\0';
return (value);
}
- failures ++;
+ ++failures;
if (!verbose && previous_failures(file, line, 1))
return (value);
fprintf(stderr, "%s:%d: Assertion failed\n", file, line);
return (value);
}
+int
+test_assert_chdir(const char *file, int line, const char *pathname)
+{
+ count_assertion(file, line);
+ if (chdir(pathname) == 0)
+ return (1);
+ ++failures;
+ if (!verbose && previous_failures(file, line, 1))
+ return (0);
+ fprintf(stderr, "%s:%d: chdir(\"%s\") failed\n",
+ file, line, pathname);
+ return (0);
+
+}
+
/* assertEqualInt() displays the values of the two integers. */
int
test_assert_equal_int(const char *file, int line,
- int v1, const char *e1, int v2, const char *e2, void *extra)
+ long long v1, const char *e1, long long v2, const char *e2, void *extra)
{
count_assertion(file, line);
if (v1 == v2) {
msg[0] = '\0';
return (1);
}
- failures ++;
+ ++failures;
if (!verbose && previous_failures(file, line, 1))
return (0);
fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n",
file, line);
- fprintf(stderr, " %s=%d\n", e1, v1);
- fprintf(stderr, " %s=%d\n", e2, v2);
+ fprintf(stderr, " %s=%lld\n", e1, v1);
+ fprintf(stderr, " %s=%lld\n", e2, v2);
report_failure(extra);
return (0);
}
msg[0] = '\0';
return (1);
}
- failures ++;
+ ++failures;
if (!verbose && previous_failures(file, line, 1))
return (0);
fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n",
msg[0] = '\0';
return (1);
}
- failures ++;
+ ++failures;
if (!verbose && previous_failures(file, line, 1))
return (0);
fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n",
msg[0] = '\0';
return (1);
}
- failures ++;
+ ++failures;
if (!verbose && previous_failures(file, line, 1))
return (0);
fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n",
if (st.st_size == 0)
return (1);
- failures ++;
+ ++failures;
if (!verbose && previous_failures(test_filename, test_line, 1))
return (0);
fprintf(stderr, "%s:%d: Could not stat: %s\n",
test_filename, test_line, f1);
report_failure(NULL);
- failures++;
+ ++failures;
return (0);
}
if (st.st_size != 0)
return (1);
- failures ++;
+ ++failures;
if (!verbose && previous_failures(test_filename, test_line, 1))
return (0);
}
fclose(f1);
fclose(f2);
- failures ++;
+ ++failures;
if (!verbose && previous_failures(test_filename, test_line, 1))
return (0);
fprintf(stderr, "%s:%d: Files are not identical\n",
char f[1024];
va_list ap;
+ count_assertion(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(f, fpattern, ap);
va_end(ap);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (!_access(f, 0))
+ return (1);
+#else
if (!access(f, F_OK))
return (1);
+#endif
+ ++failures;
if (!previous_failures(test_filename, test_line, 1)) {
fprintf(stderr, "%s:%d: File doesn't exist\n",
test_filename, test_line);
char f[1024];
va_list ap;
+ count_assertion(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(f, fpattern, ap);
va_end(ap);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (_access(f, 0))
+ return (1);
+#else
if (access(f, F_OK))
return (1);
+#endif
+ ++failures;
if (!previous_failures(test_filename, test_line, 1)) {
fprintf(stderr, "%s:%d: File exists and shouldn't\n",
test_filename, test_line);
FILE *f;
int n;
+ count_assertion(test_filename, test_line);
va_start(ap, fpattern);
vsprintf(fn, fpattern, ap);
va_end(ap);
f = fopen(fn, "rb");
if (f == NULL) {
- failures ++;
+ ++failures;
if (!previous_failures(test_filename, test_line, 1)) {
fprintf(stderr, "%s:%d: File doesn't exist: %s\n",
test_filename, test_line, fn);
free(contents);
return (1);
}
- failures ++;
+ ++failures;
if (!previous_failures(test_filename, test_line, 1)) {
fprintf(stderr, "%s:%d: File contents don't match\n",
test_filename, test_line);
fprintf(stderr, " file=\"%s\"\n", fn);
if (n > 0)
- hexdump(contents, buff, n, 0);
+ hexdump(contents, buff, n > 512 ? 512 : 0, 0);
else {
fprintf(stderr, " File empty, contents should be:\n");
- hexdump(buff, NULL, s, 0);
+ hexdump(buff, NULL, s > 512 ? 512 : 0, 0);
}
report_failure(test_extra);
}
/* assertTextFileContents() asserts the contents of a text file. */
int
-test_assert_text_file_contents(const char *buff, const char *f)
+test_assert_text_file_contents(const char *buff, const char *fn)
{
char *contents;
const char *btxt, *ftxt;
- int fd;
+ FILE *f;
int n, s;
- fd = open(f, O_RDONLY);
+ count_assertion(test_filename, test_line);
+ f = fopen(fn, "r");
s = strlen(buff);
contents = malloc(s * 2 + 128);
- n = read(fd, contents, s * 2 + 128 -1);
+ n = fread(contents, 1, s * 2 + 128 - 1, f);
if (n >= 0)
contents[n] = '\0';
- close(fd);
+ fclose(f);
/* Compare texts. */
btxt = buff;
ftxt = (const char *)contents;
free(contents);
return (1);
}
- failures ++;
+ ++failures;
if (!previous_failures(test_filename, test_line, 1)) {
fprintf(stderr, "%s:%d: File contents don't match\n",
test_filename, test_line);
- fprintf(stderr, " file=\"%s\"\n", f);
+ fprintf(stderr, " file=\"%s\"\n", fn);
if (n > 0)
hexdump(contents, buff, n, 0);
else {
return (0);
}
+int
+test_assert_file_hardlinks(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ struct stat st1, st2;
+ int r;
+
+ count_assertion(file, line);
+ r = lstat(path1, &st1);
+ if (r != 0) {
+ ++failures;
+ if (!previous_failures(file, line, 1))
+ fprintf(stderr, "%s:%d: File ``%s'' should exist\n",
+ file, line, path1);
+ return (0);
+ }
+ r = lstat(path2, &st2);
+ if (r != 0) {
+ ++failures;
+ if (!previous_failures(file, line, 1))
+ fprintf(stderr, "%s:%d: File ``%s'' should exist\n",
+ file, line, path2);
+ return (0);
+ }
+ if (st1.st_ino != st2.st_ino || st1.st_dev != st2.st_dev) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr,
+ "%s:%d: Files ``%s'' and ``%s'' are not hardlinked\n",
+ file, line, path1, path2);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ return (1);
+}
+
+int
+test_assert_file_nlinks(const char *file, int line,
+ const char *pathname, int nlinks)
+{
+ struct stat st;
+ int r;
+
+ count_assertion(file, line);
+ r = lstat(pathname, &st);
+ if (r == 0 && st.st_nlink == nlinks)
+ return (1);
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: File ``%s'' has %d links, expected %d\n",
+ file, line, pathname, st.st_nlink, nlinks);
+ report_failure(NULL);
+ }
+ return (0);
+}
+
+int
+test_assert_file_size(const char *file, int line,
+ const char *pathname, long size)
+{
+ struct stat st;
+ int r;
+
+ count_assertion(file, line);
+ r = lstat(pathname, &st);
+ if (r == 0 && st.st_size == size)
+ return (1);
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: File ``%s'' has size %ld, expected %ld\n",
+ file, line, pathname, (long)st.st_size, (long)size);
+ report_failure(NULL);
+ }
+ return (0);
+}
+
+int
+test_assert_is_dir(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+ count_assertion(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: Dir ``%s'' doesn't exist\n",
+ file, line, pathname);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ if (!S_ISDIR(st.st_mode)) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: ``%s'' is not a dir\n",
+ file, line, pathname);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ if (mode < 0) {
+ msg[0] = '\0';
+ return (1);
+ }
+ if (mode != (st.st_mode & 07777)) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: Dir ``%s'' has wrong mode\n",
+ file, line, pathname);
+ fprintf(stderr, " Expected: 0%3o\n", mode);
+ fprintf(stderr, " Found: 0%3o\n", st.st_mode & 07777);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ msg[0] = '\0';
+ return (1);
+}
+
+int
+test_assert_is_symlink(const char *file, int line,
+ const char *pathname, const char *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ // TODO: Vista supports symlinks
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: Symlink ``%s'' not supported\n",
+ file, line, pathname);
+ report_failure(NULL);
+ }
+ return (0);
+#else
+ char buff[300];
+ struct stat st;
+ ssize_t linklen;
+ int r;
+
+ count_assertion(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: Symlink ``%s'' doesn't exist\n",
+ file, line, pathname);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ if (!S_ISLNK(st.st_mode)) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: ``%s'' should be a symlink\n",
+ file, line, pathname);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ if (contents == NULL)
+ return (1);
+ linklen = readlink(pathname, buff, sizeof(buff));
+ if (linklen < 0) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: symlink ``%s'' can't be read\n",
+ file, line, pathname);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ buff[linklen] = '\0';
+ if (strcmp(buff, contents) != 0) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: Wrong symlink ``%s''\n",
+ file, line, pathname);
+ fprintf(stderr, " Expected: %s\n", contents);
+ fprintf(stderr, " Found: %s\n", buff);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ return (1);
+#endif
+}
+
+int
+test_assert_is_reg(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+ count_assertion(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0 || !S_ISREG(st.st_mode)) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: File ``%s'' doesn't exist\n",
+ file, line, pathname);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ if (mode < 0)
+ return (1);
+ if (mode != (st.st_mode & 07777)) {
+ ++failures;
+ if (!previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: Dir ``%s'' has wrong mode\n",
+ file, line, pathname);
+ fprintf(stderr, " Expected: 0%3o\n", mode);
+ fprintf(stderr, " Found: 0%3o\n", st.st_mode & 07777);
+ report_failure(NULL);
+ }
+ return (0);
+ }
+ return (1);
+}
+
int
test_assert_make_dir(const char *file, int line, const char *dirname, int mode)
{
count_assertion(file, line);
#if defined(_WIN32) && !defined(__CYGWIN__)
- r = mkdir(dirname);
+ r = _mkdir(dirname);
#else
r = mkdir(dirname, mode);
#endif
msg[0] = '\0';
return (1);
}
- failures++;
+ ++failures;
if (!verbose && previous_failures(file, line, 1))
return (0);
fprintf(stderr, "%s:%d: Could not create directory\n",
return(0);
}
+int
+test_assert_make_hardlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+ int succeeded;
+
+ count_assertion(file, line);
+#if HAVE_CREATEHARDLINK
+ succeeded = CreateHardLink(newpath, linkto, NULL);
+#elif HAVE_LINK
+ succeeded = !link(linkto, newpath);
+#else
+ succeeded = 0;
+#endif
+ if (succeeded) {
+ msg[0] = '\0';
+ return (1);
+ }
+ ++failures;
+ if (verbose || !previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: Could not create new hardlink\n",
+ file, line);
+ fprintf(stderr, " New link: %s\n", newpath);
+ fprintf(stderr, " Old name: %s\n", linkto);
+ }
+ return(0);
+}
+
+
+int
+test_assert_make_symlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+ int succeeded;
+
+#if HAVE_CREATESYMBOLICLINK
+ int targetIsDir = 0; /* TODO: Fix this. */
+ count_assertion(file, line);
+ succeeded = CreateSymbolicLink(newpath, linkto, targetIsDir);
+#elif HAVE_SYMLINK
+ count_assertion(file, line);
+ succeeded = !symlink(linkto, newpath);
+#else
+ succeeded = 0;
+#endif
+ if (succeeded) {
+ msg[0] = '\0';
+ return (1);
+ }
+ ++failures;
+ if (verbose || !previous_failures(file, line, 1)) {
+ fprintf(stderr, "%s:%d: Could not create new symlink\n",
+ file, line);
+ fprintf(stderr, " New link: %s\n", newpath);
+ fprintf(stderr, " Old name: %s\n", linkto);
+ }
+ return(0);
+}
+
+int
+test_assert_umask(const char *file, int line, int mask)
+{
+ count_assertion(file, line);
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ umask(mask);
+ return (1);
+}
+
/*
* Call standard system() call, but build up the command line using
* sprintf() conventions.
fclose(f);
return (NULL);
}
- p = malloc(st.st_size + 1);
+ p = malloc((size_t)st.st_size + 1);
if (p == NULL) {
fprintf(stderr, "Can't allocate %ld bytes of memory to read file %s\n", (long int)st.st_size, filename);
fclose(f);
return (NULL);
}
- bytes_read = fread(p, 1, st.st_size, f);
+ bytes_read = fread(p, 1, (size_t)st.st_size, f);
if (bytes_read < st.st_size) {
fprintf(stderr, "Can't read file %s\n", filename);
fclose(f);
static int test_run(int i, const char *tmpdir)
{
int failures_before = failures;
+ int oldumask;
if (!quiet_flag) {
printf("%d: %s\n", i, tests[i].name);
* Always explicitly chdir() in case the last test moved us to
* a strange place.
*/
- if (chdir(tmpdir)) {
+ if (!assertChdir(tmpdir)) {
fprintf(stderr,
"ERROR: Couldn't chdir to temp dir %s\n",
tmpdir);
exit(1);
}
/* Chdir() to that work directory. */
- if (chdir(tests[i].name)) {
+ if (!assertChdir(tests[i].name)) {
fprintf(stderr,
"ERROR: Couldn't chdir to temp dir ``%s''\n",
tests[i].name);
}
/* Explicitly reset the locale before each test. */
setlocale(LC_ALL, "C");
+ /* Record the umask before we run the test. */
+ umask(oldumask = umask(0));
/* Run the actual test. */
(*tests[i].func)();
+ /* Restore umask */
+ umask(oldumask);
/* Summarize the results of this test. */
summarize();
/* If there were no failures, we can remove the work dir. */
if (failures == failures_before) {
- if (!keep_temp_files && chdir(tmpdir) == 0) {
+ if (!keep_temp_files && assertChdir(tmpdir)) {
#if defined(_WIN32) && !defined(__CYGWIN__)
systemf("rmdir /S /Q %s", tests[i].name);
#else
/* If the final tmpdir is empty, we can remove it. */
/* This should be the usual case when all tests succeed. */
- chdir("..");
+ assertChdir("..");
rmdir(tmpdir);
return (tests_failed);
#error Oops: No config.h and no pre-built configuration in test.h.
#endif
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#include <sys/types.h> /* Windows requires this before sys/stat.h */
+#include <sys/stat.h>
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
+#if HAVE_DIRENT_H
#include <dirent.h>
#else
-#define dirent direct
-#include "../cpio_windows.h"
#include <direct.h>
-#endif
-#if defined(__CYGWIN__)
-/* In cygwin-1.7.x, the .nlinks field of directories is
- * deliberately inaccurate, because to populate it requires
- * stat'ing every file in the directory, which is slow.
- * So, as an optimization cygwin doesn't do that in newer
- * releases; all correct applications on any platform should
- * never rely on it being > 1, so this optimization doesn't
- * impact the operation of correctly coded applications.
- * Therefore, the cpio test should not check its accuracy
- */
-# define NLINKS_INACCURATE_FOR_DIRS
+#define dirent direct
#endif
#include <errno.h>
#include <fcntl.h>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
-#if !defined(_WIN32) || defined(__CYGWIN__)
+#include <time.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <time.h>
#include <wchar.h>
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
#endif
-#ifdef __FreeBSD__
-#include <sys/cdefs.h> /* For __FBSDID */
-#else
-/* Some non-FreeBSD platforms such as newlib-derived ones like
- * cygwin, have __FBSDID, so this definition must be guarded.
+/*
+ * System-specific tweaks. We really want to minimize these
+ * as much as possible, since they make it harder to understand
+ * the mainline code.
*/
-#ifndef __FBSDID
-#define __FBSDID(a) struct _undefined_hack
-#endif
+
+/* Windows (including Visual Studio and MinGW but not Cygwin) */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include "../cpio_windows.h"
+#define strdup _strdup
+#define LOCALE_DE "deu"
+#else
+#define LOCALE_DE "de_DE.UTF-8"
#endif
+/* Visual Studio */
#ifdef _MSC_VER
#define snprintf sprintf_s
#endif
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define LOCALE_DE "deu"
+/* Cygwin */
+#if defined(__CYGWIN__)
+/* Cygwin-1.7.x is lazy about populating nlinks, so don't
+ * expect it to be accurate. */
+# define NLINKS_INACCURATE_FOR_DIRS
+#endif
+
+/* FreeBSD */
+#ifdef __FreeBSD__
+#include <sys/cdefs.h> /* For __FBSDID */
#else
-#define LOCALE_DE "de_DE.UTF-8"
+/* Surprisingly, some non-FreeBSD platforms define __FBSDID. */
+#ifndef __FBSDID
+#define __FBSDID(a) struct _undefined_hack
+#endif
#endif
/*
/* An implementation of the standard assert() macro */
#define assert(e) test_assert(__FILE__, __LINE__, (e), #e, NULL)
-
+/* chdir() and error if it fails */
+#define assertChdir(path) \
+ test_assert_chdir(__FILE__, __LINE__, path)
/* Assert two integers are the same. Reports value of each one if not. */
#define assertEqualInt(v1,v2) \
test_assert_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-
/* Assert two strings are the same. Reports value of each one if not. */
#define assertEqualString(v1,v2) \
test_assert_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
/* Assert that file contents match a string; supports printf-style arguments. */
#define assertFileContents \
test_setup(__FILE__, __LINE__);test_assert_file_contents
+#define assertFileHardlinks(path1, path2) \
+ test_assert_file_hardlinks(__FILE__, __LINE__, path1, path2)
+#define assertFileNLinks(pathname, nlinks) \
+ test_assert_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
+#define assertFileSize(pathname, size) \
+ test_assert_file_size(__FILE__, __LINE__, pathname, size)
#define assertTextFileContents \
test_setup(__FILE__, __LINE__);test_assert_text_file_contents
+#define assertIsDir(pathname, mode) \
+ test_assert_is_dir(__FILE__, __LINE__, pathname, mode)
+#define assertIsReg(pathname, mode) \
+ test_assert_is_reg(__FILE__, __LINE__, pathname, mode)
+#define assertIsSymlink(pathname, contents) \
+ test_assert_is_symlink(__FILE__, __LINE__, pathname, contents)
/* Create a directory, report error if it fails. */
#define assertMakeDir(dirname, mode) \
test_assert_make_dir(__FILE__, __LINE__, dirname, mode)
+#define assertMakeHardlink(newfile, oldfile) \
+ test_assert_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
+#define assertMakeSymlink(newfile, linkto) \
+ test_assert_make_symlink(__FILE__, __LINE__, newfile, linkto)
+#define assertUmask(mask) \
+ test_assert_umask(__FILE__, __LINE__, mask)
/*
* This would be simple with C99 variadic macros, but I don't want to
/* Function declarations. These are defined in test_utility.c. */
void failure(const char *fmt, ...);
-void test_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
int test_assert(const char *, int, int, const char *, void *);
+int test_assert_chdir(const char *, int, const char *);
int test_assert_empty_file(const char *, ...);
-int test_assert_non_empty_file(const char *, ...);
int test_assert_equal_file(const char *, const char *, ...);
-int test_assert_equal_int(const char *, int, int, const char *, int, const char *, void *);
+int test_assert_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
+int test_assert_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
int test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
int test_assert_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int test_assert_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
int test_assert_file_contents(const void *, int, const char *, ...);
-int test_assert_text_file_contents(const char *buff, const char *f);
int test_assert_file_exists(const char *, ...);
+int test_assert_file_hardlinks(const char *, int, const char *, const char *);
+int test_assert_file_nlinks(const char *, int, const char *, int);
int test_assert_file_not_exists(const char *, ...);
+int test_assert_file_size(const char *, int, const char *, long);
+int test_assert_is_dir(const char *, int, const char *, int);
+int test_assert_is_reg(const char *, int, const char *, int);
+int test_assert_is_symlink(const char *, int, const char *, const char *);
int test_assert_make_dir(const char *, int, const char *, int);
+int test_assert_make_hardlink(const char *, int, const char *newpath, const char *);
+int test_assert_make_symlink(const char *, int, const char *newpath, const char *);
+int test_assert_non_empty_file(const char *, ...);
+int test_assert_text_file_contents(const char *buff, const char *f);
+int test_assert_umask(const char *, int, int);
+void test_setup(const char *, int);
+void test_skipping(const char *fmt, ...);
/* Like sprintf, then system() */
int systemf(const char * fmt, ...);