1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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.
This commit is contained in:
Marian Buschsieweke 2023-06-13 22:01:29 +02:00
parent ef82aa6acc
commit e0b5d63021
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -8,6 +8,9 @@
#ifndef UNITTESTS_CONSTANTS_H
#define UNITTESTS_CONSTANTS_H
#include <limits.h>
#include <stdint.h>
#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