Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
55
libs/editor/editor_tests/config_loader_test.cpp
Normal file
55
libs/editor/editor_tests/config_loader_test.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#include "testing/testing.hpp"
|
||||
|
||||
#include "editor/config_loader.hpp"
|
||||
#include "editor/editor_config.hpp"
|
||||
|
||||
#include "platform/platform_tests_support/scoped_file.hpp"
|
||||
|
||||
#include "base/atomic_shared_ptr.hpp"
|
||||
|
||||
#include <pugixml.hpp>
|
||||
|
||||
namespace
|
||||
{
|
||||
using namespace editor;
|
||||
using platform::tests_support::ScopedFile;
|
||||
|
||||
void CheckGeneralTags(pugi::xml_document const & doc)
|
||||
{
|
||||
auto const types = doc.select_nodes("/comaps/editor/types");
|
||||
TEST(!types.empty(), ());
|
||||
auto const fields = doc.select_nodes("/comaps/editor/fields");
|
||||
TEST(!fields.empty(), ());
|
||||
}
|
||||
|
||||
UNIT_TEST(ConfigLoader_Base)
|
||||
{
|
||||
base::AtomicSharedPtr<EditorConfig> config;
|
||||
ConfigLoader loader(config);
|
||||
|
||||
TEST(!config.Get()->GetTypesThatCanBeAdded().empty(), ());
|
||||
}
|
||||
|
||||
// This functionality is not used and corresponding server is not working.
|
||||
// Uncomment it when server will be up.
|
||||
// UNIT_TEST(ConfigLoader_GetRemoteHash)
|
||||
//{
|
||||
// auto const hashStr = ConfigLoader::GetRemoteHash();
|
||||
// TEST_NOT_EQUAL(hashStr, "", ());
|
||||
// TEST_EQUAL(hashStr, ConfigLoader::GetRemoteHash(), ());
|
||||
//}
|
||||
//
|
||||
// UNIT_TEST(ConfigLoader_GetRemoteConfig)
|
||||
//{
|
||||
// pugi::xml_document doc;
|
||||
// ConfigLoader::GetRemoteConfig(doc);
|
||||
// CheckGeneralTags(doc);
|
||||
//}
|
||||
|
||||
UNIT_TEST(ConfigLoader_LoadFromLocal)
|
||||
{
|
||||
pugi::xml_document doc;
|
||||
ConfigLoader::LoadFromLocal(doc);
|
||||
CheckGeneralTags(doc);
|
||||
}
|
||||
} // namespace
|
||||
Loading…
Add table
Add a link
Reference in a new issue