Repository navigation
fix(test-backend)!: report the test rumble counts in size_t - #490
Merged
Merged
Conversation
siracozmen01
commented
Nov 5, 2026
siracozmen01
left a comment
Contributor
Author
There was a problem hiding this comment.
Review at 30b26e2: ready, with one point not verified. No findings. Read, not run.
- The clear-on-failure contract covers the wider type by construction.
GetRumbleclears withmwinClearOut(countOut, sizeof *countOut)(backend_test_pads.c:141), so the clear widens with the pointer's type to all 8 bytes on 64-bit, before any refusal. The storedmwinTestRumble.countissize_ttoo.*countOut = rumble->countand therumble->count + 1in backend_test.c:465 and 473 neither truncate nor change behavior. On 32-bit buildssize_tis the same 32 bits as before. - The test change is right.
Rumbledrops the count so the struct'sstatic_assertof no padding still holds (3 × 4 bytes). The count is filled with the pattern and checked on its own after each call, under the samestatusas the other outputs. With the clear removed, the 8-byte count keeps the pattern on a refused call. That is the failure the body reports. - test.h, the backend and test_gamepad.c take and pass
size_t*, and the BREAKING CHANGE footer names both functions. That fits #371's ruling that a count issize_t.
Not verified: callers outside the five files. Any C caller still passing uint32_t* is an incompatible pointer type, which the warning-as-error builds would refuse. So the clean gcc-14, ASan, minimal, fuzz, MinGW, wasm32-wasi and Android builds cover everything those trees compile. Not covered are samples outside the build, the docs, and any JS or Java test hook that reaches these through a raw 4-byte slot. On wasm32 size_t is 4 bytes, so a JS slot stays right there. A search for GetTestRumble and GetTestTriggerRumble across the repository would settle it.
Merged
siracozmen01
pushed a commit
that referenced
this pull request
Nov 5, 2026
🤖 I have created a release *beep* *boop* --- ## [0.15.0](v0.14.0...v0.15.0) (2026-11-05) The iOS device check, that a window shows no flash against the launch screen before its first frame, is waived by the owner for this release, which ships on the iOS simulator suite: its iOS changes leave the launch and the first frame alone. ### Changed - **Breaking:** `mwinMessageButtons` is now `mwinMessageChoice`, its constants `mwin_buttonsOk`, `mwin_buttonsOkCancel` and `mwin_buttonsYesNo` are now `mwin_choiceOk`, `mwin_choiceOkCancel` and `mwin_choiceYesNo`, and `mwinMessageBoxDef.buttons` is now `mwinMessageBoxDef.choice`. The type is a choice of one, but its plural name read as a set of flags, as every other plural type in the API is ([#489](#489)). - **Breaking:** the test platform's `mwinGamepad_GetTestRumble` and `mwinGamepad_GetTestTriggerRumble` take `size_t* countOut` instead of `uint32_t* countOut`, as every other count the API reports is a `size_t` ([#490](#490)). - Maul Window builds against Maul Unicode 1.2.0, which gives the results 1.1.2 gave, so nothing a program gets from Maul Window changes. The installed CMake config and pkg-config file ask for Maul Unicode 1.2.0, and a build on a machine with only Maul Unicode 1.1.2 installed fetches 1.2.0 instead of using it ([#493](#493)). ### Fixed - On Windows, a generic HID gamepad with more than 64 buttons down at once, such as a stick or button box of 128 whose toggle switches stay down, reads its buttons. Before, the library asked Windows' parser for the buttons down with room for 64, the parser refused, and the report's buttons were dropped: each button kept the state of the last report that listed 64 or fewer, and a press or a release in between was lost ([#495](#495)).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mwinGamepad_GetTestRumbleandmwinGamepad_GetTestTriggerRumbleininclude/maul-window/test.hreport how many rumbles a gamepad of the test platform was given in auint32_t* countOut. #376 made every count the API reports asize_t, and a count of calls is a count too.Change
size_t* countOut.size_t.test/test_gamepad.creads the count into asize_t.test/test_outputs.cchecks that a refused call clears the count, now apart from the other three outputs. It fills and checks those as one struct with no padding, and asize_tbeside three 32-bit values leaves padding on a 64-bit build.Verification
tools/check.sh changedpasses, thegamepadandoutputssuites included.GetRumble,outputsfails on both counts, for a call with no context and for a gamepad that is gone.BREAKING CHANGE:
mwinGamepad_GetTestRumbleandmwinGamepad_GetTestTriggerRumbletakesize_t* countOutinstead ofuint32_t* countOut.Closes #488