tests: Add a test for fd leaks on zombie objects

Until recently, if a client destroying a resource raced with the
server generating an event on that resource that delivered a file
descriptor, we would leak the fd.

This tests for a leaked fd from that race condition.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
Derek Foreman 2017-12-06 11:22:24 -06:00 committed by Daniel Stone
parent 239ba39331
commit f74c9b98db
3 changed files with 151 additions and 1 deletions

View file

@ -114,7 +114,8 @@ protocol/%-client-protocol-core.h : $(top_srcdir)/protocol/%.xml
BUILT_SOURCES = \
$(nodist_libwayland_server_la_SOURCES) \
$(nodist_libwayland_client_la_SOURCES) \
$(nodist_headers_test_SOURCES)
$(nodist_headers_test_SOURCES) \
$(nodist_display_test_SOURCES)
CLEANFILES = $(BUILT_SOURCES) doc/doxygen/doxygen_sqlite3.db
DISTCLEANFILES = src/wayland-version.h
@ -206,6 +207,10 @@ client_test_SOURCES = tests/client-test.c
client_test_LDADD = libtest-runner.la
display_test_SOURCES = tests/display-test.c
display_test_LDADD = libtest-runner.la
nodist_display_test_SOURCES = \
protocol/tests-server-protocol.h \
protocol/tests-client-protocol.h \
protocol/tests-protocol.c
connection_test_SOURCES = tests/connection-test.c
connection_test_LDADD = libtest-runner.la
event_loop_test_SOURCES = tests/event-loop-test.c