BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]");
const uint8_t sample = (uint8_t)((i*16) >> 8);
- BOOST_CHECK_EQUAL(*((uint8_t*)s._mip_map[0].data + i++),
+ BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF,
prev_sample ^ sample);
prev_sample = sample;
for(int j = 1; i < s._mip_map[0].length && j < 16; j++)
{
BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]");
- BOOST_CHECK_EQUAL(*((uint8_t*)s._mip_map[0].data + i++), 0);
+ BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0);
}
}
const uint8_t expected = sample ^ prev_sample;
prev_sample = i;
- BOOST_CHECK_EQUAL(*((uint8_t*)s._mip_map[1].data + i),
- expected);
+ BOOST_CHECK_EQUAL(s.get_subsample(1, i) & 0xFF, expected);
}
// Check mip map level 2
const uint8_t expected = (sample ^ prev_sample) | 0x0F;
prev_sample = sample;
- BOOST_CHECK_EQUAL(*((uint8_t*)s._mip_map[2].data + i),
- expected);
+ BOOST_CHECK_EQUAL(s.get_subsample(2, i) & 0xFF, expected);
}
// Check mip map level 3
vector<LogicDataSnapshot::EdgePair> edges;
s.get_subsampled_edges(edges, 0, Length-1, 1, 7);
- BOOST_REQUIRE_EQUAL(edges.size(), 32);
- for(int i = 0; i < 31; i++)
+ BOOST_CHECK_EQUAL(edges.size(), 32);
+
+ for(int i = 0; i < edges.size() - 1; i++)
{
- BOOST_REQUIRE_EQUAL(edges[i].first, i * 32768);
- BOOST_REQUIRE_EQUAL(edges[i].second, i & 1);
+ BOOST_CHECK_EQUAL(edges[i].first, i * 32768);
+ BOOST_CHECK_EQUAL(edges[i].second, i & 1);
}
- BOOST_REQUIRE_EQUAL(edges[31].first, 999999);
+ BOOST_CHECK_EQUAL(edges[31].first, 999999);
}
BOOST_AUTO_TEST_SUITE_END()