ref: 1b9b630334553ba7878cada99b8ed0927c831941
parent: 598b900d802c3cd2dada356a57510e7655694a07
author: lieff <[email protected]>
date: Mon Jan 15 12:30:39 EST 2018
test nosimd coverage
--- a/minimp3.h
+++ b/minimp3.h
@@ -128,6 +128,11 @@
{
static int g_have_simd;
int CPUInfo[4];
+#ifdef MINIMP3_TEST
+ static int g_counter;
+ if (g_counter++ > 100)
+ goto test_nosimd;
+#endif
if (g_have_simd)
return g_have_simd - 1;
minimp3_cpuid(CPUInfo, 0);
@@ -137,6 +142,9 @@
g_have_simd = (CPUInfo[3] & (1 << 26)) + 1; // SSE2
return g_have_simd - 1;
}
+#ifdef MINIMP3_TEST
+test_nosimd:
+#endif
g_have_simd = 1;
return 0;
}
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -6,7 +6,7 @@
set -e
-gcc -coverage -O0 -o minimp3 minimp3_test.c -lm
+gcc -coverage -O0 -DMINIMP3_TEST -o minimp3 minimp3_test.c -lm
gcov minimp3_test.c
scripts/test.sh