23 lines
613 B
C++
23 lines
613 B
C++
|
#ifdef TESTS_BUILD
|
||
|
#include "../../extern/catch.hpp"
|
||
|
#include "../../src/Library/EffectParameter.hpp"
|
||
|
|
||
|
using namespace CreatureLib::Library;
|
||
|
TEST_CASE("Bool EffectParameter", "[Library]") {
|
||
|
auto p = EffectParameter(true);
|
||
|
REQUIRE(p.AsBool());
|
||
|
auto p2 = EffectParameter(false);
|
||
|
REQUIRE_FALSE(p2.AsBool());
|
||
|
}
|
||
|
|
||
|
TEST_CASE("Int EffectParameter", "[Library]") {
|
||
|
auto p = EffectParameter((int64_t)684);
|
||
|
REQUIRE(p.AsInt() == 684);
|
||
|
}
|
||
|
|
||
|
TEST_CASE("String EffectParameter", "[Library]") {
|
||
|
auto p = EffectParameter(std::string("foobar"));
|
||
|
REQUIRE(strcmp(p.AsString(), "foobar") == 0);
|
||
|
}
|
||
|
|
||
|
#endif
|