JFJochReceiverPlots: Safer code

This commit is contained in:
2026-02-28 16:09:14 +01:00
parent e432edb5d9
commit 6e97b7c15c
5 changed files with 164 additions and 151 deletions

View File

@@ -272,28 +272,6 @@ TEST_CASE("StatusVector_Plot_NoBinning","[StatusVector]") {
REQUIRE(plot_out.GetPlots()[0].y[0] == Catch::Approx(11));
}
TEST_CASE("StatusMultiVector","[StatusMultiVector]") {
StatusMultiVector status_vector;
status_vector.AddElement("plot1", 0, 4);
status_vector.AddElement("plot1", 1, 3);
status_vector.AddElement("plot2", 0, 5);
status_vector.AddElement("plot2", 1, 4);
auto ret = status_vector.GetMeanPlot(1, 3.0, 5.0);
REQUIRE(ret.GetPlots().size() == 2);
REQUIRE(ret.GetPlots()[0].title == "plot1");
REQUIRE(ret.GetPlots()[0].x.size() == 2);
REQUIRE(ret.GetPlots()[0].y.size() == 2);
REQUIRE(ret.GetPlots()[0].x[0] == 3.0 + 5.0 * 0.0f);
REQUIRE(ret.GetPlots()[0].y[1] == 3.0f);
REQUIRE(ret.GetPlots()[1].title == "plot2");
REQUIRE(ret.GetPlots()[1].x.size() == 2);
REQUIRE(ret.GetPlots()[1].y.size() == 2);
REQUIRE(ret.GetPlots()[1].x[1] == 3.0 + 5.0 * 1.0f);
REQUIRE(ret.GetPlots()[1].y[1] == 4.0f);
}
TEST_CASE("StatusVector_Clear","[StatusVector]") {
StatusVector status_vector;
status_vector.AddElement(5, 800);