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 #include "action_layer.h"
14 void set_time(uint32_t t);
15 void advance_time(uint32_t ms);
19 using testing::AnyNumber;
20 using testing::Return;
21 using testing::Between;
23 void TestFixture::SetUpTestCase() {
25 EXPECT_CALL(driver, send_keyboard_mock(_));
29 void TestFixture::TearDownTestCase() {
32 TestFixture::TestFixture() {
35 TestFixture::~TestFixture() {
39 // Run for a while to make sure all keys are completely released
40 EXPECT_CALL(driver, send_keyboard_mock(_)).Times(AnyNumber());
41 idle_for(TAPPING_TERM + 10);
42 testing::Mock::VerifyAndClearExpectations(&driver);
43 // Verify that the matrix really is cleared
44 EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(Between(0, 1));
47 void TestFixture::run_one_scan_loop() {
52 void TestFixture::idle_for(unsigned time) {
53 for (unsigned i=0; i<time; i++) {