Files
behavior-tree/ros2/bt_executor/tools/test_recovery_policy.cpp
T

17 lines
736 B
C++
Raw Normal View History

#include <bt_executor/recovery_policy.hpp>
#include <cassert>
#include <string>
int main() {
using namespace bt_executor;
assert(!recovery_authorized("", ""));
assert(!recovery_authorized("short", "short"));
assert(recovery_authorized("sixteen-byte-key!", "sixteen-byte-key!"));
assert(!recovery_authorized("sixteen-byte-key!", "sixteen-byte-key?"));
assert(!recovery_authorized("sixteen-byte-key!", "sixteen-byte-key!x"));
assert(!recovery_authorized(std::string(1025,'x'),std::string(1025,'x')));
assert(!recovery_resume_permitted(false,false,false));
assert(!recovery_resume_permitted(true,true,false));
assert(recovery_resume_permitted(true,false,false));
assert(recovery_resume_permitted(false,true,true));
}