fix tests for gottthard1

This commit is contained in:
maliakal_d 2022-12-06 10:59:33 +01:00
parent 570a567a8c
commit 3a89c2a61e

View File

@ -105,6 +105,10 @@ TEST_CASE("roi", "[.cmd]") {
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD) { if (det_type == defs::GOTTHARD) {
if (det.size() > 1) {
REQUIRE_THROWS(proxy.Call("roi", {"0", "255"}, -1, PUT));
REQUIRE_NOTHROW(proxy.Call("roi", {}, -1, GET));
} else {
auto prev_val = det.getROI(); auto prev_val = det.getROI();
{ {
std::ostringstream oss; std::ostringstream oss;
@ -120,6 +124,7 @@ TEST_CASE("roi", "[.cmd]") {
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setROI(prev_val[i], i); det.setROI(prev_val[i], i);
} }
}
} else { } else {
REQUIRE_THROWS(proxy.Call("roi", {}, -1, GET)); REQUIRE_THROWS(proxy.Call("roi", {}, -1, GET));
} }
@ -135,7 +140,7 @@ TEST_CASE("clearroi", "[.cmd]") {
{ {
std::ostringstream oss; std::ostringstream oss;
proxy.Call("clearroi", {}, -1, PUT, oss); proxy.Call("clearroi", {}, -1, PUT, oss);
REQUIRE(oss.str() == "clearroi [-1, -1]\n"); REQUIRE(oss.str() == "clearroi successful\n");
} }
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setROI(prev_val[i], i); det.setROI(prev_val[i], i);