3 Commits
Author SHA1 Message Date
Ali Erdinc Koroglu c882582b81 Add missing stdint.h include
Include <stdint.h> to provide the definition of uintptr_t and fix
the GCC build failure

Signed-off-by: Ali Erdinc Koroglu <ali.koroglu@oss.qualcomm.com>
2026-09-24 16:20:43 +03:00
Igor Opaniuk fd0e86d542 tests: warn and skip overly-long paths in rmtree
rmtree() concatenates the directory path and entry name into a
PATH_MAX buffer without checking for truncation, which -Wformat-
truncation flags on the Windows build where PATH_MAX is 260. A
truncated path would also make the cleanup delete the wrong file in
principle.

Check the snprintf() result and skip entries that do not fit; using
the return value also satisfies the warning. A skipped entry means
the parent rmdir() fails with ENOTEMPTY and the workdir lingers, so
report the skip on stderr instead of hiding it - the message names
the entry, making a leftover workdir traceable to its cause.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-07-21 14:57:42 +02:00
Igor Opaniuk d3ff3e028b tests: cover oscompat path helpers
Add a cmocka unit test for the header-only helpers in oscompat.h:

 - path_is_absolute(), checking POSIX and (under _WIN32) drive-letter
   and UNC paths;
 - qdl_mkdir_p(), checking recursive creation, idempotency on an
   existing directory, trailing slashes, the "." and empty-path cases,
   the ENAMETOOLONG guard, and failure when a path component is not a
   directory.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-06-21 11:47:44 +02:00