Radium Engine
1.6.3
Loading...
Searching...
No Matches
mapiterators.cpp
1
#include <
Core/Utils/StdMapIterators.hpp
>
2
#include <catch2/catch_test_macros.hpp>
3
4
#include <string>
5
#include <utility>
6
7
TEST_CASE(
"Core/Utils/StdMapIterators"
,
"[unittests][Core][Core/Utils][StdMapIterators]"
) {
8
std::map<int, std::string>
myMap { { 2,
"2"
}, { 3,
"3"
} };
9
11
for
(
const
auto
& k :
Ra::Core::Utils::map_keys
( myMap ) )
12
REQUIRE( k ==
std::stoi
( myMap[k] ) );
14
16
for
(
auto
& v :
Ra::Core::Utils::map_values
( myMap ) )
17
v =
std::string
(
"-"
) + v;
19
20
for
(
const
auto
& k :
Ra::Core::Utils::map_keys
( myMap ) )
21
REQUIRE( k == -
std::stoi
( myMap[k] ) );
22
}
StdMapIterators.hpp
std::string
std::map
std::stoi
T stoi(T... args)
Ra::Core::Utils::map_keys
Generate a range to iterate over the keys of a map.
Definition
StdMapIterators.hpp:22
Ra::Core::Utils::map_values
Generate a range to iterate over the values of a map.
Definition
StdMapIterators.hpp:69
tests
unittest
Core
mapiterators.cpp
Generated by
1.12.0