set(sigrok-qt2_TEST_SOURCES
test/test.cpp
+ datasnapshot.cpp
+ logicdatasnapshot.cpp
)
set(QT_USE_QTOPENGL TRUE)
target_link_libraries(sigrok-qt2-test
${Boost_LIBRARIES}
+ ${PKGDEPS_LIBRARIES}
+ ${QT_LIBRARIES}
)
enable_testing()
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
+
+#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);
+}