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,52 @@
#include "testing/testing.hpp"
#include "base/linked_map.hpp"
#include <map>
#include <string>
UNIT_TEST(LinkedMap_Smoke)
{
base::LinkedMap<int, std::string, std::map> container;
TEST(container.IsEmpty(), ());
TEST(container.Emplace(1, "hello"), ());
TEST(container.Emplace(2, "world"), ());
TEST(container.Emplace(3, "!"), ());
TEST(!container.IsEmpty(), ());
TEST_EQUAL(container.Size(), 3, ());
TEST(!container.Emplace(2, "again"), ());
TEST_EQUAL(container.Size(), 3, ());
TEST(container.Contains(2), ());
auto const getResult = container.Get(2);
TEST_EQUAL(getResult, "world", ());
TEST_EQUAL(container.Front(), "hello", ());
container.PopFront();
TEST_EQUAL(container.Front(), "world", ());
TEST_EQUAL(container.Size(), 2, ());
TEST(!container.Contains(10), ());
TEST(!container.Erase(10), ());
TEST_EQUAL(container.Size(), 2, ());
TEST(container.Contains(3), ());
TEST(container.Erase(3), ());
TEST_EQUAL(container.Size(), 1, ());
TEST_EQUAL(container.Front(), "world", ());
decltype(container) otherContainer;
otherContainer.Swap(container);
TEST(container.IsEmpty(), ());
TEST_EQUAL(container.Size(), 0, ());
TEST(!otherContainer.IsEmpty(), ());
TEST_EQUAL(otherContainer.Size(), 1, ());
TEST_EQUAL(otherContainer.Front(), "world", ());
}