summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozleak/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/mozbase/mozleak/tests
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/mozbase/mozleak/tests')
-rw-r--r--testing/mozbase/mozleak/tests/manifest.toml4
-rw-r--r--testing/mozbase/mozleak/tests/test_lsan.py30
2 files changed, 34 insertions, 0 deletions
diff --git a/testing/mozbase/mozleak/tests/manifest.toml b/testing/mozbase/mozleak/tests/manifest.toml
new file mode 100644
index 0000000000..133b0581e6
--- /dev/null
+++ b/testing/mozbase/mozleak/tests/manifest.toml
@@ -0,0 +1,4 @@
+[DEFAULT]
+subsuite = "mozbase"
+
+["test_lsan.py"]
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()