diff --git a/test/core/test_nothrow_new.cpp b/test/core/test_nothrow_new.cpp index eb3c195d403c3..4f1a7334dcb1e 100644 --- a/test/core/test_nothrow_new.cpp +++ b/test/core/test_nothrow_new.cpp @@ -3,18 +3,14 @@ // University of Illinois/NCSA Open Source License. Both these licenses can be // found in the LICENSE file. -#include +#include +#include #include -char* data; - int main() { - data = new (std::nothrow) char[20 * 1024 * 1024]; - if (data == nullptr) { - std::cout << "success" << std::endl; - return 0; - } else { - std::cout << "failure" << std::endl; - return 1; - } + char* data = new (std::nothrow) char[20 * 1024 * 1024]; + printf("data: %p\n", data); + assert(data == nullptr); + printf("success\n"); + return 0; } diff --git a/test/core/test_nothrow_new.out b/test/core/test_nothrow_new.out index 2e9ba477f89e8..dee5a560282b5 100644 --- a/test/core/test_nothrow_new.out +++ b/test/core/test_nothrow_new.out @@ -1 +1,2 @@ +data: 0 success