MCPcopy Create free account
hub / github.com/boostorg/histogram / main

Function main

test/adaptive_storage_test.cpp:290–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290int main() {
291 // low-level tools
292 {
293 uint8_t c = 0;
294 BOOST_TEST_EQ(detail::safe_increase(c), true);
295 BOOST_TEST_EQ(c, 1);
296 c = 255;
297 BOOST_TEST_EQ(detail::safe_increase(c), false);
298 BOOST_TEST_EQ(c, 255);
299 BOOST_TEST_EQ(detail::safe_assign(c, 255), true);
300 BOOST_TEST_EQ(detail::safe_assign(c, 256), false);
301 BOOST_TEST_EQ(c, 255);
302 c = 0;
303 BOOST_TEST_EQ(detail::safe_radd(c, 255), true);
304 BOOST_TEST_EQ(c, 255);
305 c = 1;
306 BOOST_TEST_EQ(detail::safe_radd(c, 255), false);
307 BOOST_TEST_EQ(c, 1);
308 c = 255;
309 BOOST_TEST_EQ(detail::safe_radd(c, 1), false);
310 BOOST_TEST_EQ(c, 255);
311 }
312
313 // empty state
314 {
315 adaptive_storage_type a;
316 BOOST_TEST_EQ(a.size(), 0);
317 }
318
319 // copy
320 {
321 copy_impl<detail::wcount>();
322 copy_impl<void>();
323 copy_impl<uint8_t>();
324 copy_impl<uint16_t>();
325 copy_impl<uint32_t>();
326 copy_impl<uint64_t>();
327 copy_impl<detail::mp_int>();
328 }
329
330 // equal_operator
331 {
332 equal_impl<void>();
333 equal_impl<uint8_t>();
334 equal_impl<uint16_t>();
335 equal_impl<uint32_t>();
336 equal_impl<uint64_t>();
337 equal_impl<detail::mp_int>();
338 equal_impl<detail::wcount>();
339 }
340
341 // increase_and_grow
342 {
343 increase_and_grow_impl<void>();
344 increase_and_grow_impl<uint8_t>();
345 increase_and_grow_impl<uint16_t>();
346 increase_and_grow_impl<uint32_t>();
347 increase_and_grow_impl<uint64_t>();

Callers

nothing calls this directly

Calls 9

safe_increaseFunction · 0.85
safe_assignFunction · 0.85
safe_raddFunction · 0.85
weightFunction · 0.85
sizeMethod · 0.45
valueMethod · 0.45
increaseMethod · 0.45
addMethod · 0.45
varianceMethod · 0.45

Tested by

no test coverage detected