diff --git a/tests/std/tests/Dev10_908702_string_memory_leak/test.cpp b/tests/std/tests/Dev10_908702_string_memory_leak/test.cpp index 65ef7e531f..6bf4cd733e 100644 --- a/tests/std/tests/Dev10_908702_string_memory_leak/test.cpp +++ b/tests/std/tests/Dev10_908702_string_memory_leak/test.cpp @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// REQUIRES: debug_CRT + #include #include #include @@ -20,9 +22,7 @@ int main() { v.insert(v.begin(), 2, "2"); } -#ifdef _DEBUG assert(!_CrtDumpMemoryLeaks()); -#endif { string one("111"); @@ -32,21 +32,17 @@ int main() { two = three; } -#ifdef _DEBUG assert(!_CrtDumpMemoryLeaks()); -#endif // Also test DevDiv-846054 ": Spurious memory leaks". locale::global(locale("")); -#ifdef _DEBUG assert(!_CrtDumpMemoryLeaks()); -#endif } // Also test DevDiv-810608 ": [torino][boost]error C2665: // 'std::_Crt_new_delete::operator new' : none of the 2 overloads could convert all the argument types". -void meow(void* pv) { +void meow(void* pv) { // COMPILE-ONLY // Saying "new" instead of "::new" is intentional here. new (pv) locale(); } diff --git a/tests/std/tests/Dev11_0748972_function_crash_out_of_memory/test.cpp b/tests/std/tests/Dev11_0748972_function_crash_out_of_memory/test.cpp index 268721302d..844be31d86 100644 --- a/tests/std/tests/Dev11_0748972_function_crash_out_of_memory/test.cpp +++ b/tests/std/tests/Dev11_0748972_function_crash_out_of_memory/test.cpp @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// REQUIRES: debug_CRT + #define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING #include @@ -127,11 +129,9 @@ void test(const int num) { g_allocations_remaining = 1000000; -#ifdef _DEBUG if (_CrtDumpMemoryLeaks()) { abort(); } -#endif return; }