Skip to content

Commit 5654d33

Browse files
committed
Suppress the warning of uninteresting call.
The API call in the constructor and deconstructor are not watched. Add EXPECT_CALL().
1 parent 12dfc1c commit 5654d33

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

test/test_mockgpiobasic.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99
#include "gpiobasic.hpp"
1010
#include "sdkwrapper.hpp"
1111

12+
using ::testing::_;
1213
class MockGpioBasicTest : public ::testing::Test {
1314
protected:
14-
virtual void SetUp() { gpio = new rpp_driver::MockGpioBasic(sdk_); }
15+
virtual void SetUp() {
16+
EXPECT_CALL(sdk_, gpio_init(_));
17+
gpio = new rpp_driver::MockGpioBasic(sdk_);
18+
}
1519

16-
virtual void TearDown() { delete gpio; }
20+
virtual void TearDown() {
21+
EXPECT_CALL(sdk_, gpio_deinit(_));
22+
delete gpio;
23+
}
1724

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

0 commit comments

Comments
 (0)