aboutsummaryrefslogtreecommitdiffstats
path: root/tests/queue-test.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add dispatch timeout testsSebastian Wick2025-02-041-0/+87
| | | | | | | | | | | Add tests which verify that... * wl_display_dispatch_timeout with a big enough timeout behaves the same as wl_display_dispatch * wl_display_dispatch_timeout will time out when there are no messages to dispatch Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* client: Allow setting names for queuesDerek Foreman2024-01-221-0/+112
| | | | | | | | | | Allow setting a name for an event queue. The queue is used only for printing additional debug information. Debug output can now show the name of the event queue an event is dispatched from, or the event queue of a proxy when a request is made. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* debug: Replace "@<id>" with "#<id>" in logsAlex Yang2023-06-271-2/+2
| | | | | | | | | | | | Wayland debug logs resemble email addresses. This is a problem when anonymizing logs from users. For example: [2512874.343] xdg_surface@700.configure(333) In the above log line, the substring "surface@700.config" can be mistaken for an email address and redacted during anonymization. Signed-off-by: Alex Yang <aycyang@google.com>
* client: Do not warn about attached proxies on default queue destruction.Alexandros Frantzis2023-03-011-1/+62
| | | | | | | | | | | | | | If the default queue is being destroyed, the client is disconnecting from the wl_display, so there is no possibility of subsequent events being queued to the destroyed default queue, which is what this warning is about. Note that interacting with (e.g., destroying) a wl_proxy after its wl_display is destroyed is a certain memory error, and this warning will indirectly warn about this issue. However, this memory error should be detected and warned about through a more deliberate mechanism. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* client: Abort when trying to add an event to a destroyed queueAlexandros Frantzis2023-02-281-0/+61
| | | | | | | | | | Detect when we are trying to add an event to a destroyed queue, and abort instead of causing a use-after-free memory error. This situation can occur when an wl_event_queue is destroyed before its attached wl_proxy objects. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* client: Warn when a queue is destroyed with attached proxiesAlexandros Frantzis2023-02-281-0/+93
| | | | | | | Log a warning if the queue is destroyed while proxies are still attached, to help developers debug and fix potential memory errors. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.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/queue-test: Add tests for proxy wrappersJonas Ådahl2016-04-291-0/+122
| | | | | | | | | | Test that doing wl_display.sync on a wrapped proxy with a special queue works as expected. Test that creating a wrapper on a destroyed but not freed proxy fails. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: Pass argument to client mainJonas Ådahl2016-01-161-3/+3
| | | | | | | | | | | | Change the API to pass an "void *" argument to the client main function, allowing the caller to call the same main function with different input. A helper (client_create_noarg) is added for when no argument is passed, and the existing test cases are changed to use this function instead. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.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>
* tests: split queue-test testcasesMarek Chalupa2014-12-011-1/+19
| | | | | | | | | All the test-cases are in one test atm. It doesn't matter for the outcome, but when it is split to more tests, the debugging and reading the output is simpler. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* queue-test: put back timeoutMarek Chalupa2014-11-171-0/+2
| | | | | | | | In 93e654061b9 we removed call to alarm() that served as timeout in this test. Now when we have test_set_timeout() func, return the timeout back. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
* queue-test: Add another assertionPhilip Withnall2014-11-051-1/+1
| | | | | | | | | Ensure that the round trip succeeds. Signed-off-by: Philip Withnall <philip at tecnocode.co.uk> Signed-off-by: Karsten Otto <ottoka at posteo.de> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: use test compositor in queue-testMarek Chalupa2014-08-221-151/+29
| | | | | | | | | | | | | | | Most of the code of the queue-test is covered by the test compositor, so we can save few lines and use the test compositor instead. I think it's also more readable. This patch removes timeout from the test. We plan to add timeout to all tests later, though. v2. rebased to master Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: remove unnecessary lines from queue-testMarek Chalupa2014-08-211-10/+0
| | | | | | | | | | | | | | | Earlier, the wl_display_dispatch_pending were setting number of thread that can dispatch events. This behaviour was removed later, so now these lines are redundant. Related commits: 385fe30e8b144a968aa88c6546c2ef247771b3d7 78cfa967681c965d23f6cbf76e080bbb0b564ff6 3c7e8bfbb4745315b7bcbf69fa746c3d6718c305 Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: remove leaks from queue-testMarek Chalupa2014-08-211-0/+5
| | | | | | | Destroy all objects that we have created Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* tests: test the wl_display_roundtrip_queue() functionGiulio Camuffo2014-08-211-0/+74
| | | | | | | [Pekka Paalanen: moved variable declarations to before code. Added some comments, and added the re-arm to additionally test the opposite case.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* queue-test: assert non-NULL return valuesU. Artie Eoff2014-01-151-0/+3
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* Replace two remaining wl_display_add_gloavl() occurencesKristian Høgsberg2013-07-091-2/+3
|
* queue-test: WEXITSTATUS() is undefined if WIFEXITED() is falseKristian Høgsberg2013-02-081-2/+3
| | | | | | 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.
* tests: Add out of order delete_id queue testsJonas Ådahl2012-11-071-12/+96
| | | | | | | | 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>
* tests: Use a pipe for synchronization to avoid potential deadlockJonas Ådahl2012-11-071-24/+55
| | | | | | | 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>
* tests: Add queue test caseJonas Ådahl2012-11-051-0/+171
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>