diff options
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 |