Marc Durdin
a03eb37f6d
Update km_kbp_context_api.cpp
2020-02-10 13:58:10 +11:00
Marc Durdin
2159302620
fix(common/core): buffer overrun in context api
...
A static buffer for UTF-8 encoded characters used in debugging and test
logs did not provide enough space for SMP characters (require 6 bytes
rather than 4). This was used only for test cases and not in production
code -- outputting JSON text.
This should fix the failing keyboardprocessor test builds on Windows and
macOS.
2020-02-10 13:58:09 +11:00
Darcy Wong
ca5445dc19
chore(common): Add comments to tests
...
Fix comments per review
2020-02-10 09:33:21 +07:00
Darcy
ddcf601954
fix(common): Update kmp.json test file
2020-02-07 15:29:52 +07:00
Darcy
181b9959c7
fix(common): Fix window when setting context buffer
...
Fix adjustment of context buffer when buffer is full. This also accounts for deadkey or surrogate pairs.
* Also added 3 meson unit tests
2020-02-07 14:59:09 +07:00
Darcy
d127f08bed
chore(common): Manually add kmx
2020-02-06 16:51:05 +07:00
Darcy Wong
704c6d8dbd
fix(common): Adjust test keyboard
...
Using numbers so debugging context will be clearer
2020-02-06 16:50:03 +07:00
Darcy
21246a516d
fix(common): Add unit test for testing long context (>= 64 chars)
...
Reproduces issue #2575 with a keyboardprcoessor unit test.
* Also fix build warning in `kmx_options.cpp` where unsigned int `idx` is always `>= 0`
2020-02-06 11:12:30 +07:00
Tim Eves
79060a36c6
Use more generic preprocessor macro 64bit
...
__x86_64__ is only for Intel __LP64__ and _LP64 are for any arch that has 64bit `long int` and pointers, and 32bit `int` same as Intel.
2019-02-26 11:40:44 +07:00
Joshua A. Horton
ba769e67c3
Merge branch 'beta' into p5s2-merge
2019-02-04 21:02:15 +07:00
Tim Eves
5429037179
Fix bug #1494 potential for buffer overrun
...
The get/put routines now require the buffer size remaining to be read/written to permit checking and the iterator will update this value whenever iterator comparisions are made. Other direct uses of get/put have been updated.
2019-01-17 17:12:42 +07:00
Tim Eves
a441321cf5
Newer compilers are complaining about catching std::exception derived class by value, this fixes that.
2019-01-14 09:44:43 +07:00
Daniel Glassey
c71677f9a8
Merge pull request #1477 from keymanapp/common-keyboardprocessor-xenial
...
[common][linux] keyboardprocessor on xenial
2019-01-04 10:59:26 +07:00
glasseyes
30be8a13a1
add comment about meson for kmcomp.found
2019-01-03 16:31:40 +07:00
glasseyes
8558a22144
xenial doesn't like files in args
...
Error message is:
"Command line arguments must be strings, files or targets"
even though the arguments are files()
2019-01-03 15:57:18 +07:00
Tim Eves
a9512c206a
Spevify meson project_version and libtool version number separately.
...
Set the default project version to 11.0.0
2019-01-03 14:52:06 +07:00
glasseyes
50c325b0ad
ignore alphas in d/watch
...
set tier for launchpad.sh to get SHA256SUMS from right place
2019-01-03 12:57:02 +07:00
Tim Eves
0514304076
Fix double staged option tests 035 & 036 test correct expected values
2018-12-19 12:36:16 +07:00
Tim Eves
2f2254ddca
km_kbp_state_options_update should set the persisted cache copy as well.
2018-12-19 12:35:08 +07:00
Tim Eves
da815eb92e
Fix use-after0free in abstract_processor::lookup_option() design
...
Since option was not assigned to non temporary storage the string was deleted and caused the API to return freed memory.
2018-12-19 12:15:24 +07:00
Tim Eves
f8f1407fb8
Rfactor options out of class state into virtual methods on abstract_processor
2018-12-19 11:20:28 +07:00
Marc Durdin
8e73a4d729
[Common] Update tests to validate that option persist actions are correctly handled.
2018-12-19 10:45:56 +11:00
Tim Eves
d2e9ef9d49
Enable test support for PERSIST action.
2018-12-18 18:54:06 +07:00
Tim Eves
dfcedcdb6c
Merge branch 'master' into common-refactor-actions-options
2018-12-18 17:27:31 +07:00
Tim Eves
02e2350a43
Merge pull request #1437 from keymanapp/common-refactor-processor-init
...
[wip] [Common] refactor processor init
2018-12-18 17:10:57 +07:00
Tim Eves
ed8799dbbb
Fix FTBFS bug on Windows
2018-12-18 17:03:36 +07:00
Tim Eves
f3474dbaa5
Tidy up KMX_Option a bit and add persist action queuing to Save()
2018-12-18 16:39:07 +07:00
glasseyes
7e1c076079
put test back and make is use L and R keys
2018-12-18 12:50:41 +07:00
glasseyes
65457bd603
remove test for generic CTRL and ALT
...
which shouldn't be used for input
2018-12-18 12:06:00 +07:00
Tim Eves
86eafe9391
Merge pull request #1427 from keymanapp/common-refactor-path
...
[Common] refactor path
2018-12-18 10:39:46 +07:00
Tim Eves
6c98983155
Implement keyboard option saving test case
2018-12-18 10:16:59 +07:00
Tim Eves
9a991f9abc
More tidy ups
2018-12-18 10:16:04 +07:00
Tim Eves
a1766f5405
Enable new kmx tests
2018-12-18 09:45:41 +07:00
Tim Eves
cf28753737
Add extra kmx test keyboards to exercise option processing better
...
Thanks to @mcdurdin for creating those
2018-12-18 09:11:07 +07:00
glasseyes
416aaec057
rename new tests to 038, 039
2018-12-18 08:41:21 +07:00
Tim Eves
57b01ad640
Implement new state API using existing machinery.
2018-12-18 08:39:37 +07:00
Tim Eves
568f1ebcd5
Fix state-api test to use action_item == operator and refactor test build script
2018-12-17 23:41:35 +07:00
Tim Eves
29a5fa6d2e
Add more convert function use, psuh_persist actions and various tidy-ups
2018-12-17 23:40:44 +07:00
Tim Eves
8598daa447
Remove vkey and erased members of action_items union
2018-12-17 23:30:07 +07:00
Tim Eves
0bf44af891
Whitespace, warnings and header tidy ups
2018-12-17 23:28:59 +07:00
Tim Eves
fbecf51a1a
Refactor direct access to actions context lists with objects and smart push methods
2018-12-17 23:21:38 +07:00
Tim Eves
9b9833e9b9
Merge branch 'common-refactor-path' into common-refactor-processor-init
2018-12-17 23:13:52 +07:00
glasseyes
1c2eca06f2
tests for punctuation keys and generic ctrlalt
2018-12-17 20:09:24 +07:00
Tim Eves
35a764ba51
Fix type deduction issue in path::join static function.
...
Will compile on Windows now and switch to normalised paths.
2018-12-17 15:39:10 +07:00
glasseyes
db3e12880b
context for 020 deadkeys and backspace
2018-12-17 10:25:03 +07:00
Tim Eves
18ce72e7c8
Refactor keyboard processor initialisation code.
...
Turn the keyboard class backing the km_kbp_keyboard and km_kbp_keyboard_attr objects into just keyboard_attributes.
Move the abstract_processor and sublcasses as the objects that back km_kbp_keyboard and make keyboard_attrs a member of the asbtract_processor.
Move kmx_processor and mock_processor declarations into their own headers.
Make all vector<km_kbp_option_item> into vector<option> to handle memory management, moving and copying correctly.
Update test cases accordingly
2018-12-17 06:02:22 +07:00
Tim Eves
e79c524d90
Fix option value type's copy ctor and move ctor & assignment
...
Also add an copy assignment operator and allow initialisation from
char16_t pointers as well as u16string objects.
2018-12-17 05:55:23 +07:00
Tim Eves
2067547640
Add support for char16_t * compatible << operator to json class
2018-12-17 05:42:10 +07:00
Tim Eves
56f85d1a82
Fix wrong overload of std::string:;append
2018-12-17 02:40:35 +07:00
Tim Eves
a3aca838fb
Fix ambiguity during type deduction in normalise on Windows.
2018-12-14 09:38:04 +07:00