21 #include <gtest/gtest.h> 22 #include <gmock/gmock.h> 46 EXPECT_CALL(*testDriver, createDevice).Times(::testing::AtLeast(2));
47 std::list<std::string> deviceArgs1, deviceArgs2;
48 deviceArgs1.push_back(
"testDeviceArgs1");
49 daq_manager->loadDevice(
"testDeviceDriver", deviceArgs1);
50 deviceArgs2.push_back(
"testDeviceArgs2");
51 daq_manager->loadDevice(
"testDeviceDriver", deviceArgs2);
54 std::list<std::string> deviceArgs3;
55 deviceArgs3.push_back(
"missingDriver");
56 daq_manager->loadDevice(
"missingDriver", deviceArgs3);
57 EXPECT_THAT(cerr_buffer.str(), ::testing::HasSubstr(
"does not exist"));
62 EXPECT_THAT(cerr_buffer.str(), ::testing::HasSubstr(
"Driver already registered"));
65 delete anotherTestDriver;
74 "INPUT CHANNEL DESCRIPTION",
79 "OUTPUT CHANNEL DESCRIPTION",
82 std::vector<IO::channel_t *> channelList;
83 std::vector<MockDAQDevice *> deviceList;
85 for(
int i = 0; i < 5; ++i)
88 channelList[i][0] = inputchannel;
89 channelList[i][1] = outputchannel;
90 deviceList.push_back(
new MockDAQDevice(std::to_string(i), channelList[i], (
size_t) 2));
93 for(
auto it = deviceList.begin(); it != deviceList.end(); ++it)
95 EXPECT_CALL(**it, getChannelCount).Times(::testing::AtLeast(1));
98 daq_manager->foreachDevice(callback, &deviceList);
99 for(
int i = 0; i < 5; ++i)
101 delete[] channelList[i];
102 delete deviceList[i];