OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class OptionsFileTest : public testing::Test { | 36 class OptionsFileTest : public testing::Test { |
37 public: | 37 public: |
38 OptionsFileTest() { | 38 OptionsFileTest() { |
39 Pathname dir; | 39 Pathname dir; |
40 ASSERT(Filesystem::GetTemporaryFolder(dir, true, NULL)); | 40 ASSERT(Filesystem::GetTemporaryFolder(dir, true, NULL)); |
41 test_file_ = Filesystem::TempFilename(dir, ".testfile"); | 41 test_file_ = Filesystem::TempFilename(dir, ".testfile"); |
42 OpenStore(); | 42 OpenStore(); |
43 } | 43 } |
44 | 44 |
| 45 ~OptionsFileTest() override { |
| 46 remove(test_file_.c_str()); |
| 47 } |
| 48 |
45 protected: | 49 protected: |
46 void OpenStore() { | 50 void OpenStore() { |
47 store_.reset(new OptionsFile(test_file_)); | 51 store_.reset(new OptionsFile(test_file_)); |
48 } | 52 } |
49 | 53 |
50 rtc::scoped_ptr<OptionsFile> store_; | 54 rtc::scoped_ptr<OptionsFile> store_; |
51 | 55 |
52 private: | 56 private: |
53 std::string test_file_; | 57 std::string test_file_; |
54 }; | 58 }; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 EXPECT_TRUE(store_->GetStringValue(kEmptyString, &out)); | 163 EXPECT_TRUE(store_->GetStringValue(kEmptyString, &out)); |
160 EXPECT_EQ(kTestString2, out); | 164 EXPECT_EQ(kTestString2, out); |
161 EXPECT_TRUE(store_->SetStringValue(kTestOptionB, kEmptyString)); | 165 EXPECT_TRUE(store_->SetStringValue(kTestOptionB, kEmptyString)); |
162 EXPECT_TRUE(store_->Save()); | 166 EXPECT_TRUE(store_->Save()); |
163 EXPECT_TRUE(store_->Load()); | 167 EXPECT_TRUE(store_->Load()); |
164 EXPECT_TRUE(store_->GetStringValue(kTestOptionB, &out)); | 168 EXPECT_TRUE(store_->GetStringValue(kTestOptionB, &out)); |
165 EXPECT_EQ(kEmptyString, out); | 169 EXPECT_EQ(kEmptyString, out); |
166 } | 170 } |
167 | 171 |
168 } // namespace rtc | 172 } // namespace rtc |
OLD | NEW |