summaryrefslogtreecommitdiff
path: root/harness.c
diff options
context:
space:
mode:
Diffstat (limited to 'harness.c')
-rw-r--r--harness.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/harness.c b/harness.c
index 25b3e9e..fa4e191 100644
--- a/harness.c
+++ b/harness.c
@@ -36,6 +36,7 @@
* July 3, 2003: Updated printout message.
* Oct 19, 2004: Updated isLegalUTF8 test data and corrected switch statements to catch
* illegal surrogate use in UTF-8, per report from Frank Tang.
+ * May 8, 2006: added ED 60 80 to isLegalUTF8 test.
*
*/
@@ -97,8 +98,9 @@ struct utf8_test utf8_testData[] = {
{ 1, 3, { 0xEE, 0x80, 0x80, 0x00, 0x00 }}, /* 19 */
{ 0, 3, { 0xED, 0xA0, 0x80, 0x00, 0x00 }}, /* 20 */
{ 0, 3, { 0xED, 0xBF, 0xBF, 0x00, 0x00 }}, /* 21 */
+ { 0, 3, { 0xED, 0x60, 0x80, 0x00, 0x00 }}, /* 22 */
-/* for all > 21 use "short" buffer lengths to detect over-run */
+/* for all > 22 use "short" buffer lengths to detect over-run */
{ 0, 4, { 0xF0, 0x93, 0xB2, 0xC3, 0x00 }}, /* 18 use short buflen */
{ 0, 0, { 0x00, 0x00, 0x00, 0x00, 0x00 }},
@@ -114,8 +116,8 @@ int test01() {
for (i = 0; utf8_testData[i].utf8_len; i++) {
wantVal1 = wantVal2 = utf8_testData[i].utf8_legal;
gotVal1 = isLegalUTF8(&(utf8_testData[i].utf8_seq[0]), utf8_testData[i].utf8_len);
- /* use truncated length for tests over 21 */
- if (i <= 21) { len2 = 4; } else { len2 = utf8_testData[i].utf8_len-1; wantVal2 = 0; }
+ /* use truncated length for tests over 22 */
+ if (i <= 22) { len2 = 4; } else { len2 = utf8_testData[i].utf8_len-1; wantVal2 = 0; }
gotVal2 = isLegalUTF8Sequence(&(utf8_testData[i].utf8_seq[0]), &(utf8_testData[i].utf8_seq[0])+len2);
if ((gotVal1 != wantVal1) || (gotVal2 != wantVal2)) {
printf("Test01 error: seq %d is %d & %d (should be %d & %d) for bytes (%x,%x,%x,%x,%x,) & len %d\n",
@@ -430,7 +432,7 @@ int test04() {
main() {
printf("Three tests of round-trip conversions will be performed.\n");
- printf("One test of illegal UTF-32 will be peroformed.\n");
+ printf("One test of illegal UTF-32 will be performed.\n");
printf("Two illegal result messages are expected; one in test 02A; one in test 03A.\n");
printf("These are for tests of Surrogate conversion.\n\n");
fflush(stdout);