AU/unittest: DeltaDiffGeneratorTest uses uniquely named temp files
This should allow tests to be run in parallel.
BUG=chromium:236465
TEST=Tests successful; create/remove uniquely named files
Change-Id: I4df126d2183214fa62ed84cfe43ba7a36124e7c2
Reviewed-on: https://gerrit.chromium.org/gerrit/62326
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/delta_diff_generator_unittest.cc b/delta_diff_generator_unittest.cc
index 181fd27..f4570f9 100644
--- a/delta_diff_generator_unittest.cc
+++ b/delta_diff_generator_unittest.cc
@@ -51,12 +51,24 @@
class DeltaDiffGeneratorTest : public ::testing::Test {
protected:
- const string old_path() { return "DeltaDiffGeneratorTest-old_path"; }
- const string new_path() { return "DeltaDiffGeneratorTest-new_path"; }
+ const string& old_path() { return old_path_; }
+ const string& new_path() { return new_path_; }
+
+ virtual void SetUp() {
+ ASSERT_TRUE(utils::MakeTempFile("DeltaDiffGeneratorTest-old_path-XXXXXX",
+ &old_path_, NULL));
+ ASSERT_TRUE(utils::MakeTempFile("DeltaDiffGeneratorTest-new_path-XXXXXX",
+ &new_path_, NULL));
+ }
+
virtual void TearDown() {
unlink(old_path().c_str());
unlink(new_path().c_str());
}
+
+ private:
+ string old_path_;
+ string new_path_;
};
TEST_F(DeltaDiffGeneratorTest, RunAsRootMoveSmallTest) {