[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Add testcase for parsing Strings
From: |
Darshit Shah |
Subject: |
[PATCH] Add testcase for parsing Strings |
Date: |
Sun, 12 Jan 2020 11:43:34 +0100 |
It was found that the ios_read_string function does not correctly check
for the EOF condition. This patch adds a test that does 2 things:
1. Ensure that the EOF condition is correctly handled
2. Ensure that the strings must be NULL terminated to be identified
* testsuite/poke.map/maps-arrays-19.pk: New Test
---
testsuite/poke.map/maps-arrays-19.pk | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 testsuite/poke.map/maps-arrays-19.pk
diff --git a/testsuite/poke.map/maps-arrays-19.pk
b/testsuite/poke.map/maps-arrays-19.pk
new file mode 100644
index 00000000..565f96e2
--- /dev/null
+++ b/testsuite/poke.map/maps-arrays-19.pk
@@ -0,0 +1,8 @@
+/* { dg-do run } */
+/* { dg-data {c*} {0x02 0x20 0x30 0x40 0x66 0x6f 0x6f 0x00 0x62 0x61 0x72
0x73} } */
+
+/* { dg-command { string[2] @ 4#B } } */
+/* { dg-output { "\\\[\"foo\"\\\]" } */
+
+/* { dg-command { string[] @ 4#B } } */
+/* { dg-output "\\\[\"foo\"\\\]" } */
--
2.24.1
- [PATCH] Add testcase for parsing Strings,
Darshit Shah <=