From c6013ca7dd2aaf5d3de86c92c916457ffd330cc0 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sun, 13 Jan 2013 19:24:31 +0000 Subject: [PATCH] Added Sixteen test case This test case is a replica of sixteen.sr attached to the Bug #33 --- test/data/logicsnapshot.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/data/logicsnapshot.cpp b/test/data/logicsnapshot.cpp index 3e3ff2f9..67321c86 100644 --- a/test/data/logicsnapshot.cpp +++ b/test/data/logicsnapshot.cpp @@ -509,4 +509,28 @@ BOOST_AUTO_TEST_CASE(WideData) delete [] data; } +/* + * This test is a replica of sixteen.sr attached to Bug #33. + */ +BOOST_AUTO_TEST_CASE(Sixteen) +{ + const int Length = 8; + uint16_t data[Length]; + + sr_datafeed_logic logic; + logic.unitsize = sizeof(data[0]); + logic.length = Length * sizeof(data[0]); + logic.data = data; + + for(int i = 0; i < Length; i++) + data[i] = 0xFFFE; + + LogicSnapshot s(logic); + + vector edges; + s.get_subsampled_edges(edges, 0, 2, 0.0004, 1); + + BOOST_CHECK_EQUAL(edges.size(), 2); +} + BOOST_AUTO_TEST_SUITE_END() -- 2.30.2