python:tests: Fix crashing pymessaging tests
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 13 Nov 2023 23:34:01 +0000 (12:34 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Nov 2023 22:07:36 +0000 (22:07 +0000)
commitbeff3e6d7762b423500a7ebf163878ede68b4a2f
treee2da00d83b1d9bdd26bdb6b51833ce73ef72fb0c
parentec3e420840eded527a2a7bb1177b5daa79ee8448
python:tests: Fix crashing pymessaging tests

Commit 8c75d9fc73614fad29a998d08c4b11034ab2aebb changed
Messaging.deregister() to take a two‐element tuple containing private
data as well as a callback, but it did not change the call in
samba.tests.messaging.MessagingTests.test_register to match.

Since imessaging_deregister() completely ignored the ‘private_data’
parameter passed to it (assuming the callback was registered with
msg_type == -1), everything still appeared to work — until commit
b22c21799527323877b330c16c23057582721abb changed Messaging.deregister()
to no longer leak memory. Now the wrong variable had its reference count
decremented, causing the test to crash.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/messaging.py