cli and test side wip

This commit is contained in:
maliakal_d committed 2026-10-13 12:04:47 +02:00
1 parent 6df1aba669
commit 86ff8e7e79
13 files changed
+195 -4

No files matched your search

@@ -791,4 +791,45 @@ TEST_CASE("sync", "[.detectorintegration]") {
}
}
TEST_CASE("hdr", "[.detectorintegration]") {
Detector det;
Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) {
// disable and args
REQUIRE_THROWS(caller.call("hdr", {"0", "synchrotron"}, -1, PUT));
//invalid enable
REQUIRE_THROWS(caller.call("hdr", {"2"}, -1, PUT));
// no operation mode
REQUIRE_THROWS(caller.call("hdr", {"1"}, -1, PUT));
// invalid operation mode
REQUIRE_THROWS(caller.call("hdr", {"invalid"}, -1, PUT));
// TODO: implement get chip type to get hdr, throw if !hdr and trying fel for oper mode and not throw if hdr
{
std::ostringstream oss;
REQUIRE_NOTHROW(caller.call("hdr", {"synchrotron"}, -1, PUT, oss));
REQUIRE(oss.str() == "hdr [synchrotron]\n");
}
{
std::ostringstream oss;
REQUIRE_NOTHROW(caller.call("hdr", {}, -1, GET, oss));
REQUIRE(oss.str() == "hdr [enabled synchrotron]\n");
}
{
std::ostringstream oss;
REQUIRE_NOTHROW(caller.call("hdr", {"0"}, -1, PUT, oss));
REQUIRE(oss.str() == "hdr [0]\n");
}
{
std::ostringstream oss;
REQUIRE_NOTHROW(caller.call("hdr", {}, -1, GET, oss));
REQUIRE(oss.str() == "hdr [disabled]\n");
}
} else {
REQUIRE_THROWS(caller.call("hdr", {}, -1, GET));
REQUIRE_THROWS(caller.call("hdr", {"0"}, -1, PUT));
}
}
} // namespace sls