Merge pull request #13069 from AriParkkila/fix-unittest-for-CellularNetwork

Cellular: Fix unittest for CellularNetwork
pull/13095/head
Martin Kojtal 2020-06-10 12:02:26 +02:00 committed by GitHub
commit 12910eabbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -364,7 +364,7 @@ TEST_F(TestAT_CellularNetwork, test_AT_CellularNetwork_get_network_registering_m
ATHandler_stub::nsapi_error_value = NSAPI_ERROR_DEVICE_ERROR;
mode = CellularNetwork::NWModeManual;
EXPECT_TRUE(NSAPI_ERROR_DEVICE_ERROR == cn.get_network_registering_mode(mode));
EXPECT_TRUE(mode == -1);
EXPECT_TRUE(mode == CellularNetwork::NWModeManual);
}
TEST_F(TestAT_CellularNetwork, test_AT_CellularNetwork_set_registration_urc)

View File

@ -200,7 +200,7 @@ public:
/** Get the current network registering mode
*
* @param mode on successful return contains the current network registering mode
* @param mode on success the current network registering mode, otherwise unchanged
* @return NSAPI_ERROR_OK on success
* NSAPI_ERROR_DEVICE_ERROR on failure
*/

View File

@ -202,7 +202,9 @@ nsapi_error_t AT_CellularNetwork::get_network_registering_mode(NWRegisteringMode
{
int ret;
nsapi_error_t error = _at.at_cmd_int("+COPS", "?", ret);
if (error == NSAPI_ERROR_OK) {
mode = (NWRegisteringMode)ret;
}
return error;
}