diff options
| -rw-r--r-- | .clang-tidy | 1 | ||||
| -rw-r--r-- | test/internal/sdref.cpp | 7 | ||||
| -rw-r--r-- | test/source/base.cpp | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..f6ee139 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1 @@ +Checks: 'clang-analyzer-*' diff --git a/test/internal/sdref.cpp b/test/internal/sdref.cpp index 3b261d5..e8effa9 100644 --- a/test/internal/sdref.cpp +++ b/test/internal/sdref.cpp @@ -216,7 +216,14 @@ TEST_F(SdRefTest, MoveSelf) EXPECT_TRUE(event); EXPECT_EQ(expected_event, event.get()); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wself-move" +#endif event = std::move(event); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif EXPECT_TRUE(event); EXPECT_EQ(expected_event, event.get()); EXPECT_CALL(mock, sd_event_unref(expected_event)) diff --git a/test/source/base.cpp b/test/source/base.cpp index df855c1..75a6dde 100644 --- a/test/source/base.cpp +++ b/test/source/base.cpp @@ -327,7 +327,7 @@ TEST_F(BaseMethodTest, SetPrepareError) { EXPECT_CALL(mock, sd_event_source_set_prepare(expected_source, testing::_)) .WillOnce(Return(0)); - base->set_prepare(std::move([](Base&) {})); + base->set_prepare([](Base&) {}); EXPECT_TRUE(base->get_prepare()); Base::Callback callback = [](Base&) {}; @@ -342,7 +342,7 @@ TEST_F(BaseMethodTest, SetPrepareNull) { EXPECT_CALL(mock, sd_event_source_set_prepare(expected_source, testing::_)) .WillOnce(Return(0)); - base->set_prepare(std::move([](Base&) {})); + base->set_prepare([](Base&) {}); EXPECT_TRUE(base->get_prepare()); EXPECT_CALL(mock, sd_event_source_set_prepare(expected_source, nullptr)) |

