diff options
Diffstat (limited to 'testing/mozbase/mozleak/tests/test_lsan.py')
-rw-r--r-- | testing/mozbase/mozleak/tests/test_lsan.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/mozbase/mozleak/tests/test_lsan.py b/testing/mozbase/mozleak/tests/test_lsan.py new file mode 100644 index 0000000000..d9a537e868 --- /dev/null +++ b/testing/mozbase/mozleak/tests/test_lsan.py @@ -0,0 +1,32 @@ +from __future__ import absolute_import +import pytest + +import mozunit +from mozleak import lsan + + +@pytest.mark.parametrize( + ("input_", "expected"), + [ + ( + "alloc_system::platform::_$LT$impl$u20$core..alloc.." + "GlobalAlloc$u20$for$u20$alloc_system..System$GT$::" + "alloc::h5a1f0db41e296502", + "alloc_system::platform::_$LT$impl$u20$core..alloc.." + "GlobalAlloc$u20$for$u20$alloc_system..System$GT$::alloc", + ), + ( + "alloc_system::platform::_$LT$impl$u20$core..alloc.." + "GlobalAlloc$u20$for$u20$alloc_system..System$GT$::alloc", + "alloc_system::platform::_$LT$impl$u20$core..alloc.." + "GlobalAlloc$u20$for$u20$alloc_system..System$GT$::alloc", + ), + ], +) +def test_clean(input_, expected): + leaks = lsan.LSANLeaks(None) + assert leaks._cleanFrame(input_) == expected + + +if __name__ == "__main__": + mozunit.main() |