From 1dda8cf666a28b5eaadc68b1cd5457c92c1f347d Mon Sep 17 00:00:00 2001 From: Robin Ekman Date: Thu, 12 Sep 2024 21:48:16 +0200 Subject: [PATCH] fix: test for arm64 architecture properly in MP3DecoderTests on arm64/aarch64 libmpg123 generates bad data leading to the test MP3DecoderTests.test_DecodeMP3As2PiecesMPG123_SameAs1Piece failing. this test was excluded by testing for the TARGET_CPU_ARM64 macro. but this is an Xcode macro defined in TargetConditionals.h. thus the test would not be excluded when compiling on a device such as the Raspberry Pi 4 or 5. the portable way to test for arm64 architecture with clang is to check for __aarch64__: https://stackoverflow.com/a/41666292 --- Tests/MP3DecoderTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/MP3DecoderTests.cpp b/Tests/MP3DecoderTests.cpp index be19f3c513..40d382e7d0 100644 --- a/Tests/MP3DecoderTests.cpp +++ b/Tests/MP3DecoderTests.cpp @@ -92,7 +92,7 @@ static void runMp3TwoPieceTestWithBackend(int backend) { EXPECT_TRUE(cmp==0); } -#if !TARGET_CPU_ARM64 +#if !__aarch64__ // FIXME: Looks like MPG123 generates bad data in that test. Needs proper debugging on arm64 host. TEST_F(MP3DecoderTests, test_DecodeMP3As2PiecesMPG123_SameAs1Piece) { runMp3TwoPieceTestWithBackend(0); // mpg123