diff options
| author | Martin Matuska <mm@FreeBSD.org> | 2016-05-11 10:19:44 +0000 | 
|---|---|---|
| committer | Martin Matuska <mm@FreeBSD.org> | 2016-05-11 10:19:44 +0000 | 
| commit | 4e579f6c9425c995106fbf72667f4ec7e5d5db85 (patch) | |
| tree | d298bb9fa3cf4f58e328e696a77fadf758a534eb /tar/test/test.h | |
| parent | 8c8f03ca5b7f1f0d07c23e7c354a45b7c95335f0 (diff) | |
Diffstat (limited to 'tar/test/test.h')
| -rw-r--r-- | tar/test/test.h | 29 | 
1 files changed, 25 insertions, 4 deletions
diff --git a/tar/test/test.h b/tar/test/test.h index a0a9bb6f600c..704a137ed3fb 100644 --- a/tar/test/test.h +++ b/tar/test/test.h @@ -66,6 +66,7 @@  #include <stdio.h>  #include <stdlib.h>  #include <string.h> +#include <ctype.h>  #include <time.h>  #ifdef HAVE_UNISTD_H  #include <unistd.h> @@ -91,7 +92,7 @@  #endif  /* Visual Studio */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900  #define snprintf	sprintf_s  #endif @@ -144,6 +145,9 @@  /* As above, but raw blocks of bytes. */  #define assertEqualMem(v1, v2, l)	\    assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL) +/* Assert that memory is full of a specified byte */ +#define assertMemoryFilledWith(v1, l, b)					\ +  assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)  /* Assert two files are the same. */  #define assertEqualFile(f1, f2)	\    assertion_equal_file(__FILE__, __LINE__, (f1), (f2)) @@ -227,6 +231,7 @@ int assertion_empty_file(const char *, int, const char *);  int assertion_equal_file(const char *, int, const char *, const char *);  int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);  int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *); +int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);  int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);  int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);  int assertion_file_atime(const char *, int, const char *, long, long); @@ -277,9 +282,15 @@ int canGrzip(void);  /* Return true if this platform can run the "gzip" program. */  int canGzip(void); +/* Return true if this platform can run the specified command. */ +int canRunCommand(const char *); +  /* Return true if this platform can run the "lrzip" program. */  int canLrzip(void); +/* Return true if this platform can run the "lz4" program. */ +int canLz4(void); +  /* Return true if this platform can run the "lzip" program. */  int canLzip(void); @@ -302,21 +313,31 @@ int is_LargeInode(const char *);  /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */  char *slurpfile(size_t *, const char *fmt, ...); +/* Dump block of bytes to a file. */ +void dumpfile(const char *filename, void *, size_t); +  /* Extracts named reference file to the current directory. */  void extract_reference_file(const char *); +/* Copies named reference file to the current directory. */ +void copy_reference_file(const char *); + +/* Extracts a list of files to the current directory. + * List must be NULL terminated. + */ +void extract_reference_files(const char **);  /* Path to working directory for current test */ -const char *testworkdir; +extern const char *testworkdir;  /*   * Special interfaces for program test harness.   */  /* Pathname of exe to be tested. */ -const char *testprogfile; +extern const char *testprogfile;  /* Name of exe to use in printf-formatted command strings. */  /* On Windows, this includes leading/trailing quotes. */ -const char *testprog; +extern const char *testprog;  #ifdef USE_DMALLOC  #include <dmalloc.h>  | 
