diff options
Diffstat (limited to 'base/include/android-base/test_utils.h')
-rw-r--r-- | base/include/android-base/test_utils.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/base/include/android-base/test_utils.h b/base/include/android-base/test_utils.h index 2edafe3443..b95fa07ce8 100644 --- a/base/include/android-base/test_utils.h +++ b/base/include/android-base/test_utils.h @@ -31,6 +31,8 @@ class TemporaryFile { // Release the ownership of fd, caller is reponsible for closing the // fd or stream properly. int release(); + // Don't remove the temporary file in the destructor. + void DoNotRemove() { remove_file_ = false; } int fd; char path[1024]; @@ -38,6 +40,8 @@ class TemporaryFile { private: void init(const std::string& tmp_dir); + bool remove_file_ = true; + DISALLOW_COPY_AND_ASSIGN(TemporaryFile); }; |