Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2017-11-17 16:01:54 +0300
committerArsentiy Milchakov <milcars@mapswithme.com>2017-11-17 17:34:25 +0300
commit50653171ff545219eae083cffa5106baeeea325d (patch)
treec382b7c754a88e54d6243752412c76d5d9a59e5a /local_ads
parente03e986c71969db0d3d5b625224368715252c6e8 (diff)
[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.
Diffstat (limited to 'local_ads')
-rw-r--r--local_ads/local_ads_tests/file_helpers_tests.cpp7
1 files changed, 4 insertions, 3 deletions
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<uint8_t> rawData = {1, 2, 3, 4, 5};
{