From e0b5d630215f5ac8d63fa1f17af2b1f653ba87ae Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 13 Jun 2023 22:01:29 +0200 Subject: [PATCH] tests/unittests: improve int size detection Deduce from the value of `INT_MAX` whether `int` is 16 bit or 32 bit, rather than check CPU names. --- tests/unittests/common/unittests-constants.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unittests/common/unittests-constants.h b/tests/unittests/common/unittests-constants.h index e36e2ceac7..5d5a730624 100644 --- a/tests/unittests/common/unittests-constants.h +++ b/tests/unittests/common/unittests-constants.h @@ -8,6 +8,9 @@ #ifndef UNITTESTS_CONSTANTS_H #define UNITTESTS_CONSTANTS_H +#include +#include + #include "embUnit/embUnit.h" #ifdef __cplusplus @@ -55,7 +58,7 @@ extern "C" { #define TEST_UINT64 (13500266397057512199LLU) #endif -#if defined(CPU_CC430) || defined(CPU_MSP430FXYZ) || defined(CPU_ATMEGA2560) +#if INT_MAX == INT16_MAX #define TEST_INT TEST_INT16 #else #define TEST_INT TEST_INT32