Skip to content

Commit 9b8acca

Browse files
committed
Remove #ifdef UNITTEST from MbedCRC.h
Production code should not contain any test-specific checks. Rather than checking `UNITTEST`, MbedCRC.h can simply include in all cases <mstd_type_traits> whose unit test stub exists. Also remove the `UNITTEST` macro from CMake definitions of kvstore unit tests which depend on MbedCRC.h.
1 parent dd81b53 commit 9b8acca

File tree

3 files changed

+0
-11
lines changed

3 files changed

+0
-11
lines changed

drivers/include/drivers/MbedCRC.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@
2929
#include "platform/SingletonPtr.h"
3030
#include "platform/PlatformMutex.h"
3131

32-
#ifdef UNITTEST
33-
#include <type_traits>
34-
#define MSTD_CONSTEXPR_IF_HAS_IS_CONSTANT_EVALUATED
35-
#else
3632
#include <mstd_type_traits>
37-
#endif
3833

3934
namespace mbed {
4035
/** \addtogroup drivers-public-api */

storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ add_executable(${TEST_NAME})
77

88
target_compile_definitions(${TEST_NAME}
99
PRIVATE
10-
UNITTEST
1110
MBED_LFS_READ_SIZE=64
1211
MBED_LFS_PROG_SIZE=64
1312
MBED_LFS_BLOCK_SIZE=512

storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ set(TEST_NAME tdbstore-unittest)
55

66
add_executable(${TEST_NAME})
77

8-
target_compile_definitions(${TEST_NAME}
9-
PRIVATE
10-
UNITTEST
11-
)
12-
138
target_sources(${TEST_NAME}
149
PRIVATE
1510
${mbed-os_SOURCE_DIR}/storage/blockdevice/source/HeapBlockDevice.cpp

0 commit comments

Comments
 (0)