projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: bt2: pass _TraceClassConst to destruction listeners
[babeltrace.git]
/
tests
/
bindings
/
python
/
bt2
/
test_trace_class.py
diff --git
a/tests/bindings/python/bt2/test_trace_class.py
b/tests/bindings/python/bt2/test_trace_class.py
index eca5274e03f13682eeb808d7049aee3083943d92..2fe61463f7d4d0f74c98d0c3cbf397599f9a905c 100644
(file)
--- a/
tests/bindings/python/bt2/test_trace_class.py
+++ b/
tests/bindings/python/bt2/test_trace_class.py
@@
-184,9
+184,13
@@
class TraceClassTestCase(unittest.TestCase):
def test_destruction_listener(self):
def on_trace_class_destruction(trace_class):
def test_destruction_listener(self):
def on_trace_class_destruction(trace_class):
+ nonlocal type_of_passed_trace_class
+ type_of_passed_trace_class = type(trace_class)
+
nonlocal num_destruct_calls
num_destruct_calls += 1
nonlocal num_destruct_calls
num_destruct_calls += 1
+ type_of_passed_trace_class = None
num_destruct_calls = 0
trace_class = get_default_trace_class()
num_destruct_calls = 0
trace_class = get_default_trace_class()
@@
-203,6
+207,7
@@
class TraceClassTestCase(unittest.TestCase):
del trace_class
self.assertEqual(num_destruct_calls, 1)
del trace_class
self.assertEqual(num_destruct_calls, 1)
+ self.assertIs(type_of_passed_trace_class, bt2_trace_class._TraceClassConst)
def test_remove_destruction_listener_wrong_type(self):
trace_class = get_default_trace_class()
def test_remove_destruction_listener_wrong_type(self):
trace_class = get_default_trace_class()
This page took
0.023148 seconds
and
4
git commands to generate.