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:
Konstantin Pastbin
2025-04-13 16:37:30 +07:00
commit e3e4a1985a
12931 changed files with 13195100 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#include "testing/testing.hpp"
#include "coding/sparse_vector.hpp"
UNIT_TEST(SparseVector_Smoke)
{
uint32_t const arr[] = { 0, 0, 5, 0, 7, 1000, 0, 0, 1, 0 };
uint64_t const count = std::size(arr);
coding::SparseVectorBuilder<uint32_t> builder(count);
for (uint32_t v : arr)
{
if (v == 0)
builder.PushEmpty();
else
builder.PushValue(v);
}
auto vec = builder.Build();
TEST_EQUAL(vec.GetSize(), count, ());
for (size_t i = 0; i < count; ++i)
{
TEST_EQUAL(vec.Has(i), (arr[i] != 0), ());
if (arr[i] != 0)
TEST_EQUAL(vec.Get(i), arr[i], ());
}
}