1 #include "test_fixture.hpp"
2 #include "gmock/gmock.h"
3 #include "test_driver.hpp"
4 #include "test_matrix.h"
7 #include "action_tapping.h"
10 void set_time(uint32_t t);
11 void advance_time(uint32_t ms);
15 using testing::AnyNumber;
16 using testing::Return;
17 using testing::Between;
19 void TestFixture::SetUpTestCase() {
21 EXPECT_CALL(driver, send_keyboard_mock(_));
25 void TestFixture::TearDownTestCase() {
28 TestFixture::TestFixture() {
31 TestFixture::~TestFixture() {
34 // Run for a while to make sure all keys are completely released
35 EXPECT_CALL(driver, send_keyboard_mock(_)).Times(AnyNumber());
36 idle_for(TAPPING_TERM + 10);
37 testing::Mock::VerifyAndClearExpectations(&driver);
38 // Verify that the matrix really is cleared
39 EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(Between(0, 1));
42 void TestFixture::run_one_scan_loop() {
47 void TestFixture::idle_for(unsigned time) {
48 for (unsigned i=0; i<time; i++) {