aboutsummaryrefslogtreecommitdiffstats
path: root/tests/map-test.c
Commit message (Collapse)AuthorAgeFilesLines
* util: Avoid undefined behaviour in for_each_helperFergus Dall2021-07-211-0/+16
| | | | | | | | | | | | | | | | | for_each_helper tries to calculate a one-past-the-end pointer for its wl_array input. This is fine when the array has one or more entries, but we initialize arrays by setting wl_array.data to NULL. Pointer arithmetic is only defined when both the pointer operand and the result point to the same allocation, or one-past-the-end of that allocation. As NULL points to no allocation, no pointer arithmetic can be performed on it, not even adding 0, even if the result is never dereferenced. This is caught by clang's ubsan from version 10. Many tests already hit this case, but I added an explicit test for iterating over an empty wl_map. Signed-off-by: Fergus Dall <sidereal@google.com>
* (multiple): Include stdint.hYong Bakos2016-07-251-0/+1
| | | | | | | | | | Some headers and source files have been using types such as uint32_t without explicitly including stdint.h. Explicitly include stdint.h where appropriate. Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
* tests: Update boilerplate from MIT X11 license to MIT Expat licenseBryce Harrington2015-06-121-16/+19
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Update tests for wl_map changes and add a map_flags testJason Ekstrand2013-06-051-16/+38
|
* tests: fix make check for out-of-tree buildsDylan Noblesmith2012-06-301-1/+1
| | | | | | | | | | It was failing with missing include files. While here, destroy the ugly "../src/..." include paths used in the tests that was just hacking around this problem in the Makefile: sed -i s/..\\/src\\/// tests/*.c
* Add simple memory leak check to all tests.U. Artie Eoff2012-03-241-0/+2
| | | | | | | | | Wrap all tests with a memory balance check to detect potential memory leaks. Fixed a few tests that had memory leaks contained in the tests themselves. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* tests: More wl_map testsKristian Høgsberg2012-03-051-0/+46
|
* tests: Add Unit tests for wl_map and wl_array data structuresKristian Høgsberg2012-03-021-0/+47
We use a simple test-runner helper that runs each test in a separate process and reports the pass/fail rate at the end.