Skip to content

Commit

Permalink
Suppress the warning of uninteresting call.
Browse files Browse the repository at this point in the history
The API call in the constructor and deconstructor are not watched.
Add EXPECT_CALL().
  • Loading branch information
suikan4github committed Oct 16, 2024
1 parent 12dfc1c commit 5654d33
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/test_mockgpiobasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
#include "gpiobasic.hpp"
#include "sdkwrapper.hpp"

using ::testing::_;
class MockGpioBasicTest : public ::testing::Test {
protected:
virtual void SetUp() { gpio = new rpp_driver::MockGpioBasic(sdk_); }
virtual void SetUp() {
EXPECT_CALL(sdk_, gpio_init(_));
gpio = new rpp_driver::MockGpioBasic(sdk_);
}

virtual void TearDown() { delete gpio; }
virtual void TearDown() {
EXPECT_CALL(sdk_, gpio_deinit(_));
delete gpio;
}

::rpp_driver::MockSdkWrapper sdk_;
::rpp_driver::MockGpioBasic *gpio;
Expand All @@ -23,4 +30,4 @@ class MockGpioBasicTest : public ::testing::Test {
* In this test case, we test teh MockGpioBasic is surely able to compile.
* So, none of the other methods are tested.
*/
TEST_F(MockGpioBasicTest, constructor) {}
TEST_F(MockGpioBasicTest, Constructor) {}

0 comments on commit 5654d33

Please # to comment.