Storage integration tests refactoring.

This commit is contained in:
Vladimir Byko-Ianko 2016-03-30 13:52:55 +03:00
parent 6fcb1e5510
commit a1b7e6df7c
9 changed files with 24 additions and 30 deletions

View file

@ -1,5 +1,7 @@
#include "testing/testing.hpp"
#include "storage/storage_integration_tests/test_defines.hpp"
#include "map/framework.hpp"
#include "platform/local_country_file_utils.hpp"
@ -18,11 +20,6 @@
using namespace platform;
using namespace storage;
namespace
{
static string const kMapTestDir = "map-tests";
}
UNIT_TEST(StorageFastMigrationTests)
{
WritableDirChanger writableDirChanger(kMapTestDir);

View file

@ -1,5 +1,7 @@
#include "testing/testing.hpp"
#include "storage/storage_integration_tests/test_defines.hpp"
#include "map/framework.hpp"
#include "platform/platform.hpp"
@ -17,11 +19,6 @@ using namespace storage;
namespace
{
string const kTestWebServer = "http://direct.mapswithme.com/";
string const kMapTestDir = "map-tests";
string const kCountryId = "Germany"; // Germany has 3-levels hierachy
int GetLevelCount(Storage & storage, TCountryId const & countryId)

View file

@ -1,5 +1,7 @@
#include "testing/testing.hpp"
#include "storage/storage_integration_tests/test_defines.hpp"
#include "storage/storage.hpp"
#include "platform/local_country_file_utils.hpp"
@ -23,13 +25,8 @@ using namespace storage;
namespace
{
string const kCountryId = "Angola";
string const kTestWebServer = "http://direct.mapswithme.com/";
string const kMapTestDir = "map-tests";
class InterruptException : public exception {};
void Update(TCountryId const &, storage::Storage::TLocalFilePtr const localCountryFile)

View file

@ -1,5 +1,7 @@
#include "testing/testing.hpp"
#include "storage/storage_integration_tests/test_defines.hpp"
#include "map/framework.hpp"
#include "platform/http_request.hpp"
@ -24,11 +26,6 @@ using namespace storage;
namespace
{
string const kTestWebServer = "http://direct.mapswithme.com/";
string const kMapTestDir = "map-tests";
TCountryId const kGroupCountryId = "New Zealand";
TCountriesSet const kLeafCountriesIds = {"Tokelau",
"New Zealand North_Auckland",

View file

@ -1,5 +1,7 @@
#include "testing/testing.hpp"
#include "storage/storage_integration_tests/test_defines.hpp"
#include "storage/storage.hpp"
#include "platform/local_country_file_utils.hpp"
@ -21,13 +23,8 @@ using namespace storage;
namespace
{
string const kCountryId = "Angola";
string const kMapTestDir = "map-tests";
string const kTestWebServer = "http://direct.mapswithme.com/";
void Update(TCountryId const &, storage::Storage::TLocalFilePtr const localCountryFile)
{
TEST_EQUAL(localCountryFile->GetCountryName(), kCountryId, ());

View file

@ -25,6 +25,7 @@ win32*|linux* {
}
HEADERS += \
test_defines.hpp
SOURCES += \
../../testing/testingmain.cpp \
@ -34,3 +35,4 @@ SOURCES += \
storage_group_download_tests.cpp \
storage_http_tests.cpp \
storage_update_tests.cpp \
test_defines.cpp

View file

@ -1,5 +1,7 @@
#include "testing/testing.hpp"
#include "storage/storage_integration_tests/test_defines.hpp"
#include "map/framework.hpp"
#include "platform/http_request.hpp"
@ -19,11 +21,6 @@ using namespace storage;
namespace
{
string const kTestWebServer = "http://direct.mapswithme.com/";
string const kMapTestDir = "map-tests";
string const kCountriesTxtFile = COUNTRIES_FILE;
string const kMwmVersion1 = "160316";

View file

@ -0,0 +1,4 @@
#include "storage/storage_integration_tests/test_defines.hpp"
string const kMapTestDir = string("map-tests");
string const kTestWebServer = string("http://direct.mapswithme.com/");

View file

@ -0,0 +1,6 @@
#pragma once
#include "std/string.hpp"
extern string const kMapTestDir;
extern string const kTestWebServer;