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 4b861a0db82ecc2972171e8c3104ae42b620ed0c..fd5f8deb26b1a1f75691bbb14176103e7335a967 100644
(file)
--- a/
tests/bindings/python/bt2/test_trace_class.py
+++ b/
tests/bindings/python/bt2/test_trace_class.py
@@
-172,9
+172,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()
@@
-191,6
+195,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.024644 seconds
and
4
git commands to generate.