fixed tests to get headwareversion number instead of serial number to know ic 2.0 jf boards nd also the set master fail only if more than 1 detector (fix intests only)

This commit is contained in:
maliakal_d 2022-12-05 17:07:46 +01:00
parent 66cf1825ea
commit 104bc6f619

View File

@ -566,8 +566,8 @@ TEST_CASE("fliprows", "[.cmd]") {
auto det_type = det.getDetectorType().squash(); auto det_type = det.getDetectorType().squash();
bool jungfrauhw2 = false; bool jungfrauhw2 = false;
if (det_type == defs::JUNGFRAU && if (det_type == defs::JUNGFRAU &&
((det.getSerialNumber().tsquash("inconsistent serial number to test") & ((det.getHardwareVersion().tsquash("inconsistent serial number to test")
0x30000) == 0x30000)) { == "2.0"))) {
jungfrauhw2 = true; jungfrauhw2 = true;
} }
if (det_type == defs::EIGER || jungfrauhw2) { if (det_type == defs::EIGER || jungfrauhw2) {
@ -625,7 +625,9 @@ TEST_CASE("master", "[.cmd]") {
proxy.Call("master", {"1"}, 0, PUT, oss1); proxy.Call("master", {"1"}, 0, PUT, oss1);
REQUIRE(oss1.str() == "master 1\n"); REQUIRE(oss1.str() == "master 1\n");
} }
if (det.size() > 1) {
REQUIRE_THROWS(proxy.Call("master", {"1"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("master", {"1"}, -1, PUT));
}
// set all to slaves, and then master // set all to slaves, and then master
for (int i = 0; i != det.size(); ++i) { for (int i = 0; i != det.size(); ++i) {
det.setMaster(0, {i}); det.setMaster(0, {i});
@ -1650,9 +1652,8 @@ TEST_CASE("readnrows", "[.cmd]") {
if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) {
bool jungfrauhw2 = false; bool jungfrauhw2 = false;
if (det_type == defs::JUNGFRAU && if (det_type == defs::JUNGFRAU &&
((det.getSerialNumber().tsquash( ((det.getHardwareVersion().tsquash("inconsistent hardware version number to test")
"inconsistent serial number to test") & == "2.0"))) {
0x30000) == 0x30000)) {
jungfrauhw2 = true; jungfrauhw2 = true;
} }
if (det_type == defs::JUNGFRAU && !jungfrauhw2) { if (det_type == defs::JUNGFRAU && !jungfrauhw2) {