catch2: download with CMake + update to recent Catch2
This commit is contained in:
+7
-1
@@ -63,7 +63,13 @@ FetchContent_Declare(
|
||||
GIT_TAG bae261433241ff2f458350e26ab026f00f01c427
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(pistache_http zstd sls_detector_package)
|
||||
FetchContent_Declare(
|
||||
catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2
|
||||
GIT_TAG 4e8d92b
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(pistache_http zstd sls_detector_package catch2)
|
||||
|
||||
ADD_SUBDIRECTORY(jungfrau)
|
||||
ADD_SUBDIRECTORY(compression)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../acquisition_device/AcquisitionCounters.h"
|
||||
|
||||
TEST_CASE("AcquisitionCountersTest","[AcquisitionDeviceCounters]") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../image_analysis/AzimuthalIntegrationProfile.h"
|
||||
|
||||
@@ -38,10 +38,10 @@ TEST_CASE("AzimuthalIntegrationMapping_GetBinToQ","[AzimuthalIntegration]") {
|
||||
AzimuthalIntegrationMapping mapping(x);
|
||||
auto bin_to_q = mapping.GetBinToQ();
|
||||
|
||||
REQUIRE(bin_to_q[0] == Approx(0.15));
|
||||
REQUIRE(bin_to_q[1] == Approx(0.25));
|
||||
REQUIRE(bin_to_q[15] == Approx(1.65));
|
||||
REQUIRE(bin_to_q[38] == Approx(3.95));
|
||||
REQUIRE(bin_to_q[0] == Catch::Approx(0.15));
|
||||
REQUIRE(bin_to_q[1] == Catch::Approx(0.25));
|
||||
REQUIRE(bin_to_q[15] == Catch::Approx(1.65));
|
||||
REQUIRE(bin_to_q[38] == Catch::Approx(3.95));
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_QToBin","[AzimuthalIntegration]") {
|
||||
@@ -53,8 +53,8 @@ TEST_CASE("AzimuthalIntegrationMapping_QToBin","[AzimuthalIntegration]") {
|
||||
|
||||
REQUIRE(mapping.QToBin(0.0) == 0);
|
||||
REQUIRE(std::floor(mapping.QToBin(0.200001)) == 1);
|
||||
REQUIRE(mapping.QToBin(0.6) == Approx(5));
|
||||
REQUIRE(mapping.QToBin(50.0) == Approx(38));
|
||||
REQUIRE(mapping.QToBin(0.6) == Catch::Approx(5));
|
||||
REQUIRE(mapping.QToBin(50.0) == Catch::Approx(38));
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationProfile","[AzimuthalIntegration]") {
|
||||
@@ -85,8 +85,8 @@ TEST_CASE("AzimuthalIntegrationProfile","[AzimuthalIntegration]") {
|
||||
REQUIRE(plot[0].x.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot[0].y.size() == mapping.GetBinNumber());
|
||||
for (int i = 0; i < mapping.GetBinNumber(); i++) {
|
||||
REQUIRE(plot[0].x[i] == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot[0].y[i] == Approx(i * 4));
|
||||
REQUIRE(plot[0].x[i] == Catch::Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot[0].y[i] == Catch::Approx(i * 4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,8 +115,8 @@ TEST_CASE("AzimuthalIntegrationProfile_operatorAdd","[AzimuthalIntegration]") {
|
||||
REQUIRE(plot[0].x.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot[0].y.size() == mapping.GetBinNumber());
|
||||
for (int i = 0; i < mapping.GetBinNumber(); i++) {
|
||||
REQUIRE(plot[0].x[i] == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot[0].y[i] == Approx(i * 4));
|
||||
REQUIRE(plot[0].x[i] == Catch::Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot[0].y[i] == Catch::Approx(i * 4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +138,6 @@ TEST_CASE("AzimuthalIntegrationProfile_GetMeanValueOfBins","[AzimuthalIntegratio
|
||||
}
|
||||
REQUIRE_NOTHROW(profile.Add(sum, count));
|
||||
|
||||
REQUIRE(profile.GetMeanValueOfBins(0,2) == Approx ((sum[0] + sum[1] + sum[2]) / double(count[0] + count[1] + count[2])));
|
||||
REQUIRE(profile.GetMeanValueOfBins(5,7) == Approx ((sum[5] + sum[6] + sum[7]) / double (count[5] + count[6] + count[7])));
|
||||
REQUIRE(profile.GetMeanValueOfBins(0,2) == Catch::Approx((sum[0] + sum[1] + sum[2]) / double(count[0] + count[1] + count[2])));
|
||||
REQUIRE(profile.GetMeanValueOfBins(5,7) == Catch::Approx((sum[5] + sum[6] + sum[7]) / double (count[5] + count[6] + count[7])));
|
||||
}
|
||||
|
||||
+12
-12
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../frame_serialize/CBORStream2Serializer.h"
|
||||
#include "../frame_serialize/CBORStream2Deserializer.h"
|
||||
@@ -76,22 +76,22 @@ TEST_CASE("CBORSerialize_Start", "[CBOR]") {
|
||||
StartMessage &output_message = *deserialized->start_message;
|
||||
|
||||
CHECK(output_message.images_per_file == message.images_per_file);
|
||||
CHECK(output_message.detector_distance == Approx(message.detector_distance));
|
||||
CHECK(output_message.beam_center_x == Approx(message.beam_center_x));
|
||||
CHECK(output_message.beam_center_y == Approx(message.beam_center_y));
|
||||
CHECK(output_message.detector_distance == Catch::Approx(message.detector_distance));
|
||||
CHECK(output_message.beam_center_x == Catch::Approx(message.beam_center_x));
|
||||
CHECK(output_message.beam_center_y == Catch::Approx(message.beam_center_y));
|
||||
CHECK(output_message.number_of_images == message.number_of_images);
|
||||
CHECK(output_message.image_size_x == message.image_size_x);
|
||||
CHECK(output_message.image_size_y == message.image_size_y);
|
||||
CHECK(output_message.pixel_bit_depth == message.pixel_bit_depth);
|
||||
CHECK(output_message.incident_energy == Approx(message.incident_energy));
|
||||
CHECK(output_message.incident_wavelength == Approx(message.incident_wavelength));
|
||||
CHECK(output_message.frame_time == Approx(message.frame_time));
|
||||
CHECK(output_message.count_time == Approx(message.count_time));
|
||||
CHECK(output_message.incident_energy == Catch::Approx(message.incident_energy));
|
||||
CHECK(output_message.incident_wavelength == Catch::Approx(message.incident_wavelength));
|
||||
CHECK(output_message.frame_time == Catch::Approx(message.frame_time));
|
||||
CHECK(output_message.count_time == Catch::Approx(message.count_time));
|
||||
CHECK(output_message.saturation_value == message.saturation_value);
|
||||
CHECK(output_message.error_value == message.error_value);
|
||||
CHECK(output_message.pixel_size_x == Approx(message.pixel_size_x));
|
||||
CHECK(output_message.pixel_size_y == Approx(message.pixel_size_y));
|
||||
CHECK(output_message.sensor_thickness == Approx(message.sensor_thickness));
|
||||
CHECK(output_message.pixel_size_x == Catch::Approx(message.pixel_size_x));
|
||||
CHECK(output_message.pixel_size_y == Catch::Approx(message.pixel_size_y));
|
||||
CHECK(output_message.sensor_thickness == Catch::Approx(message.sensor_thickness));
|
||||
CHECK(output_message.sensor_material == message.sensor_material);
|
||||
CHECK(output_message.pixel_mask_enabled == message.pixel_mask_enabled);
|
||||
CHECK(output_message.space_group_number == message.space_group_number);
|
||||
@@ -246,7 +246,7 @@ TEST_CASE("CBORSerialize_End", "[CBOR]") {
|
||||
REQUIRE(output_message.images_collected_count == message.images_collected_count);
|
||||
REQUIRE(output_message.images_sent_to_write_count == message.images_sent_to_write_count);
|
||||
REQUIRE(output_message.efficiency);
|
||||
REQUIRE(output_message.efficiency == Approx(message.efficiency.value()));
|
||||
REQUIRE(output_message.efficiency == Catch::Approx(message.efficiency.value()));
|
||||
REQUIRE(output_message.end_date == message.end_date);
|
||||
REQUIRE(output_message.series_id == message.series_id);
|
||||
REQUIRE(output_message.series_unique_id == message.series_unique_id);
|
||||
|
||||
@@ -40,7 +40,7 @@ ADD_EXECUTABLE(CatchTest
|
||||
RegressionTest.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(CatchTest JFJochBroker JFJochReceiver JFJochWriter JFJochImageAnalysis JFJochCommon JFJochHLSSimulation JFJochPreview JFJochResonet)
|
||||
target_link_libraries(CatchTest Catch2WithMain JFJochBroker JFJochReceiver JFJochWriter JFJochImageAnalysis JFJochCommon JFJochHLSSimulation JFJochPreview JFJochResonet)
|
||||
target_include_directories(CatchTest PRIVATE .)
|
||||
|
||||
INSTALL(TARGETS CatchTest RUNTIME)
|
||||
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../common/Coord.h"
|
||||
|
||||
TEST_CASE("Coord_Comparison", "[LinearAlgebra][Coord]") {
|
||||
@@ -57,9 +57,9 @@ TEST_CASE("Coord_Scalar_div", "[LinearAlgebra][Coord]") {
|
||||
Coord a{1, 2, 3};
|
||||
|
||||
auto scalar_div = a / 4;
|
||||
CHECK(scalar_div.x == Approx(a.x * 0.25));
|
||||
CHECK(scalar_div.y == Approx(a.y * 0.25));
|
||||
CHECK(scalar_div.z == Approx(a.z * 0.25));
|
||||
CHECK(scalar_div.x == Catch::Approx(a.x * 0.25));
|
||||
CHECK(scalar_div.y == Catch::Approx(a.y * 0.25));
|
||||
CHECK(scalar_div.z == Catch::Approx(a.z * 0.25));
|
||||
}
|
||||
|
||||
TEST_CASE("Coord_dot", "[LinearAlgebra][Coord]") {
|
||||
@@ -102,15 +102,15 @@ TEST_CASE("Coord_operator_bracket","[LinearAlgebra][Coord]") {
|
||||
TEST_CASE("Coord_normalize","[LinearAlgebra][Coord]") {
|
||||
Coord a{4,0,0};
|
||||
REQUIRE(a.Length() == 4.0);
|
||||
REQUIRE(a.Normalize().Length() == Approx(1.0));
|
||||
REQUIRE(a.Normalize().x == Approx(1.0));
|
||||
REQUIRE(a.Normalize().Length() == Catch::Approx(1.0));
|
||||
REQUIRE(a.Normalize().x == Catch::Approx(1.0));
|
||||
REQUIRE(a.Normalize().y == 0.0);
|
||||
REQUIRE(a.Normalize().z == 0.0);
|
||||
|
||||
Coord b{3, 4, 5};
|
||||
REQUIRE(b.Length() == Approx(sqrt(3*3+4*4+5*5)));
|
||||
REQUIRE(b.Normalize().Length() == Approx(1.0));
|
||||
REQUIRE(b.Normalize().x == Approx(3 /sqrt(3*3+4*4+5*5)));
|
||||
REQUIRE(b.Normalize().y == Approx(4 /sqrt(3*3+4*4+5*5)));
|
||||
REQUIRE(b.Normalize().z == Approx(5 /sqrt(3*3+4*4+5*5)));
|
||||
REQUIRE(b.Length() == Catch::Approx(sqrt(3*3+4*4+5*5)));
|
||||
REQUIRE(b.Normalize().Length() == Catch::Approx(1.0));
|
||||
REQUIRE(b.Normalize().x == Catch::Approx(3 /sqrt(3*3+4*4+5*5)));
|
||||
REQUIRE(b.Normalize().y == Catch::Approx(4 /sqrt(3*3+4*4+5*5)));
|
||||
REQUIRE(b.Normalize().z == Catch::Approx(5 /sqrt(3*3+4*4+5*5)));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../common/DetectorGeometry.h"
|
||||
|
||||
TEST_CASE("DetectorGeometry_Regular", "[DetectorGeometry]") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../common/DetectorSetup.h"
|
||||
|
||||
TEST_CASE("DetectorSetup_MismatchInSize") {
|
||||
@@ -15,7 +15,7 @@ TEST_CASE("DetectorSetup_ProtoBuf") {
|
||||
REQUIRE(setup.GetDescription() == "JF");
|
||||
REQUIRE(setup.GetDetectorModuleHostname().size() == 4);
|
||||
REQUIRE(setup.GetDetectorModuleHostname()[3] == "mx4");
|
||||
REQUIRE(setup.GetPixelSize_mm() == Approx(0.075));
|
||||
REQUIRE(setup.GetPixelSize_mm() == Catch::Approx(0.075));
|
||||
REQUIRE(setup.GetModulesNum() == 4);
|
||||
REQUIRE(setup.GetGeometry().GetModulesNum() == 4);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
#include "../compression/JFJochCompressor.h"
|
||||
@@ -399,14 +398,14 @@ TEST_CASE("DiffractionExperiment_Metadata","[DiffractionExperiment]") {
|
||||
|
||||
x.PhotonEnergy_keV(6.0);
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == 6.0);
|
||||
REQUIRE(x.GetWavelength_A() == Approx(12.39854 / 6.0));
|
||||
REQUIRE(x.GetWavelength_A() == Catch::Approx(12.39854 / 6.0));
|
||||
|
||||
x.DetectorDistance_mm(30.0).BeamX_pxl(1200).BeamY_pxl(1000).FrameTime(900us);
|
||||
|
||||
REQUIRE(x.GetBeamX_pxl() == Approx(1200));
|
||||
REQUIRE(x.GetBeamY_pxl() == Approx(1000));
|
||||
REQUIRE(x.GetBeamX_pxl() == Catch::Approx(1200));
|
||||
REQUIRE(x.GetBeamY_pxl() == Catch::Approx(1000));
|
||||
|
||||
REQUIRE(x.GetDetectorDistance_mm() == Approx(30.0));
|
||||
REQUIRE(x.GetDetectorDistance_mm() == Catch::Approx(30.0));
|
||||
|
||||
REQUIRE_THROWS(x.PedestalG0Frames(-1));
|
||||
REQUIRE_THROWS(x.PedestalG1Frames(-1));
|
||||
@@ -537,16 +536,16 @@ TEST_CASE("DiffractionExperiment_RadialIntegration_LowQ","[DiffractionExperiment
|
||||
REQUIRE_THROWS(x.LowQForAzimInt_recipA(50));
|
||||
|
||||
x.LowQForAzimInt_recipA(4);
|
||||
REQUIRE(x.GetLowQForAzimInt_recipA() == Approx(4));
|
||||
REQUIRE(x.GetLowQForAzimInt_recipA() == Catch::Approx(4));
|
||||
|
||||
REQUIRE_THROWS(x.LowResForAzimInt_A(0));
|
||||
REQUIRE_THROWS(x.LowResForAzimInt_A(-1));
|
||||
|
||||
x.LowResForAzimInt_A(5.0);
|
||||
REQUIRE(x.GetLowQForAzimInt_recipA() == Approx(2 * M_PI / 5.0));
|
||||
REQUIRE(x.GetLowQForAzimInt_recipA() == Catch::Approx(2 * M_PI / 5.0));
|
||||
|
||||
DiffractionExperiment y(x);
|
||||
REQUIRE(y.GetLowQForAzimInt_recipA() == Approx(2 * M_PI / 5.0));
|
||||
REQUIRE(y.GetLowQForAzimInt_recipA() == Catch::Approx(2 * M_PI / 5.0));
|
||||
}
|
||||
|
||||
|
||||
@@ -558,26 +557,26 @@ TEST_CASE("DiffractionExperiment_RadialIntegration_HighQ","[DiffractionExperimen
|
||||
REQUIRE_THROWS(x.HighQForAzimInt_recipA(50));
|
||||
|
||||
x.HighQForAzimInt_recipA(8);
|
||||
REQUIRE(x.GetHighQForAzimInt_recipA() == Approx(8.0));
|
||||
REQUIRE(x.GetHighQForAzimInt_recipA() == Catch::Approx(8.0));
|
||||
|
||||
REQUIRE_THROWS(x.HighResForAzimInt_A(0));
|
||||
REQUIRE_THROWS(x.HighResForAzimInt_A(-1));
|
||||
|
||||
x.HighResForAzimInt_A(3.0);
|
||||
REQUIRE(x.GetHighQForAzimInt_recipA() == Approx(2 * M_PI / 3.0));
|
||||
REQUIRE(x.GetHighQForAzimInt_recipA() == Catch::Approx(2 * M_PI / 3.0));
|
||||
|
||||
DiffractionExperiment y(x);
|
||||
REQUIRE(y.GetHighQForAzimInt_recipA() == Approx(2 * M_PI / 3.0));
|
||||
REQUIRE(y.GetHighQForAzimInt_recipA() == Catch::Approx(2 * M_PI / 3.0));
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_RadialIntegration_QSpacing","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
|
||||
|
||||
x.QSpacingForAzimInt_recipA(0.456);
|
||||
REQUIRE(x.GetQSpacingForAzimInt_recipA() == Approx(0.456));
|
||||
REQUIRE(x.GetQSpacingForAzimInt_recipA() == Catch::Approx(0.456));
|
||||
|
||||
DiffractionExperiment y(x);
|
||||
REQUIRE(y.GetQSpacingForAzimInt_recipA() == Approx(0.456));
|
||||
REQUIRE(y.GetQSpacingForAzimInt_recipA() == Catch::Approx(0.456));
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_StorageCells","[DiffractionExperiment]") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../common/DiffractionGeometry.h"
|
||||
#include <iostream>
|
||||
|
||||
@@ -12,8 +12,8 @@ TEST_CASE("RecipToDetector_1", "[LinearAlgebra][Coord]") {
|
||||
|
||||
auto recip = DetectorToRecip(x, pos_x, pos_y);
|
||||
auto [proj_x, proj_y] = RecipToDector(x, recip);
|
||||
REQUIRE(proj_x == Approx(pos_x));
|
||||
REQUIRE(proj_y == Approx(pos_y));
|
||||
REQUIRE(proj_x == Catch::Approx(pos_x));
|
||||
REQUIRE(proj_y == Catch::Approx(pos_y));
|
||||
REQUIRE((recip - DetectorToRecip(x, proj_x, proj_y)).Length() < 0.00000001f);
|
||||
REQUIRE(DistFromEwaldSphere(x, recip) < 4e-4);
|
||||
}
|
||||
@@ -25,8 +25,8 @@ TEST_CASE("RecipToDetector_2", "[LinearAlgebra][Coord]") {
|
||||
|
||||
auto recip = DetectorToRecip(x, pos_x, pos_y);
|
||||
auto [proj_x, proj_y] = RecipToDector(x, recip);
|
||||
REQUIRE(proj_x == Approx(pos_x));
|
||||
REQUIRE(proj_y == Approx(pos_y));
|
||||
REQUIRE(proj_x == Catch::Approx(pos_x));
|
||||
REQUIRE(proj_y == Catch::Approx(pos_y));
|
||||
REQUIRE((recip - DetectorToRecip(x, proj_x, proj_y)).Length() < 0.00000001f);
|
||||
REQUIRE(DistFromEwaldSphere(x, recip) < 4e-4);
|
||||
}
|
||||
@@ -38,8 +38,8 @@ TEST_CASE("RecipToDetector_3", "[LinearAlgebra][Coord]") {
|
||||
|
||||
auto recip = DetectorToRecip(x, pos_x, pos_y);
|
||||
auto [proj_x, proj_y] = RecipToDector(x, recip);
|
||||
REQUIRE(proj_x == Approx(pos_x));
|
||||
REQUIRE(proj_y == Approx(pos_y));
|
||||
REQUIRE(proj_x == Catch::Approx(pos_x));
|
||||
REQUIRE(proj_y == Catch::Approx(pos_y));
|
||||
REQUIRE((recip - DetectorToRecip(x, proj_x, proj_y)).Length() < 0.00000001f);
|
||||
REQUIRE(DistFromEwaldSphere(x, recip) < 4e-4);
|
||||
}
|
||||
@@ -49,9 +49,9 @@ TEST_CASE("Phi","") {
|
||||
x.DetectorDistance_mm(75).PhotonEnergy_keV(WVL_1A_IN_KEV);
|
||||
x.BeamX_pxl(1000).BeamY_pxl(1000);
|
||||
|
||||
REQUIRE(Phi(x, 2000, 1000) == Approx(0.0));
|
||||
REQUIRE(Phi(x, 1000, 2000) == Approx(M_PI_2));
|
||||
REQUIRE(Phi(x, 2000, 2000) == Approx(M_PI_4));
|
||||
REQUIRE(Phi(x, 2000, 1000) == Catch::Approx(0.0));
|
||||
REQUIRE(Phi(x, 1000, 2000) == Catch::Approx(M_PI_2));
|
||||
REQUIRE(Phi(x, 2000, 2000) == Catch::Approx(M_PI_4));
|
||||
}
|
||||
|
||||
TEST_CASE("Cos2Theta","") {
|
||||
@@ -62,7 +62,7 @@ TEST_CASE("Cos2Theta","") {
|
||||
// det distance == 1000 pixel
|
||||
// theta = 30 deg
|
||||
// tan(2 * theta) = sqrt(3)
|
||||
REQUIRE(CosTwoTheta(x, 1000, 1000 * (1.0 + sqrt(3))) == Approx(0.5f));
|
||||
REQUIRE(CosTwoTheta(x, 1000, 1000 * (1.0 + sqrt(3))) == Catch::Approx(0.5f));
|
||||
}
|
||||
|
||||
TEST_CASE("PxlToRes","") {
|
||||
@@ -72,13 +72,13 @@ TEST_CASE("PxlToRes","") {
|
||||
// sin(theta) = 1/2
|
||||
// theta = 30 deg
|
||||
// tan(2 * theta) = sqrt(3)
|
||||
REQUIRE(PxlToRes(x, 0, 1000 * sqrt(3)) == Approx(1.0));
|
||||
REQUIRE(PxlToRes(x, 0, 1000 * sqrt(3)) == Catch::Approx(1.0));
|
||||
|
||||
// sin(theta) = 1/4
|
||||
// theta = 14.47 deg
|
||||
// tan(2 * theta) = 0.55328333517
|
||||
|
||||
REQUIRE(PxlToRes(x, 1000 * 0.55328333517 * cosf(1), 1000 * 0.55328333517 * sinf(1)) == Approx(2.0));
|
||||
REQUIRE(PxlToRes(x, 1000 * 0.55328333517 * cosf(1), 1000 * 0.55328333517 * sinf(1)) == Catch::Approx(2.0));
|
||||
}
|
||||
|
||||
TEST_CASE("ResToPxl","") {
|
||||
@@ -88,12 +88,12 @@ TEST_CASE("ResToPxl","") {
|
||||
// sin(theta) = 1/2
|
||||
// theta = 30 deg
|
||||
// tan(2 * theta) = sqrt(3)
|
||||
REQUIRE(ResToPxl(x, 1.0) == Approx(1000 * sqrt(3)));
|
||||
REQUIRE(ResToPxl(x, 1.0) == Catch::Approx(1000 * sqrt(3)));
|
||||
|
||||
// sin(theta) = 1/4
|
||||
// theta = 14.47 deg
|
||||
// tan(2 * theta) = 0.55328333517
|
||||
REQUIRE(ResToPxl(x, 2.0) == Approx(1000 * 0.55328333517));
|
||||
REQUIRE(ResToPxl(x, 2.0) == Catch::Approx(1000 * 0.55328333517));
|
||||
}
|
||||
|
||||
TEST_CASE("SolidAngleCorrection","") {
|
||||
@@ -102,12 +102,12 @@ TEST_CASE("SolidAngleCorrection","") {
|
||||
x.BeamX_pxl(1000).BeamY_pxl(1000).DetectorDistance_mm(75);
|
||||
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 0.0) == 1.0f);
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 2 * M_PI) == Approx(0.5f * 0.5f * 0.5f));
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 2 * M_PI) == Catch::Approx(0.5f * 0.5f * 0.5f));
|
||||
|
||||
// theta = 30 deg
|
||||
// cos (2 * theta) = 1/2
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 1000, 1000) == 1.0f);
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f * 0.5f * 0.5f));
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Catch::Approx(0.5f * 0.5f * 0.5f));
|
||||
}
|
||||
|
||||
TEST_CASE("PolarizationCorrection","") {
|
||||
@@ -117,17 +117,17 @@ TEST_CASE("PolarizationCorrection","") {
|
||||
|
||||
// Circular polarization 0.5*(1+cos(2theta)^2)
|
||||
x.PolarizationFactor(0);
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f * (1 + 0.5f * 0.5f)));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 + sqrt(3))) == Approx(0.5f * (1 + 0.5f * 0.5f)));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Catch::Approx(0.5f * (1 + 0.5f * 0.5f)));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 + sqrt(3))) == Catch::Approx(0.5f * (1 + 0.5f * 0.5f)));
|
||||
|
||||
// Horizontal polarization
|
||||
x.PolarizationFactor(1);
|
||||
|
||||
// No correction in vertical direction
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 + sqrt(3))) == Approx(1.0f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 - sqrt(3))) == Approx(1.0f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 + sqrt(3))) == Catch::Approx(1.0f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 - sqrt(3))) == Catch::Approx(1.0f));
|
||||
|
||||
// cos(2*theta)^2 in horizontal direction
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f * 0.5f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 - sqrt(3)), 1000) == Approx(0.5f * 0.5f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Catch::Approx(0.5f * 0.5f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 - sqrt(3)), 1000) == Catch::Approx(0.5f * 0.5f));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../common/DiffractionSpot.h"
|
||||
|
||||
TEST_CASE("DiffractionSpot_ConvertToImageCoordinates", "[LinearAlgebra][Coord]") {
|
||||
@@ -15,7 +15,7 @@ TEST_CASE("DiffractionSpot_ConvertToImageCoordinates", "[LinearAlgebra][Coord]")
|
||||
REQUIRE(spot_1.Count() == 12 * 2 + 4 * 2);
|
||||
|
||||
spot_1.ConvertToImageCoordinates(experiment, 1);
|
||||
REQUIRE(spot_1.RawCoord().x == Approx(CONVERTED_MODULE_COLS + 8 + 800.5 + 6));
|
||||
REQUIRE(spot_1.RawCoord().y == Approx(CONVERTED_MODULE_LINES * 2 + 36 - 1 - 300.25 - 2));
|
||||
REQUIRE(spot_1.RawCoord().x == Catch::Approx(CONVERTED_MODULE_COLS + 8 + 800.5 + 6));
|
||||
REQUIRE(spot_1.RawCoord().y == Catch::Approx(CONVERTED_MODULE_LINES * 2 + 36 - 1 - 300.25 - 2));
|
||||
REQUIRE(spot_1.Count() == 12 * 2 + 4 * 2);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../fpga/hls/hls_jfjoch.h"
|
||||
|
||||
TEST_CASE("FPGA_EigerReorderTest") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../fpga/hls/hls_jfjoch.h"
|
||||
|
||||
TEST_CASE("FPGA_FrameGenerator_Cancel") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../fpga/hls/hls_jfjoch.h"
|
||||
|
||||
TEST_CASE("FPGA_FrameWriterTestIgnore") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <random>
|
||||
|
||||
#include "../jungfrau/JFPedestalCalc.h"
|
||||
@@ -367,7 +367,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range", "[FPGA][Full]") {
|
||||
for (const auto energy : energy_values) {
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy);
|
||||
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
JFCalibration c_in(x);
|
||||
c_in.Pedestal(0,0) = pedestal_g0;
|
||||
@@ -418,7 +418,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_HG0", "[FPGA][Full]") {
|
||||
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy);
|
||||
REQUIRE(x.IsUsingGainHG0());
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
JFCalibration c_in(x);
|
||||
c_in.Pedestal(0,0) = pedestal_g0;
|
||||
@@ -448,7 +448,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_HG0", "[FPGA][Full]") {
|
||||
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy);
|
||||
REQUIRE(!x.IsUsingGainHG0());
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
JFCalibration c_in(x);
|
||||
c_in.Pedestal(0,0) = pedestal_g0;
|
||||
@@ -499,7 +499,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_fixedG1", "[FPGA][Full]") {
|
||||
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy);
|
||||
REQUIRE(x.IsFixedGainG1());
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
JFCalibration c_in(x);
|
||||
c_in.Pedestal(0,0) = pedestal_g0;
|
||||
@@ -549,7 +549,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_I32", "[FPGA][Full]") {
|
||||
for (const auto energy : energy_values) {
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy).FPGAOutputMode(FPGAPixelOutput::Int32);
|
||||
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
JFCalibration c_in(x);
|
||||
c_in.Pedestal(0,0) = pedestal_g0;
|
||||
@@ -602,7 +602,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_sum4", "[FPGA][Full]") {
|
||||
logger.Info("Trying with {} keV", energy);
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy).Summation(nsummation);
|
||||
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
JFCalibration c_in(x);
|
||||
c_in.Pedestal(0,0) = pedestal_g0;
|
||||
@@ -654,7 +654,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_U16", "[FPGA][Full]") {
|
||||
logger.Info("Trying with {} keV", energy);
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy).FPGAOutputMode(FPGAPixelOutput::Uint16);
|
||||
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
JFCalibration c_in(x);
|
||||
c_in.Pedestal(0,0) = pedestal_g0;
|
||||
@@ -815,7 +815,7 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_convert_full_range", "[FPG
|
||||
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).UseInternalPacketGenerator(true).PhotonEnergy_keV(energy);
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
auto gain_from_file = GainCalibrationFromTestFile();
|
||||
|
||||
@@ -870,7 +870,7 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_convert_full_range_adu_his
|
||||
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).UseInternalPacketGenerator(true).PhotonEnergy_keV(energy);
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Approx(energy));
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
auto gain_from_file = GainCalibrationFromTestFile();
|
||||
|
||||
@@ -1477,23 +1477,23 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_integration", "[FPGA][Full
|
||||
REQUIRE(memcmp(imageBuf, frame.data(), RAW_MODULE_SIZE * sizeof(uint16_t)) == 0);
|
||||
|
||||
auto integration_result = test.GetDeviceOutput(0, 0)->integration_result;
|
||||
CHECK(integration_result[0].sum == Approx(32754LU * (RAW_MODULE_SIZE / 2)));
|
||||
CHECK(integration_result[0].sum == Catch::Approx(32754LU * (RAW_MODULE_SIZE / 2)));
|
||||
CHECK(integration_result[0].count == RAW_MODULE_SIZE / 2);
|
||||
CHECK(integration_result[1].sum == 0);
|
||||
CHECK(integration_result[1].count == 0);
|
||||
CHECK(integration_result[FPGA_INTEGRATION_BIN_COUNT - 1].sum == Approx(32754LU * (RAW_MODULE_SIZE / 2 - 1)));
|
||||
CHECK(integration_result[FPGA_INTEGRATION_BIN_COUNT - 1].sum == Catch::Approx(32754LU * (RAW_MODULE_SIZE / 2 - 1)));
|
||||
CHECK(integration_result[FPGA_INTEGRATION_BIN_COUNT - 1].count == RAW_MODULE_SIZE / 2 - 1);
|
||||
|
||||
integration_result = test.GetDeviceOutput(0, 1)->integration_result;
|
||||
CHECK(integration_result[54].sum == Approx(32754LU * (RAW_MODULE_SIZE)));
|
||||
CHECK(integration_result[54].sum == Catch::Approx(32754LU * (RAW_MODULE_SIZE)));
|
||||
CHECK(integration_result[54].count == RAW_MODULE_SIZE);
|
||||
|
||||
integration_result = test.GetDeviceOutput(0, 2)->integration_result;
|
||||
CHECK(integration_result[54].sum == Approx(32754 * (RAW_MODULE_SIZE)));
|
||||
CHECK(integration_result[54].sum == Catch::Approx(32754 * (RAW_MODULE_SIZE)));
|
||||
CHECK(integration_result[54].count == RAW_MODULE_SIZE);
|
||||
|
||||
integration_result = test.GetDeviceOutput(0, 3)->integration_result;
|
||||
CHECK(integration_result[54].sum == Approx(32754 * (RAW_MODULE_SIZE)));
|
||||
CHECK(integration_result[54].sum == Catch::Approx(32754 * (RAW_MODULE_SIZE)));
|
||||
CHECK(integration_result[54].count == RAW_MODULE_SIZE);
|
||||
}
|
||||
|
||||
@@ -2150,13 +2150,13 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_roi_calc", "[FPGA][Full]")
|
||||
for (int m = 0; m < x.GetModulesNum(); m++) {
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[0].sum == 83 + 95 + 13 + 125);
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[0].sum2 == 83 * 83 + 95 * 95 + 13 * 13 + 125 * 125);
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[0].sum_x_weighted == Approx(83 * 12 + 95 * 13 + 13 * 12 + 125 * 13));
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[0].sum_y_weighted == Approx(83 * 3 + 95 * 3 + 13 * 4 + 125 * 4));
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[0].sum_x_weighted == Catch::Approx(83 * 12 + 95 * 13 + 13 * 12 + 125 * 13));
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[0].sum_y_weighted == Catch::Approx(83 * 3 + 95 * 3 + 13 * 4 + 125 * 4));
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[0].max_value == 125);
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[0].good_pixels == 4);
|
||||
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[1].sum_x_weighted == Approx(83 * (812+6) + 95 * (813+6) + 13 * (812+6) + 125 * (813+6)));
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[1].sum_y_weighted == Approx(83 * (303+2) + 95 * (303+2) + 13 * (304+2) + 125 * (304+2)));
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[1].sum_x_weighted == Catch::Approx(83 * (812+6) + 95 * (813+6) + 13 * (812+6) + 125 * (813+6)));
|
||||
CHECK (test.GetDeviceOutput(i, m)->roi_counts[1].sum_y_weighted == Catch::Approx(83 * (303+2) + 95 * (303+2) + 13 * (304+2) + 125 * (304+2)));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/ip_icmp.h>
|
||||
#include <net/if_arp.h>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <iostream>
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../fpga/hls/hls_jfjoch.h"
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <iostream>
|
||||
#include <bitshuffle/bitshuffle.h>
|
||||
|
||||
#include "../receiver/FrameTransformation.h"
|
||||
#include "../common/RawToConvertedGeometry.h"
|
||||
#include "../compression/JFJochDecompress.h"
|
||||
#include <random>
|
||||
|
||||
using namespace std::literals::chrono_literals;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <iostream>
|
||||
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../common/Histogram.h"
|
||||
|
||||
|
||||
+22
-22
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../writer/HDF5Objects.h"
|
||||
#include "../image_analysis/IndexerWrapper.h"
|
||||
|
||||
@@ -8,54 +8,54 @@
|
||||
|
||||
TEST_CASE("CrystalLattice") {
|
||||
CrystalLattice l(make_unit_cell(50,60,80, 90, 90, 90));
|
||||
REQUIRE(l.Vec0().Length() == Approx(50));
|
||||
REQUIRE(l.Vec1().Length() == Approx(60));
|
||||
REQUIRE(l.Vec2().Length() == Approx(80));
|
||||
REQUIRE(l.Vec0().Length() == Catch::Approx(50));
|
||||
REQUIRE(l.Vec1().Length() == Catch::Approx(60));
|
||||
REQUIRE(l.Vec2().Length() == Catch::Approx(80));
|
||||
REQUIRE(angle_deg(l.Vec0(), l.Vec2()) == 90);
|
||||
REQUIRE(angle_deg(l.Vec0(), l.Vec1()) == 90);
|
||||
REQUIRE(angle_deg(l.Vec1(), l.Vec2()) == 90);
|
||||
|
||||
l = CrystalLattice(make_unit_cell(30, 40, 70, 90, 95, 90));
|
||||
REQUIRE(l.Vec0().Length() == Approx(30));
|
||||
REQUIRE(l.Vec1().Length() == Approx(40));
|
||||
REQUIRE(l.Vec2().Length() == Approx(70));
|
||||
REQUIRE(l.Vec0().Length() == Catch::Approx(30));
|
||||
REQUIRE(l.Vec1().Length() == Catch::Approx(40));
|
||||
REQUIRE(l.Vec2().Length() == Catch::Approx(70));
|
||||
REQUIRE(angle_deg(l.Vec0(), l.Vec2()) == 95);
|
||||
REQUIRE(angle_deg(l.Vec0(), l.Vec1()) == 90);
|
||||
REQUIRE(angle_deg(l.Vec1(), l.Vec2()) == 90);
|
||||
|
||||
l = CrystalLattice(make_unit_cell(45, 45, 70, 90, 90, 120));
|
||||
REQUIRE(l.Vec0().Length() == Approx(45));
|
||||
REQUIRE(l.Vec1().Length() == Approx(45));
|
||||
REQUIRE(l.Vec2().Length() == Approx(70));
|
||||
REQUIRE(angle_deg(l.Vec0(), l.Vec2()) == Approx(90));
|
||||
REQUIRE(angle_deg(l.Vec0(), l.Vec1()) == Approx(120));
|
||||
REQUIRE(angle_deg(l.Vec1(), l.Vec2()) == Approx(90));
|
||||
REQUIRE(l.Vec0().Length() == Catch::Approx(45));
|
||||
REQUIRE(l.Vec1().Length() == Catch::Approx(45));
|
||||
REQUIRE(l.Vec2().Length() == Catch::Approx(70));
|
||||
REQUIRE(angle_deg(l.Vec0(), l.Vec2()) == Catch::Approx(90));
|
||||
REQUIRE(angle_deg(l.Vec0(), l.Vec1()) == Catch::Approx(120));
|
||||
REQUIRE(angle_deg(l.Vec1(), l.Vec2()) == Catch::Approx(90));
|
||||
}
|
||||
|
||||
TEST_CASE("CrystalLattice_ReciprocalLattice") {
|
||||
CrystalLattice l(make_unit_cell(50,60,80, 78, 80, 120));
|
||||
CrystalLattice rl = l.ReciprocalLattice();
|
||||
|
||||
REQUIRE(l.Vec0() * rl.Vec0() == Approx(1.0));
|
||||
REQUIRE(l.Vec0() * rl.Vec0() == Catch::Approx(1.0));
|
||||
REQUIRE(l.Vec0() * rl.Vec1() < 1e-5);
|
||||
REQUIRE(l.Vec0() * rl.Vec2() < 1e-5);
|
||||
|
||||
REQUIRE(l.Vec1() * rl.Vec0() < 1e-5);
|
||||
REQUIRE(l.Vec1() * rl.Vec1() == Approx(1.0));
|
||||
REQUIRE(l.Vec1() * rl.Vec1() == Catch::Approx(1.0));
|
||||
REQUIRE(l.Vec1() * rl.Vec2() < 1e-5);
|
||||
|
||||
REQUIRE(l.Vec2() * rl.Vec0() < 1e-5);
|
||||
REQUIRE(l.Vec2() * rl.Vec1() < 1e-5);
|
||||
REQUIRE(l.Vec2() * rl.Vec2() == Approx(1.0));
|
||||
REQUIRE(l.Vec2() * rl.Vec2() == Catch::Approx(1.0));
|
||||
}
|
||||
|
||||
TEST_CASE("CrystalLattice_EigenMatrix") {
|
||||
CrystalLattice l1(make_unit_cell(50,60,80, 78, 80, 120));
|
||||
auto m = l1.GetEigenMatrix();
|
||||
CrystalLattice l2(m);
|
||||
REQUIRE(l2.Vec0().x == Approx(l1.Vec0().x));
|
||||
REQUIRE(l2.Vec1().y == Approx(l1.Vec1().y));
|
||||
REQUIRE(l2.Vec2().x == Approx(l1.Vec2().x));
|
||||
REQUIRE(l2.Vec0().x == Catch::Approx(l1.Vec0().x));
|
||||
REQUIRE(l2.Vec1().y == Catch::Approx(l1.Vec1().y));
|
||||
REQUIRE(l2.Vec2().x == Catch::Approx(l1.Vec2().x));
|
||||
}
|
||||
|
||||
inline double round_err(double x) {
|
||||
@@ -90,9 +90,9 @@ TEST_CASE("FastFeedbackIndexer","[Indexing]") {
|
||||
REQUIRE(!ret.empty());
|
||||
|
||||
//auto uc = ret[0].GetUnitCell();
|
||||
//REQUIRE(c.a == Approx(uc.a));
|
||||
//REQUIRE(c.b == Approx(uc.b));
|
||||
//REQUIRE(c.c == Approx(uc.c));
|
||||
//REQUIRE(c.a == Catch::Approx(uc.a));
|
||||
//REQUIRE(c.b == Catch::Approx(uc.b));
|
||||
//REQUIRE(c.c == Catch::Approx(uc.c));
|
||||
|
||||
double err[3] = {0.0, 0.0, 0.0};
|
||||
for (const auto &iter: recip) {
|
||||
|
||||
+31
-31
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include <random>
|
||||
|
||||
#include "../jungfrau/JFCalibration.h"
|
||||
@@ -30,20 +30,20 @@ TEST_CASE("JFCalibration_GainStatistics","[JFCalibration]") {
|
||||
|
||||
REQUIRE(s.size() == 4);
|
||||
|
||||
REQUIRE(s[0].gain_g0_mean == Approx(35.0));
|
||||
REQUIRE(s[1].gain_g0_mean == Approx(36.0));
|
||||
REQUIRE(s[2].gain_g0_mean == Approx(37.0));
|
||||
REQUIRE(s[3].gain_g0_mean == Approx(38.0));
|
||||
REQUIRE(s[0].gain_g0_mean == Catch::Approx(35.0));
|
||||
REQUIRE(s[1].gain_g0_mean == Catch::Approx(36.0));
|
||||
REQUIRE(s[2].gain_g0_mean == Catch::Approx(37.0));
|
||||
REQUIRE(s[3].gain_g0_mean == Catch::Approx(38.0));
|
||||
|
||||
REQUIRE(s[0].gain_g1_mean == Approx(-56));
|
||||
REQUIRE(s[1].gain_g1_mean == Approx(-55));
|
||||
REQUIRE(s[2].gain_g1_mean == Approx(-54));
|
||||
REQUIRE(s[3].gain_g1_mean == Approx(-53));
|
||||
REQUIRE(s[0].gain_g1_mean == Catch::Approx(-56));
|
||||
REQUIRE(s[1].gain_g1_mean == Catch::Approx(-55));
|
||||
REQUIRE(s[2].gain_g1_mean == Catch::Approx(-54));
|
||||
REQUIRE(s[3].gain_g1_mean == Catch::Approx(-53));
|
||||
|
||||
REQUIRE(s[0].gain_g2_mean == Approx(0/32.));
|
||||
REQUIRE(s[1].gain_g2_mean == Approx(1/32.));
|
||||
REQUIRE(s[2].gain_g2_mean == Approx(2/32.));
|
||||
REQUIRE(s[3].gain_g2_mean == Approx(3/32.));
|
||||
REQUIRE(s[0].gain_g2_mean == Catch::Approx(0/32.));
|
||||
REQUIRE(s[1].gain_g2_mean == Catch::Approx(1/32.));
|
||||
REQUIRE(s[2].gain_g2_mean == Catch::Approx(2/32.));
|
||||
REQUIRE(s[3].gain_g2_mean == Catch::Approx(3/32.));
|
||||
}
|
||||
|
||||
TEST_CASE("JFCalibration_PedestalAndMaskStatistics","[JFCalibration]") {
|
||||
@@ -64,17 +64,17 @@ TEST_CASE("JFCalibration_PedestalAndMaskStatistics","[JFCalibration]") {
|
||||
|
||||
auto s1 = calibration.GetModuleStatistics(1);
|
||||
|
||||
REQUIRE(s1[0].pedestal_g0_mean == Approx(1000));
|
||||
REQUIRE(s1[0].pedestal_g1_mean == Approx(2000));
|
||||
REQUIRE(s1[0].pedestal_g2_mean == Approx(3000));
|
||||
REQUIRE(s1[0].pedestal_g0_mean == Catch::Approx(1000));
|
||||
REQUIRE(s1[0].pedestal_g1_mean == Catch::Approx(2000));
|
||||
REQUIRE(s1[0].pedestal_g2_mean == Catch::Approx(3000));
|
||||
|
||||
REQUIRE(s1[1].pedestal_g0_mean == Approx(2000));
|
||||
REQUIRE(s1[1].pedestal_g1_mean == Approx(4000));
|
||||
REQUIRE(s1[1].pedestal_g2_mean == Approx(6000));
|
||||
REQUIRE(s1[1].pedestal_g0_mean == Catch::Approx(2000));
|
||||
REQUIRE(s1[1].pedestal_g1_mean == Catch::Approx(4000));
|
||||
REQUIRE(s1[1].pedestal_g2_mean == Catch::Approx(6000));
|
||||
|
||||
REQUIRE(s1[2].pedestal_g0_mean == Approx(3000));
|
||||
REQUIRE(s1[2].pedestal_g1_mean == Approx(6000));
|
||||
REQUIRE(s1[2].pedestal_g2_mean == Approx(9000));
|
||||
REQUIRE(s1[2].pedestal_g0_mean == Catch::Approx(3000));
|
||||
REQUIRE(s1[2].pedestal_g1_mean == Catch::Approx(6000));
|
||||
REQUIRE(s1[2].pedestal_g2_mean == Catch::Approx(9000));
|
||||
|
||||
REQUIRE(s1[0].bad_pixels == 0);
|
||||
REQUIRE(s1[1].bad_pixels == 0);
|
||||
@@ -127,17 +127,17 @@ TEST_CASE("JFCalibration_Statistics_All","[JFCalibration]") {
|
||||
REQUIRE(s0[2].bad_pixels == 0);
|
||||
REQUIRE(s0[3].bad_pixels == 0);
|
||||
|
||||
REQUIRE(s0[4].pedestal_g0_mean == Approx(1000));
|
||||
REQUIRE(s0[4].pedestal_g1_mean == Approx(2000));
|
||||
REQUIRE(s0[4].pedestal_g2_mean == Approx(3000));
|
||||
REQUIRE(s0[4].pedestal_g0_mean == Catch::Approx(1000));
|
||||
REQUIRE(s0[4].pedestal_g1_mean == Catch::Approx(2000));
|
||||
REQUIRE(s0[4].pedestal_g2_mean == Catch::Approx(3000));
|
||||
|
||||
REQUIRE(s0[5].pedestal_g0_mean == Approx(2000));
|
||||
REQUIRE(s0[5].pedestal_g1_mean == Approx(4000));
|
||||
REQUIRE(s0[5].pedestal_g2_mean == Approx(6000));
|
||||
REQUIRE(s0[5].pedestal_g0_mean == Catch::Approx(2000));
|
||||
REQUIRE(s0[5].pedestal_g1_mean == Catch::Approx(4000));
|
||||
REQUIRE(s0[5].pedestal_g2_mean == Catch::Approx(6000));
|
||||
|
||||
REQUIRE(s0[6].pedestal_g0_mean == Approx(3000));
|
||||
REQUIRE(s0[6].pedestal_g1_mean == Approx(6000));
|
||||
REQUIRE(s0[6].pedestal_g2_mean == Approx(9000));
|
||||
REQUIRE(s0[6].pedestal_g0_mean == Catch::Approx(3000));
|
||||
REQUIRE(s0[6].pedestal_g1_mean == Catch::Approx(6000));
|
||||
REQUIRE(s0[6].pedestal_g2_mean == Catch::Approx(9000));
|
||||
|
||||
REQUIRE(s0[4].bad_pixels == 0);
|
||||
REQUIRE(s0[5].bad_pixels == 0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../jungfrau/JFConversionFloatingPoint.h"
|
||||
#include "../tests/FPGAUnitTest.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../broker/JFJochBrokerParser.h"
|
||||
|
||||
using namespace nlohmann::literals;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../receiver/JFJochReceiverTest.h"
|
||||
#include "../acquisition_device/HLSSimulatedDevice.h"
|
||||
@@ -442,10 +442,10 @@ TEST_CASE("JFJochReceiverTest_PedestalG0_StorageCell", "[JFJochReceiver]") {
|
||||
JFModulePedestal out_pedestal_2 = output.pedestal_result[2];
|
||||
JFModulePedestal out_pedestal_3 = output.pedestal_result[3];
|
||||
|
||||
REQUIRE(out_pedestal_0.Mean() == Approx(5670));
|
||||
REQUIRE(out_pedestal_1.Mean() == Approx(4560));
|
||||
REQUIRE(out_pedestal_2.Mean() == Approx(3450));
|
||||
REQUIRE(out_pedestal_3.Mean() == Approx(2000));
|
||||
REQUIRE(out_pedestal_0.Mean() == Catch::Approx(5670));
|
||||
REQUIRE(out_pedestal_1.Mean() == Catch::Approx(4560));
|
||||
REQUIRE(out_pedestal_2.Mean() == Catch::Approx(3450));
|
||||
REQUIRE(out_pedestal_3.Mean() == Catch::Approx(2000));
|
||||
}
|
||||
|
||||
TEST_CASE("JFJochReceiverTest_PedestalG1_NoFrames", "[JFJochReceiver]") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../broker/JFJochStateMachine.h"
|
||||
|
||||
using namespace std::literals::chrono_literals;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <random>
|
||||
|
||||
#include "../jungfrau/JFModulePedestal.h"
|
||||
@@ -12,7 +12,7 @@ TEST_CASE("JFPedestal_Mean","[JFModulePedestal]") {
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++)
|
||||
pedestal_arr[i] = 2455;
|
||||
|
||||
REQUIRE(pedestal.Mean() == Approx(2455));
|
||||
REQUIRE(pedestal.Mean() == Catch::Approx(2455));
|
||||
}
|
||||
|
||||
TEST_CASE("JFPedestal_GetPedestal","[JFModulePedestal]") {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include "../preview//WriteJPEG.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../receiver/LossyFilter.h"
|
||||
|
||||
TEST_CASE("LossyFilterDisabled","[LossyFilter]") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../writer/HDF5Objects.h"
|
||||
#include "../resonet/NeuralNetResPredictor.h"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <random>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../jungfrau/JFPedestalCalc.h"
|
||||
|
||||
TEST_CASE("JFPedestalCalc", "[JFPedestalCalc]") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "../common/PixelMask.h"
|
||||
|
||||
TEST_CASE("PixelMask_MaskModuleEdges","[PixelMask]") {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <thread>
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../preview/PreviewCounter.h"
|
||||
|
||||
TEST_CASE("PreviewCount", "") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../common/ROIMap.h"
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../image_analysis/Regression.h"
|
||||
|
||||
@@ -14,6 +14,6 @@ TEST_CASE("Regression") {
|
||||
y[i] = 7 * i + 5;
|
||||
}
|
||||
auto reg = regression(x, y);
|
||||
REQUIRE(reg.intercept == Approx(5.0));
|
||||
REQUIRE(reg.slope == Approx(7.0));
|
||||
REQUIRE(reg.intercept == Catch::Approx(5.0));
|
||||
REQUIRE(reg.slope == Catch::Approx(7.0));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../common/SendBufferControl.h"
|
||||
|
||||
|
||||
+14
-14
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../common/StatusVector.h"
|
||||
|
||||
TEST_CASE("StatusVector_GetMeanPerBin","[StatusVector]") {
|
||||
@@ -16,7 +16,7 @@ TEST_CASE("StatusVector_GetMeanPerBin","[StatusVector]") {
|
||||
REQUIRE(status_out.size() == 3);
|
||||
REQUIRE(status_out[0] == 11);
|
||||
REQUIRE(status_out[1] == 0);
|
||||
REQUIRE(status_out[2] == Approx((45 + 44 + 41) / 3.0));
|
||||
REQUIRE(status_out[2] == Catch::Approx((45 + 44 + 41) / 3.0));
|
||||
|
||||
status_out = status_vector.GetMeanPerBin(500);
|
||||
|
||||
@@ -25,8 +25,8 @@ TEST_CASE("StatusVector_GetMeanPerBin","[StatusVector]") {
|
||||
REQUIRE(status_out[1] == 0);
|
||||
REQUIRE(status_out[2] == 0);
|
||||
REQUIRE(status_out[3] == 0);
|
||||
REQUIRE(status_out[4] == Approx(45));
|
||||
REQUIRE(status_out[5] == Approx((44+41)/2.0));
|
||||
REQUIRE(status_out[4] == Catch::Approx(45));
|
||||
REQUIRE(status_out[5] == Catch::Approx((44+41)/2.0));
|
||||
|
||||
status_out = status_vector.GetMeanPerBin(1);
|
||||
REQUIRE(status_out.size() == 2601);
|
||||
@@ -117,10 +117,10 @@ TEST_CASE("StatusVector_Plot","[StatusVector]") {
|
||||
REQUIRE(plot_out.size() == 1);
|
||||
REQUIRE(plot_out[0].x.size() == 3);
|
||||
REQUIRE(plot_out[0].y.size() == 3);
|
||||
REQUIRE(plot_out[0].x[0] == Approx(500));
|
||||
REQUIRE(plot_out[0].y[0] == Approx(11));
|
||||
REQUIRE(plot_out[0].x[2] == Approx(2500));
|
||||
REQUIRE(plot_out[0].y[2] == Approx((45 + 44 + 41) / 3.0));
|
||||
REQUIRE(plot_out[0].x[0] == Catch::Approx(500));
|
||||
REQUIRE(plot_out[0].y[0] == Catch::Approx(11));
|
||||
REQUIRE(plot_out[0].x[2] == Catch::Approx(2500));
|
||||
REQUIRE(plot_out[0].y[2] == Catch::Approx((45 + 44 + 41) / 3.0));
|
||||
}
|
||||
|
||||
TEST_CASE("StatusVector_Plot_OneBin","[StatusVector]") {
|
||||
@@ -131,8 +131,8 @@ TEST_CASE("StatusVector_Plot_OneBin","[StatusVector]") {
|
||||
REQUIRE(plot_out.size() == 1);
|
||||
REQUIRE(plot_out[0].x.size() == 1);
|
||||
REQUIRE(plot_out[0].y.size() == 1);
|
||||
REQUIRE(plot_out[0].x[0] == Approx(2.5));
|
||||
REQUIRE(plot_out[0].y[0] == Approx(11));
|
||||
REQUIRE(plot_out[0].x[0] == Catch::Approx(2.5));
|
||||
REQUIRE(plot_out[0].y[0] == Catch::Approx(11));
|
||||
}
|
||||
|
||||
|
||||
@@ -144,9 +144,9 @@ TEST_CASE("StatusVector_Plot_NoBinning","[StatusVector]") {
|
||||
REQUIRE(plot_out.size() == 1);
|
||||
REQUIRE(plot_out[0].x.size() == 6);
|
||||
REQUIRE(plot_out[0].y.size() == 6);
|
||||
REQUIRE(plot_out[0].x[0] == Approx(0));
|
||||
REQUIRE(plot_out[0].y[0] == Approx(0));
|
||||
REQUIRE(plot_out[0].x[0] == Catch::Approx(0));
|
||||
REQUIRE(plot_out[0].y[0] == Catch::Approx(0));
|
||||
|
||||
REQUIRE(plot_out[0].x[5] == Approx(5));
|
||||
REQUIRE(plot_out[0].y[5] == Approx(11));
|
||||
REQUIRE(plot_out[0].x[5] == Catch::Approx(5));
|
||||
REQUIRE(plot_out[0].y[5] == Catch::Approx(11));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <filesystem>
|
||||
|
||||
#include "../writer/StreamWriter.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../image_analysis/StrongPixelSet.h"
|
||||
|
||||
TEST_CASE("DiffractionSpot_AddOperator","[StrongPixelSet]") {
|
||||
@@ -12,8 +12,8 @@ TEST_CASE("DiffractionSpot_AddOperator","[StrongPixelSet]") {
|
||||
REQUIRE(spot2.Count() == 5);
|
||||
|
||||
REQUIRE(spot1.Count() == 15);
|
||||
REQUIRE(spot1.RawCoord().x == Approx((4*10+3*5)/15.0));
|
||||
REQUIRE(spot1.RawCoord().y == Approx((1*10+4*5)/15.0));
|
||||
REQUIRE(spot1.RawCoord().x == Catch::Approx((4*10+3*5)/15.0));
|
||||
REQUIRE(spot1.RawCoord().y == Catch::Approx((1*10+4*5)/15.0));
|
||||
REQUIRE(spot1.MaxCount() == 10);
|
||||
REQUIRE(spot1.PixelCount() == 2);
|
||||
}
|
||||
@@ -44,8 +44,8 @@ TEST_CASE("StrongPixelSet_BuildSpots","[StrongPixelSet]") {
|
||||
|
||||
REQUIRE(spots[0].Count() == 9.0f);
|
||||
REQUIRE(spots[0].PixelCount() == 9);
|
||||
REQUIRE(spots[0].RawCoord().x == Approx(7.0));
|
||||
REQUIRE(spots[0].RawCoord().y == Approx(105.0));
|
||||
REQUIRE(spots[0].RawCoord().x == Catch::Approx(7.0));
|
||||
REQUIRE(spots[0].RawCoord().y == Catch::Approx(105.0));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <../common/ThreadSafeFIFO.h>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <random>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include "../writer/ZMQImagePuller.h"
|
||||
#include "../frame_serialize/ZMQStream2PusherGroup.h"
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch2/catch_all.hpp>
|
||||
#include <bitshuffle/bitshuffle.h>
|
||||
#include <zstd.h>
|
||||
#include <iostream>
|
||||
#include <random>
|
||||
|
||||
#include "../compression/JFJochCompressor.h"
|
||||
#include "../compression/JFJochDecompress.h"
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
-17970
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user