summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozleak/tests/test_lsan.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/mozbase/mozleak/tests/test_lsan.py
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/mozbase/mozleak/tests/test_lsan.py')
-rw-r--r--testing/mozbase/mozleak/tests/test_lsan.py30
1 files changed, 30 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..6a55a555b7
--- /dev/null
+++ b/testing/mozbase/mozleak/tests/test_lsan.py
@@ -0,0 +1,30 @@
+import mozunit
+import pytest
+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()