Files
aare/src/defs.test.cpp
T
Erik Fröjdh aa39470686
Build on RHEL9 / build (push) Successful in 2m31s
Build on RHEL8 / build (push) Successful in 3m4s
Run tests using data on local RHEL8 / build (push) Successful in 3m52s
Build on local RHEL8 / build (push) Successful in 2m45s
Removed unused DynamicCluster (#346)
- Removed unused DynamicCluster
- Removed commented out references to ClusterFileV2
2026-08-14 11:11:43 +02:00

44 lines
1.4 KiB
C++

// SPDX-License-Identifier: MPL-2.0
#include "aare/defs.hpp"
#include <catch2/catch_test_macros.hpp>
#include <string>
TEST_CASE("Enum values") {
// Since some of the enums are written to file we need to make sure
// they match the value in the slsDetectorPackage
REQUIRE(static_cast<int>(aare::DetectorType::Generic) == 0);
REQUIRE(static_cast<int>(aare::DetectorType::Eiger) == 1);
REQUIRE(static_cast<int>(aare::DetectorType::Gotthard) == 2);
REQUIRE(static_cast<int>(aare::DetectorType::Jungfrau) == 3);
REQUIRE(static_cast<int>(aare::DetectorType::ChipTestBoard) == 4);
REQUIRE(static_cast<int>(aare::DetectorType::Moench) == 5);
REQUIRE(static_cast<int>(aare::DetectorType::Mythen3) == 6);
REQUIRE(static_cast<int>(aare::DetectorType::Gotthard2) == 7);
REQUIRE(static_cast<int>(aare::DetectorType::Xilinx_ChipTestBoard) == 8);
// Not included
REQUIRE(static_cast<int>(aare::DetectorType::Moench03) == 100);
}
TEST_CASE("Basic ops on BitOffset") {
REQUIRE_THROWS(aare::BitOffset(10));
aare::BitOffset offset(5);
REQUIRE(offset.value() == 5);
aare::BitOffset offset2;
REQUIRE(offset2.value() == 0);
aare::BitOffset offset3(offset);
REQUIRE(offset3.value() == 5);
REQUIRE(offset == offset3);
// Now assign offset to offset2 which should get the value 5
offset2 = offset;
REQUIRE(offset2.value() == 5);
REQUIRE(offset2 == offset);
}