mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-07-07 02:45:10 +02:00
fixed ctb guard tests
This commit is contained in:
@@ -33,6 +33,17 @@ TEST_CASE("check_master_file_attributes",
|
||||
auto acq_state = acq::default_acquisition_state();
|
||||
auto file_state = acq::default_file_state();
|
||||
|
||||
// if ctb, set to default and restore after test
|
||||
auto detType = det.getDetectorType().squash(defs::GENERIC);
|
||||
std::optional<acq::CTBState> ctb_state = std::nullopt;
|
||||
if (detType == defs::CHIPTESTBOARD ||
|
||||
detType == defs::XILINX_CHIPTESTBOARD) {
|
||||
ctb_state = std::make_optional(acq::default_ctb_state(detType));
|
||||
}
|
||||
acq::CTBStateGuard ctb_guard(det, ctb_state);
|
||||
|
||||
INFO("Checking master file attributes for " << ToString(detType));
|
||||
|
||||
// binary => /tmp/sls_test_master_0.json
|
||||
file_state.file_format = defs::BINARY;
|
||||
acq::run(det, acq_state, file_state);
|
||||
@@ -42,7 +53,7 @@ TEST_CASE("check_master_file_attributes",
|
||||
|
||||
// get expected state of parameters and check against master file
|
||||
acq::ExpectedState expected_state =
|
||||
acq::build_expected_state(det, acq_state, file_state);
|
||||
acq::build_expected_state(det, acq_state, file_state, ctb_state);
|
||||
checks::check_metadata(checker, expected_state);
|
||||
|
||||
#ifdef HDF5C
|
||||
@@ -56,7 +67,7 @@ TEST_CASE("check_master_file_attributes",
|
||||
|
||||
// get expected state of parameters and check against master file
|
||||
acq::ExpectedState expected_state =
|
||||
acq::build_expected_state(det, acq_state, file_state);
|
||||
acq::build_expected_state(det, acq_state, file_state, ctb_state);
|
||||
checks::check_metadata(checker, expected_state);
|
||||
} catch (H5::Exception &e) {
|
||||
LOG(logERROR) << "HDF5 error: " << e.getDetailMsg();
|
||||
|
||||
Reference in New Issue
Block a user