JFJochReceiver: Plot is C++ struct
This commit is contained in:
@@ -79,14 +79,13 @@ TEST_CASE("RadialIntegrationProfile","[RadialIntegration]") {
|
||||
std::vector<int64_t> sum_wr(mapping.GetBinNumber() - 1);
|
||||
REQUIRE_THROWS(profile.Add(sum_wr, count));
|
||||
|
||||
JFJochProtoBuf::Plot plot;
|
||||
profile.GetPlot(plot);
|
||||
Plot plot = profile.GetPlot();
|
||||
|
||||
REQUIRE(plot.x_size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.y_size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.x.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.y.size() == mapping.GetBinNumber());
|
||||
for (int i = 0; i < mapping.GetBinNumber(); i++) {
|
||||
REQUIRE(plot.x(i) == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot.y(i) == Approx(i * 4));
|
||||
REQUIRE(plot.x[i] == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot.y[i] == Approx(i * 4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,14 +108,13 @@ TEST_CASE("RadialIntegrationProfile_operatorAdd","[RadialIntegration]") {
|
||||
REQUIRE_NOTHROW(profile0.Add(sum, count));
|
||||
REQUIRE_NOTHROW(profile1 += profile0);
|
||||
|
||||
JFJochProtoBuf::Plot plot;
|
||||
profile1.GetPlot(plot);
|
||||
auto plot = profile1.GetPlot();
|
||||
|
||||
REQUIRE(plot.x_size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.y_size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.x.size() == mapping.GetBinNumber());
|
||||
REQUIRE(plot.y.size() == mapping.GetBinNumber());
|
||||
for (int i = 0; i < mapping.GetBinNumber(); i++) {
|
||||
REQUIRE(plot.x(i) == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot.y(i) == Approx(i * 4));
|
||||
REQUIRE(plot.x[i] == Approx(mapping.GetBinToQ()[i]));
|
||||
REQUIRE(plot.y[i] == Approx(i * 4));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user