diff --git a/UNITTESTS/drivers/PwmOut/unittest.cmake b/UNITTESTS/drivers/PwmOut/unittest.cmake index 475cf0ae94..84dc7938d2 100644 --- a/UNITTESTS/drivers/PwmOut/unittest.cmake +++ b/UNITTESTS/drivers/PwmOut/unittest.cmake @@ -19,7 +19,7 @@ set(unittest-sources set(unittest-test-sources drivers/PwmOut/test_pwmout.cpp stubs/mbed_critical_stub.c - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/pwmout_api_stub.c ) diff --git a/UNITTESTS/drivers/Watchdog/unittest.cmake b/UNITTESTS/drivers/Watchdog/unittest.cmake index 1b907a9f54..702ef40ac7 100644 --- a/UNITTESTS/drivers/Watchdog/unittest.cmake +++ b/UNITTESTS/drivers/Watchdog/unittest.cmake @@ -19,7 +19,7 @@ set(unittest-sources set(unittest-test-sources drivers/Watchdog/test_watchdog.cpp stubs/mbed_critical_stub.c - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/watchdog_api_stub.c ) diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularbase/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularbase/unittest.cmake index beff24981a..a5eb81daab 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularbase/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularbase/unittest.cmake @@ -21,7 +21,7 @@ set(unittest-sources # Test files set(unittest-test-sources features/cellular/framework/AT/at_cellularbase/at_cellularbasetest.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/ATHandler_stub.cpp stubs/EventQueue_stub.cpp stubs/FileHandle_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake index 15bcccf231..4f37b2e497 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake @@ -30,7 +30,7 @@ set(unittest-test-sources stubs/equeue_stub.c stubs/EventQueue_stub.cpp stubs/FileHandle_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/NetworkInterface_stub.cpp stubs/NetworkInterfaceDefaults_stub.cpp stubs/NetworkStack_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake index ac50a142f6..cc4bd08556 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake @@ -34,7 +34,7 @@ set(unittest-test-sources stubs/NetworkInterfaceDefaults_stub.cpp stubs/EventQueue_stub.cpp stubs/FileHandle_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/CellularDevice_stub.cpp stubs/NetworkStack_stub.cpp stubs/AT_CellularContext_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularinformation/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularinformation/unittest.cmake index c8a646694f..f49beec89f 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularinformation/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularinformation/unittest.cmake @@ -24,7 +24,7 @@ set(unittest-test-sources stubs/AT_CellularBase_stub.cpp stubs/EventQueue_stub.cpp stubs/FileHandle_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/ConditionVariable_stub.cpp stubs/Mutex_stub.cpp ) diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularnetwork/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularnetwork/unittest.cmake index d2e6330239..e68b7e6819 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularnetwork/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularnetwork/unittest.cmake @@ -25,7 +25,7 @@ set(unittest-test-sources stubs/EventQueue_stub.cpp stubs/FileHandle_stub.cpp stubs/us_ticker_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/SocketAddress_stub.cpp stubs/randLIB_stub.cpp stubs/ConditionVariable_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake index c2407a6adf..0e2083992b 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake @@ -25,7 +25,7 @@ set(unittest-test-sources stubs/FileHandle_stub.cpp stubs/CellularUtil_stub.cpp stubs/us_ticker_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/ThisThread_stub.cpp stubs/mbed_wait_api_stub.cpp stubs/ConditionVariable_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularstack/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularstack/unittest.cmake index 85bd80fd5c..145dedb118 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularstack/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularstack/unittest.cmake @@ -27,7 +27,7 @@ set(unittest-test-sources stubs/us_ticker_stub.cpp stubs/NetworkStack_stub.cpp stubs/SocketAddress_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/ThisThread_stub.cpp stubs/ConditionVariable_stub.cpp stubs/Mutex_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake index 6d0419fed5..e47181168f 100644 --- a/UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake @@ -27,7 +27,7 @@ set(unittest-test-sources stubs/us_ticker_stub.cpp stubs/UARTSerial_stub.cpp stubs/SerialBase_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_poll_stub.cpp stubs/Timer_stub.cpp stubs/equeue_stub.c diff --git a/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake index fe3072e288..6b1757f2a0 100644 --- a/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake @@ -22,7 +22,7 @@ set(unittest-test-sources stubs/FileHandle_stub.cpp stubs/CellularStateMachine_stub.cpp stubs/EventQueue_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/UARTSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/ATHandler_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake index c6e4ae3767..4177b67cf6 100644 --- a/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake @@ -22,7 +22,7 @@ set(unittest-test-sources stubs/FileHandle_stub.cpp stubs/CellularStateMachine_stub.cpp stubs/EventQueue_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/UARTSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/ATHandler_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake index 172ba725d8..9b844877c1 100644 --- a/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake @@ -22,7 +22,7 @@ set(unittest-test-sources stubs/FileHandle_stub.cpp stubs/CellularDevice_stub.cpp stubs/EventQueue_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/UARTSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/ATHandler_stub.cpp diff --git a/UNITTESTS/features/lorawan/loramac/unittest.cmake b/UNITTESTS/features/lorawan/loramac/unittest.cmake index 24ba918272..bb999d8850 100644 --- a/UNITTESTS/features/lorawan/loramac/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramac/unittest.cmake @@ -34,7 +34,7 @@ set(unittest-test-sources features/lorawan/loramac/Test_LoRaMac.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANStack_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/LoRaMacCrypto_stub.cpp stubs/LoRaMacChannelPlan_stub.cpp stubs/LoRaWANTimer_stub.cpp diff --git a/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake b/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake index 1dc3272977..cd05c2c44a 100644 --- a/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake @@ -32,7 +32,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources features/lorawan/loramaccommand/Test_LoRaMacCommand.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/LoRaPHY_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake b/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake index 2001f8e9d7..69ab1c8ff7 100644 --- a/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake @@ -35,7 +35,7 @@ set(unittest-test-sources stubs/cipher_stub.c stubs/aes_stub.c stubs/cmac_stub.c - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ../features/nanostack/coap-service/test/coap-service/unittest/stub/mbedtls_stub.c ) diff --git a/UNITTESTS/features/lorawan/loraphy/unittest.cmake b/UNITTESTS/features/lorawan/loraphy/unittest.cmake index b3c8a5854a..7eef3259c1 100644 --- a/UNITTESTS/features/lorawan/loraphy/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphy/unittest.cmake @@ -33,7 +33,7 @@ set(unittest-includes ${unittest-includes} set(unittest-test-sources features/lorawan/loraphy/Test_LoRaPHY.cpp stubs/LoRaWANTimer_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake b/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake index b4648ab904..c54402ee5e 100644 --- a/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake @@ -34,7 +34,7 @@ set(unittest-test-sources features/lorawan/loraphyas923/Test_LoRaPHYAS923.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake b/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake index abc6c4752c..e225f5b324 100644 --- a/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake @@ -34,7 +34,7 @@ set(unittest-test-sources features/lorawan/loraphyau915/Test_LoRaPHYAU915.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake b/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake index 6c6746f189..f3e2caa64a 100644 --- a/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake @@ -34,7 +34,7 @@ set(unittest-test-sources features/lorawan/loraphycn470/Test_LoRaPHYCN470.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake b/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake index d0ccd7fece..aabf895989 100644 --- a/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake @@ -33,7 +33,7 @@ set(unittest-includes ${unittest-includes} set(unittest-test-sources features/lorawan/loraphycn779/Test_LoRaPHYCN779.cpp stubs/LoRaPHY_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake b/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake index 5966a3ee60..b4544ed8aa 100644 --- a/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake @@ -33,7 +33,7 @@ set(unittest-includes ${unittest-includes} set(unittest-test-sources features/lorawan/loraphyeu433/Test_LoRaPHYEU433.cpp stubs/LoRaPHY_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake b/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake index 1398a52257..14887b49a3 100644 --- a/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake @@ -33,7 +33,7 @@ set(unittest-includes ${unittest-includes} set(unittest-test-sources features/lorawan/loraphyeu868/Test_LoRaPHYEU868.cpp stubs/LoRaPHY_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake b/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake index 2fa34a6f73..74231bf9a9 100644 --- a/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake @@ -33,7 +33,7 @@ set(unittest-includes ${unittest-includes} set(unittest-test-sources features/lorawan/loraphyin865/Test_LoRaPHYIN865.cpp stubs/LoRaPHY_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake b/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake index cc32c13f02..ee92a1472e 100644 --- a/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake @@ -34,7 +34,7 @@ set(unittest-test-sources features/lorawan/loraphykr920/Test_LoRaPHYKR920.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake b/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake index f181da5e3f..5e7ac3305d 100644 --- a/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake @@ -34,7 +34,7 @@ set(unittest-test-sources features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake b/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake index f99ccca9ba..ce3ff46233 100644 --- a/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake @@ -35,7 +35,7 @@ set(unittest-test-sources stubs/LoRaPHY_stub.cpp stubs/LoRaWANStack_stub.cpp stubs/LoRaMac_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/LoRaMacCrypto_stub.cpp stubs/LoRaMacChannelPlan_stub.cpp stubs/LoRaWANTimer_stub.cpp diff --git a/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake b/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake index b8b506c044..8cb8d6af5f 100644 --- a/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake @@ -34,7 +34,7 @@ set(unittest-test-sources features/lorawan/lorawanstack/Test_LoRaWANStack.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaMac_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/LoRaMacCrypto_stub.cpp stubs/LoRaMacChannelPlan_stub.cpp diff --git a/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake b/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake index 75dd100985..663f4ba674 100644 --- a/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake @@ -33,7 +33,7 @@ set(unittest-includes ${unittest-includes} set(unittest-test-sources features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp stubs/EventQueue_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/equeue_stub.c ) diff --git a/UNITTESTS/features/netsocket/DTLSSocket/unittest.cmake b/UNITTESTS/features/netsocket/DTLSSocket/unittest.cmake index fa43a292ee..29f7916c8a 100644 --- a/UNITTESTS/features/netsocket/DTLSSocket/unittest.cmake +++ b/UNITTESTS/features/netsocket/DTLSSocket/unittest.cmake @@ -22,7 +22,7 @@ set(unittest-sources set(unittest-test-sources features/netsocket/DTLSSocket/test_DTLSSocket.cpp stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/mbed_critical_stub.c stubs/equeue_stub.c diff --git a/UNITTESTS/features/netsocket/DTLSSocketWrapper/unittest.cmake b/UNITTESTS/features/netsocket/DTLSSocketWrapper/unittest.cmake index 98f011a071..ddf449e3fb 100644 --- a/UNITTESTS/features/netsocket/DTLSSocketWrapper/unittest.cmake +++ b/UNITTESTS/features/netsocket/DTLSSocketWrapper/unittest.cmake @@ -21,7 +21,7 @@ set(unittest-sources set(unittest-test-sources features/netsocket/DTLSSocketWrapper/test_DTLSSocketWrapper.cpp stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/mbed_critical_stub.c stubs/equeue_stub.c diff --git a/UNITTESTS/features/netsocket/EthernetInterface/unittest.cmake b/UNITTESTS/features/netsocket/EthernetInterface/unittest.cmake index d0dfbdf151..7b9dba8511 100644 --- a/UNITTESTS/features/netsocket/EthernetInterface/unittest.cmake +++ b/UNITTESTS/features/netsocket/EthernetInterface/unittest.cmake @@ -25,7 +25,7 @@ set(unittest-sources set(unittest-test-sources features/netsocket/EthernetInterface/test_EthernetInterface.cpp stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/equeue_stub.c stubs/EventQueue_stub.cpp stubs/mbed_shared_queues_stub.cpp diff --git a/UNITTESTS/features/netsocket/InternetSocket/unittest.cmake b/UNITTESTS/features/netsocket/InternetSocket/unittest.cmake index 39575a6a10..a6793bf24f 100644 --- a/UNITTESTS/features/netsocket/InternetSocket/unittest.cmake +++ b/UNITTESTS/features/netsocket/InternetSocket/unittest.cmake @@ -17,7 +17,7 @@ set(unittest-sources set(unittest-test-sources features/netsocket/InternetSocket/test_InternetSocket.cpp stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/mbed_critical_stub.c stubs/equeue_stub.c diff --git a/UNITTESTS/features/netsocket/NetworkInterface/unittest.cmake b/UNITTESTS/features/netsocket/NetworkInterface/unittest.cmake index 5c142078da..2d2888f193 100644 --- a/UNITTESTS/features/netsocket/NetworkInterface/unittest.cmake +++ b/UNITTESTS/features/netsocket/NetworkInterface/unittest.cmake @@ -19,7 +19,7 @@ set(unittest-sources # Test files set(unittest-test-sources stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/equeue_stub.c stubs/EventQueue_stub.cpp stubs/mbed_shared_queues_stub.cpp diff --git a/UNITTESTS/features/netsocket/NetworkStack/unittest.cmake b/UNITTESTS/features/netsocket/NetworkStack/unittest.cmake index 6daf74304e..ec4f1d91be 100644 --- a/UNITTESTS/features/netsocket/NetworkStack/unittest.cmake +++ b/UNITTESTS/features/netsocket/NetworkStack/unittest.cmake @@ -21,7 +21,7 @@ set(unittest-sources # Test files set(unittest-test-sources stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/equeue_stub.c stubs/EventQueue_stub.cpp stubs/mbed_error.c diff --git a/UNITTESTS/features/netsocket/TCPServer/unittest.cmake b/UNITTESTS/features/netsocket/TCPServer/unittest.cmake index e8c4572bad..482b8ae061 100644 --- a/UNITTESTS/features/netsocket/TCPServer/unittest.cmake +++ b/UNITTESTS/features/netsocket/TCPServer/unittest.cmake @@ -21,7 +21,7 @@ set(unittest-sources set(unittest-test-sources stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/mbed_critical_stub.c stubs/equeue_stub.c diff --git a/UNITTESTS/features/netsocket/TCPSocket/unittest.cmake b/UNITTESTS/features/netsocket/TCPSocket/unittest.cmake index f21779b405..92b506ba72 100644 --- a/UNITTESTS/features/netsocket/TCPSocket/unittest.cmake +++ b/UNITTESTS/features/netsocket/TCPSocket/unittest.cmake @@ -18,7 +18,7 @@ set(unittest-sources set(unittest-test-sources features/netsocket/TCPSocket/test_TCPSocket.cpp stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/mbed_critical_stub.c stubs/equeue_stub.c diff --git a/UNITTESTS/features/netsocket/TLSSocket/unittest.cmake b/UNITTESTS/features/netsocket/TLSSocket/unittest.cmake index 9e0b906fe8..e4746d3df4 100644 --- a/UNITTESTS/features/netsocket/TLSSocket/unittest.cmake +++ b/UNITTESTS/features/netsocket/TLSSocket/unittest.cmake @@ -20,7 +20,7 @@ set(unittest-sources set(unittest-test-sources features/netsocket/TLSSocket/test_TLSSocket.cpp stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/mbed_critical_stub.c stubs/equeue_stub.c diff --git a/UNITTESTS/features/netsocket/TLSSocketWrapper/unittest.cmake b/UNITTESTS/features/netsocket/TLSSocketWrapper/unittest.cmake index d126328baf..2096f1da75 100644 --- a/UNITTESTS/features/netsocket/TLSSocketWrapper/unittest.cmake +++ b/UNITTESTS/features/netsocket/TLSSocketWrapper/unittest.cmake @@ -19,7 +19,7 @@ set(unittest-sources set(unittest-test-sources features/netsocket/TLSSocketWrapper/test_TLSSocketWrapper.cpp stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/mbed_critical_stub.c stubs/equeue_stub.c diff --git a/UNITTESTS/features/netsocket/UDPSocket/unittest.cmake b/UNITTESTS/features/netsocket/UDPSocket/unittest.cmake index b23122f4b3..3eabef520d 100644 --- a/UNITTESTS/features/netsocket/UDPSocket/unittest.cmake +++ b/UNITTESTS/features/netsocket/UDPSocket/unittest.cmake @@ -19,7 +19,7 @@ set(unittest-sources set(unittest-test-sources features/netsocket/UDPSocket/test_UDPSocket.cpp stubs/Mutex_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_atomic_stub.c stubs/mbed_critical_stub.c stubs/equeue_stub.c diff --git a/UNITTESTS/features/netsocket/cellular/CellularNonIPSocket/unittest.cmake b/UNITTESTS/features/netsocket/cellular/CellularNonIPSocket/unittest.cmake index 57ace7017d..05e1710710 100644 --- a/UNITTESTS/features/netsocket/cellular/CellularNonIPSocket/unittest.cmake +++ b/UNITTESTS/features/netsocket/cellular/CellularNonIPSocket/unittest.cmake @@ -20,5 +20,5 @@ set(unittest-test-sources stubs/EventFlags_stub.cpp stubs/Mutex_stub.cpp stubs/CellularContext_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) diff --git a/UNITTESTS/features/netsocket/nsapi_dns/unittest.cmake b/UNITTESTS/features/netsocket/nsapi_dns/unittest.cmake index 331945f83c..ba983cb6f7 100644 --- a/UNITTESTS/features/netsocket/nsapi_dns/unittest.cmake +++ b/UNITTESTS/features/netsocket/nsapi_dns/unittest.cmake @@ -21,7 +21,7 @@ set(unittest-sources set(unittest-test-sources stubs/Mutex_stub.cpp ../features/netsocket/SocketAddress.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/NetworkStack_stub.cpp stubs/NetworkInterfaceDefaults_stub.cpp stubs/mbed_atomic_stub.c diff --git a/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/test.cpp b/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/test.cpp index 659b47b462..c7bf7dfcba 100644 --- a/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/test.cpp +++ b/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/test.cpp @@ -50,6 +50,12 @@ TEST_F(HeapBlockDeviceTest, constructor) EXPECT_EQ(one.deinit(), BD_ERROR_OK); } +TEST_F(HeapBlockDeviceTest, constructor_wrong_size) +{ + mbed_assert_throw_errors=true; + ASSERT_ANY_THROW(mbed::HeapBlockDevice one(3050, 100)); +} + TEST_F(HeapBlockDeviceTest, double_init) { mbed::HeapBlockDevice one{DEVICE_SIZE}; diff --git a/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake b/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake index 8ae0f85c9d..0c064dc8f5 100644 --- a/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake +++ b/UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake @@ -11,7 +11,7 @@ set(unittest-includes ${unittest-includes} set(unittest-sources ../features/storage/blockdevice/HeapBlockDevice.cpp stubs/mbed_atomic_stub.c - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) set(unittest-test-sources diff --git a/UNITTESTS/moduletests/storage/blockdevice/SlicingBlockDevice/unittest.cmake b/UNITTESTS/moduletests/storage/blockdevice/SlicingBlockDevice/unittest.cmake index 93285d0a13..83d0e0d7e6 100644 --- a/UNITTESTS/moduletests/storage/blockdevice/SlicingBlockDevice/unittest.cmake +++ b/UNITTESTS/moduletests/storage/blockdevice/SlicingBlockDevice/unittest.cmake @@ -12,7 +12,7 @@ set(unittest-sources ../features/storage/blockdevice/SlicingBlockDevice.cpp ../features/storage/blockdevice/HeapBlockDevice.cpp stubs/mbed_atomic_stub.c - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp ) set(unittest-test-sources diff --git a/UNITTESTS/platform/ATCmdParser/unittest.cmake b/UNITTESTS/platform/ATCmdParser/unittest.cmake index 29daa2bdea..de19302015 100644 --- a/UNITTESTS/platform/ATCmdParser/unittest.cmake +++ b/UNITTESTS/platform/ATCmdParser/unittest.cmake @@ -11,6 +11,6 @@ set(unittest-sources set(unittest-test-sources platform/ATCmdParser/test_ATCmdParser.cpp stubs/FileHandle_stub.cpp - stubs/mbed_assert_stub.c + stubs/mbed_assert_stub.cpp stubs/mbed_poll_stub.cpp ) diff --git a/UNITTESTS/stubs/mbed_assert_stub.c b/UNITTESTS/stubs/mbed_assert_stub.cpp similarity index 79% rename from UNITTESTS/stubs/mbed_assert_stub.c rename to UNITTESTS/stubs/mbed_assert_stub.cpp index 426413a95b..875ef8792d 100644 --- a/UNITTESTS/stubs/mbed_assert_stub.c +++ b/UNITTESTS/stubs/mbed_assert_stub.cpp @@ -17,9 +17,14 @@ #include "platform/mbed_assert.h" #include +#include -void mbed_assert_internal(const char *expr, const char *file, int line) +bool mbed_assert_throw_errors = false; + +extern "C" void mbed_assert_internal(const char *expr, const char *file, int line) { fprintf(stderr, "mbed assertation failed: %s, file: %s, line %d \n", expr, file, line); + if (mbed_assert_throw_errors) { + throw 1; + } } - diff --git a/UNITTESTS/target_h/platform/mbed_assert.h b/UNITTESTS/target_h/platform/mbed_assert.h index 3d7a8a24d8..a8ff37564b 100644 --- a/UNITTESTS/target_h/platform/mbed_assert.h +++ b/UNITTESTS/target_h/platform/mbed_assert.h @@ -50,6 +50,12 @@ void mbed_assert_internal(const char *expr, const char *file, int line); } #endif +/** + * For unittests: Global flag to select whether MBED_ASSERT + * throws error. Default false. + */ +extern bool mbed_assert_throw_errors; + /** MBED_ASSERT * Declare runtime assertions: results in runtime error if condition is false * @@ -63,18 +69,12 @@ void mbed_assert_internal(const char *expr, const char *file, int line); * } * @endcode */ -#if defined( NDEBUG ) && !defined (MBED_WDOG_ASSERT) -#define MBED_ASSERT(expr) ((void)0) -#else #define MBED_ASSERT(expr) \ do { \ if (!(expr)) { \ mbed_assert_internal(#expr, __FILE__, __LINE__); \ } \ } while (0) -#endif - - /** MBED_STATIC_ASSERT * Declare compile-time assertions, results in compile-time error if condition is false