Add testcases for rollover conditions on Keyboard HID keys

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1024/head
Michael Richters 4 years ago
parent 2073c4f855
commit a2f720e365
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -0,0 +1,27 @@
// -*- mode: c++ -*-
/* Kaleidoscope - Firmware for computer input devices
* Copyright (C) 2020 Keyboard.io, Inc.
*
* 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, version 3.
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <cstdint>
namespace kaleidoscope {
namespace testing {
} // namespace testing
} // namespace kaleidoscope

@ -0,0 +1,48 @@
/* -*- mode: c++ -*-
* Copyright (C) 2020 Keyboard.io, Inc.
*
* 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, version 3.
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include <Kaleidoscope.h>
#include "./common.h"
// *INDENT-OFF*
KEYMAPS(
[0] = KEYMAP_STACKED
(
LSHIFT(Key_A), LSHIFT(Key_B), LSHIFT(LCTRL(LALT(Key_X))), ___, ___, ___, ___,
Key_A, Key_B, ___, ___, ___, ___, ___,
Key_LeftShift, Key_RightShift, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___, ___,
___, ___, ___, ___,
___,
___, ___, ___, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___, ___,
___, ___, ___, ___,
___
),
)
// *INDENT-ON*
void setup() {
Kaleidoscope.setup();
}
void loop() {
Kaleidoscope.loop();
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:virtual:model01",
"port": ""
}
}

@ -0,0 +1,70 @@
VERSION 1
KEYSWITCH SFT_A 0 0
KEYSWITCH SFT_B 0 1
KEYSWITCH MEH_X 0 2
KEYSWITCH A 1 0
KEYSWITCH B 1 1
KEYSWITCH LSFT 2 0
KEYSWITCH RSFT 2 1
# ==============================================================================
NAME Key with modifier flag alone
RUN 4 ms
PRESS SFT_A
RUN 1 cycle
EXPECT keyboard-report Key_LeftShift # The report should contain `shift`
EXPECT keyboard-report Key_LeftShift Key_A # The report should contain `shift` + `A`
RUN 4 ms
RELEASE SFT_A
RUN 1 cycle
EXPECT keyboard-report Key_LeftShift # The report should contain `shift`
EXPECT keyboard-report empty # Report should be empty
RUN 5 ms
# ==============================================================================
NAME Key with multiple modifier flags alone
RUN 4 ms
PRESS MEH_X
RUN 1 cycle
EXPECT keyboard-report Key_LeftShift Key_LeftControl Key_LeftAlt # The report should contain three modifiers
EXPECT keyboard-report Key_LeftShift Key_LeftControl Key_LeftAlt Key_X # The report should add `X`
RUN 4 ms
RELEASE MEH_X
RUN 1 cycle
EXPECT keyboard-report Key_LeftShift Key_LeftControl Key_LeftAlt # The report should contain three modifiers
EXPECT keyboard-report empty # Report should be empty
RUN 5 ms
# ==============================================================================
NAME No mod flags to mod flags
RUN 4 ms
PRESS A
RUN 1 cycle
EXPECT keyboard-report Key_A # The report should contain `A`
RUN 4 ms
PRESS SFT_B
RUN 1 cycle
EXPECT keyboard-report Key_LeftShift Key_A # The report should contain `shift` + `A`
EXPECT keyboard-report Key_LeftShift Key_A Key_B # The report should contain `shift`, `A` & `B`
RUN 4 ms
RELEASE A
RUN 1 cycle
EXPECT keyboard-report Key_LeftShift Key_B # The report should contain `shift` + `B`
RUN 4 ms
RELEASE SFT_B
RUN 1 cycle
EXPECT keyboard-report Key_LeftShift # The report should contain `shift`
EXPECT keyboard-report empty # Report should be empty
RUN 5 ms
Loading…
Cancel
Save