Only run mallopt_smoke test on bionic.

Even though glibc has mallopt, there is no way to guarantee that
we use an invalid argument. Since this test is only really useful
for bionic, only run it on bionic.

Test: Ran glibc and verified the test is skipped.
Change-Id: If991e8804b21c83f3d7e3b15a0b60e48da331567
This commit is contained in:
Christopher Ferris 2023-01-18 15:08:37 -08:00
parent cc66ba30e5
commit 2ef59371ff

View file

@ -661,13 +661,13 @@ TEST(malloc, verify_alignment) {
}
TEST(malloc, mallopt_smoke) {
#if !defined(ANDROID_HOST_MUSL)
#if defined(__BIONIC__)
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";
GTEST_SKIP() << "bionic-only test";
#endif
}