Skip to content
Snippets Groups Projects
Commit db3da657 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

moved the test completely to the new interface

parent 39967fdc
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@
#include "ScalarAccessor.h"
#include "ApplicationModule.h"
#include "DeviceModule.h"
using namespace boost::unit_test_framework;
namespace ctk = ChimeraTK;
......@@ -67,7 +68,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testTwoScalarPollPushAccessors, T, test_types ) {
TestApplication app;
TestModule<T> testModule;
testModule.consumingPush.consumeFromDevice("Dummy0","/MyModule/Variable", ctk::UpdateMode::poll);
ctk::DeviceModule dev{"Dummy0"};
dev("/MyModule/Variable") >> testModule.consumingPush;
try {
app.makeConnections();
BOOST_ERROR("Exception expected.");
......@@ -85,7 +88,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testNoFeeder, T, test_types ) {
TestApplication app;
TestModule<T> testModule;
testModule.consumingPush2.connectTo(testModule.consumingPush);
testModule.consumingPush2 >> testModule.consumingPush;
try {
app.makeConnections();
BOOST_ERROR("Exception expected.");
......@@ -104,7 +107,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testTwoFeeders, T, test_types ) {
TestModule<T> testModule;
try {
testModule.feedingPush.connectTo(testModule.feedingPush2);
testModule.feedingPush >> testModule.feedingPush2;
BOOST_ERROR("Exception expected.");
}
catch(ctk::ApplicationExceptionWithID<ctk::ApplicationExceptionID::illegalVariableNetwork> &e) {
......@@ -122,8 +125,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testTooManyPollingConsumers, T, test_types ) {
TestApplication app;
TestModule<T> testModule;
testModule.consumingPoll.consumeFromDevice("Dummy0","/MyModule/Variable", ctk::UpdateMode::poll);
testModule.consumingPoll.connectTo(testModule.consumingPoll2);
ctk::DeviceModule dev{"Dummy0"};
dev("/MyModule/Variable") >> testModule.consumingPoll >> testModule.consumingPoll2;
try {
app.makeConnections();
BOOST_ERROR("Exception expected.");
......
......@@ -17,6 +17,7 @@
#include "ScalarAccessor.h"
#include "ApplicationModule.h"
#include "DeviceModule.h"
using namespace boost::unit_test_framework;
namespace ctk = ChimeraTK;
......@@ -68,10 +69,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testTriggerPollFeederPushConsumer, T, test_types
TestApplication app;
TestModule<T> testModule;
testModule.feedingToDevice.feedToDevice("Dummy0","/MyModule/Variable");
ctk::DeviceModule dev{"Dummy0"};
testModule.consumingPush.consumeFromDevice("Dummy0","/MyModule/Variable", ctk::UpdateMode::poll);
testModule.consumingPush.addTrigger(testModule.theTrigger);
testModule.feedingToDevice >> dev("/MyModule/Variable");
dev("/MyModule/Variable") [ testModule.theTrigger ] >> testModule.consumingPush;
app.run();
// single theaded test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment