/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #include #include #include #include #include #include "Data/Containers/BinSearchArrayMap.hpp" #include "Data/Containers/StableVector.hpp" using namespace OpenVulkano; TEST_CASE("BinSearchArrayMap With Default") { SECTION("Insert") { BinSearchArrayMap map; for (int i = 0; i < 50; i++) { map.Insert(i, std::to_string(i)); } REQUIRE(map.Size() == 50); REQUIRE(map.Get(16) == "16"); REQUIRE(map.Get(23) == "23"); REQUIRE(map.Get(48) == "48"); } SECTION("Remove") { BinSearchArrayMap map; for (int i = 0; i < 50; i++) { map.Insert(i, std::to_string(i)); } map.Remove(16); map.Remove(23); map.Remove(48); } } TEST_CASE("BinSearchArrayMap With StableVector") { SECTION("Insert") { BinSearchArrayMap map; for (int i = 0; i < 50; i++) { map.Insert(i, std::to_string(i)); } REQUIRE(map.Size() == 50); REQUIRE(map.Get(16) == "16"); REQUIRE(map.Get(23) == "23"); REQUIRE(map.Get(48) == "48"); } SECTION("Remove") { BinSearchArrayMap map; for (int i = 0; i < 50; i++) { map.Insert(i, std::to_string(i)); } map.Remove(16); map.Remove(23); map.Remove(48); printf("ARRAY WITH STABLE VECTOR\n"); for (int i = 0; i < 50; i++) { printf("index: %d, value: %s\n", i, map[i].c_str()); } } }