From 67f722c9c8cb077b946dfb2b6a3b538e37f3aa8c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 2 Jul 2017 21:46:35 +0300 Subject: Configure vscode file associations, use hpp instead of h --- tests/test_common/test_fixture.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/test_common/test_fixture.hpp (limited to 'tests/test_common/test_fixture.hpp') diff --git a/tests/test_common/test_fixture.hpp b/tests/test_common/test_fixture.hpp new file mode 100644 index 000000000..4146b682b --- /dev/null +++ b/tests/test_common/test_fixture.hpp @@ -0,0 +1,30 @@ +/* Copyright 2017 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #pragma once + +#include "gtest/gtest.h" + +class TestFixture : public testing::Test { +public: + TestFixture(); + ~TestFixture(); + static void SetUpTestCase(); + static void TearDownTestCase(); + + void run_one_scan_loop(); + void idle_for(uint ms); +}; \ No newline at end of file -- cgit v1.2.3 From 78545b95090816767bf3e17c4745bb0c3db01a5f Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 11 Jul 2017 19:41:04 +0300 Subject: Fix unreferenced errors with mingw compiler and unit tests --- quantum/keymap_common.c | 1 - tests/basic/keymap.c | 5 ++++- tests/test_common/matrix.c | 3 +++ tests/test_common/test_fixture.cpp | 4 ++-- tests/test_common/test_fixture.hpp | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) (limited to 'tests/test_common/test_fixture.hpp') diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index b1460c53c..1c522e8b8 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -169,7 +169,6 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) } // translates key to keycode -__attribute__ ((weak)) uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { // Read entire word (16bits) diff --git a/tests/basic/keymap.c b/tests/basic/keymap.c index 3274f213f..3f97c0a0e 100644 --- a/tests/basic/keymap.c +++ b/tests/basic/keymap.c @@ -40,4 +40,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } } return MACRO_NONE; -}; \ No newline at end of file +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { +} \ No newline at end of file diff --git a/tests/test_common/matrix.c b/tests/test_common/matrix.c index 0d9fa68b0..4b501039b 100644 --- a/tests/test_common/matrix.c +++ b/tests/test_common/matrix.c @@ -58,3 +58,6 @@ void release_key(uint8_t col, uint8_t row) { void clear_all_keys(void) { memset(matrix, 0, sizeof(matrix)); } + +void led_set(uint8_t usb_led) { +} diff --git a/tests/test_common/test_fixture.cpp b/tests/test_common/test_fixture.cpp index df57338df..4084ee9c6 100644 --- a/tests/test_common/test_fixture.cpp +++ b/tests/test_common/test_fixture.cpp @@ -44,8 +44,8 @@ void TestFixture::run_one_scan_loop() { advance_time(1); } -void TestFixture::idle_for(uint time) { - for (uint i=0; i