version 1.0.0-rc.13

This commit is contained in:
2024-10-05 13:14:49 +02:00
parent e03a41ec73
commit e812918e2e
436 changed files with 53636 additions and 41327 deletions
+25
View File
@@ -2,6 +2,7 @@
#include <catch2/catch_all.hpp>
#include "../common/DetectorSetup.h"
#include "../common/NetworkAddressConvert.h"
TEST_CASE("DetectorSetup_MismatchInSize") {
REQUIRE_THROWS(DetectorSetup(DetectorGeometry(8), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"}));
@@ -32,6 +33,30 @@ TEST_CASE("DetectorSetup_ProtoBuf_FullSpeed") {
REQUIRE(setup.GetUDPInterfaceCount() == 1);
}
TEST_CASE("DetectorSetup_IPv4Base_2Interfaces") {
DetectorSetup detector(DetectorGeometry(2));
detector.UDPInterfaceCount(2);
REQUIRE_NOTHROW(detector.BaseIPv4Addr("64.1.124.1"));
REQUIRE(detector.GetSrcIPv4Addr(0) == IPv4AddressFromStr("64.1.124.1"));
REQUIRE(detector.GetSrcIPv4Addr(1) == IPv4AddressFromStr("64.1.124.2"));
REQUIRE(detector.GetSrcIPv4Addr(3) == IPv4AddressFromStr("64.1.124.4"));
REQUIRE_THROWS(detector.GetSrcIPv4Addr(4));
}
TEST_CASE("DetectorSetup_IPv4Base_1Interface") {
DetectorSetup detector(DetectorGeometry(4));
detector.UDPInterfaceCount(1);
REQUIRE_NOTHROW(detector.BaseIPv4Addr("64.1.124.1"));
REQUIRE(detector.GetSrcIPv4Addr(0) == IPv4AddressFromStr("64.1.124.1"));
REQUIRE(detector.GetSrcIPv4Addr(1) == IPv4AddressFromStr("64.1.124.2"));
REQUIRE(detector.GetSrcIPv4Addr(3) == IPv4AddressFromStr("64.1.124.4"));
REQUIRE_THROWS(detector.GetSrcIPv4Addr(4));
}
TEST_CASE("DetectorSetup_LoadGainFile") {
DetectorSetup setup(DetectorGeometry(4), DetectorType::JUNGFRAU, "JF", {"mx1","mx2","mx3","mx4"});
REQUIRE_THROWS(setup.LoadGain({}));