| 102 | } |
| 103 | |
| 104 | void incrementSingleIteration(unsigned seed) |
| 105 | { |
| 106 | unsigned next = seed + 1; |
| 107 | |
| 108 | FixedHash<4> h1(seed); |
| 109 | FixedHash<4> h2 = h1; |
| 110 | FixedHash<4> h3(next); |
| 111 | |
| 112 | FixedHash<32> hh1(seed); |
| 113 | FixedHash<32> hh2 = hh1; |
| 114 | FixedHash<32> hh3(next); |
| 115 | |
| 116 | BOOST_CHECK_EQUAL(++h2, h3); |
| 117 | BOOST_CHECK_EQUAL(++hh2, hh3); |
| 118 | |
| 119 | BOOST_CHECK(h2 > h1); |
| 120 | BOOST_CHECK(hh2 > hh1); |
| 121 | |
| 122 | unsigned reverse1 = ((FixedHash<4>::Arith)h2).convert_to<unsigned>(); |
| 123 | unsigned reverse2 = ((FixedHash<32>::Arith)hh2).convert_to<unsigned>(); |
| 124 | |
| 125 | BOOST_CHECK_EQUAL(next, reverse1); |
| 126 | BOOST_CHECK_EQUAL(next, reverse2); |
| 127 | } |
| 128 | |
| 129 | BOOST_AUTO_TEST_CASE(FixedHashIncrement) |
| 130 | { |
no outgoing calls
no test coverage detected