diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-05-07 15:41:54 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-05-07 15:41:54 +0200 |
commit | ff94be47f5dbdcf99cea23fad8c9b992a8e5a67e (patch) | |
tree | dd57b80bf6ecd853fb3c6d5eab041630ecd1e75e /test/libapt/file-helpers.h | |
parent | e39698a485e332742b935292dc4329abf19cbb53 (diff) | |
parent | 98c934f2723d63d00908803ad47ab1359081ec2d (diff) |
Merge branch 'debian/sid' into bugfix/update-progress-reporting
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 |