v1.0.0-rc.36
This commit is contained in:
@@ -6,13 +6,78 @@
|
||||
#include "../common/NetworkAddressConvert.h"
|
||||
|
||||
TEST_CASE("DetectorSetup_MismatchInSize") {
|
||||
REQUIRE_THROWS(DetectorSetup(DetectorGeometry(8), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"}));
|
||||
REQUIRE_THROWS(DetectorSetup(DetectorGeometry(2), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"}));
|
||||
REQUIRE_NOTHROW(DetectorSetup(DetectorGeometry(4), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"}));
|
||||
REQUIRE_THROWS(
|
||||
DetectorSetup(DetectorGeometryModular(8), DetectorType::JUNGFRAU, "JF", {"mx1", "mx2", "mx3", "mx4"}));
|
||||
REQUIRE_THROWS(
|
||||
DetectorSetup(DetectorGeometryModular(2), DetectorType::JUNGFRAU, "JF", {"mx1", "mx2", "mx3", "mx4"}));
|
||||
REQUIRE_NOTHROW(
|
||||
DetectorSetup(DetectorGeometryModular(4), DetectorType::JUNGFRAU, "JF", {"mx1", "mx2", "mx3", "mx4"}));
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_MismatchInSize_EIGER") {
|
||||
REQUIRE_THROWS(DetectorSetup(DetectorGeometryModular(4), DetectorType::EIGER, "JF", {"mx1", "mx2", "mx3", "mx4"}));
|
||||
REQUIRE_NOTHROW(DetectorSetup(DetectorGeometryModular(2), DetectorType::EIGER, "JF", {"mx1", "mx2", "mx3", "mx4"}));
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_MismatchInSize_DECTRIS") {
|
||||
REQUIRE_NOTHROW(DetectorSetup(DetectorGeometryFixed(123, 112), DetectorType::DECTRIS, "JF", {"mx1"}));
|
||||
REQUIRE_NOTHROW(DetectorSetup(DetectorGeometryFixed(123, 112), DetectorType::DECTRIS, "JF", {}));
|
||||
REQUIRE_THROWS(DetectorSetup(DetectorGeometryFixed(123, 112), DetectorType::DECTRIS, "JF", {"mx1", "mx2"}));
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_MismatchInGeometry") {
|
||||
REQUIRE_THROWS(DetectorSetup(DetectorGeometryFixed(123, 112), DetectorType::EIGER, "JF"));
|
||||
REQUIRE_THROWS(DetectorSetup(DetectorGeometryFixed(123, 112), DetectorType::JUNGFRAU, "JF"));
|
||||
REQUIRE_THROWS(DetectorSetup(DetectorGeometryModular(2), DetectorType::DECTRIS, "JF"));
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_ReadoutDepth") {
|
||||
auto setup = DetDECTRIS(123,123, "zzz", "a");
|
||||
REQUIRE_NOTHROW(setup.BitDepthReadout(16));
|
||||
REQUIRE(setup.GetBitDepthReadout() == 16);
|
||||
REQUIRE_NOTHROW(setup.BitDepthReadout(12));
|
||||
REQUIRE(setup.GetBitDepthReadout() == 12);
|
||||
REQUIRE_NOTHROW(setup.BitDepthReadout(32));
|
||||
REQUIRE(setup.GetBitDepthReadout() == 32);
|
||||
REQUIRE_NOTHROW(setup.BitDepthReadout(8));
|
||||
REQUIRE(setup.GetBitDepthReadout() == 8);
|
||||
REQUIRE_THROWS(setup.BitDepthReadout(0));
|
||||
REQUIRE_THROWS(setup.BitDepthReadout(15));
|
||||
REQUIRE_THROWS(setup.BitDepthReadout(-1));
|
||||
|
||||
auto setup2 = DetJF(1);
|
||||
REQUIRE(setup2.GetBitDepthReadout() == 16);
|
||||
REQUIRE_THROWS(setup2.BitDepthReadout(32));
|
||||
|
||||
auto setup3 = DetEIGER(1);
|
||||
REQUIRE(!setup3.GetBitDepthReadout());
|
||||
REQUIRE_THROWS(setup3.BitDepthReadout(32));
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_ImageDepth") {
|
||||
auto setup = DetDECTRIS(123,123, "zzz", "a");
|
||||
REQUIRE_NOTHROW(setup.BitDepthImage(16));
|
||||
REQUIRE(setup.GetBitDepthImage() == 16);
|
||||
REQUIRE_THROWS(setup.BitDepthImage(12));
|
||||
REQUIRE_NOTHROW(setup.BitDepthImage(32));
|
||||
REQUIRE(setup.GetBitDepthImage() == 32);
|
||||
REQUIRE_NOTHROW(setup.BitDepthImage(8));
|
||||
REQUIRE(setup.GetBitDepthImage() == 8);
|
||||
REQUIRE_THROWS(setup.BitDepthImage(0));
|
||||
REQUIRE_THROWS(setup.BitDepthImage(15));
|
||||
REQUIRE_THROWS(setup.BitDepthImage(-1));
|
||||
|
||||
auto setup2 = DetJF(1);
|
||||
REQUIRE(!setup2.GetBitDepthImage());
|
||||
REQUIRE_THROWS(setup2.BitDepthImage(32));
|
||||
|
||||
auto setup3 = DetEIGER(1);
|
||||
REQUIRE(!setup3.GetBitDepthImage());
|
||||
REQUIRE_THROWS(setup3.BitDepthImage(32));
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_ProtoBuf") {
|
||||
DetectorSetup setup(DetectorGeometry(4), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"});
|
||||
DetectorSetup setup = DetJF(DetectorGeometryModular(4), "JF", {"mx1","mx2","mx3","mx4"});
|
||||
|
||||
REQUIRE(setup.GetDescription() == "JF");
|
||||
REQUIRE(setup.GetDetectorModuleHostname().size() == 4);
|
||||
@@ -23,7 +88,7 @@ TEST_CASE("DetectorSetup_ProtoBuf") {
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_ProtoBuf_FullSpeed") {
|
||||
DetectorSetup setup(DetectorGeometry(4), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"});
|
||||
DetectorSetup setup = DetJF(DetectorGeometryModular(4), "JF", {"mx1","mx2","mx3","mx4"});
|
||||
|
||||
REQUIRE(setup.GetUDPInterfaceCount() == 2);
|
||||
REQUIRE_NOTHROW(setup.UDPInterfaceCount(1));
|
||||
@@ -35,7 +100,7 @@ TEST_CASE("DetectorSetup_ProtoBuf_FullSpeed") {
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_IPv4Base_2Interfaces") {
|
||||
DetectorSetup detector(DetectorGeometry(2));
|
||||
DetectorSetup detector = DetJF(DetectorGeometryModular(2));
|
||||
detector.UDPInterfaceCount(2);
|
||||
REQUIRE_NOTHROW(detector.BaseIPv4Addr("64.1.124.1"));
|
||||
|
||||
@@ -47,7 +112,7 @@ TEST_CASE("DetectorSetup_IPv4Base_2Interfaces") {
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_IPv4Base_1Interface") {
|
||||
DetectorSetup detector(DetectorGeometry(4));
|
||||
DetectorSetup detector = DetJF(DetectorGeometryModular(4));
|
||||
detector.UDPInterfaceCount(1);
|
||||
REQUIRE_NOTHROW(detector.BaseIPv4Addr("64.1.124.1"));
|
||||
|
||||
@@ -59,7 +124,7 @@ TEST_CASE("DetectorSetup_IPv4Base_1Interface") {
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_LoadTrimFile") {
|
||||
DetectorSetup setup(DetectorGeometry(4), DetectorType::EIGER, "E", {"mx1","mx2","mx3","mx4","mx5","mx6","mx7","mx8"});
|
||||
DetectorSetup setup(DetectorGeometryModular(4), DetectorType::EIGER, "E", {"mx1","mx2","mx3","mx4","mx5","mx6","mx7","mx8"});
|
||||
REQUIRE_NOTHROW(setup.SetTrimFiles({"a", "b", "c", "d", "e", "f", "g", "h"}));
|
||||
REQUIRE(setup.GetTrimFileDirectory().empty());
|
||||
REQUIRE(setup.GetTrimFileNames().size() == 8);
|
||||
@@ -72,7 +137,7 @@ TEST_CASE("DetectorSetup_LoadTrimFile") {
|
||||
}
|
||||
|
||||
TEST_CASE("DetectorSetup_LoadGainFile") {
|
||||
DetectorSetup setup(DetectorGeometry(4), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"});
|
||||
DetectorSetup setup(DetectorGeometryModular(4), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"});
|
||||
REQUIRE_THROWS(setup.LoadGain({}));
|
||||
|
||||
REQUIRE(setup.GetGainCalibration().empty());
|
||||
@@ -102,12 +167,12 @@ TEST_CASE("DetectorSetup_LoadGainFile") {
|
||||
|
||||
|
||||
TEST_CASE("DetectorSetup_MaxFrameTime") {
|
||||
DetectorSetup s1(DetectorGeometry(8), DetectorType::JUNGFRAU);
|
||||
DetectorSetup s1(DetectorGeometryModular(8), DetectorType::JUNGFRAU);
|
||||
s1.UDPInterfaceCount(1);
|
||||
REQUIRE(s1.GetMinFrameTime() == std::chrono::microseconds(MIN_FRAME_TIME_JUNGFRAU_HALF_SPEED_IN_US));
|
||||
s1.UDPInterfaceCount(2);
|
||||
REQUIRE(s1.GetMinFrameTime() == std::chrono::microseconds(MIN_FRAME_TIME_JUNGFRAU_FULL_SPEED_IN_US));
|
||||
|
||||
DetectorSetup s2(DetectorGeometry(8), DetectorType::EIGER);
|
||||
DetectorSetup s2(DetectorGeometryModular(8), DetectorType::EIGER);
|
||||
REQUIRE(s2.GetMinFrameTime() == std::chrono::microseconds(MIN_FRAME_TIME_EIGER_IN_US));
|
||||
}
|
||||
Reference in New Issue
Block a user