Supports iterating over BaseLibrary.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
19
tests/LibraryTests/BaseLibraryTests.cpp
Normal file
19
tests/LibraryTests/BaseLibraryTests.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include "../../extern/catch.hpp"
|
||||
#include "../../src/Library/BaseLibrary.hpp"
|
||||
#include "../TestLibrary/TestLibrary.hpp"
|
||||
|
||||
using namespace CreatureLib::Library;
|
||||
TEST_CASE("Iterate over library", "[Library]") {
|
||||
auto& lib = TestLibrary::Get()->GetSpeciesLibrary();
|
||||
auto i = 0;
|
||||
for (auto b : *lib) {
|
||||
if (i == 0) {
|
||||
CHECK(b.second->GetName() == "testSpecies1"_cnc);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
CHECK(i == 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user