1.0.0-rc.89

This commit is contained in:
2025-10-01 22:54:40 +02:00
parent fae0d06500
commit 14f5051692
170 changed files with 542 additions and 383 deletions

View File

@@ -0,0 +1,25 @@
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#include <catch2/catch_all.hpp>
#include "../image_analysis/bragg_integration/ResolutionShells.h"
TEST_CASE("ResolutionShells_WrongInput") {
REQUIRE_THROWS(ResolutionShells(-1,5,10));
REQUIRE_THROWS(ResolutionShells(7,5,10));
REQUIRE_THROWS(ResolutionShells(5,6,0));
REQUIRE_THROWS(ResolutionShells(5,6,-10));
}
TEST_CASE("ResolutionShells") {
ResolutionShells shells(1,50, 20);
REQUIRE(!shells.GetShell(50.0111));
REQUIRE(shells.GetShell(50.0) == 0);
REQUIRE(shells.GetShell(49.555) == 0);
REQUIRE(shells.GetShell(1.001) == 19);
REQUIRE(!shells.GetShell(1.0));
float one_over_d_sq = 1/(50. * 50.) + 10.2 * (1/(1 * 1) - 1/(50 * 50)) / 20;
REQUIRE(shells.GetShell(1/sqrtf(one_over_d_sq)) == 10);
}