diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /xpcom/tests/gtest/TestAllocReplacement.cpp | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xpcom/tests/gtest/TestAllocReplacement.cpp')
-rw-r--r-- | xpcom/tests/gtest/TestAllocReplacement.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/xpcom/tests/gtest/TestAllocReplacement.cpp b/xpcom/tests/gtest/TestAllocReplacement.cpp index 4b2c41b0f3..e0f0d001d5 100644 --- a/xpcom/tests/gtest/TestAllocReplacement.cpp +++ b/xpcom/tests/gtest/TestAllocReplacement.cpp @@ -73,34 +73,3 @@ TEST(AllocReplacement, posix_memalign_check) }); } #endif - -#if defined(XP_WIN) -# include <windows.h> - -# undef ASSERT_ALLOCATION_HAPPENED -# define ASSERT_ALLOCATION_HAPPENED(lambda) \ - ASSERT_TRUE(ValidateHookedAllocation( \ - lambda, [](void* p) { HeapFree(GetProcessHeap(), 0, p); })); - -TEST(AllocReplacement, HeapAlloc_check) -{ - ASSERT_ALLOCATION_HAPPENED([] { - HANDLE h = GetProcessHeap(); - return HeapAlloc(h, 0, kAllocAmount); - }); -} - -TEST(AllocReplacement, HeapReAlloc_check) -{ - ASSERT_ALLOCATION_HAPPENED([] { - HANDLE h = GetProcessHeap(); - void* p = HeapAlloc(h, 0, kAllocAmount / 2); - - if (!p) { - return static_cast<void*>(nullptr); - } - - return HeapReAlloc(h, 0, p, kAllocAmount); - }); -} -#endif |