9 #include <boost/test/unit_test.hpp>
19 BOOST_AUTO_TEST_SUITE(material_composition)
21 constexpr
float eps = 1.0
f / 255
u;
25 unsigned int carbonZ = 12
u;
27 unsigned int carbonWeight = 46
u;
28 float carbonFraction = float(carbonWeight) / 255
u;
31 BOOST_CHECK_EQUAL(a.
element(), carbonZ);
35 BOOST_CHECK_EQUAL(b.element(), carbonZ);
46 BOOST_CHECK(!!compound);
47 BOOST_CHECK_EQUAL(compound.size(), 4
u);
49 float totalFraction = 0.0f;
50 for (
const auto& eFraction : compound) {
51 totalFraction += eFraction.fraction();
59 BOOST_CHECK_EQUAL(compound.size(), shuffled.size());
60 BOOST_CHECK_EQUAL(compound, shuffled);
70 BOOST_CHECK(!!compound);
71 BOOST_CHECK_EQUAL(compound.size(), 4
u);
73 float totalFraction = 0.0f;
74 for (
const auto& eFraction : compound) {
75 totalFraction += eFraction.fraction();
81 BOOST_AUTO_TEST_SUITE_END()