diff --git a/integrationTests/test-integrationMulti.cpp b/integrationTests/test-integrationMulti.cpp index ae0eaab12..511ac797e 100755 --- a/integrationTests/test-integrationMulti.cpp +++ b/integrationTests/test-integrationMulti.cpp @@ -4,6 +4,8 @@ #include "tests/globals.h" #include +using namespace Catch::literals; + TEST_CASE("Initialize a multi detector", "[.integration][.multi]") { auto hostnames = sls::split(hostname, '+'); @@ -83,7 +85,6 @@ TEST_CASE("Set and get dacs", "[.integration][.multi]") { CHECK(d.setDAC(-1, di::THRESHOLD, 0) == -1); CHECK(d.setDAC(-1, di::THRESHOLD, 0, 0) == -1); CHECK(d.setDAC(-1, di::THRESHOLD, 0, 1) == -1); - } break; @@ -110,17 +111,84 @@ TEST_CASE("Set and get dacs", "[.integration][.multi]") { d.freeSharedMemory(); } -TEST_CASE("Timers", "[.integration][.multi]") { +TEST_CASE("Set and read timers", "[.integration][.multi]") { + multiSlsDetector d(0, true, true); d.setHostname(hostname.c_str()); + // FRAME_NUMBER int n_frames = 3; d.setNumberOfFrames(n_frames); CHECK(d.setNumberOfFrames() == n_frames); - double exptime = 1; + // ACQUISITION_TIME + double exptime = 0.3; d.setExposureTime(exptime, true); - CHECK(d.setExposureTime(-1, true) == exptime); + CHECK(d.setExposureTime(-1, true) == Approx(exptime)); + CHECK(d.setExposureTime(-1) == Approx(exptime * 1E9)); + + // FRAME_PERIOD, + double period = 0.5; + d.setExposurePeriod(period, true); + CHECK(d.setExposurePeriod(-1, true) == Approx(period)); + CHECK(d.setExposurePeriod(-1) == Approx(period * 1E9)); + + // DELAY_AFTER_TRIGGER, + // GATES_NUMBER, + // CYCLES_NUMBER, + // ACTUAL_TIME + // MEASUREMENT_TIME + + // PROGRESS, /**< fraction of measurement elapsed - only get! */ + // MEASUREMENTS_NUMBER, + + int measurements = 2; + d.setTimer(ti::MEASUREMENTS_NUMBER, measurements); + CHECK(d.setTimer(ti::MEASUREMENTS_NUMBER, -1) == measurements); + + // FRAMES_FROM_START, + // FRAMES_FROM_START_PG, + // SAMPLES, + + // SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */ + double subframe_exposure = 2000000; // ns + if (type == dt::EIGER) { + d.setSubFrameExposureTime(subframe_exposure); + CHECK(d.setSubFrameExposureTime(-1) == Approx(subframe_exposure)); + } + + // STORAGE_CELL_NUMBER, /**