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:
authorArsentiy Milchakov <milcars@mapswithme.com>2017-02-09 14:24:20 +0300
committerArsentiy Milchakov <milcars@mapswithme.com>2017-02-09 14:24:20 +0300
commit819f7361f9f9d86bcf1a1d2e784c44c9560e5f28 (patch)
treec047c349739f9ab3327e538cf5f364a3ddaefb25 /indexer/indexer_tests
parent4920a7cce57fc4937df5939586df05bf0d289181 (diff)
facebook banners are added to place page
Diffstat (limited to 'indexer/indexer_tests')
-rw-r--r--indexer/indexer_tests/banners_test.cpp70
-rw-r--r--indexer/indexer_tests/indexer_tests.pro1
2 files changed, 0 insertions, 71 deletions
diff --git a/indexer/indexer_tests/banners_test.cpp b/indexer/indexer_tests/banners_test.cpp
deleted file mode 100644
index 62654e3777..0000000000
--- a/indexer/indexer_tests/banners_test.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "testing/testing.hpp"
-
-#include "indexer/banners.hpp"
-#include "indexer/classificator.hpp"
-#include "indexer/classificator_loader.hpp"
-
-#include "std/iostream.hpp"
-
-using namespace banner;
-
-UNIT_TEST(Banners_Load)
-{
- char const kBanners[] =
- "# comment\n"
- "[abc]\n"
- "icon = test.png\n"
- "start=2016-07-14\n"
- "type= shop-clothes \n"
- "\n"
- "[error]\n"
- "[re_123]\n"
- "type=shop-shoes\n"
- "url=http://{aux}.com\n"
- " \t aux=\t\ttest \n"
- "[future]\n"
- "type=shop-wine\n"
- "start=2028-01-01\n"
- "end=2028-12-31\n"
- "[final]\n"
- "type=shop-pet\n"
- "start=2016-07-13\n"
- "end=2016-07-14\n"
- "\t";
-
- classificator::Load();
- Classificator & c = classif();
-
- BannerSet bs;
- istringstream is(kBanners);
- bs.ReadBanners(is);
-
- TEST(bs.HasBannerForType(c.GetTypeByPath({"shop", "clothes"})), ());
- Banner const & bannerAbc = bs.GetBannerForType(c.GetTypeByPath({"shop", "clothes"}));
- TEST(!bannerAbc.IsEmpty(), ());
- TEST_EQUAL(bannerAbc.GetIconName(), "test.png", ());
- TEST_EQUAL(bannerAbc.GetMessageBase(), "banner_abc", ());
- TEST_EQUAL(bannerAbc.GetDefaultUrl(), "", ());
- TEST_EQUAL(bannerAbc.GetFormattedUrl("http://example.com"), "http://example.com", ());
- TEST_EQUAL(bannerAbc.GetFormattedUrl(), "", ());
- TEST(bannerAbc.IsActive(), ());
-
- TEST(bs.HasBannerForType(c.GetTypeByPath({"shop", "shoes"})), ());
- Banner const & bannerRe = bs.GetBannerForType(c.GetTypeByPath({"shop", "shoes"}));
- TEST(!bannerRe.IsEmpty(), ());
- TEST(bannerRe.IsActive(), ());
- TEST_EQUAL(bannerRe.GetIconName(), "", ());
- TEST_EQUAL(bannerRe.GetFormattedUrl(), "http://test.com", ());
- TEST_EQUAL(bannerRe.GetFormattedUrl("http://ex.ru/{aux}?var={v}"), "http://ex.ru/test?var={v}", ());
-
- TEST(bs.HasBannerForType(c.GetTypeByPath({"shop", "wine"})), ());
- Banner const & bannerFuture = bs.GetBannerForType(c.GetTypeByPath({"shop", "wine"}));
- TEST(!bannerFuture.IsEmpty(), ());
- TEST(!bannerFuture.IsActive(), ());
-
- TEST(bs.HasBannerForType(c.GetTypeByPath({"shop", "pet"})), ());
- Banner const & bannerFinal = bs.GetBannerForType(c.GetTypeByPath({"shop", "pet"}));
- TEST(!bannerFinal.IsEmpty(), ());
- TEST(!bannerFinal.IsActive(), ());
- TEST_EQUAL(bannerFinal.GetFormattedUrl("http://{aux}.ru"), "http://{aux}.ru", ());
-}
diff --git a/indexer/indexer_tests/indexer_tests.pro b/indexer/indexer_tests/indexer_tests.pro
index 79b5de4b4a..1ff165f0ac 100644
--- a/indexer/indexer_tests/indexer_tests.pro
+++ b/indexer/indexer_tests/indexer_tests.pro
@@ -28,7 +28,6 @@ HEADERS += \
SOURCES += \
../../testing/testingmain.cpp \
- banners_test.cpp \
categories_test.cpp \
cell_coverer_test.cpp \
cell_id_test.cpp \