From 50653171ff545219eae083cffa5106baeeea325d Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Fri, 17 Nov 2017 16:01:54 +0300 Subject: [platform] [tests] Added an option to ScopedFile. The option allows one to push responsibility on the user of the ScopedFile, that is, enables a scenario where a ScopedFile does not try to create the file on disk but only assures the cleanup. --- local_ads/local_ads_tests/file_helpers_tests.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'local_ads') diff --git a/local_ads/local_ads_tests/file_helpers_tests.cpp b/local_ads/local_ads_tests/file_helpers_tests.cpp index bf920a42ad..408b677abf 100644 --- a/local_ads/local_ads_tests/file_helpers_tests.cpp +++ b/local_ads/local_ads_tests/file_helpers_tests.cpp @@ -8,10 +8,11 @@ using namespace local_ads; using namespace std; +using platform::tests_support::ScopedFile; UNIT_TEST(LocalAdsHelpers_Read_Write_Country_Name) { - platform::tests_support::ScopedFile testFile("la_tests.dat"); + ScopedFile testFile("la_tests.dat", ScopedFile::Mode::Create); string const countryName = "Russia_Moscow"; { @@ -31,7 +32,7 @@ UNIT_TEST(LocalAdsHelpers_Read_Write_Country_Name) UNIT_TEST(LocalAdsHelpers_Read_Write_Timestamp) { - platform::tests_support::ScopedFile testFile("la_tests.dat"); + ScopedFile testFile("la_tests.dat", ScopedFile::Mode::Create); auto ts = local_ads::Clock::now(); { @@ -55,7 +56,7 @@ UNIT_TEST(LocalAdsHelpers_Read_Write_Timestamp) UNIT_TEST(LocalAdsHelpers_Read_Write_RawData) { - platform::tests_support::ScopedFile testFile("la_tests.dat"); + ScopedFile testFile("la_tests.dat", ScopedFile::Mode::Create); vector rawData = {1, 2, 3, 4, 5}; { -- cgit v1.2.3