summaryrefslogtreecommitdiff
path: root/tests/malloc_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/malloc_test.cpp')
-rw-r--r--tests/malloc_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index ed98f15d3..d70136496 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -22,6 +22,10 @@
#include <malloc.h>
#include <unistd.h>
+#if defined(__BIONIC__)
+#include <libc/bionic/malloc_debug_common.h>
+#endif
+
TEST(malloc, malloc_std) {
// Simple malloc test.
void *ptr = malloc(100);
@@ -291,6 +295,10 @@ TEST(malloc, realloc_overflow) {
free(ptr);
}
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+extern "C" void* pvalloc(size_t);
+extern "C" void* valloc(size_t);
+
TEST(malloc, pvalloc_std) {
size_t pagesize = sysconf(_SC_PAGESIZE);
void* ptr = pvalloc(100);
@@ -315,3 +323,4 @@ TEST(malloc, valloc_std) {
TEST(malloc, valloc_overflow) {
ASSERT_EQ(NULL, valloc(SIZE_MAX));
}
+#endif