Fix tests printing errors
This commit is contained in:
parent
6d36d20d06
commit
0081731654
|
@ -100,7 +100,9 @@ TEST_CASE("[Modules][LimboAI] BBNode") {
|
||||||
CHECK(param->get_value(dummy, bb) == Variant(other));
|
CHECK(param->get_value(dummy, bb) == Variant(other));
|
||||||
}
|
}
|
||||||
SUBCASE("When variable doesn't exist") {
|
SUBCASE("When variable doesn't exist") {
|
||||||
|
ERR_PRINT_OFF;
|
||||||
CHECK(param->get_value(dummy, bb, Variant()).is_null());
|
CHECK(param->get_value(dummy, bb, Variant()).is_null());
|
||||||
|
ERR_PRINT_ON;
|
||||||
}
|
}
|
||||||
SUBCASE("When variable has wrong type") {
|
SUBCASE("When variable has wrong type") {
|
||||||
bb->set_var("test_var", 123);
|
bb->set_var("test_var", 123);
|
||||||
|
|
|
@ -35,8 +35,10 @@ TEST_CASE("[Modules][LimboAI] BTCheckTrigger") {
|
||||||
|
|
||||||
ct->set_variable("trigger");
|
ct->set_variable("trigger");
|
||||||
|
|
||||||
SUBCASE("When variable is not set") {
|
SUBCASE("When variable is not found") {
|
||||||
|
ERR_PRINT_OFF;
|
||||||
CHECK(ct->execute(0.01666) == BTTask::FAILURE);
|
CHECK(ct->execute(0.01666) == BTTask::FAILURE);
|
||||||
|
ERR_PRINT_ON;
|
||||||
}
|
}
|
||||||
SUBCASE("When variable set to false") {
|
SUBCASE("When variable set to false") {
|
||||||
bb->set_var("trigger", false);
|
bb->set_var("trigger", false);
|
||||||
|
|
|
@ -73,14 +73,14 @@ TEST_CASE("[Modules][LimboAI] BTNewScope") {
|
||||||
ns->get_blackboard()->set_var("berry", "raspberry");
|
ns->get_blackboard()->set_var("berry", "raspberry");
|
||||||
CHECK(ns->get_blackboard()->get_var("berry", "wetgoop") == "raspberry");
|
CHECK(ns->get_blackboard()->get_var("berry", "wetgoop") == "raspberry");
|
||||||
CHECK(child->get_blackboard()->get_var("berry", "wetgoop") == "raspberry");
|
CHECK(child->get_blackboard()->get_var("berry", "wetgoop") == "raspberry");
|
||||||
CHECK(parent->get_blackboard()->get_var("berry", "wetgoop") == "wetgoop");
|
CHECK(parent->get_blackboard()->get_var("berry", "wetgoop", false) == "wetgoop");
|
||||||
CHECK_FALSE(parent->get_blackboard()->has_var("berry"));
|
CHECK_FALSE(parent->get_blackboard()->has_var("berry"));
|
||||||
|
|
||||||
// * Check if setting a variable doesn't propagate it up the scope (now with the child task)
|
// * Check if setting a variable doesn't propagate it up the scope (now with the child task)
|
||||||
child->get_blackboard()->set_var("seed", "sunflower");
|
child->get_blackboard()->set_var("seed", "sunflower");
|
||||||
CHECK(child->get_blackboard()->get_var("seed", "wetgoop") == "sunflower");
|
CHECK(child->get_blackboard()->get_var("seed", "wetgoop") == "sunflower");
|
||||||
CHECK(ns->get_blackboard()->get_var("seed", "wetgoop") == "sunflower");
|
CHECK(ns->get_blackboard()->get_var("seed", "wetgoop") == "sunflower");
|
||||||
CHECK(parent->get_blackboard()->get_var("seed", "wetgoop") == "wetgoop");
|
CHECK(parent->get_blackboard()->get_var("seed", "wetgoop", false) == "wetgoop");
|
||||||
CHECK_FALSE(parent->get_blackboard()->has_var("seed"));
|
CHECK_FALSE(parent->get_blackboard()->has_var("seed"));
|
||||||
|
|
||||||
// * Check return status
|
// * Check return status
|
||||||
|
|
Loading…
Reference in New Issue