From a54c271814eb1cb50bd482d5676f566fa0a83fe2 Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Mon, 24 Sep 2018 21:09:13 +0300 Subject: [PATCH] cmake Paths corrected --- UNITTESTS/features/lorawan/loramac/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loramaccommand/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp | 1 + UNITTESTS/features/lorawan/loraphy/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphyas923/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphyau915/unittest.cmake | 4 ++-- UNITTESTS/features/lorawan/loraphycn470/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphycn779/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphyin865/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphykr920/unittest.cmake | 2 +- UNITTESTS/features/lorawan/loraphyus915/unittest.cmake | 2 +- UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake | 2 +- .../features/lorawan/lorawanstack/Test_LoRaWANStack.cpp | 2 ++ UNITTESTS/features/lorawan/lorawanstack/unittest.cmake | 2 +- UNITTESTS/features/lorawan/lorawantimer/unittest.cmake | 2 +- features/lorawan/LoRaWANStack.cpp | 2 +- features/lorawan/lorastack/mac/LoRaMacCommand.cpp | 5 +++-- 21 files changed, 25 insertions(+), 21 deletions(-) diff --git a/UNITTESTS/features/lorawan/loramac/unittest.cmake b/UNITTESTS/features/lorawan/loramac/unittest.cmake index 70b39ac5ce..aff97c0412 100644 --- a/UNITTESTS/features/lorawan/loramac/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramac/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loramac/Test_LoRaMac.cpp + features/lorawan/loramac/Test_LoRaMac.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANStack_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake b/UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake index 99c3466fcb..1f15bf09ed 100644 --- a/UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loramacchannelplan/Test_LoRaMacChannelPlan.cpp + features/lorawan/loramacchannelplan/Test_LoRaMacChannelPlan.cpp stubs/LoRaPHY_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake b/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake index 400bb5227d..1dc3272977 100644 --- a/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramaccommand/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loramaccommand/Test_LoRaMacCommand.cpp + features/lorawan/loramaccommand/Test_LoRaMacCommand.cpp stubs/mbed_assert_stub.c stubs/LoRaPHY_stub.cpp ) diff --git a/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake b/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake index d3972d3ca2..e41d668906 100644 --- a/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake +++ b/UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loramaccrypto/Test_LoRaMacCrypto.cpp + features/lorawan/loramaccrypto/Test_LoRaMacCrypto.cpp stubs/cipher_stub.c stubs/aes_stub.c stubs/cmac_stub.c diff --git a/UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp b/UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp index 5bf5adeb7f..6b7fabaaaf 100644 --- a/UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp +++ b/UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp @@ -536,6 +536,7 @@ TEST_F(Test_LoRaPHY, set_next_channel) uint8_t ch; lorawan_time_t t1; lorawan_time_t t2; + p.aggregate_timeoff = 10000; EXPECT_TRUE(LORAWAN_STATUS_DUTYCYCLE_RESTRICTED == object->set_next_channel(&p, &ch, &t1, &t2)); uint16_t list[16]; diff --git a/UNITTESTS/features/lorawan/loraphy/unittest.cmake b/UNITTESTS/features/lorawan/loraphy/unittest.cmake index e58d5ec582..c1abde4e46 100644 --- a/UNITTESTS/features/lorawan/loraphy/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphy/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphy/Test_LoRaPHY.cpp + features/lorawan/loraphy/Test_LoRaPHY.cpp stubs/LoRaWANTimer_stub.cpp stubs/mbed_assert_stub.c ) diff --git a/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake b/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake index c298ddc0fd..b4648ab904 100644 --- a/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyas923/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphyas923/Test_LoRaPHYAS923.cpp + features/lorawan/loraphyas923/Test_LoRaPHYAS923.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake b/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake index d42ce5c2f9..abc6c4752c 100644 --- a/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyau915/unittest.cmake @@ -20,7 +20,7 @@ set(TEST_SUITE_NAME "lorawan_LoRaPHYAU915") # Source files set(unittest-sources - ../features/lorawan/lorastack/phy/LoRaPHYAU915.cpp + ../features/lorawan/lorastack/phy/LoRaPHYAU915.cpp ) # Add test specific include paths @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphyau915/Test_LoRaPHYAU915.cpp + features/lorawan/loraphyau915/Test_LoRaPHYAU915.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake b/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake index 2f3182d4af..6c6746f189 100644 --- a/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphycn470/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphycn470/Test_LoRaPHYCN470.cpp + features/lorawan/loraphycn470/Test_LoRaPHYCN470.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake b/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake index c7069f8dbb..d0ccd7fece 100644 --- a/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphycn779/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphycn779/Test_LoRaPHYCN779.cpp + features/lorawan/loraphycn779/Test_LoRaPHYCN779.cpp stubs/LoRaPHY_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake b/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake index b483fd4d5b..5966a3ee60 100644 --- a/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyeu433/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphyeu433/Test_LoRaPHYEU433.cpp + features/lorawan/loraphyeu433/Test_LoRaPHYEU433.cpp stubs/LoRaPHY_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake b/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake index ec4924a01c..1398a52257 100644 --- a/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyeu868/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphyeu868/Test_LoRaPHYEU868.cpp + features/lorawan/loraphyeu868/Test_LoRaPHYEU868.cpp stubs/LoRaPHY_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake b/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake index 51ae6e039a..2fa34a6f73 100644 --- a/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyin865/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphyin865/Test_LoRaPHYIN865.cpp + features/lorawan/loraphyin865/Test_LoRaPHYIN865.cpp stubs/LoRaPHY_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake b/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake index 0785af4bb2..cc32c13f02 100644 --- a/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphykr920/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphykr920/Test_LoRaPHYKR920.cpp + features/lorawan/loraphykr920/Test_LoRaPHYKR920.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake b/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake index 3ffbff0e0f..f181da5e3f 100644 --- a/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake +++ b/UNITTESTS/features/lorawan/loraphyus915/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp + features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANTimer_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake b/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake index 3a86f0516e..9e123a1c5e 100644 --- a/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawaninterface/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/lorawaninterface/Test_LoRaWANInterface.cpp + features/lorawan/lorawaninterface/Test_LoRaWANInterface.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaWANStack_stub.cpp stubs/LoRaMac_stub.cpp diff --git a/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp b/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp index e0eed1aed5..3b9572aacd 100644 --- a/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp +++ b/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp @@ -419,6 +419,7 @@ TEST_F(Test_LoRaWANStack, handle_rx) loramac_mcps_indication_t ind; LoRaMac_stub::mcps_ind_ptr = &ind; + ind.status = LORAMAC_EVENT_INFO_STATUS_OK; loramac_mlme_confirm_t mlme; LoRaMac_stub::mlme_conf_ptr = &mlme; @@ -442,6 +443,7 @@ TEST_F(Test_LoRaWANStack, handle_rx) ind.buffer = ind_buf; ind.buffer_size = 150; ind.type = MCPS_UNCONFIRMED; + ind.is_data_recvd = true; radio._ev->rx_done(NULL, 0, 0, 0); //data == NULL || LENGTH == 0 (2 cases) diff --git a/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake b/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake index f33c941e48..8c97d36268 100644 --- a/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawanstack/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/lorawanstack/Test_LoRaWANStack.cpp + features/lorawan/lorawanstack/Test_LoRaWANStack.cpp stubs/LoRaPHY_stub.cpp stubs/LoRaMac_stub.cpp stubs/mbed_assert_stub.c diff --git a/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake b/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake index 73529a621a..48764961fc 100644 --- a/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake +++ b/UNITTESTS/features/lorawan/lorawantimer/unittest.cmake @@ -31,7 +31,7 @@ set(unittest-includes ${unittest-includes} # Test & stub files set(unittest-test-sources - ../features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp + features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp stubs/EventQueue_stub.cpp stubs/mbed_assert_stub.c stubs/equeue_stub.c diff --git a/features/lorawan/LoRaWANStack.cpp b/features/lorawan/LoRaWANStack.cpp index d88ea021b2..1b28e7c9d7 100644 --- a/features/lorawan/LoRaWANStack.cpp +++ b/features/lorawan/LoRaWANStack.cpp @@ -1064,8 +1064,8 @@ lorawan_status_t LoRaWANStack::state_controller(device_states_t new_state) break; default: //Because this is internal function only coding error causes this + tr_error("Unknown state: %d:", new_state); MBED_ASSERT(false); - break; } return status; diff --git a/features/lorawan/lorastack/mac/LoRaMacCommand.cpp b/features/lorawan/lorastack/mac/LoRaMacCommand.cpp index 99d56c8ec6..87afc3409f 100644 --- a/features/lorawan/lorastack/mac/LoRaMacCommand.cpp +++ b/features/lorawan/lorastack/mac/LoRaMacCommand.cpp @@ -33,7 +33,6 @@ SPDX-License-Identifier: BSD-3-Clause */ static const uint8_t max_eirp_table[] = { 8, 10, 12, 13, 14, 16, 18, 20, 21, 24, 26, 27, 29, 30, 33, 36 }; - LoRaMacCommand::LoRaMacCommand() { sticky_mac_cmd = false; @@ -93,7 +92,9 @@ void LoRaMacCommand::parse_mac_commands_to_repeat() case MOTE_MAC_LINK_CHECK_REQ: { // 0 byte payload break; } - default: {}//Cannot happen + default: { + MBED_ASSERT(false); + } } }