MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

unit_tests/util/bit_range.cpp:12–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace osrm::util;
11
12BOOST_AUTO_TEST_CASE(bit_range_8bit_test)
13{
14 std::uint8_t value_1 = (1UL << 0) | (1UL << 1) | (1UL << 5) | (1UL << 7);
15 std::uint8_t value_2 = (1UL << 0);
16 std::uint8_t value_3 =
17 (1UL << 0) | (1UL << 1) | (1UL << 2) | (1UL << 3) | (1UL << 4) | (1UL << 5);
18
19 CHECK_EQUAL_RANGE(makeBitRange<std::uint8_t>(value_1), 7, 5, 1, 0);
20 CHECK_EQUAL_RANGE(makeBitRange<std::uint8_t>(value_2), 0);
21 CHECK_EQUAL_RANGE(makeBitRange<std::uint8_t>(value_3), 5, 4, 3, 2, 1, 0);
22
23 BOOST_CHECK_EQUAL(makeBitRange<std::uint8_t>(value_3).size(), 6);
24 BOOST_CHECK_EQUAL(makeBitRange<std::uint8_t>(0).size(), 0);
25}
26
27BOOST_AUTO_TEST_CASE(bit_range_16bit_test)
28{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected