Skip to content

Commit 210ea9f

Browse files
tidy up code and fix warnings
1 parent c7f377b commit 210ea9f

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

test/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ ament_add_gtest(${PROJECT_NAME}_utest utest.cpp
2727
if(TARGET ${PROJECT_NAME}_utest)
2828
target_include_directories(${PROJECT_NAME}_utest
2929
PUBLIC "../include" ${console_bridge_INCLUDE_DIRS} ${Poco_INCLUDE_DIRS})
30-
target_link_libraries(${PROJECT_NAME}_utest ${PROJECT_NAME} ${Poco_LIBRARIES})
30+
target_link_libraries(${PROJECT_NAME}_utest
31+
${PROJECT_NAME}
32+
${Poco_LIBRARIES}
33+
)
3134
if(NOT WIN32)
3235
target_link_libraries(${PROJECT_NAME}_utest pthread)
3336
endif()
34-
add_dependencies(${PROJECT_NAME}_utest ${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME}_TestPlugins2)
37+
add_dependencies(${PROJECT_NAME}_utest
38+
${PROJECT_NAME}_TestPlugins1
39+
${PROJECT_NAME}_TestPlugins2)
3540
endif()
3641

3742
ament_add_gtest(${PROJECT_NAME}_unique_ptr_test unique_ptr_test.cpp

test/unique_ptr_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ TEST(ClassLoaderUniquePtrTest, nonExistentPlugin)
7575

7676
obj->saySomething();
7777
}
78-
catch(const class_loader::CreateClassException& e)
78+
catch(const class_loader::CreateClassException&)
7979
{
8080
SUCCEED();
8181
return;
@@ -126,7 +126,7 @@ TEST(ClassLoaderUniquePtrTest, threadSafety)
126126
ASSERT_FALSE(loader1.isLibraryLoaded());
127127

128128
}
129-
catch(const class_loader::ClassLoaderException& ex)
129+
catch(const class_loader::ClassLoaderException&)
130130
{
131131
FAIL() << "Unexpected ClassLoaderException.";
132132
}
@@ -173,7 +173,7 @@ TEST(ClassLoaderUniquePtrTest, loadRefCountingLazy)
173173

174174
return;
175175
}
176-
catch(const class_loader::ClassLoaderException& e)
176+
catch(const class_loader::ClassLoaderException&)
177177
{
178178
FAIL() << "Unexpected exception.\n";
179179
}

test/utest.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ TEST(ClassLoaderTest, nonExistentPlugin)
7474
}
7575

7676
obj->saySomething();
77-
} catch (const class_loader::CreateClassException & e) {
77+
} catch (const class_loader::CreateClassException &) {
7878
SUCCEED();
7979
return;
8080
} catch (...) {
@@ -88,7 +88,7 @@ TEST(ClassLoaderTest, nonExistentLibrary)
8888
{
8989
try {
9090
class_loader::ClassLoader loader1("libDoesNotExist.so", false);
91-
} catch (const class_loader::LibraryLoadException & e) {
91+
} catch (const class_loader::LibraryLoadException &) {
9292
SUCCEED();
9393
return;
9494
} catch (...) {
@@ -115,7 +115,7 @@ TEST(ClassLoaderTest, invalidBase)
115115
} else {
116116
FAIL() << "Class not available for correct base class.";
117117
}
118-
} catch (const class_loader::LibraryLoadException & e) {
118+
} catch (const class_loader::LibraryLoadException &) {
119119
FAIL() << "Unexpected exception";
120120
} catch (...) {
121121
FAIL() << "Unexpected and unknown exception caught.\n";
@@ -161,7 +161,7 @@ TEST(ClassLoaderTest, threadSafety)
161161
loader1.unloadLibrary();
162162
ASSERT_FALSE(loader1.isLibraryLoaded());
163163

164-
} catch (const class_loader::ClassLoaderException & ex) {
164+
} catch (const class_loader::ClassLoaderException &) {
165165
FAIL() << "Unexpected ClassLoaderException.";
166166
} catch (...) {
167167
FAIL() << "Unknown exception.";
@@ -194,7 +194,7 @@ TEST(ClassLoaderTest, loadRefCountingNonLazy)
194194
ASSERT_TRUE(loader1.isLibraryLoaded());
195195

196196
return;
197-
} catch (const class_loader::ClassLoaderException & e) {
197+
} catch (const class_loader::ClassLoaderException &) {
198198
FAIL() << "Unexpected exception.\n";
199199
} catch (...) {
200200
FAIL() << "Unknown exception caught.\n";
@@ -235,7 +235,7 @@ TEST(ClassLoaderTest, loadRefCountingLazy)
235235
ASSERT_TRUE(loader1.isLibraryLoaded());
236236

237237
return;
238-
} catch (const class_loader::ClassLoaderException & e) {
238+
} catch (const class_loader::ClassLoaderException &) {
239239
FAIL() << "Unexpected exception.\n";
240240
} catch (...) {
241241
FAIL() << "Unknown exception caught.\n";

0 commit comments

Comments
 (0)