summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'base/include')
-rw-r--r--base/include/android-base/test_utils.h4
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 2edafe344..b95fa07ce 100644
--- a/base/include/android-base/test_utils.h
+++ b/base/include/android-base/test_utils.h
@@ -31,6 +31,8 @@ class TemporaryFile {
31 // Release the ownership of fd, caller is reponsible for closing the 31 // Release the ownership of fd, caller is reponsible for closing the
32 // fd or stream properly. 32 // fd or stream properly.
33 int release(); 33 int release();
34 // Don't remove the temporary file in the destructor.
35 void DoNotRemove() { remove_file_ = false; }
34 36
35 int fd; 37 int fd;
36 char path[1024]; 38 char path[1024];
@@ -38,6 +40,8 @@ class TemporaryFile {
38 private: 40 private:
39 void init(const std::string& tmp_dir); 41 void init(const std::string& tmp_dir);
40 42
43 bool remove_file_ = true;
44
41 DISALLOW_COPY_AND_ASSIGN(TemporaryFile); 45 DISALLOW_COPY_AND_ASSIGN(TemporaryFile);
42}; 46};
43 47