Fixed crash on gendoc (#430)

Fixed by checking for help action before using the detector
added test that checks that for all helps this doesn't crash
Disabled Timer tests by default since they take ~2s
This commit is contained in:
Erik Fröjdh
2022-04-07 16:20:54 +02:00
committed by GitHub
parent e9dc3d8c38
commit d8c6f9141d
4 changed files with 26 additions and 9 deletions

View File

@ -16,6 +16,17 @@ using sls::Detector;
using test::GET;
using test::PUT;
TEST_CASE("Calling help doesn't throw or cause segfault"){
//Dont add [.cmd] tag this should run with normal tests
CmdProxy proxy(nullptr);
auto commands = proxy.GetProxyCommands();
std::ostringstream os;
for (const auto &cmd : commands)
REQUIRE_NOTHROW(proxy.Call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os));
}
TEST_CASE("Unknown command", "[.cmd]") {
Detector det;