mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-30 17:44:07 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
37
indexer/indexer_tests/read_features_tests.cpp
Normal file
37
indexer/indexer_tests/read_features_tests.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "testing/testing.hpp"
|
||||
|
||||
#include "indexer/classificator_loader.hpp"
|
||||
#include "indexer/data_source.hpp"
|
||||
|
||||
#include "platform/local_country_file.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
UNIT_TEST(ReadFeatures_Smoke)
|
||||
{
|
||||
classificator::Load();
|
||||
|
||||
FrozenDataSource dataSource;
|
||||
dataSource.RegisterMap(platform::LocalCountryFile::MakeForTesting("minsk-pass"));
|
||||
|
||||
vector<shared_ptr<MwmInfo>> infos;
|
||||
dataSource.GetMwmsInfo(infos);
|
||||
CHECK_EQUAL(infos.size(), 1, ());
|
||||
|
||||
auto handle = dataSource.GetMwmHandleById(MwmSet::MwmId(infos[0]));
|
||||
|
||||
FeaturesLoaderGuard const guard(dataSource, handle.GetId());
|
||||
LOG(LINFO, (guard.GetNumFeatures()));
|
||||
for (uint32_t i = 0; i + 1 < guard.GetNumFeatures(); ++i)
|
||||
{
|
||||
auto ft1 = guard.GetFeatureByIndex(i);
|
||||
auto ft2 = guard.GetFeatureByIndex(i + 1);
|
||||
|
||||
ft2->ForEachType([](auto const /* t */) {});
|
||||
ft1->ForEachType([](auto const /* t */) {});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user