From d6706d1a5f08e6584e4669d618e4696f3f564222 Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Mon, 9 Dec 2019 13:11:56 +0200 Subject: [PATCH 1/2] Unittest configuration mechanism improved Earlier all unittests ended up having all flags in common from all unittest targets. This is now improved by using googletest provided mechanism to set build time compile options All cmake files have been modified to reflect changes (when needed) Could not figure out a syntax for {0x00, 0x00, ..., 0x00} intitializer list yet, so those needs to be setup by updating C/CXX flags. --- UNITTESTS/CMakeLists.txt | 5 + UNITTESTS/drivers/PwmOut/unittest.cmake | 7 +- UNITTESTS/drivers/Watchdog/unittest.cmake | 11 +- UNITTESTS/empty_baseline/unittest.cmake | 102 ++++++++++----- UNITTESTS/events/equeue/unittest.cmake | 7 +- .../AT/at_cellularcontext/unittest.cmake | 7 + .../AT/at_cellulardevice/unittest.cmake | 18 ++- .../AT/at_cellularsms/unittest.cmake | 7 +- .../framework/AT/athandler/athandlertest.cpp | 26 ++++ .../framework/AT/athandler/unittest.cmake | 10 +- .../device/cellularcontext/unittest.cmake | 16 ++- .../device/cellulardevice/unittest.cmake | 14 +- .../cellularstatemachine/unittest.cmake | 16 ++- .../features/lorawan/loramac/unittest.cmake | 22 ++-- .../lorawan/loramacchannelplan/unittest.cmake | 5 +- .../lorawan/loramaccommand/unittest.cmake | 3 + .../lorawan/loramaccrypto/unittest.cmake | 3 + .../features/lorawan/loraphy/unittest.cmake | 9 +- .../lorawan/loraphyas923/unittest.cmake | 6 + .../lorawan/loraphyau915/unittest.cmake | 6 + .../lorawan/loraphycn470/unittest.cmake | 9 ++ .../lorawan/loraphycn779/unittest.cmake | 5 + .../lorawan/loraphyeu433/unittest.cmake | 6 + .../lorawan/loraphyeu868/unittest.cmake | 6 + .../lorawan/loraphyin865/unittest.cmake | 6 + .../lorawan/loraphykr920/unittest.cmake | 6 + .../loraphyus915/Test_LoRaPHYUS915.cpp | 1 + .../lorawan/loraphyus915/unittest.cmake | 6 + .../lorawan/lorawaninterface/unittest.cmake | 7 +- .../lorawan/lorawanstack/unittest.cmake | 14 +- .../lorawantimer/Test_LoRaWANTimer.cpp | 3 + .../lorawan/lorawantimer/unittest.cmake | 6 +- .../CellularNonIPSocket/unittest.cmake | 5 + .../netsocket/nsapi_dns/unittest.cmake | 10 +- .../HeapBlockDevice/unittest.cmake | 122 ++++++------------ UNITTESTS/stubs/AT_CellularContext_stub.cpp | 4 +- 36 files changed, 341 insertions(+), 175 deletions(-) diff --git a/UNITTESTS/CMakeLists.txt b/UNITTESTS/CMakeLists.txt index f39dab41bf..e9dfb7b9d2 100644 --- a/UNITTESTS/CMakeLists.txt +++ b/UNITTESTS/CMakeLists.txt @@ -158,6 +158,7 @@ foreach(testfile ${unittest-file-list}) set(unittest-includes ${unittest-includes-base}) set(unittest-sources) set(unittest-test-sources) + set(unittest-test-flags) # Get source files include("${testfile}") @@ -184,6 +185,8 @@ foreach(testfile ${unittest-file-list}) add_library("${TEST_SUITE_NAME}.${LIB_NAME}" STATIC ${unittest-sources}) target_include_directories("${TEST_SUITE_NAME}.${LIB_NAME}" PRIVATE ${unittest-includes}) + target_compile_options("${TEST_SUITE_NAME}.${LIB_NAME}" PRIVATE + ${unittest-test-flags}) set(LIBS_TO_BE_LINKED ${LIBS_TO_BE_LINKED} "${TEST_SUITE_NAME}.${LIB_NAME}") # Append lib build directory to list @@ -195,6 +198,8 @@ foreach(testfile ${unittest-file-list}) add_executable(${TEST_SUITE_NAME} ${unittest-test-sources}) target_include_directories(${TEST_SUITE_NAME} PRIVATE ${unittest-includes}) + target_compile_options(${TEST_SUITE_NAME} PRIVATE + ${unittest-test-flags}) # Link the executable with the libraries. target_link_libraries(${TEST_SUITE_NAME} ${LIBS_TO_BE_LINKED}) diff --git a/UNITTESTS/drivers/PwmOut/unittest.cmake b/UNITTESTS/drivers/PwmOut/unittest.cmake index 84dc7938d2..0f03592db0 100644 --- a/UNITTESTS/drivers/PwmOut/unittest.cmake +++ b/UNITTESTS/drivers/PwmOut/unittest.cmake @@ -23,6 +23,7 @@ set(unittest-test-sources stubs/pwmout_api_stub.c ) -# defines -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_PWMOUT") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_PWMOUT") +set(unittest-test-flags + -DDEVICE_PWMOUT +) + diff --git a/UNITTESTS/drivers/Watchdog/unittest.cmake b/UNITTESTS/drivers/Watchdog/unittest.cmake index 702ef40ac7..bea2163e0d 100644 --- a/UNITTESTS/drivers/Watchdog/unittest.cmake +++ b/UNITTESTS/drivers/Watchdog/unittest.cmake @@ -17,12 +17,13 @@ set(unittest-sources # Test files set(unittest-test-sources - drivers/Watchdog/test_watchdog.cpp - stubs/mbed_critical_stub.c + drivers/Watchdog/test_watchdog.cpp + stubs/mbed_critical_stub.c stubs/mbed_assert_stub.cpp stubs/watchdog_api_stub.c ) -# defines -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1") +set(unittest-test-flags + -DDEVICE_WATCHDOG + -DMBED_WDOG_ASSERT=1 +) diff --git a/UNITTESTS/empty_baseline/unittest.cmake b/UNITTESTS/empty_baseline/unittest.cmake index 81f36fd3d1..39e6699a3b 100644 --- a/UNITTESTS/empty_baseline/unittest.cmake +++ b/UNITTESTS/empty_baseline/unittest.cmake @@ -12,42 +12,78 @@ set(unittest-includes ${unittest-includes} ) set(unittest-sources - ../features/device_key/source/DeviceKey.cpp - ../components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp - ../components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp - ../components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp - ../components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp - ../components/storage/blockdevice/COMPONENT_RSPIF/SPIFReducedBlockDevice.cpp - ../components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp - ../components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp - ../features/storage/filesystem/Dir.cpp - ../features/storage/filesystem/FileSystem.cpp - ../features/storage/filesystem/File.cpp - ../features/storage/kvstore/global_api/kvstore_global_api.cpp - ../features/storage/kvstore/securestore/SecureStore.cpp - ../features/storage/kvstore/kv_map/KVMap.cpp - ../features/storage/kvstore/tdbstore/TDBStore.cpp - ../features/storage/kvstore/direct_access_devicekey/DirectAccessDevicekey.cpp - ../features/storage/kvstore/conf/kv_config.cpp - ../features/storage/kvstore/filesystemstore/FileSystemStore.cpp - ../features/storage/system_storage/SystemStorage.cpp - ../features/storage/blockdevice/ChainingBlockDevice.cpp - ../features/storage/blockdevice/ReadOnlyBlockDevice.cpp - ../features/storage/blockdevice/SlicingBlockDevice.cpp - ../features/storage/blockdevice/MBRBlockDevice.cpp - ../features/storage/blockdevice/HeapBlockDevice.cpp - ../features/storage/blockdevice/FlashSimBlockDevice.cpp - ../features/storage/blockdevice/ObservingBlockDevice.cpp - ../features/storage/blockdevice/ProfilingBlockDevice.cpp - ../features/storage/blockdevice/BufferedBlockDevice.cpp - ../features/storage/blockdevice/ExhaustibleBlockDevice.cpp + ../features/device_key/source/DeviceKey.cpp + ../components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp + ../components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp + ../components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp + ../components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp + ../components/storage/blockdevice/COMPONENT_RSPIF/SPIFReducedBlockDevice.cpp + ../components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp + ../components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp + ../features/storage/filesystem/Dir.cpp + ../features/storage/filesystem/FileSystem.cpp + ../features/storage/filesystem/File.cpp + ../features/storage/kvstore/global_api/kvstore_global_api.cpp + ../features/storage/kvstore/securestore/SecureStore.cpp + ../features/storage/kvstore/kv_map/KVMap.cpp + ../features/storage/kvstore/tdbstore/TDBStore.cpp + ../features/storage/kvstore/direct_access_devicekey/DirectAccessDevicekey.cpp + ../features/storage/kvstore/conf/kv_config.cpp + ../features/storage/kvstore/filesystemstore/FileSystemStore.cpp + ../features/storage/system_storage/SystemStorage.cpp + ../features/storage/blockdevice/ChainingBlockDevice.cpp + ../features/storage/blockdevice/ReadOnlyBlockDevice.cpp + ../features/storage/blockdevice/SlicingBlockDevice.cpp + ../features/storage/blockdevice/MBRBlockDevice.cpp + ../features/storage/blockdevice/HeapBlockDevice.cpp + ../features/storage/blockdevice/FlashSimBlockDevice.cpp + ../features/storage/blockdevice/ObservingBlockDevice.cpp + ../features/storage/blockdevice/ProfilingBlockDevice.cpp + ../features/storage/blockdevice/BufferedBlockDevice.cpp + ../features/storage/blockdevice/ExhaustibleBlockDevice.cpp ) set(unittest-test-sources empty_baseline/empty_baseline.cpp ) -set(DEVICE_FLAGS "-DDEVICE_ANALOGIN -DDEVICE_ANALOGOUT -DDEVICE_CAN -DDEVICE_ETHERNET -DDEVICE_FLASH -DDEVICE_I2C -DDEVICE_I2CSLAVE -DDEVICE_I2C_ASYNCH -DDEVICE_INTERRUPTIN -DDEVICE_LPTICKER -DDEVICE_PORTIN -DDEVICE_PORTINOUT -DDEVICE_PORTOUT -DDEVICE_PWMOUT -DDEVICE_QSPI -DDEVICE_SERIAL -DDEVICE_SERIAL_ASYNCH -DDEVICE_SERIAL_FC -DDEVICE_SPI -DDEVICE_SPISLAVE -DDEVICE_SPI_ASYNCH -DDEVICE_FLASH -DCOMPONENT_FLASHIAP") -set(CONF_FLAGS "-DMBED_CONF_PLATFORM_CTHUNK_COUNT_MAX=10 -DMBED_CONF_DATAFLASH_SPI_FREQ=1 -DMBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS=0 -DMBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE=0 -DMBED_CONF_QSPIF_QSPI_FREQ=1 -DMBED_CONF_QSPIF_QSPI_MIN_READ_SIZE=1 -DMBED_CONF_QSPIF_QSPI_MIN_PROG_SIZE=1 -DMBED_LFS_READ_SIZE=64 -DMBED_LFS_PROG_SIZE=64 -DMBED_LFS_BLOCK_SIZE=512 -DMBED_LFS_LOOKAHEAD=512 -DFLASHIAP_APP_ROM_END_ADDR=0x80000 -DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE=1024 -DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS=0x80000 -DMBED_CONF_STORAGE_STORAGE_TYPE=default") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEVICE_FLAGS} ${CONF_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DEVICE_FLAGS} ${CONF_FLAGS}") +set(unittest-test-flags + -DDEVICE_ANALOGIN + -DDEVICE_ANALOGOUT + -DDEVICE_CAN + -DDEVICE_ETHERNET + -DDEVICE_FLASH + -DDEVICE_I2C + -DDEVICE_I2CSLAVE + -DDEVICE_I2C_ASYNCH + -DDEVICE_INTERRUPTIN + -DDEVICE_LPTICKER + -DDEVICE_PORTIN + -DDEVICE_PORTINOUT + -DDEVICE_PORTOUT + -DDEVICE_PWMOUT + -DDEVICE_QSPI + -DDEVICE_SERIAL + -DDEVICE_SERIAL_ASYNCH + -DDEVICE_SERIAL_FC + -DDEVICE_SPI + -DDEVICE_SPISLAVE + -DDEVICE_SPI_ASYNCH + -DCOMPONENT_FLASHIAP + -DMBED_CONF_PLATFORM_CTHUNK_COUNT_MAX=10 + -DMBED_CONF_DATAFLASH_SPI_FREQ=1 + -DMBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS=0 + -DMBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE=0 + -DMBED_CONF_QSPIF_QSPI_FREQ=1 + -DMBED_CONF_QSPIF_QSPI_MIN_READ_SIZE=1 + -DMBED_CONF_QSPIF_QSPI_MIN_PROG_SIZE=1 + -DMBED_LFS_READ_SIZE=64 + -DMBED_LFS_PROG_SIZE=64 + -DMBED_LFS_BLOCK_SIZE=512 + -DMBED_LFS_LOOKAHEAD=512 + -DFLASHIAP_APP_ROM_END_ADDR=0x80000 + -DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE=1024 + -DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS=0x80000 + -DMBED_CONF_STORAGE_STORAGE_TYPE=default + -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096 +) diff --git a/UNITTESTS/events/equeue/unittest.cmake b/UNITTESTS/events/equeue/unittest.cmake index 1b97b53b8c..b685b9108c 100644 --- a/UNITTESTS/events/equeue/unittest.cmake +++ b/UNITTESTS/events/equeue/unittest.cmake @@ -20,5 +20,8 @@ set(unittest-test-sources stubs/EqueuePosix_stub.c ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -DEQUEUE_PLATFORM_POSIX") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -DEQUEUE_PLATFORM_POSIX") +set(unittest-test-flags + -pthread + -DEQUEUE_PLATFORM_POSIX +) + diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake index 4f37b2e497..d0bd83c975 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake @@ -45,3 +45,10 @@ set(unittest-test-sources stubs/ConditionVariable_stub.cpp stubs/Mutex_stub.cpp ) + +set(unittest-test-flags + -DDEVICE_SERIAL=1 + -DDEVICE_INTERRUPTIN=1 + -DMBED_CONF_CELLULAR_USE_SMS=1 + -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL +) diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake index cc4bd08556..4584229884 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake @@ -48,9 +48,17 @@ set(unittest-test-sources stubs/Mutex_stub.cpp ) -# defines -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_SERIAL=1 -DDEVICE_INTERRUPTIN=1 -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN=NULL") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_SERIAL=1 -DDEVICE_INTERRUPTIN=1 -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN=NULL") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200") +set(unittest-test-flags + -DDEVICE_SERIAL=1 + -DDEVICE_INTERRUPTIN=1 + -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL + -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME=NULL + -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD=NULL + -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN=NULL + -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN=NULL + -DMDMTXD=NC + -DMDMRXD=NC + -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 + -DMBED_CONF_CELLULAR_USE_SMS=1 +) diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake index a29f95ed46..cd4cc12980 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake @@ -32,7 +32,6 @@ set(unittest-test-sources stubs/Mutex_stub.cpp ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_CELLULAR_USE_SMS=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_CELLULAR_USE_SMS=1") - - +set(unittest-test-flags + -DMBED_CONF_CELLULAR_USE_SMS=1 +) diff --git a/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp b/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp index 44a86e5e94..99d240ae09 100644 --- a/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp +++ b/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp @@ -947,6 +947,32 @@ TEST_F(TestATHandler, test_ATHandler_read_int) ret = at.read_int(); EXPECT_TRUE(2 == ret); + at.resp_stop(); + at.clear_error(); + + char table3[] = "\"9223372036854775808,\"OK\r\n\0"; + filehandle_stub_table = table3; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = strlen(table3); + + at.resp_start(); + ret = at.read_int(); + EXPECT_TRUE(-1 == ret); + at.resp_stop(); + at.clear_error(); + + char table4[] = "\"-9223372036854775809,\"OK\r\n\0"; + filehandle_stub_table = table4; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = strlen(table4); + + at.resp_start(); + ret = at.read_int(); + EXPECT_TRUE(-1 == ret); + at.resp_stop(); + at.clear_error(); } TEST_F(TestATHandler, test_ATHandler_resp_start) diff --git a/UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake index e47181168f..c2f232945b 100644 --- a/UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake @@ -10,7 +10,7 @@ set(unittest-includes ${unittest-includes} ../features/cellular/framework/common ../features/cellular/framework/AT ../features/frameworks/mbed-client-randlib/mbed-client-randlib - + ) # Source files @@ -41,5 +41,9 @@ set(unittest-test-sources stubs/rtx_mutex_stub.c ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_CELLULAR_DEBUG_AT=true -DOS_STACK_SIZE=2048") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_CELLULAR_DEBUG_AT=true -DOS_STACK_SIZE=2048") +set(unittest-test-flags + -DMBED_CONF_CELLULAR_DEBUG_AT=true + -DOS_STACK_SIZE=2048 + -DDEVICE_SERIAL=1 + -DDEVICE_INTERRUPTIN=1 +) diff --git a/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake index b0a46633f8..a51ee147fb 100644 --- a/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake @@ -45,6 +45,16 @@ set(unittest-test-sources stubs/Mutex_stub.cpp ) -# defines -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1 -DMBED_CONF_CELLULAR_CONTROL_PLANE_OPT=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1 -DMBED_CONF_CELLULAR_CONTROL_PLANE_OPT=0") +set(unittest-test-flags + -DMDMRTS=PTC0 + -DMDMCTS=PTC1 + -DMDMTXD=NC + -DMDMRXD=NC + -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 + -DCELLULAR_DEVICE=myCellularDevice + -DDEVICE_SERIAL_FC=1 + -DMBED_CONF_CELLULAR_CONTROL_PLANE_OPT=0 + -DDEVICE_SERIAL=1 + -DDEVICE_INTERRUPTIN=1 + -DMBED_CONF_CELLULAR_USE_SMS=1 +) diff --git a/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake index 4177b67cf6..7a21e10003 100644 --- a/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake @@ -37,6 +37,18 @@ set(unittest-test-sources stubs/Mutex_stub.cpp ) +set(unittest-test-flags + -DMDMRTS=PTC0 + -DMDMCTS=PTC1 + -DMDMTXD=NC + -DMDMRXD=NC + -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 + -DCELLULAR_DEVICE=myCellularDevice + -DDEVICE_SERIAL_FC=1 + -DDEVICE_SERIAL=1 + -DDEVICE_INTERRUPTIN=1 +) + # defines -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1") diff --git a/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake index 9b844877c1..61e33e03ff 100644 --- a/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake @@ -42,6 +42,16 @@ set(unittest-test-sources stubs/Mutex_stub.cpp ) -# defines -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1 -DMBED_CONF_RTOS_PRESENT=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1 -DMBED_CONF_RTOS_PRESENT=1") +set(unittest-test-flags + -DMDMRTS=PTC0 + -DMDMCTS=PTC1 + -DMDMTXD=NC + -DMDMRXD=NC + -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 + -DCELLULAR_DEVICE=myCellularDevice + -DDEVICE_SERIAL_FC=1 + -DMBED_CONF_RTOS_PRESENT=1 + -DDEVICE_SERIAL=1 + -DDEVICE_INTERRUPTIN=1 + -DMBED_CONF_CELLULAR_USE_SMS=1 +) diff --git a/UNITTESTS/features/lorawan/loramac/unittest.cmake b/UNITTESTS/features/lorawan/loramac/unittest.cmake index bb999d8850..f68bee28b8 100644 --- a/UNITTESTS/features/lorawan/loramac/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramac/unittest.cmake @@ -43,19 +43,21 @@ set(unittest-test-sources stubs/Mutex_stub.cpp ) -# defines -#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_RTOS_PRESENT=1") -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_RTOS_PRESENT=1") +set(unittest-test-flags + -DMBED_CONF_LORA_ADR_ON=true + -DMBED_CONF_LORA_PUBLIC_NETWORK=true + -DMBED_CONF_LORA_NB_TRIALS=2 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_DUTY_CYCLE_ON=true + -DMBED_CONF_LORA_MAX_SYS_RX_ERROR=10 + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DEVICE_ADDRESS=0x00000000 +) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_ADR_ON=true -DMBED_CONF_LORA_PUBLIC_NETWORK=true -DMBED_CONF_LORA_NB_TRIALS=2 -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_ADR_ON=true -DMBED_CONF_LORA_PUBLIC_NETWORK=true -DMBED_CONF_LORA_NB_TRIALS=2 -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5") - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_DUTY_CYCLE_ON=true -DMBED_CONF_LORA_MAX_SYS_RX_ERROR=10 -DMBED_CONF_LORA_NWKSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_DUTY_CYCLE_ON=true -DMBED_CONF_LORA_MAX_SYS_RX_ERROR=10 -DMBED_CONF_LORA_NWKSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_NWKSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_NWKSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_APPSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_APPSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_DEVICE_ADDRESS=\"0x00000000\"") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_DEVICE_ADDRESS=\"0x00000000\"") diff --git a/UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake b/UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake index 1f15bf09ed..4bc3c0ac89 100644 --- a/UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake @@ -35,5 +35,6 @@ set(unittest-test-sources stubs/LoRaPHY_stub.cpp ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_TX_MAX_SIZE=255") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_TX_MAX_SIZE=255") +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 +) diff --git a/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake b/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake index cd05c2c44a..a1929ec218 100644 --- a/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake @@ -36,3 +36,6 @@ set(unittest-test-sources stubs/LoRaPHY_stub.cpp ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 +) diff --git a/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake b/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake index 69ab1c8ff7..7e9eeb8222 100644 --- a/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake @@ -40,3 +40,6 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + ) diff --git a/UNITTESTS/features/lorawan/loraphy/unittest.cmake b/UNITTESTS/features/lorawan/loraphy/unittest.cmake index 7eef3259c1..75665763d0 100644 --- a/UNITTESTS/features/lorawan/loraphy/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphy/unittest.cmake @@ -36,6 +36,11 @@ set(unittest-test-sources stubs/mbed_assert_stub.cpp ) +set(unittest-test-flags + -DMBED_CONF_LORA_WAKEUP_TIME=5 + -DMBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_NB_TRIALS=2 +) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 -DMBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true -DMBED_CONF_LORA_WAKEUP_TIME=5") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 -DMBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true -DMBED_CONF_LORA_WAKEUP_TIME=5") diff --git a/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake b/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake index c54402ee5e..723ade142b 100644 --- a/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake @@ -38,3 +38,9 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + diff --git a/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake b/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake index e225f5b324..93c12ac934 100644 --- a/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake @@ -38,6 +38,12 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_FSB_MASK=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_FSB_MASK=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"") diff --git a/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake b/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake index f3e2caa64a..910ba9a183 100644 --- a/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake @@ -38,3 +38,12 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_FSB_MASK_CHINA=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_FSB_MASK_CHINA=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"") + diff --git a/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake b/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake index aabf895989..66c11e27a4 100644 --- a/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake @@ -37,6 +37,11 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_FSB_MASK_CHINA=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_FSB_MASK_CHINA=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"") diff --git a/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake b/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake index b4544ed8aa..ffafac6247 100644 --- a/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake @@ -37,3 +37,9 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + diff --git a/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake b/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake index 14887b49a3..009eb043b2 100644 --- a/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake @@ -37,3 +37,9 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + diff --git a/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake b/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake index 74231bf9a9..1ba6039ac5 100644 --- a/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake @@ -37,3 +37,9 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + diff --git a/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake b/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake index ee92a1472e..a34e3aad8d 100644 --- a/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake @@ -38,3 +38,9 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + diff --git a/UNITTESTS/features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp b/UNITTESTS/features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp index 36e3a15e78..82d9e7b685 100644 --- a/UNITTESTS/features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp +++ b/UNITTESTS/features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp @@ -19,6 +19,7 @@ #include "LoRaPHYUS915.h" #include "LoRaPHY_stub.h" + class my_radio : public LoRaRadio { public: diff --git a/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake b/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake index 5e7ac3305d..d68bca9de2 100644 --- a/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake @@ -38,5 +38,11 @@ set(unittest-test-sources ) +set(unittest-test-flags + -DMBED_CONF_LORA_TX_MAX_SIZE=255 + -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_FSB_MASK=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_FSB_MASK=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"") diff --git a/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake b/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake index ce3ff46233..0db5b7ad29 100644 --- a/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake @@ -44,9 +44,10 @@ set(unittest-test-sources stubs/Mutex_stub.cpp ) -# defines -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_PHY=\"EU868\"") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_PHY=\"EU868\"") +set(unittest-test-flags + -DMBED_CONF_LORA_PHY=EU868 + -DMBED_CONF_LORA_TX_MAX_SIZE=255 +) diff --git a/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake b/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake index 8cb8d6af5f..cbedd9cdf4 100644 --- a/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake @@ -45,13 +45,9 @@ set(unittest-test-sources stubs/Mutex_stub.cpp ) -# defines -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_OVER_THE_AIR_ACTIVATION=true -DMBED_CONF_LORA_DEVICE_EUI=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_OVER_THE_AIR_ACTIVATION=true -DMBED_CONF_LORA_DEVICE_EUI=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_AUTOMATIC_UPLINK_MESSAGE=true") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_AUTOMATIC_UPLINK_MESSAGE=true") - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_APPLICATION_EUI=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\" -DMBED_CONF_LORA_APPLICATION_KEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_APPLICATION_EUI=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\" -DMBED_CONF_LORA_APPLICATION_KEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"") +set(unittest-test-flags + -DMBED_CONF_LORA_OVER_THE_AIR_ACTIVATION=true + -DMBED_CONF_LORA_AUTOMATIC_UPLINK_MESSAGE=true + -DMBED_CONF_LORA_TX_MAX_SIZE=255 +) diff --git a/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp b/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp index 3389de828b..9fb10a3985 100644 --- a/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp +++ b/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp @@ -18,6 +18,8 @@ #include "gtest/gtest.h" #include "LoRaWANTimer.h" +#include "equeue_stub.h" + using namespace events; class Test_LoRaWANTimer : public testing::Test { @@ -69,6 +71,7 @@ TEST_F(Test_LoRaWANTimer, init) TEST_F(Test_LoRaWANTimer, start) { + equeue_stub.void_ptr = NULL; timer_event_t ev; memset(&ev, 0, sizeof(ev)); object->start(ev, 10); diff --git a/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake b/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake index 663f4ba674..b4ee1c9e3d 100644 --- a/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake @@ -37,6 +37,8 @@ set(unittest-test-sources stubs/equeue_stub.c ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG=1") +set(unittest-test-flags + -DNDEBUG=1 + -DMBED_CONF_LORA_TX_MAX_SIZE=255 +) diff --git a/UNITTESTS/features/netsocket/cellular/CellularNonIPSocket/unittest.cmake b/UNITTESTS/features/netsocket/cellular/CellularNonIPSocket/unittest.cmake index 05e1710710..066a1986bf 100644 --- a/UNITTESTS/features/netsocket/cellular/CellularNonIPSocket/unittest.cmake +++ b/UNITTESTS/features/netsocket/cellular/CellularNonIPSocket/unittest.cmake @@ -22,3 +22,8 @@ set(unittest-test-sources stubs/CellularContext_stub.cpp stubs/mbed_assert_stub.cpp ) + +set(unittest-test-flags + -DDEVICE_SERIAL=1 + -DDEVICE_INTERRUPTIN=1 +) diff --git a/UNITTESTS/features/netsocket/nsapi_dns/unittest.cmake b/UNITTESTS/features/netsocket/nsapi_dns/unittest.cmake index ba983cb6f7..63980cb611 100644 --- a/UNITTESTS/features/netsocket/nsapi_dns/unittest.cmake +++ b/UNITTESTS/features/netsocket/nsapi_dns/unittest.cmake @@ -13,7 +13,7 @@ set(unittest-sources ../features/frameworks/nanostack-libservice/source/libip6string/ip6tos.c ../features/frameworks/nanostack-libservice/source/libip4string/stoip4.c ../features/frameworks/nanostack-libservice/source/libip6string/stoip6.c - ../features/frameworks/nanostack-libservice/source/libBits/common_functions.c + ../features/frameworks/nanostack-libservice/source/libBits/common_functions.c ../features/frameworks/nanostack-libservice/source/libList/ns_list.c ) @@ -38,5 +38,9 @@ set(unittest-test-sources ../features/netsocket/UDPSocket.cpp ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME=10000 -DMBED_CONF_NSAPI_DNS_RETRIES=1 -DMBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS=10 -DMBED_CONF_NSAPI_DNS_CACHE_SIZE=5") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME=10000 -DMBED_CONF_NSAPI_DNS_RETRIES=1 -DMBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS=10 -DMBED_CONF_NSAPI_DNS_CACHE_SIZE=5") \ No newline at end of file +set(unittest-test-flags + -DMBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME=10000 + -DMBED_CONF_NSAPI_DNS_RETRIES=1 + -DMBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS=10 + -DMBED_CONF_NSAPI_DNS_CACHE_SIZE=5 +) diff --git a/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake b/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake index 0c064dc8f5..254a5ccc14 100644 --- a/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake +++ b/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake @@ -18,83 +18,45 @@ set(unittest-test-sources features/storage/blockdevice/HeapBlockDevice/test.cpp ) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FFS_DBG=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\"") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FFS_DBG=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\"") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1") +set(unittest-test-flags + -DMBED_CONF_FAT_CHAN_FFS_DBG=0 + -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0 + -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0 + -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0 + -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0 + -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1 + -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0 + -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0 + -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0 + -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0 + -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0 + -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437 + -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3 + -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255 + -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0 + -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255 + -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12 + -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3 + -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1 + -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4 + -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0 + -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\" + -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0 + -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512 + -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096 + -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1 + -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0 + -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1 + -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0 + -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1 + -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0 + -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1 + -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1 + -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017 + -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0 + -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0 + -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000 + -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE + -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0 + -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1 +) diff --git a/UNITTESTS/stubs/AT_CellularContext_stub.cpp b/UNITTESTS/stubs/AT_CellularContext_stub.cpp index 88a7f5e879..e2ce0c2cd5 100644 --- a/UNITTESTS/stubs/AT_CellularContext_stub.cpp +++ b/UNITTESTS/stubs/AT_CellularContext_stub.cpp @@ -30,8 +30,8 @@ AT_CellularContext::AT_CellularContext(ATHandler &at, CellularDevice *device, co _is_context_active = false; _is_context_activated = false; _apn = apn; - _uname = MBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME; - _pwd = MBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD; + _uname = NULL; + _pwd = NULL; _status_cb = NULL; _cid = -1; _new_context_set = false; From aac3437a22ff2831080f1e7e50546335c6a6a400 Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Mon, 9 Dec 2019 14:09:42 +0200 Subject: [PATCH 2/2] Cleaned up athandlertest.cpp --- .../framework/AT/athandler/athandlertest.cpp | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp b/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp index 99d240ae09..44a86e5e94 100644 --- a/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp +++ b/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp @@ -947,32 +947,6 @@ TEST_F(TestATHandler, test_ATHandler_read_int) ret = at.read_int(); EXPECT_TRUE(2 == ret); - at.resp_stop(); - at.clear_error(); - - char table3[] = "\"9223372036854775808,\"OK\r\n\0"; - filehandle_stub_table = table3; - filehandle_stub_table_pos = 0; - mbed_poll_stub::revents_value = POLLIN; - mbed_poll_stub::int_value = strlen(table3); - - at.resp_start(); - ret = at.read_int(); - EXPECT_TRUE(-1 == ret); - at.resp_stop(); - at.clear_error(); - - char table4[] = "\"-9223372036854775809,\"OK\r\n\0"; - filehandle_stub_table = table4; - filehandle_stub_table_pos = 0; - mbed_poll_stub::revents_value = POLLIN; - mbed_poll_stub::int_value = strlen(table4); - - at.resp_start(); - ret = at.read_int(); - EXPECT_TRUE(-1 == ret); - at.resp_stop(); - at.clear_error(); } TEST_F(TestATHandler, test_ATHandler_resp_start)