From b0af8afca79ef7b217a88e2309298bc6fa90e01d Mon Sep 17 00:00:00 2001 From: vng Date: Wed, 22 Jul 2015 19:38:37 +0300 Subject: [PATCH] Fixed test. --- search/search_tests/locality_finder_test.cpp | 25 +++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/search/search_tests/locality_finder_test.cpp b/search/search_tests/locality_finder_test.cpp index b04dcaf686..fc2ea02dd1 100644 --- a/search/search_tests/locality_finder_test.cpp +++ b/search/search_tests/locality_finder_test.cpp @@ -2,6 +2,7 @@ #include "indexer/data_header.hpp" #include "indexer/index.hpp" +#include "indexer/classificator_loader.hpp" #include "search/locality_finder.hpp" @@ -37,13 +38,25 @@ void doTests2(search::LocalityFinder & finder, vector const & input, UNIT_TEST(LocalityFinder) { + classificator::Load(); + Index index; - auto const p = index.Register(platform::LocalCountryFile::MakeForTesting("World")); - TEST_EQUAL(MwmSet::RegResult::Success, p.second, ()); - MwmSet::MwmHandle const & handle = p.first; - TEST(handle.IsAlive(), ()); - shared_ptr info = handle.GetId().GetInfo(); - m2::RectD const & rect = info->m_limitRect; + m2::RectD rect; + + try + { + auto const p = index.Register(platform::LocalCountryFile::MakeForTesting("World")); + TEST_EQUAL(MwmSet::RegResult::Success, p.second, ()); + + MwmSet::MwmHandle const & handle = p.first; + TEST(handle.IsAlive(), ()); + + rect = handle.GetId().GetInfo()->m_limitRect; + } + catch (RootException const & ex) + { + LOG(LERROR, ("Read World.mwm error:", ex.Msg())); + } search::LocalityFinder finder(&index); finder.SetLanguage(StringUtf8Multilang::GetLangIndex("en"));