File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ The issue #16 changes its public member function. But it is referred internally
1414### Removed
1515### Fixed
1616- [ Issue #11 ] ( https://github.com/suikan4github/rpp_driver/issues/11 ) Fails to compile in MSVC.
17+ - [ Issue #17 ] ( https://github.com/suikan4github/rpp_driver/issues/17 ) The mock of the GpioBasic has the wrong definition.
1718### Security
1819### Known Issue
1920
Original file line number Diff line number Diff line change @@ -101,8 +101,10 @@ class GpioBasic {
101101};
102102#if __has_include(<gmock/gmock.h>)
103103// GCOVR_EXCL_START
104- class MockGpioBasic : public SdkWrapper {
104+ class MockGpioBasic : public GpioBasic {
105105 public:
106+ MockGpioBasic (SdkWrapper &sdk)
107+ : GpioBasic(sdk, 0 ) {}; // 0 is dummy. We don't care.
106108 MOCK_METHOD1 (SetDir, void (bool ));
107109 MOCK_METHOD1 (SetInputEnabled, void (bool ));
108110 MOCK_METHOD1 (Put, void (bool ));
Original file line number Diff line number Diff line change 1+ /*
2+ * Test the MockGpioBasic class.
3+ * Only constructor is tested.
4+ */
5+
6+ #include < gmock/gmock.h>
7+ #include < gtest/gtest.h>
8+
9+ #include " gpiobasic.hpp"
10+ #include " sdkwrapper.hpp"
11+
12+ class MockGpioBasicTest : public ::testing::Test {
13+ protected:
14+ virtual void SetUp () { gpio = new rpp_driver::MockGpioBasic (sdk_); }
15+
16+ virtual void TearDown () { delete gpio; }
17+
18+ ::rpp_driver::MockSdkWrapper sdk_;
19+ ::rpp_driver::MockGpioBasic *gpio;
20+ };
21+
22+ /*
23+ * In this test case, we test teh MockGpioBasic is surely able to compile.
24+ * So, none of the other methods are tested.
25+ */
26+ TEST_F (MockGpioBasicTest, constructor) {}
You can’t perform that action at this time.
0 commit comments