30 #include <gtest/gtest.h>
36 TEST(PluginlibTest, unknownPlugin) {
41 TEST(PluginlibTest, misspelledPlugin) {
46 TEST(PluginlibTest, invalidPackage) {
52 TEST(PluginlibTest, brokenPlugin) {
57 TEST(PluginlibTest, workingPlugin) {
62 foo->initialize(10.0);
63 EXPECT_EQ(100.0, foo->result());
65 FAIL() <<
"Throwing exception: " << ex.what();
68 FAIL() <<
"Uncaught exception";
72 TEST(PluginlibTest, createUnmanagedInstanceAndUnloadLibrary) {
73 ROS_INFO(
"Making the ClassLoader...");
82 ROS_INFO(
"Checking if plugin is loaded with isClassLoaded...");
86 FAIL() <<
"Library containing class should be loaded but isn't.";
88 ROS_INFO(
"Trying to unload class with unloadLibraryForClass...");
92 FAIL() <<
"Could not unload library when I should be able to.";
97 TEST(PluginlibTest, createManagedInstanceAndUnloadLibrary) {
98 ROS_INFO(
"Making the ClassLoader...");
101 ROS_INFO(
"Instantiating plugin...");
106 ROS_INFO(
"Checking if plugin is loaded with isClassLoaded...");
110 FAIL() <<
"Library containing class should be loaded but isn't.";
113 ROS_INFO(
"Trying to unload class with unloadLibraryForClass...");
117 FAIL() <<
"Could not unload library when I should be able to.";
122 TEST(PluginlibTest, brokenXML) {
132 ADD_FAILURE() <<
"Didn't throw exception as expected";
136 int main(
int argc,
char ** argv)
138 testing::InitGoogleTest(&argc, argv);
139 return RUN_ALL_TESTS();