From: Joel Holdsworth Date: Sat, 29 Sep 2012 09:11:18 +0000 (+0100) Subject: Made longpulses a 64-bit test X-Git-Tag: pulseview-0.1.0~291 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4f767cf7100023341f94fa9f0d1befc5101c3d6d;p=pulseview.git Made longpulses a 64-bit test --- diff --git a/test/logicdatasnapshot.cpp b/test/logicdatasnapshot.cpp index a8f8fd30..5041c1b3 100644 --- a/test/logicdatasnapshot.cpp +++ b/test/logicdatasnapshot.cpp @@ -342,16 +342,16 @@ BOOST_AUTO_TEST_CASE(LongPulses) //----- Create a LogicDataSnapshot -----// sr_datafeed_logic logic; - logic.unitsize = 1; + logic.unitsize = 8; logic.length = Length; - logic.data = (uint64_t*)new uint8_t[Length]; - uint8_t *p = (uint8_t*)logic.data; + logic.data = (uint64_t*)new uint64_t[Length]; + uint64_t *p = (uint64_t*)logic.data; for(int i = 0; i < Cycles; i++) { for(j = 0; j < PulseWidth; j++) - *p++ = 0xFF; + *p++ = ~0; for(j; j < Period; j++) - *p++ = 0x00; + *p++ = 0; } LogicDataSnapshot s(logic); @@ -368,14 +368,14 @@ BOOST_AUTO_TEST_CASE(LongPulses) for(j = 0; i < s._mip_map[0].length && j < 2; j++) { BOOST_TEST_MESSAGE( "Testing mip_map[0].data[" << i << "]"); - BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0xFF); + BOOST_CHECK_EQUAL(s.get_subsample(0, i++), ~0); } for(j; i < s._mip_map[0].length && j < Period/LogicDataSnapshot::MipMapScaleFactor; j++) { BOOST_TEST_MESSAGE( "Testing mip_map[0].data[" << i << "]"); - BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0x00); + BOOST_CHECK_EQUAL(s.get_subsample(0, i++), 0); } }