Commit Graph

11 Commits

Author SHA1 Message Date
Michael Forney
678c8681e2 Avoid pointer arithmetic on void *
The pointer operand to the binary `+` operator must be to a complete
object type. Since we are working with byte sizes, use `char *` for
arithmetic instead.

Signed-off-by: Michael Forney <mforney@mforney.org>
2019-06-05 10:01:07 +00:00
Yong Bakos
a1ab2c03ae array-test: Include wayland-util.h and simplify init test
Include wayland-util.h in addition to wayland-private.h, to be more explicit
about where wl_array is defined.

Remove the useless repeated testing of wl_array_init, because if it fails once
out of thousands of iterations we're all doomed anyway.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[Pekka: add the memset]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-10-18 12:24:53 +03:00
Yong Bakos
f04f218781 tests: Test wl_array_release
array-test.c did not cover wl_array_release, so add one test that specifically
tests this method.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[Pekka: do not overwrite array.data]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-10-18 12:24:53 +03:00
Bryce Harrington
c2547c70a7 tests: Don't increment variables inside an assert()
Addresses this warning found by Denis Denisov:

  [tests/array-test.c:137]: (warning) Assert statement modifies 'i'.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-07-10 00:12:36 -07:00
Bryce Harrington
773babedfc tests: Update boilerplate from MIT X11 license to MIT Expat license
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-12 15:31:24 -07:00
U. Artie Eoff
fcf5f06b7d array-test: assert wl_array_add result is not NULL
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-15 10:46:08 -08:00
Dylan Noblesmith
b486e3aba5 tests: fix make check for out-of-tree builds
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
2012-06-30 19:58:37 +00:00
Kristian Høgsberg
ac06144cc9 tests: Fix signedness warnings 2012-04-13 10:11:11 -04:00
U. Artie Eoff
a0e590a0f3 Add simple memory leak check to all tests.
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>
2012-03-24 14:37:42 -04:00
Kristian Høgsberg
8e2cac7ae4 Add wl_array_for_each 2012-03-04 13:40:49 -05:00
Kristian Høgsberg
62d2569954 tests: Add Unit tests for wl_map and wl_array data structures
We use a simple test-runner helper that runs each test in a separate
process and reports the pass/fail rate at the end.
2012-03-02 18:05:33 -05:00