File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,11 +167,12 @@ class MockAdau1361 : public Adau1361 {
167167 MockAdau1361 (Adau1361Lower& adau1361_lower)
168168 : Adau1361(48'000 , 12'000'000 , adau1361_lower) {
169169 } // with dummy fs and dummy mclock
170- MOCK_METHOD0 (GetStateMachine, uint32_t ( void ));
170+
171171 MOCK_METHOD0 (Start, void (void ));
172- MOCK_METHOD0 (Stop, void (void ));
173- MOCK_METHOD1 (PutFifoBlocking, void (int32_t value));
174- MOCK_METHOD0 (GetFifoBlocking, int32_t ());
172+ MOCK_METHOD3 (SetGain,
173+ void (CodecChannel channel, float left_gain, float right_gain));
174+ MOCK_METHOD2 (Mute, void (CodecChannel channel, bool mute));
175+ MOCK_METHOD1 (Mute, void (CodecChannel channel));
175176};
176177// GCOVR_EXCL_STOP
177178#endif // __has_include(<gmock/gmock.h>)
Original file line number Diff line number Diff line change 1+ /*
2+ * Test the MockAdau1361 class.
3+ * Only constructor is tested.
4+ */
5+
6+ #include < gmock/gmock.h>
7+ #include < gtest/gtest.h>
8+
9+ #include " adau1361.hpp"
10+ #include " sdkwrapper.hpp"
11+
12+ using ::testing::_;
13+ class MockAdau1361Test : public ::testing::Test {
14+ protected:
15+ virtual void SetUp () {
16+ codec_lower_ = new ::rpp_driver::MockAdau1361Lower (i2c_);
17+ codec_ = new ::rpp_driver::MockAdau1361 (*codec_lower_);
18+ }
19+
20+ virtual void TearDown () {
21+ delete codec_;
22+ delete codec_lower_;
23+ }
24+
25+ ::rpp_driver::MockI2cMasterInterface i2c_;
26+ ::rpp_driver::MockAdau1361Lower *codec_lower_;
27+ ::rpp_driver::Adau1361 *codec_;
28+ }; // MockAdau1361Test
29+
30+ /*
31+ * In this test case, we test teh MockAdau1361 is surely able to
32+ * compile. So, none of the other methods are tested.
33+ */
34+ TEST_F (MockAdau1361Test, Constructor) {}
You can’t perform that action at this time.
0 commit comments