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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 Nov 2019 19:24:17 +0000 (14:24 -0500)
commit33efe39522a84b79167af61d732604eeb255a1aa
tree64f2336cbfeaf9af08c6bf07d55a11af932b5ccb
parentff7b7a4c57940b9f637f9c6d2f5fb25af6029b28
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.023971 seconds and 4 git commands to generate.