diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularsms/at_cellularsmstest.cpp b/UNITTESTS/features/cellular/framework/AT/at_cellularsms/at_cellularsmstest.cpp index 8589a7e9fe..1a8ffc7ae6 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularsms/at_cellularsmstest.cpp +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularsms/at_cellularsmstest.cpp @@ -137,7 +137,7 @@ TEST_F(TestAT_CellularSMS, test_AT_CellularSMS_get_sms) EXPECT_TRUE(NSAPI_ERROR_PARAMETER == sms.get_sms(NULL, 16, phone, 21, stamp, 21, &size)); ATHandler_stub::resp_info_true_counter = 1; - ATHandler_stub::int_value = 0; + ATHandler_stub::int_value = -1; EXPECT_TRUE(-1 == sms.get_sms(buf, 16, phone, 21, stamp, 21, &size)); //In below we are expecting the stub ATHandler info_resp() to respond diff --git a/features/cellular/framework/AT/AT_CellularSMS.cpp b/features/cellular/framework/AT/AT_CellularSMS.cpp index 90558661b6..964e326039 100644 --- a/features/cellular/framework/AT/AT_CellularSMS.cpp +++ b/features/cellular/framework/AT/AT_CellularSMS.cpp @@ -1044,7 +1044,7 @@ nsapi_error_t AT_CellularSMS::list_messages() (void)_at.consume_to_stop_tag(); // consume until } - if (index > 0) { + if (index >= 0) { add_info(info, index, part_number); } else { delete info;