From 979f3f4949a1b4894bdfcd2bb50aa626fcbf09ec Mon Sep 17 00:00:00 2001 From: Alice Date: Thu, 6 Aug 2026 15:45:57 +0200 Subject: [PATCH] added additional test --- src/RawFile.test.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/RawFile.test.cpp b/src/RawFile.test.cpp index e2a7dc8..0272514 100644 --- a/src/RawFile.test.cpp +++ b/src/RawFile.test.cpp @@ -473,6 +473,31 @@ TEST_CASE("Read Jungfrau frame with disabled UDP ports", REQUIRE(frame.cols() == 1024); REQUIRE(frame.rows() == 512); } + SECTION("4 modules- mixed ports disabled") { + auto fpath = test_data_path() / "raw/jungfrau" / + "4_modules_udp_disabled_master_0.json"; + REQUIRE(std::filesystem::exists(fpath)); + RawFile f(fpath); + REQUIRE(f.master().disabled_udp_ports().value() == + std::vector{1, 3, 4, 6}); + REQUIRE(f.master().udp_port_types().value() == + std::vector{"bottom", "top"}); + REQUIRE_THROWS_WITH( + f.read_frame(), + Catch::Matchers::ContainsSubstring( + "Multiple ROIs present in file. Use read_ROIs() " + "instead")); + auto frames = f.read_rois(); + REQUIRE(frames.size() == 4); + REQUIRE(frames[0].cols() == 1024); + REQUIRE(frames[0].rows() == 256); + REQUIRE(frames[1].cols() == 1024); + REQUIRE(frames[1].rows() == 256); + REQUIRE(frames[2].cols() == 1024); + REQUIRE(frames[2].rows() == 256); + REQUIRE(frames[3].cols() == 1024); + REQUIRE(frames[3].rows() == 256); + } } TEST_CASE("Read Moench frame with disabled UDP ports",