This is closer to a real-world scenario than the QueueLeaker plugin testcase.
It doesn't test the bug as deliberately, but it shows the failure of Qukeys
prior to the fix.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
`KeyAddrEventQueue::remove()` fails to confirm that the current queue is empty
before decrementing the length and shifting entries in the queue arrays. If
`remove()` or `shift()` is called when the queue is empty, `length_` gets
decremented from 0 to 255 (because it's unsigned), and then a large section of
memory gets shifted, mostly out of bounds of the event queue arrays, and
probably wreaking havoc with any number of things.
The plugin in this testcase should trigger this bug, and is detectable because
it affects the value for the current time. It's not guaranteed to detect this
bug, but it seems to be fairly consistent.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
This is a demonstration that another plugin can use the new public OneShot
methods to turn a non-OneShot key into a OneShot.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
OneShot keys should apply to all the key events generated by a Macros key, not
just the first one, even if the Macros key is injected by TapDance.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
Now that the timeout checker has been fixed, we need to remove the extra 1
millisecond from testcases that verify timeouts.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
With a non-zero default for tap-repeat, the timing of events changed, causing
this testcase to fail.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
The new items have been added to the end of the list (before `SAFE_START`),
where they belong.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
This testcase checks for any changes to existing values in Kaleidoscope-Ranges,
with the goal of preventing backwards-incompatible changes that will affect
existing EEPROM keymaps configured via Chrysalis.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
class for each generated test file. removing
this makes test definitions simpler
Also, grow support for multiple tests within a script
Signed-off-by: Jesse Vincent <jesse@keyboard.io>
This adds a test to check that `Layer.isActive(0)` should return true, without
explicitly activating layer 0. At the moment, this is not the case, and the test
will fail.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
This test runs multiple keypresses in the same cycle, and checks to see that the
last report generated contains the correct active keycodes (and no others).
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
This adds a googletest-based test harness (with googletest pulled into
`testing/googletest`, so we have a fixed state of it), and a few test
cases that demonstrate its use.
Original work by Eric Paniagua in #898, with minor cleanups by Gergely
Nagy.
Signed-off-by: Eric Paniagua <epaniagua@google.com>
Signed-off-by: Gergely Nagy <algernon@keyboard.io>