fix tests

This commit is contained in:
maliakal_d 2021-11-25 10:14:49 +01:00
parent 993ba5926e
commit 00d63e48bb
2 changed files with 41 additions and 27 deletions

View File

@ -4705,7 +4705,6 @@ int get_read_n_rows(int file_des) {
#if !defined(EIGERD) && !defined(JUNGFRAUD)
functionNotImplemented();
#else
// get only
retval = getReadNRows();
if (retval == -1) {
ret = FAIL;
@ -8685,7 +8684,7 @@ int get_flip_rows(int file_des) {
// only for HW 2.0 (version = 3)
if (isHardwareVersion2()) {
ret = FAIL;
strcpy(mess, "Could not set flip rows. Only available for "
strcpy(mess, "Could not get flip rows. Only available for "
"Hardware Board version 2.0.\n");
LOG(logERROR, (mess));
} else {

View File

@ -1557,6 +1557,20 @@ TEST_CASE("readnrows", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
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") &
0x20000)) {
jungfrauhw2 = true;
}
if (jungfrauhw2) {
{
std::ostringstream oss;
proxy.Call("readnrows", {}, -1, GET, oss);
REQUIRE(oss.str() == "readnrows 512\n");
}
} else {
auto prev_val = det.getReadNRows();
{
std::ostringstream oss;
@ -1584,6 +1598,7 @@ TEST_CASE("readnrows", "[.cmd]") {
for (int i = 0; i != det.size(); ++i) {
det.setReadNRows(prev_val[i], {i});
}
}
} else {
REQUIRE_THROWS(proxy.Call("readnrows", {}, -1, GET));
}