tests: test removing a destruction listener from a destruction listener
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 20 Nov 2019 23:51:28 +0000 (18:51 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 21 Nov 2019 21:56:53 +0000 (16:56 -0500)
commit8bd8ac79b9201c0be3ac8916d12ade0194e76437
treeaa02908be2883e314017b8c0c57a513dc289c071
parentd31480098fc794d7de1135a649c4a05b0b7fa07e
tests: test removing a destruction listener from a destruction listener

This patch adds a test to verify that removing a trace or trace class
destruction listener from an object from within a destruction listener
of that same object works correctly.

It tests 3 scenarions:

- A destruction listener removing itself.
- A destruction listener removing a destruction listener that was
  already called.
- A destruction listener removing a destruction listener that is not yet
  called.

This assumes that destruction listeners are called in the order in which
there were added.

In the third scenario (removing a destruction listener that is not yet
called), the result is that the removed listener won't get called.

Change-Id: I49de9b662b3c1f77ca1c9f84c2c3575a8616cc10
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2429
Tested-by: jenkins <jenkins@lttng.org>
tests/Makefile.am
tests/lib/Makefile.am
tests/lib/test_remove_destruction_listener_in_destruction_listener.c [new file with mode: 0644]
This page took 0.024263 seconds and 4 git commands to generate.