From: Joel Holdsworth Date: Sun, 15 Jul 2012 16:08:21 +0000 (+0100) Subject: Initial tests for LogicDataSnapshot X-Git-Tag: pulseview-0.1.0~318 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4780b4c82daf8e6d0386411d333967782bf52d8c;p=pulseview.git Initial tests for LogicDataSnapshot --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 445cb630..e0edfbc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,8 @@ set(sigrok-qt2_RESOURCES set(sigrok-qt2_TEST_SOURCES test/test.cpp + datasnapshot.cpp + logicdatasnapshot.cpp ) set(QT_USE_QTOPENGL TRUE) @@ -92,6 +94,8 @@ add_executable(sigrok-qt2-test target_link_libraries(sigrok-qt2-test ${Boost_LIBRARIES} + ${PKGDEPS_LIBRARIES} + ${QT_LIBRARIES} ) enable_testing() diff --git a/test/test.cpp b/test/test.cpp index 2c278c04..acb3c963 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -20,3 +20,18 @@ #define BOOST_TEST_MAIN #include + +#include "../logicdatasnapshot.h" + +BOOST_AUTO_TEST_CASE(LogicDataSnapshotTest) +{ + // Create an empty LogicDataSnapshot object + sr_datafeed_logic logic; + logic.length = 0; + logic.unitsize = 1; + logic.data = NULL; + + LogicDataSnapshot s(logic); + + BOOST_CHECK(s.get_sample_count() == 0); +}