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
path: root/gui
diff options
context:
space:
mode:
authorExMix <rahuba.youri@gmail.com>2013-04-05 19:08:21 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:52:49 +0300
commit4e2156d602564c24e00c8ffc8fa773369761b38a (patch)
treea73f664e5a17c4cb74810ea97161d8189de81b6c /gui
parentae5cd5e86c9faf561269fdc3a25069c57203a70b (diff)
Test for CountryStatusDisplay
Diffstat (limited to 'gui')
-rw-r--r--gui/gui_tests/gui_tests.cpp47
-rw-r--r--gui/gui_tests/gui_tests.pro2
2 files changed, 42 insertions, 7 deletions
diff --git a/gui/gui_tests/gui_tests.cpp b/gui/gui_tests/gui_tests.cpp
index f4d348388f..8870c8b2f0 100644
--- a/gui/gui_tests/gui_tests.cpp
+++ b/gui/gui_tests/gui_tests.cpp
@@ -6,6 +6,9 @@
#include "../image_view.hpp"
#include "../cached_text_view.hpp"
+#include "../../map/country_status_display.hpp"
+
+
struct BalloonTest
{
shared_ptr<gui::Balloon> m_balloon;
@@ -135,7 +138,7 @@ struct CachedTextViewTest
m_cachedTextView->setIsVisible(true);
m_cachedTextView->setFont(gui::Element::EActive,
- graphics::FontDesc(20, graphics::Color(0, 0, 0, 255), true));
+ graphics::FontDesc(20, graphics::Color(255, 0, 0, 255), true));
c->AddElement(m_cachedTextView);
}
@@ -179,9 +182,41 @@ struct ImageViewTest
}
};
-UNIT_TEST_GUI(BalloonTest);
-UNIT_TEST_GUI(ButtonTest);
-UNIT_TEST_GUI(TextViewTest);
-UNIT_TEST_GUI(ImageViewTest);
-UNIT_TEST_GUI(CachedTextViewTest);
+struct CountryStatusDisplayTest
+{
+ shared_ptr<CountryStatusDisplay> m_countryStatus;
+ shared_ptr<storage::Storage> m_storage;
+ m2::PointD m_pivot;
+
+ void Init(gui::Controller * c)
+ {
+ CountryStatusDisplay::Params p;
+
+ m_pivot = m2::PointD(400, 400);
+
+ m_storage.reset(new storage::Storage());
+ //m_storage->Init();
+
+ p.m_depth = graphics::maxDepth;
+ p.m_pivot = m_pivot;
+ p.m_position = graphics::EPosAboveLeft;
+ p.m_storage = m_storage.get();
+
+ m_countryStatus.reset(new CountryStatusDisplay(p));
+ m_countryStatus->setCountryIndex(storage::TIndex(1, 1, 1));
+ m_countryStatus->setPivot(m_pivot);
+ c->AddElement(m_countryStatus);
+ }
+
+ void DoDraw(shared_ptr<graphics::Screen> const & p)
+ {
+ }
+};
+
+//UNIT_TEST_GUI(BalloonTest);
+//UNIT_TEST_GUI(ButtonTest);
+//UNIT_TEST_GUI(TextViewTest);
+//UNIT_TEST_GUI(ImageViewTest);
+//UNIT_TEST_GUI(CachedTextViewTest);
+UNIT_TEST_GUI(CountryStatusDisplayTest);
diff --git a/gui/gui_tests/gui_tests.pro b/gui/gui_tests/gui_tests.pro
index f04e7c5052..cd468acb01 100644
--- a/gui/gui_tests/gui_tests.pro
+++ b/gui/gui_tests/gui_tests.pro
@@ -4,7 +4,7 @@ CONFIG -= app_bundle
TEMPLATE = app
ROOT_DIR = ../..
-DEPENDENCIES = qt_tstfrm gui map indexer graphics platform geometry coding base expat freetype fribidi protobuf tomcrypt
+DEPENDENCIES = qt_tstfrm map gui indexer graphics storage platform geometry coding base expat freetype fribidi protobuf tomcrypt jansson
include($$ROOT_DIR/common.pri)