Skip to content

Commit

Permalink
Add tests for mouse_swap_xy
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Sep 22, 2023
1 parent e1f93ac commit fcf82c7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,26 @@
"error": "`mouse_flip_horizontal_wheel` must be boolean, but is `null`"
},

// mouse_swap_xy

{
"class": "devices",
"input": {
"mouse_swap_xy": null
},
"error": "`mouse_swap_xy` must be boolean, but is `null`"
},

// mouse_swap_wheel

{
"class": "devices",
"input": {
"mouse_swap_wheel": null
},
"error": "`mouse_swap_wheel` must be boolean, but is `null`"
},

// simple_modifications

{
Expand Down
2 changes: 2 additions & 0 deletions tests/src/core_configuration/json/example.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheel": false,
"mouse_swap_xy": false,
"simple_modifications": [
{
"from": {
Expand Down
6 changes: 6 additions & 0 deletions tests/src/core_configuration/json/to_json_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheel": false,
"mouse_swap_xy": false,
"simple_modifications": [
{
"from": {
Expand Down Expand Up @@ -172,6 +174,8 @@
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheel": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
Expand Down Expand Up @@ -212,6 +216,8 @@
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheel": false,
"mouse_swap_xy": false,
"simple_modifications": [
{
"from": {
Expand Down
4 changes: 4 additions & 0 deletions tests/src/core_configuration/src/core_configuration_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ void run_core_configuration_test(void) {
{"mouse_flip_vertical_wheel", false},
{"mouse_flip_x", false},
{"mouse_flip_y", false},
{"mouse_swap_wheel", false},
{"mouse_swap_xy", false},
{"treat_as_built_in_keyboard", false},
},
}},
Expand Down Expand Up @@ -853,6 +855,8 @@ void run_core_configuration_test(void) {
{"mouse_flip_vertical_wheel", false},
{"mouse_flip_x", false},
{"mouse_flip_y", false},
{"mouse_swap_wheel", false},
{"mouse_swap_xy", false},
{"simple_modifications", nlohmann::json::array()},
{"treat_as_built_in_keyboard", false},
},
Expand Down
5 changes: 5 additions & 0 deletions tests/src/core_configuration/src/device_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ void run_device_test(void) {
{"mouse_flip_vertical_wheel", false},
{"mouse_flip_x", false},
{"mouse_flip_y", false},
{"mouse_swap_wheel", false},
{"mouse_swap_xy", false},
{"simple_modifications", nlohmann::json::array()},
{"treat_as_built_in_keyboard", false},
});
Expand All @@ -320,6 +322,7 @@ void run_device_test(void) {
{"treat_as_built_in_keyboard", true},
{"mouse_flip_horizontal_wheel", true},
{"mouse_flip_x", true},
{"mouse_swap_wheel", true},
});
krbn::core_configuration::details::device device(json);
nlohmann::json expected({
Expand Down Expand Up @@ -358,6 +361,8 @@ void run_device_test(void) {
{"mouse_flip_vertical_wheel", false},
{"mouse_flip_x", true},
{"mouse_flip_y", false},
{"mouse_swap_wheel", true},
{"mouse_swap_xy", false},
{"simple_modifications", nlohmann::json::array()},
{"treat_as_built_in_keyboard", true},
});
Expand Down

0 comments on commit fcf82c7

Please sign in to comment.