From 104bc6f619bb750714161c56589c5c0c09d562b8 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 5 Dec 2022 17:07:46 +0100 Subject: [PATCH] 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) --- slsDetectorSoftware/tests/test-CmdProxy.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index 6afeeac1e..b5b28bfee 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -566,8 +566,8 @@ TEST_CASE("fliprows", "[.cmd]") { auto det_type = det.getDetectorType().squash(); bool jungfrauhw2 = false; if (det_type == defs::JUNGFRAU && - ((det.getSerialNumber().tsquash("inconsistent serial number to test") & - 0x30000) == 0x30000)) { + ((det.getHardwareVersion().tsquash("inconsistent serial number to test") + == "2.0"))) { jungfrauhw2 = true; } if (det_type == defs::EIGER || jungfrauhw2) { @@ -625,7 +625,9 @@ TEST_CASE("master", "[.cmd]") { proxy.Call("master", {"1"}, 0, PUT, oss1); REQUIRE(oss1.str() == "master 1\n"); } - REQUIRE_THROWS(proxy.Call("master", {"1"}, -1, PUT)); + if (det.size() > 1) { + REQUIRE_THROWS(proxy.Call("master", {"1"}, -1, PUT)); + } // set all to slaves, and then master for (int i = 0; i != det.size(); ++i) { det.setMaster(0, {i}); @@ -1650,9 +1652,8 @@ TEST_CASE("readnrows", "[.cmd]") { if (det_type == defs::EIGER || det_type == defs::JUNGFRAU) { bool jungfrauhw2 = false; if (det_type == defs::JUNGFRAU && - ((det.getSerialNumber().tsquash( - "inconsistent serial number to test") & - 0x30000) == 0x30000)) { + ((det.getHardwareVersion().tsquash("inconsistent hardware version number to test") + == "2.0"))) { jungfrauhw2 = true; } if (det_type == defs::JUNGFRAU && !jungfrauhw2) {