test/utils.c


Log

Author Commit Date CI Message
Pierre Le Marre d2f7b9cd 2025-04-04T17:29:35 rules: Do not use strto* parsers
Pierre Le Marre d5a91fa9 2025-04-04T16:38:16 xkbcomp: Use custom parsers instead of strtol* The use of `strtol*` functions was already restricted due to its slowness and its capacity to parse other stuff than digits (e.g. signs and spaces). There is also another *big* limitation: it requires a NULL-terminated string. This is incompatible with our functions that work on buffers, because we cannot guarantee this. This may lead to a memory violation if the last token is a number. We now roll out our own parsers, which are more efficients and compatible with buffers.
Ran Benita e120807b 2025-01-29T15:35:22 Update license notices to SDPX short identifiers + update LICENSE Fix #628. Signed-off-by: Ran Benita <ran@unusedvar.com>
Pierre Le Marre 3ed763c3 2024-10-09T07:11:13 test: Add strip_lines and uncomment to text utils These allow us to store comments in files (especially keymaps), that can then be removed (e.g. to compare with output) or uncommented (e.g. to activate an optional line).
Pierre Le Marre 7697c712 2024-09-16T16:09:11 rules: Resolve relative include statements using XKB paths Contrary to keymap files, the `! include` statement in rules does not lookup include paths added to `xkb_context`. So it is not possible e.g. to import another file in the same folder without using an absolute path. - Added path utils: `is_absolute(path)`. - Added XKB paths lookup to enable e.g. `! include evdev` to work. - Added test.
Pierre Le Marre e325e65e 2024-02-20T08:13:37 Add test_unit to all tests Currently it only ensure we do not buffer `stdout`.
Peter Hutterer fe886133 2020-06-23T11:07:53 utils: add streq_null() for streq that allows NULL values Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer 9b1b0c57 2020-06-16T10:34:07 Add a snprintf_safe() helper function Returns true on success or false on error _or_ truncation. Since truncation is almost always an error anyway, we might as well make this easier to check. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>