mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #10925 from AnttiKauppila/buff_size_fix
Doubled ATHandler's BUFF_SIZEpull/10873/head
commit
7059221817
|
@ -570,15 +570,15 @@ TEST_F(TestATHandler, test_ATHandler_read_bytes)
|
||||||
mbed_poll_stub::int_value = 1;;
|
mbed_poll_stub::int_value = 1;;
|
||||||
|
|
||||||
// Read 5 bytes
|
// 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));
|
EXPECT_TRUE(!memcmp(buf, table1, 5));
|
||||||
// get_char triggered above should have filled in the whole reading buffer(fill_buffer())
|
// 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
|
// Read another 8 bytes
|
||||||
EXPECT_TRUE(8 == at.read_bytes(buf, 8) && !memcmp(buf, table1 + 5, 8));
|
EXPECT_TRUE(8 == at.read_bytes(buf, 8) && !memcmp(buf, table1 + 5, 8));
|
||||||
// Reading more than the 4 bytes left -> ERROR
|
// Reading more than the 4 bytes left -> ERROR
|
||||||
EXPECT_TRUE(-1 == at.read_bytes(buf, 5));
|
EXPECT_EQ(-1, at.read_bytes(buf, 5));
|
||||||
EXPECT_TRUE(NSAPI_ERROR_DEVICE_ERROR == at.get_last_error());
|
EXPECT_EQ(NSAPI_ERROR_DEVICE_ERROR, at.get_last_error());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TestATHandler, test_ATHandler_read_string)
|
TEST_F(TestATHandler, test_ATHandler_read_string)
|
||||||
|
|
|
@ -43,7 +43,7 @@ class FileHandle;
|
||||||
extern const char *OK;
|
extern const char *OK;
|
||||||
extern const char *CRLF;
|
extern const char *CRLF;
|
||||||
|
|
||||||
#define BUFF_SIZE 16
|
#define BUFF_SIZE 32
|
||||||
|
|
||||||
/* AT Error types enumeration */
|
/* AT Error types enumeration */
|
||||||
enum DeviceErrorType {
|
enum DeviceErrorType {
|
||||||
|
|
Loading…
Reference in New Issue