Merge pull request #11249 from dextero/get-sms-zero

Make AT_CellularSMS::list_messages support index 0 in SMS inbox
pull/11264/head
Martin Kojtal 2019-08-20 10:27:57 +02:00 committed by GitHub
commit 0b49952b9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -1044,7 +1044,7 @@ nsapi_error_t AT_CellularSMS::list_messages()
(void)_at.consume_to_stop_tag(); // consume until <CR><LF>
}
if (index > 0) {
if (index >= 0) {
add_info(info, index, part_number);
} else {
delete info;