From 1787a66d37a2ac7c8ffbb2e1cb2d1ef4d4c31e31 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Thu, 11 Oct 2018 15:22:42 +0200 Subject: [PATCH] fix compiler warnings --- core/test/test_container.cpp | 10 +++++----- core/test/test_stage.cpp | 4 ++-- .../motion_planning_tasks/test/test_task_model.cpp | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/test/test_container.cpp b/core/test/test_container.cpp index cc99d9fd..919963fe 100644 --- a/core/test/test_container.cpp +++ b/core/test/test_container.cpp @@ -457,13 +457,13 @@ TEST(Task, move) { Task t1("foo"); t1.add(std::make_unique()); t1.add(std::make_unique()); - EXPECT_EQ(t1.stages()->numChildren(), 2); + EXPECT_EQ(t1.stages()->numChildren(), 2u); Task t2 = std::move(t1); - EXPECT_EQ(t2.stages()->numChildren(), 2); - EXPECT_EQ(t1.stages()->numChildren(), 0); + EXPECT_EQ(t2.stages()->numChildren(), 2u); + EXPECT_EQ(t1.stages()->numChildren(), 0u); t1 = std::move(t2); - EXPECT_EQ(t1.stages()->numChildren(), 2); - EXPECT_EQ(t2.stages()->numChildren(), 0); + EXPECT_EQ(t1.stages()->numChildren(), 2u); + EXPECT_EQ(t2.stages()->numChildren(), 0u); } diff --git a/core/test/test_stage.cpp b/core/test/test_stage.cpp index cca39e3b..b37a19e4 100644 --- a/core/test/test_stage.cpp +++ b/core/test/test_stage.cpp @@ -49,11 +49,11 @@ TEST(Stage, registerCallbacks) { auto it = g.addSolutionCallback(cb); g.compute(); - EXPECT_EQ(called, 1); + EXPECT_EQ(called, 1u); g.removeSolutionCallback(it); g.compute(); - EXPECT_EQ(called, 1); + EXPECT_EQ(called, 1u); } TEST(ComputeIK, init) { diff --git a/visualization/motion_planning_tasks/test/test_task_model.cpp b/visualization/motion_planning_tasks/test/test_task_model.cpp index 672bad00..512577fb 100644 --- a/visualization/motion_planning_tasks/test/test_task_model.cpp +++ b/visualization/motion_planning_tasks/test/test_task_model.cpp @@ -76,7 +76,7 @@ protected: void validate(QAbstractItemModel& model, const std::initializer_list &expected) { // validate root index - ASSERT_EQ(model.rowCount(), expected.size()); + ASSERT_EQ(model.rowCount(), static_cast(expected.size())); EXPECT_EQ(model.columnCount(), 3); EXPECT_EQ(model.parent(QModelIndex()), QModelIndex()); @@ -84,15 +84,15 @@ protected: auto it = expected.begin(); for (size_t row = 0; row < expected.size(); ++row, ++it) { QModelIndex idx = model.index(row, 0); - EXPECT_EQ(idx.row(), row); + EXPECT_EQ(idx.row(), static_cast(row)); EXPECT_EQ(idx.column(), 0); EXPECT_EQ(idx.model(), &model); EXPECT_EQ(model.parent(idx), QModelIndex()); // validate data EXPECT_STREQ(model.data(idx).toByteArray().constData(), *it); - EXPECT_EQ(model.data(model.index(row, 1)).toUInt(), 0); - EXPECT_EQ(model.data(model.index(row, 2)).toUInt(), 0); + EXPECT_EQ(model.data(model.index(row, 1)).toUInt(), 0u); + EXPECT_EQ(model.data(model.index(row, 2)).toUInt(), 0u); // validate children ASSERT_EQ(model.rowCount(idx), children);