Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Test wl_signal initialization, adding and getting listeners and emitting
|
|
When memory or fd leak is detected, print how many blocks of memory were
allocated and not freed, respectively how many files were opened/unclosed.
|
|
|
|
With the work to add wl_resource accessors and port weston to use them,
we're ready to make wl_resource and wl_object opaque structs. We keep
wl_buffer in the header for EGL stacks to use, but don't expose it by
default. In time we'll remove it completely, but for now it provides a
transition paths for code that still uses wl_buffer.
Reviewed-by: Jason Ekstrand<jason@jlekstrand.net>
|
|
|
|
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
|
This commit adds a flags parameter to wl_closure_invoke(). The so far
added flags are ment to specify if the invokation is client side or
server side. When on the server side, closure arguments of type 'new_id'
should be invoked as a integer id while on the client side they should
be invoked as a pointer to a proxy object.
This fixes a bug happening when the address of a client side 'new_id'
proxy object did not fit in a 32 bit integer.
krh: Squashed test suite compile fix from Jason Ekstrand.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
In case we forget the name of the test case or typo it, the test runner
will now list the test cases in the test binary.
|
|
If a child process dies from a signal, WIFEXITED() returns false and
WEXITSTATUS() isn't well-defined. In this case, if the client segfaults,
the status is 134 and WEXITSTATUS(134) is EXIT_SUCCESS, so we mask the error.
|
|
The *.log and *.trs files should be ignored by git as well as the GNU
autotools ./test-driver helper script.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
|
|
|
|
Added a destroy signal to the wl_display object.
|
|
When redirecting stdout to a non-readable file makes the test fail as a
false negative
|
|
This is libwayland, not weston, so call the temporary files
wayland-tests-*, not weston-tests-*.
This is a candidate for the stable branch.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
Signed-off-by: Sven Joachim <svenjoac@gmx.de>
|
|
Verify that when receiving the first of two synchronization callback
events, destroying the second one doesn't cause any errors even if the
delete_id event is handled out of order.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
Using signals in the previous way could potentially lead to dead locks
if the SIGCONT was signalled before a listener was registered.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
Check that after a callback removes a proxy that most likely will have
several events queued up with the same target proxy, no more callbacks
are invoked.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
|
|
The update callback for the file descriptors was always a bit awkward and
un-intuitive. The idea was that whenever the protocol code needed to
write data to the fd it would call the 'update' function. This function
would adjust the mainloop so that it polls for POLLOUT on the fd so we
can eventually flush the data to the socket.
The problem is that in multi-threaded applications, any thread can issue
a request, which writes data to the output buffer and thus triggers the
update callback. Thus, we'll be calling out with the display mutex
held and may call from any thread.
The solution is to eliminate the udpate callback and just require that
the application or server flushes all connection buffers before blocking.
This turns out to be a simpler API, although we now require clients to
deal with EAGAIN and non-blocking writes. It also saves a few syscalls,
since the socket will be writable most of the time and most writes will
complete, so we avoid changing epoll to poll for POLLOUT, then write and
then change it back for each write.
|
|
|
|
This finalizes Robert Bradfords patch to allow NO_ASSERT_LEAK_CHECK
environment variable to disable leak checks in unit tests.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
|
|
Some code coverage tools trigger these assertions when run against the test
suite since they don't free all their memory.
|
|
Not only setenv(), also putenv() allocates memory on my system
(glibc 2.16.0). Just fail with a clear message if XDG_RUNTIME_DIR is
not set.
https://bugs.freedesktop.org/show_bug.cgi?id=52618
|
|
Use unsigned rather than signed for IDs, so they match up with what we
see in other prints.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
Since glibc dlsym() calls calloc, we get a call to our calloc wrapper as
we try to look up the real calloc implementation. dlsym() will fall back
to a static buffer in case calloc returns NULL, so that's what we'll do.
This is all highly glibc dependent, of course, but the entire malloc
weak symbol wrapper mechanism is, so there's no loss of generality here.
|
|
So all our tests don't start failing just because we had the temerity to
use realloc() rather than malloc().
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
Most of the time it does not make sense to pass a NULL object, string, or array
to a protocol request. This commit adds an explicit “allow-null” attribute
to mark the request arguments where NULL makes sense.
Passing a NULL object, string, or array to a protocol request which is not
marked as allow-null is now an error. An implementation will never receive
a NULL value for these arguments from a client.
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
|
|
These would either overflow the struct sockaddr_un, or
be truncated and leave a non-null-terminated string.
|
|
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
|
|
|
|
|
|
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
I was just curious of how much the looping takes time without
conversion, so I added this.
My results on Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz:
benchmarked noop: 1.876349827s
benchmarked magic: 2.245844470s
benchmarked div: 12.709085309s
benchmarked mul: 7.504838141s
Mul seems to take 15x the time magic does, cool!
Btw. the simple default cast of int32_t to double is slower than magic
for me, hence the use of union.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
|
|
'fixed' is a signed decimal type which offers a sign bit, 23 bits of
integer precision, and 8 bits of decimal precision. This is exposed as
an opaque struct with conversion helpers to and from double and int on
the C API side.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
|
|
|
|
Doesn't necessarily catch the signalfd bug just fixed, since that only
triggers when an uninitialized int is negative.
|
|
Make sure we include any generated headers from src/ as well, like
wayland-version.h.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
Some system C libraries do not have SOCK_CLOEXEC, and completely miss
accept4(), too. Provide a fallback for this case.
This changes the behaviour: no error messages are printed now for
failing to set CLOEXEC but the file descriptor is closed.
The unit test for this wrapper is NOT included.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
Some system C libraries do not have epoll_create1() nor EPOLL_CLOEXEC,
provide a fallback.
Add tests for the wrapper.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
Some system C libraries do not have MSG_CMSG_CLOEXEC. This flag would
automatically set O_CLOEXEC flag on any received file descriptors.
Provide a fallback that does it manually. If setting CLOEXEC fails, the
file descriptor is closed immediately, which will lead to failures but
avoid leaks. However, setting CLOEXEC is not really expected to fail
occasionally.
Add tests for the wrapper. The setup is copied from connection-test.c.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
warning: ignoring return value of ‘pipe’, declared with attribute
warn_unused_result
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
Some system C libraries do not have F_DUPFD_CLOEXEC. Provide a fallback.
Add tests for the new wl_os_dupfd_cloexec() wrapper.
Add per-wrapper call counters in os_wrappers-test.c. Makes it easier to
determine the minimum required number of wrapped calls.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
If it's not already defined, and we are on Linux, #define it. This gets
rid of a load of #ifdefs. This should also allow to use it when the
kernel supports it, but the libc does not define it.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
|
|
|