@@ -120,9 +120,12 @@ TEST_F(RTDEClientTest, no_recipe)
120120 UrException);
121121
122122 // Only input recipe is unconfigured
123- EXPECT_THROW (
124- client_.reset (new rtde_interface::RTDEClient (g_ROBOT_IP, notifier_, output_recipe_file_, input_recipe_file)),
125- UrException);
123+ EXPECT_NO_THROW (
124+ client_.reset (new rtde_interface::RTDEClient (g_ROBOT_IP, notifier_, output_recipe_file_, input_recipe_file)));
125+
126+ EXPECT_THROW (client_.reset (new rtde_interface::RTDEClient (g_ROBOT_IP, notifier_, output_recipe_file_,
127+ " /i/do/not/exist/urclrtdetest.txt" )),
128+ UrException);
126129}
127130
128131TEST_F (RTDEClientTest, empty_recipe_file)
@@ -413,6 +416,48 @@ TEST_F(RTDEClientTest, check_unknown_rtde_output_variable)
413416 EXPECT_THROW (client_->init (), UrException);
414417}
415418
419+ TEST_F (RTDEClientTest, empty_input_recipe)
420+ {
421+ std::vector<std::string> empty_input_recipe = {};
422+ client_.reset (new rtde_interface::RTDEClient (g_ROBOT_IP, notifier_, resources_output_recipe_, empty_input_recipe));
423+ client_->init ();
424+ client_->start ();
425+
426+ // Test that we can receive and parse the timestamp from the received package to prove the setup was successful
427+ const std::chrono::milliseconds read_timeout{ 100 };
428+ std::unique_ptr<rtde_interface::DataPackage> data_pkg = client_->getDataPackage (read_timeout);
429+
430+ if (data_pkg == nullptr )
431+ {
432+ std::cout << " Failed to get data package from robot" << std::endl;
433+ GTEST_FAIL ();
434+ }
435+
436+ double timestamp;
437+ EXPECT_TRUE (data_pkg->getData (" timestamp" , timestamp));
438+
439+ EXPECT_FALSE (client_->getWriter ().sendStandardDigitalOutput (1 , false ));
440+
441+ client_->pause ();
442+
443+ client_.reset (new rtde_interface::RTDEClient (g_ROBOT_IP, notifier_, output_recipe_file_, " " ));
444+ client_->init ();
445+ client_->start ();
446+
447+ data_pkg = client_->getDataPackage (read_timeout);
448+
449+ if (data_pkg == nullptr )
450+ {
451+ std::cout << " Failed to get data package from robot" << std::endl;
452+ GTEST_FAIL ();
453+ }
454+ EXPECT_TRUE (data_pkg->getData (" timestamp" , timestamp));
455+
456+ EXPECT_FALSE (client_->getWriter ().sendStandardDigitalOutput (1 , false ));
457+
458+ client_->pause ();
459+ }
460+
416461int main (int argc, char * argv[])
417462{
418463 ::testing::InitGoogleTest (&argc, argv);
0 commit comments