catch2: download with CMake + update to recent Catch2

This commit is contained in:
2024-05-14 21:10:27 +02:00
parent 9f1b6a6e96
commit eb0e5daf8f
47 changed files with 222 additions and 18206 deletions

View File

@@ -1,6 +1,6 @@
// Copyright (2019-2023) Paul Scherrer Institute
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>
#include "../common/RawToConvertedGeometry.h"
@@ -9,7 +9,7 @@ TEST_CASE("RawToConvertedGeometry_Half_and_quarter","[RawToConvertedGeometry]")
REQUIRE(half<int32_t>(7, 9, 20) == 7);
REQUIRE(half<int32_t>(27, 9, 20) == 27);
REQUIRE(half<double>(7, -10, 20) == Approx(3.5));
REQUIRE(half<double>(7, -10, 20) == Catch::Approx(3.5));
REQUIRE(half<double>(7, 9, 20) == 7);
REQUIRE(half<double>(27, 9, 20) == 27);
@@ -436,7 +436,7 @@ TEST_CASE("RawToConvertedGeometry_FP","[RawToConvertedGeometry]") {
uint64_t diff = 0;
for (int i = 0; i < x.GetModulesNum(2) * RAW_MODULE_SIZE; i++) {
if (input[i] != Approx(input2[i])) diff++;
if (input[i] != Catch::Approx(input2[i])) diff++;
}
REQUIRE(diff == 0);
}
@@ -519,6 +519,6 @@ TEST_CASE("RawToConvertedCoordinate_Coord","[RawToConvertedGeometry]") {
Coord input(800.5, 300.25, 0);
Coord c = RawToConvertedCoordinate(experiment, 1, input);
REQUIRE(Approx(c.x) == CONVERTED_MODULE_COLS + 8 + 800.5 + 6); // col 800 becomes 806 due to 3 chip boundaries
REQUIRE(Approx(c.y) == CONVERTED_MODULE_LINES * 2 + 36 - 1 - 300.25 - 2); // line 300 becomes 302 due to 1 chip boundary
REQUIRE(Catch::Approx(c.x) == CONVERTED_MODULE_COLS + 8 + 800.5 + 6); // col 800 becomes 806 due to 3 chip boundaries
REQUIRE(Catch::Approx(c.y) == CONVERTED_MODULE_LINES * 2 + 36 - 1 - 300.25 - 2); // line 300 becomes 302 due to 1 chip boundary
}