9 #include <boost/test/unit_test.hpp>
33 BOOST_AUTO_TEST_SUITE(AverageMaterials)
41 BOOST_CHECK(not slab.material());
42 BOOST_CHECK_EQUAL(slab.thickness(), 0.0f);
43 BOOST_CHECK_EQUAL(slab.thicknessInX0(), 0.0f);
44 BOOST_CHECK_EQUAL(slab.thicknessInL0(), 0.0f);
49 BOOST_CHECK(not slab.material());
50 BOOST_CHECK_EQUAL(slab.thickness(), 2.0f);
51 BOOST_CHECK_EQUAL(slab.thicknessInX0(), 0.0f);
52 BOOST_CHECK_EQUAL(slab.thicknessInL0(), 0.0f);
59 BOOST_CHECK(slab.material());
60 BOOST_CHECK_EQUAL(slab.material(), percent);
62 BOOST_CHECK_EQUAL(slab.thickness(), 2 * percent.thickness());
63 BOOST_CHECK_EQUAL(slab.thicknessInX0(), 2 * percent.thicknessInX0());
64 BOOST_CHECK_EQUAL(slab.thicknessInL0(), 2 * percent.thicknessInL0());
70 BOOST_CHECK(slab.material());
71 BOOST_CHECK_EQUAL(slab.material(), unit);
73 BOOST_CHECK_EQUAL(slab.thickness(), 2 * unit.thickness());
74 BOOST_CHECK_EQUAL(slab.thicknessInX0(), 2 * unit.thicknessInX0());
75 BOOST_CHECK_EQUAL(slab.thicknessInL0(), 2 * unit.thicknessInL0());
83 BOOST_CHECK(slab.material());
84 BOOST_CHECK_EQUAL(slab.material(), percent);
85 BOOST_CHECK_EQUAL(slab.thickness(), percent.thickness());
86 BOOST_CHECK_EQUAL(slab.thicknessInX0(), percent.thicknessInX0());
87 BOOST_CHECK_EQUAL(slab.thicknessInL0(), percent.thicknessInL0());
92 BOOST_CHECK(slab.material());
93 BOOST_CHECK_EQUAL(slab.material(), percent);
94 BOOST_CHECK_EQUAL(slab.thickness(), percent.thickness());
95 BOOST_CHECK_EQUAL(slab.thicknessInX0(), percent.thicknessInX0());
96 BOOST_CHECK_EQUAL(slab.thicknessInL0(), percent.thicknessInL0());
103 BOOST_CHECK(slab.material());
104 BOOST_CHECK_EQUAL(slab.material(), unit);
105 BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness());
106 BOOST_CHECK_EQUAL(slab.thicknessInX0(), unit.thicknessInX0());
107 BOOST_CHECK_EQUAL(slab.thicknessInL0(), unit.thicknessInL0());
112 BOOST_CHECK(slab.material());
113 BOOST_CHECK_EQUAL(slab.material(), unit);
114 BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness());
115 BOOST_CHECK_EQUAL(slab.thicknessInX0(), unit.thicknessInX0());
116 BOOST_CHECK_EQUAL(slab.thicknessInL0(), unit.thicknessInL0());
126 BOOST_CHECK(slab.material());
127 BOOST_CHECK_EQUAL(slab.material(), percent);
128 BOOST_CHECK_EQUAL(slab.thickness(), percent.thickness() + unit.thickness());
129 BOOST_CHECK_EQUAL(slab.thicknessInX0(),
130 percent.thicknessInX0() + unit.thicknessInX0());
131 BOOST_CHECK_EQUAL(slab.thicknessInL0(),
132 percent.thicknessInL0() + unit.thicknessInL0());
137 BOOST_CHECK(slab.material());
138 BOOST_CHECK_EQUAL(slab.material(), unit);
139 BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness() + percent.thickness());
140 BOOST_CHECK_EQUAL(slab.thicknessInX0(),
141 percent.thicknessInX0() + unit.thicknessInX0());
142 BOOST_CHECK_EQUAL(slab.thicknessInL0(),
143 percent.thicknessInL0() + unit.thicknessInL0());
153 BOOST_CHECK(slab.material());
154 BOOST_CHECK_EQUAL(slab.material(), unit);
155 BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness());
156 BOOST_CHECK_EQUAL(slab.thicknessInX0(), unit.thicknessInX0());
157 BOOST_CHECK_EQUAL(slab.thicknessInL0(), unit.thicknessInL0());
162 BOOST_CHECK(slab.material());
163 BOOST_CHECK_EQUAL(slab.material(), unit);
164 BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness());
165 BOOST_CHECK_EQUAL(slab.thicknessInX0(), unit.thicknessInX0());
166 BOOST_CHECK_EQUAL(slab.thicknessInL0(), unit.thicknessInL0());
178 BOOST_CHECK_EQUAL(slab.thickness(), 2.0f);
179 BOOST_CHECK_EQUAL(slab.thicknessInX0(), slabMat.thicknessInX0());
180 BOOST_CHECK_EQUAL(slab.thicknessInL0(), slabMat.thicknessInL0());
181 BOOST_CHECK(slab.material());
184 BOOST_CHECK_EQUAL(slab.material().Ar(), mat.Ar());
185 BOOST_CHECK_EQUAL(slab.material().Z(), mat.Z());
190 BOOST_CHECK_EQUAL(slab.material().molarDensity(),
191 0.5f * mat.molarDensity());
196 BOOST_CHECK(slab.material());
197 BOOST_CHECK_EQUAL(slab.thickness(), 2.0f);
198 BOOST_CHECK_EQUAL(slab.thicknessInX0(), slabMat.thicknessInX0());
199 BOOST_CHECK_EQUAL(slab.thicknessInL0(), slabMat.thicknessInL0());
202 BOOST_CHECK_EQUAL(slab.material().Ar(), mat.Ar());
203 BOOST_CHECK_EQUAL(slab.material().Z(), mat.Z());
208 BOOST_CHECK_EQUAL(slab.material().molarDensity(),
209 0.5f * mat.molarDensity());
222 BOOST_CHECK_EQUAL(slabMat0.thickness(), 0.5f);
223 BOOST_CHECK_EQUAL(slabMat0.thicknessInX0(), 0.5f);
224 BOOST_CHECK_EQUAL(slabMat0.thicknessInL0(), 0.5f);
225 BOOST_CHECK_EQUAL(slabMat1.thickness(), 1.0f);
226 BOOST_CHECK_EQUAL(slabMat1.thicknessInX0(), 0.5f);
227 BOOST_CHECK_EQUAL(slabMat1.thicknessInL0(), 0.5f);
231 BOOST_CHECK(slab.material());
232 BOOST_CHECK_EQUAL(slab.thickness(), 1.5f);
233 BOOST_CHECK_EQUAL(slab.thicknessInX0(), 1.0f);
234 BOOST_CHECK_EQUAL(slab.thicknessInL0(), 1.0f);
235 BOOST_CHECK_EQUAL(slab.material().X0(), 1.5f);
236 BOOST_CHECK_EQUAL(slab.material().L0(), 1.5f);
237 BOOST_CHECK_EQUAL(slab.material().Ar(), 3.0f);
238 BOOST_CHECK_EQUAL(slab.material().Z(), 7.0f);
239 BOOST_CHECK_EQUAL(slab.material().molarDensity(), 4.0f);
244 BOOST_CHECK(slab.material());
245 BOOST_CHECK_EQUAL(slab.thickness(), 1.5f);
246 BOOST_CHECK_EQUAL(slab.thicknessInX0(), 1.0f);
247 BOOST_CHECK_EQUAL(slab.thicknessInL0(), 1.0f);
248 BOOST_CHECK_EQUAL(slab.material().X0(), 1.5f);
249 BOOST_CHECK_EQUAL(slab.material().L0(), 1.5f);
250 BOOST_CHECK_EQUAL(slab.material().Ar(), 3.0f);
251 BOOST_CHECK_EQUAL(slab.material().Z(), 7.0f);
252 BOOST_CHECK_EQUAL(slab.material().molarDensity(), 4.0f);
256 BOOST_AUTO_TEST_SUITE_END()