diff options
author | Michael Vogt <mvo@debian.org> | 2014-04-22 15:19:17 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-04-22 15:19:17 +0200 |
commit | 9607aab538b07f1bb60f9b0d84ea445589638998 (patch) | |
tree | bdd459aac462fc0dc93b7a0eb319dc218ecc16e4 /test/libapt/file-helpers.h | |
parent | c6e00b107318e32284437f02285197154bee59bf (diff) | |
parent | ebe24b7ad56550f21f467b86ceab7f7209a876f6 (diff) |
Merge remote-tracking branch 'donkult/debian/sid' into debian/sid
Diffstat (limited to 'test/libapt/file-helpers.h')
-rw-r--r-- | test/libapt/file-helpers.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/libapt/file-helpers.h b/test/libapt/file-helpers.h new file mode 100644 index 000000000..e8472d503 --- /dev/null +++ b/test/libapt/file-helpers.h @@ -0,0 +1,29 @@ +#ifndef APT_TESTS_FILE_HELPERS +#define APT_TESTS_FILE_HELPERS + +#include <string> + +#include <gtest/gtest.h> + +class FileFd; + +#define createTemporaryDirectory(id, dir) \ + ASSERT_NO_FATAL_FAILURE(helperCreateTemporaryDirectory(id, dir)) +void helperCreateTemporaryDirectory(std::string const &id, std::string &dir); +#define removeDirectory(dir) \ + ASSERT_NO_FATAL_FAILURE(helperRemoveDirectory(dir)) +void helperRemoveDirectory(std::string const &dir); +#define createFile(dir, name) \ + ASSERT_NO_FATAL_FAILURE(helperCreateFile(dir, name)) +void helperCreateFile(std::string const &dir, std::string const &name); +#define createDirectory(dir, name) \ + ASSERT_NO_FATAL_FAILURE(helperCreateDirectory(dir, name)) +void helperCreateDirectory(std::string const &dir, std::string const &name); +#define createLink(dir, targetname, linkname) \ + ASSERT_NO_FATAL_FAILURE(helperCreateLink(dir, targetname, linkname)) +void helperCreateLink(std::string const &dir, std::string const &targetname, std::string const &linkname); +#define createTemporaryFile(id, fd, filename, content) \ + ASSERT_NO_FATAL_FAILURE(helperCreateTemporaryFile(id, fd, filename, content)) +void helperCreateTemporaryFile(std::string const &id, FileFd &fd, char * * const filename, char const * const content); + +#endif |