9 #include <boost/test/unit_test.hpp>
21 #include <nlohmann/json.hpp>
25 BOOST_AUTO_TEST_SUITE(SurfaceBoundsJsonConversion)
33 auto rectangeRef = std::make_shared<const RectangleBounds>(4., 6.);
34 nlohmann::json rectangleOut =
36 out.open(
"RectangleBounds.json");
37 out << rectangleOut.dump(2);
40 auto in = std::ifstream(
"RectangleBounds.json",
42 BOOST_CHECK(
in.good());
43 nlohmann::json rectangleIn;
48 SurfaceBoundsJsonConverter::fromJson<RectangleBounds>(rectangleIn);
50 BOOST_CHECK(rectangeRef->values() == rectangleTest->values());
54 auto rectangeRef = std::make_shared<const RectangleBounds>(4., 6.);
55 nlohmann::json rectangleOutDetray =
58 std::vector<ActsScalar> boundariesRef = {4, 6};
59 BOOST_CHECK(rectangleOutDetray[
"shape"].get<unsigned int>() == 5
u);
60 BOOST_CHECK(rectangleOutDetray[
"boundaries"].
get<std::vector<ActsScalar>>() ==
64 BOOST_AUTO_TEST_SUITE_END()