summaryrefslogtreecommitdiff
path: root/src/libmbim-glib/test/test-message-parser.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-11-26 19:34:12 +0100
committerAleksander Morgado <aleksander@aleksander.es>2019-11-26 19:57:00 +0100
commit28084e36e20d2436cf9dff03f83fc3f150c2b9e2 (patch)
tree39172da5ac84c8bd8676105e773164a10f1237fc /src/libmbim-glib/test/test-message-parser.c
parent413133f2f88b6636a7f2613e7fead937a5be8b33 (diff)
libmbim-glib,test: fix byte array reading test
The STK buffer is 256 bytes, fixed-size, so use that array size for the actual test, or it'll fail with the new strict reading checks.
Diffstat (limited to 'src/libmbim-glib/test/test-message-parser.c')
-rw-r--r--src/libmbim-glib/test/test-message-parser.c56
1 files changed, 53 insertions, 3 deletions
diff --git a/src/libmbim-glib/test/test-message-parser.c b/src/libmbim-glib/test/test-message-parser.c
index 3ba4946..273c443 100644
--- a/src/libmbim-glib/test/test-message-parser.c
+++ b/src/libmbim-glib/test/test-message-parser.c
@@ -1185,7 +1185,7 @@ test_message_parser_stk_pac_response (void)
0x38, 0x16, 0x16, 0x4C,
0x01, 0x00, 0x00, 0x00, /* command id */
0x00, 0x00, 0x00, 0x00, /* status code */
- 0x00, 0x01, 0x00, 0x00, /* buffer length */
+ 0x00, 0x01, 0x00, 0x00, /* buffer length (256) */
/* information buffer */
0x04, 0x05, 0x06, 0x07,
0xAF, 0xAE, 0xAD, 0xAC,
@@ -1226,9 +1226,34 @@ test_message_parser_stk_pac_response (void)
0x7B, 0x7A, 0x79, 0x78,
0x77, 0x76, 0x75, 0x74,
0x73, 0x72, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00,
+ 0x04, 0x05, 0x06, 0x07,
+ 0xAF, 0xAE, 0xAD, 0xAC,
+ 0xAB, 0xAA, 0xA9, 0xA8,
+ 0xA7, 0xA6, 0xA5, 0xA4,
+ 0xA3, 0xA2, 0xA1, 0xA0,
+ 0x7F, 0x7E, 0x7D, 0x7C,
+ 0x7B, 0x7A, 0x79, 0x78,
+ 0x77, 0x76, 0x75, 0x74,
+ 0x73, 0x72, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00,
+ 0x04, 0x05, 0x06, 0x07,
+ 0xAF, 0xAE, 0xAD, 0xAC,
+ 0xAB, 0xAA, 0xA9, 0xA8,
+ 0xA7, 0xA6, 0xA5, 0xA4,
+ 0xA3, 0xA2, 0xA1, 0xA0,
+ 0x7F, 0x7E, 0x7D, 0x7C,
+ 0x7B, 0x7A, 0x79, 0x78,
+ 0x77, 0x76, 0x75, 0x74,
+ 0x73, 0x72, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00,
+ 0x04, 0x05, 0x06, 0x07,
+ 0xAF, 0xAE, 0xAD, 0xAC,
+ 0xAB, 0xAA, 0xA9, 0xA8,
+ 0xA7, 0xA6, 0xA5, 0xA4,
};
- const guint8 expected_databuffer [] = {
+ const guint8 expected_databuffer [256] = {
0x04, 0x05, 0x06, 0x07,
0xAF, 0xAE, 0xAD, 0xAC,
0xAB, 0xAA, 0xA9, 0xA8,
@@ -1267,7 +1292,32 @@ test_message_parser_stk_pac_response (void)
0x7F, 0x7E, 0x7D, 0x7C,
0x7B, 0x7A, 0x79, 0x78,
0x77, 0x76, 0x75, 0x74,
- 0x73, 0x72, 0x00, 0x00
+ 0x73, 0x72, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00,
+ 0x04, 0x05, 0x06, 0x07,
+ 0xAF, 0xAE, 0xAD, 0xAC,
+ 0xAB, 0xAA, 0xA9, 0xA8,
+ 0xA7, 0xA6, 0xA5, 0xA4,
+ 0xA3, 0xA2, 0xA1, 0xA0,
+ 0x7F, 0x7E, 0x7D, 0x7C,
+ 0x7B, 0x7A, 0x79, 0x78,
+ 0x77, 0x76, 0x75, 0x74,
+ 0x73, 0x72, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00,
+ 0x04, 0x05, 0x06, 0x07,
+ 0xAF, 0xAE, 0xAD, 0xAC,
+ 0xAB, 0xAA, 0xA9, 0xA8,
+ 0xA7, 0xA6, 0xA5, 0xA4,
+ 0xA3, 0xA2, 0xA1, 0xA0,
+ 0x7F, 0x7E, 0x7D, 0x7C,
+ 0x7B, 0x7A, 0x79, 0x78,
+ 0x77, 0x76, 0x75, 0x74,
+ 0x73, 0x72, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00,
+ 0x04, 0x05, 0x06, 0x07,
+ 0xAF, 0xAE, 0xAD, 0xAC,
+ 0xAB, 0xAA, 0xA9, 0xA8,
+ 0xA7, 0xA6, 0xA5, 0xA4,
};
response = mbim_message_new (buffer, sizeof (buffer));