From c31567241346bef285046e779ded636c49ad2c3d Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Mon, 1 Jul 2019 12:33:34 +0300 Subject: [PATCH 1/2] Doubled ATHandler's BUFF_SIZE --- features/cellular/framework/AT/ATHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/cellular/framework/AT/ATHandler.h b/features/cellular/framework/AT/ATHandler.h index c05c581c0c..e019efa482 100644 --- a/features/cellular/framework/AT/ATHandler.h +++ b/features/cellular/framework/AT/ATHandler.h @@ -43,7 +43,7 @@ class FileHandle; extern const char *OK; extern const char *CRLF; -#define BUFF_SIZE 16 +#define BUFF_SIZE 32 /* AT Error types enumeration */ enum DeviceErrorType { From 369e2d53ff634ec39cb5f13dbf5f222b5c5e4c7e Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Tue, 2 Jul 2019 10:16:13 +0300 Subject: [PATCH 2/2] Fixed unittests --- .../cellular/framework/AT/athandler/athandlertest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp b/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp index d6f1e79c32..24ef017662 100644 --- a/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp +++ b/UNITTESTS/features/cellular/framework/AT/athandler/athandlertest.cpp @@ -570,15 +570,15 @@ TEST_F(TestATHandler, test_ATHandler_read_bytes) mbed_poll_stub::int_value = 1;; // Read 5 bytes - EXPECT_TRUE(5 == at.read_bytes(buf, 5)); + EXPECT_EQ(5, at.read_bytes(buf, 5)); EXPECT_TRUE(!memcmp(buf, table1, 5)); // get_char triggered above should have filled in the whole reading buffer(fill_buffer()) - EXPECT_TRUE(filehandle_stub_table_pos == (strlen(table1) - 1)); + EXPECT_EQ(filehandle_stub_table_pos, (strlen(table1))); // Read another 8 bytes EXPECT_TRUE(8 == at.read_bytes(buf, 8) && !memcmp(buf, table1 + 5, 8)); // Reading more than the 4 bytes left -> ERROR - EXPECT_TRUE(-1 == at.read_bytes(buf, 5)); - EXPECT_TRUE(NSAPI_ERROR_DEVICE_ERROR == at.get_last_error()); + EXPECT_EQ(-1, at.read_bytes(buf, 5)); + EXPECT_EQ(NSAPI_ERROR_DEVICE_ERROR, at.get_last_error()); } TEST_F(TestATHandler, test_ATHandler_read_string)