aboutsummaryrefslogtreecommitdiffstats
path: root/tests/malloc_test.cpp
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-08-13 00:56:48 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-08-13 00:56:48 +0000
commita93cea05cf0f92a61715e9fd6c22a7e519e8cfbd (patch)
tree51db1cace0a75ac9e33aef1efb36e3f1d6832c67 /tests/malloc_test.cpp
parent4c92da431155174c6bfef91c227fe34becb340c0 (diff)
parent7da20341e91a4ece30f628fb91fbc6056c9c8a7c (diff)
downloadplatform_bionic-a93cea05cf0f92a61715e9fd6c22a7e519e8cfbd.tar.gz
platform_bionic-a93cea05cf0f92a61715e9fd6c22a7e519e8cfbd.tar.bz2
platform_bionic-a93cea05cf0f92a61715e9fd6c22a7e519e8cfbd.zip
Merge "Build bionic unit tests for musl"
Diffstat (limited to 'tests/malloc_test.cpp')
-rw-r--r--tests/malloc_test.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index 30da5c32f6..f15fc75d54 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -55,10 +55,14 @@
#define HAVE_REALLOCARRAY 1
-#else
+#elif defined(__GLIBC__)
#define HAVE_REALLOCARRAY __GLIBC_PREREQ(2, 26)
+#elif defined(MUSL)
+
+#define HAVE_REALLOCARRAY 1
+
#endif
TEST(malloc, malloc_std) {
@@ -655,10 +659,14 @@ TEST(malloc, verify_alignment) {
}
TEST(malloc, mallopt_smoke) {
+#if !defined(MUSL)
errno = 0;
ASSERT_EQ(0, mallopt(-1000, 1));
// mallopt doesn't set errno.
ASSERT_EQ(0, errno);
+#else
+ GTEST_SKIP() << "musl doesn't have mallopt";
+#endif
}
TEST(malloc, mallopt_decay) {