From: Soeren Apel Date: Sun, 7 Jan 2018 20:48:54 +0000 (+0100) Subject: Fix unit tests X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=83c59147c7a7cfd34df1e26466c2b8a15b299139;p=pulseview.git Fix unit tests --- diff --git a/test/data/segment.cpp b/test/data/segment.cpp index c3c0d1b5..74aed950 100644 --- a/test/data/segment.cpp +++ b/test/data/segment.cpp @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_SUITE(SegmentTest) /* --- For debugging only BOOST_AUTO_TEST_CASE(SmallSize8Single) { - Segment s(1, sizeof(uint8_t)); + Segment s(0, 1, sizeof(uint8_t)); uint32_t num_samples = 10; //----- Chunk size << pv::data::Segment::MaxChunkSize @ 8bit, added in 1 call ----// @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(SmallSize8Single) /* --- For debugging only BOOST_AUTO_TEST_CASE(MediumSize8Single) { - Segment s(1, sizeof(uint8_t)); + Segment s(0, 1, sizeof(uint8_t)); uint32_t num_samples = pv::data::Segment::MaxChunkSize; //----- Chunk size == pv::data::Segment::MaxChunkSize @ 8bit, added in 1 call ----// @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(MediumSize8Single) /* --- For debugging only BOOST_AUTO_TEST_CASE(MaxSize8Single) { - Segment s(1, sizeof(uint8_t)); + Segment s(0, 1, sizeof(uint8_t)); // We want to see proper behavior across chunk boundaries uint32_t num_samples = 2*pv::data::Segment::MaxChunkSize; @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(MaxSize8Single) /* --- For debugging only BOOST_AUTO_TEST_CASE(MediumSize24Single) { - Segment s(1, 3); + Segment s(0, 1, 3); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = pv::data::Segment::MaxChunkSize / 3; @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(MediumSize24Single) /* --- For debugging only BOOST_AUTO_TEST_CASE(MediumSize32Single) { - Segment s(1, sizeof(uint32_t)); + Segment s(0, 1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = pv::data::Segment::MaxChunkSize / sizeof(uint32_t); @@ -162,7 +162,7 @@ BOOST_AUTO_TEST_CASE(MediumSize32Single) /* --- For debugging only BOOST_AUTO_TEST_CASE(MaxSize32Single) { - Segment s(1, sizeof(uint32_t)); + Segment s(0, 1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size // Also, we want to see proper behavior across chunk boundaries @@ -189,7 +189,7 @@ BOOST_AUTO_TEST_CASE(MaxSize32Single) /* --- For debugging only BOOST_AUTO_TEST_CASE(MediumSize32Multi) { - Segment s(1, sizeof(uint32_t)); + Segment s(0, 1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = pv::data::Segment::MaxChunkSize / sizeof(uint32_t); @@ -213,7 +213,7 @@ BOOST_AUTO_TEST_CASE(MediumSize32Multi) BOOST_AUTO_TEST_CASE(MaxSize32Multi) { - Segment s(1, sizeof(uint32_t)); + Segment s(0, 1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = 2*(pv::data::Segment::MaxChunkSize / sizeof(uint32_t)); @@ -242,7 +242,7 @@ BOOST_AUTO_TEST_CASE(MaxSize32Multi) BOOST_AUTO_TEST_CASE(MaxSize32MultiAtOnce) { - Segment s(1, sizeof(uint32_t)); + Segment s(0, 1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = 3*(pv::data::Segment::MaxChunkSize / sizeof(uint32_t)); @@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE(MaxSize32MultiAtOnce) BOOST_AUTO_TEST_CASE(MaxSize32MultiIterated) { - Segment s(1, sizeof(uint32_t)); + Segment s(0, 1, sizeof(uint32_t)); // Chunk size is num*unit_size, so with pv::data::Segment::MaxChunkSize/unit_size, we reach the maximum size uint32_t num_samples = 2*(pv::data::Segment::MaxChunkSize / sizeof(uint32_t));