forked from organicmaps/organicmaps
[tests] Adjust external settings tests
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
parent
5ffd2a8303
commit
ec072a188c
2 changed files with 14 additions and 16 deletions
|
@ -1,10 +1,10 @@
|
|||
#include "testing/testing.hpp"
|
||||
|
||||
#include "platform/downloader_utils.hpp"
|
||||
#include "platform/servers_list.hpp"
|
||||
#include "platform/local_country_file_utils.hpp"
|
||||
#include "platform/mwm_version.hpp"
|
||||
#include "platform/platform.hpp"
|
||||
#include "platform/servers_list.hpp"
|
||||
|
||||
#include "base/file_name_utils.hpp"
|
||||
|
||||
|
@ -99,17 +99,18 @@ UNIT_TEST(Downloader_ParseMetaConfig)
|
|||
{
|
||||
"servers": [ "https://url1/", "https://url2/" ],
|
||||
"settings": {
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
"DonateUrl": "value1",
|
||||
"NY": "value2",
|
||||
"key3": "value3"
|
||||
}
|
||||
}
|
||||
)")), ());
|
||||
TEST_EQUAL(cfg->m_serversList.size(), 2, ());
|
||||
TEST_EQUAL(cfg->m_serversList[0], "https://url1/", ());
|
||||
TEST_EQUAL(cfg->m_serversList[1], "https://url2/", ());
|
||||
TEST_EQUAL(cfg->m_settings.size(), 2, ());
|
||||
TEST_EQUAL(cfg->m_settings["key1"], "value1", ());
|
||||
TEST_EQUAL(cfg->m_settings["key2"], "value2", ());
|
||||
TEST_EQUAL(cfg->m_settings.size(), 2, ()); // "key3" is ignored
|
||||
TEST_EQUAL(cfg->m_settings["DonateUrl"], "value1", ());
|
||||
TEST_EQUAL(cfg->m_settings["NY"], "value2", ());
|
||||
|
||||
TEST(!downloader::ParseMetaConfig(R"(broken json)"), ());
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#include "testing/testing.hpp"
|
||||
|
||||
#include "platform/servers_list.hpp"
|
||||
|
||||
#include "platform/products.hpp"
|
||||
#include "platform/servers_list.hpp"
|
||||
|
||||
#include "cppjansson/cppjansson.hpp"
|
||||
|
||||
|
@ -40,7 +39,7 @@ UNIT_TEST(MetaConfig_JSONParser_NewFormatWithoutProducts)
|
|||
std::string newFormatJson = R"({
|
||||
"servers": ["http://url1", "http://url2"],
|
||||
"settings": {
|
||||
"key1": "value1",
|
||||
"DonateUrl": "value1",
|
||||
"key2": "value2"
|
||||
}
|
||||
})";
|
||||
|
@ -49,9 +48,8 @@ UNIT_TEST(MetaConfig_JSONParser_NewFormatWithoutProducts)
|
|||
TEST_EQUAL(result->m_serversList.size(), 2, ());
|
||||
TEST_EQUAL(result->m_serversList[0], "http://url1", ());
|
||||
TEST_EQUAL(result->m_serversList[1], "http://url2", ());
|
||||
TEST_EQUAL(result->m_settings.size(), 2, ());
|
||||
TEST_EQUAL(result->m_settings["key1"], "value1", ());
|
||||
TEST_EQUAL(result->m_settings["key2"], "value2", ());
|
||||
TEST_EQUAL(result->m_settings.size(), 1, ());
|
||||
TEST_EQUAL(result->m_settings["DonateUrl"], "value1", ());
|
||||
TEST(result->m_productsConfig.empty(), ());
|
||||
}
|
||||
|
||||
|
@ -60,7 +58,7 @@ UNIT_TEST(MetaConfig_JSONParser_NewFormatWithProducts)
|
|||
std::string newFormatJson = R"({
|
||||
"servers": ["http://url1", "http://url2"],
|
||||
"settings": {
|
||||
"key1": "value1",
|
||||
"DonateUrl": "value1",
|
||||
"key2": "value2"
|
||||
},
|
||||
"productsConfig": {
|
||||
|
@ -84,9 +82,8 @@ UNIT_TEST(MetaConfig_JSONParser_NewFormatWithProducts)
|
|||
TEST_EQUAL(result->m_serversList.size(), 2, ());
|
||||
TEST_EQUAL(result->m_serversList[0], "http://url1", ());
|
||||
TEST_EQUAL(result->m_serversList[1], "http://url2", ());
|
||||
TEST_EQUAL(result->m_settings.size(), 2, ());
|
||||
TEST_EQUAL(result->m_settings["key1"], "value1", ());
|
||||
TEST_EQUAL(result->m_settings["key2"], "value2", ());
|
||||
TEST_EQUAL(result->m_settings.size(), 1, ());
|
||||
TEST_EQUAL(result->m_settings["DonateUrl"], "value1", ());
|
||||
|
||||
TEST(!result->m_productsConfig.empty(), ());
|
||||
auto const productsConfigResult = products::ProductsConfig::Parse(result->m_productsConfig);
|
||||
|
|
Loading…
Add table
Reference in a new issue