| // Copyright 2020 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // DO NOT EDIT; Cases below are generated with: |
| // |
| // go run src/tests/fidl/conformance_suite/gen_strings.go > src/tests/fidl/conformance_suite/strings_utf8.gen.gidl |
| // |
| |
| // single byte, min: 0 |
| success("StringsValidCase1") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\x00", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 0, |
| padding:7, |
| ], |
| }, |
| } |
| |
| // single byte, max: 127 |
| success("StringsValidCase2") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\x7f", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 127, |
| padding:7, |
| ], |
| }, |
| } |
| |
| // two bytes, min: 128 |
| success("StringsValidCase3") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xc2\x80", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 194, |
| 128, |
| padding:6, |
| ], |
| }, |
| } |
| |
| // two bytes, max: 2047 |
| success("StringsValidCase4") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xdf\xbf", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 223, |
| 191, |
| padding:6, |
| ], |
| }, |
| } |
| |
| // three bytes, min: 2048 |
| success("StringsValidCase5") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xe1\x80\x80", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 225, |
| 128, |
| 128, |
| padding:5, |
| ], |
| }, |
| } |
| |
| // three bytes, max: 65535 |
| success("StringsValidCase6") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xef\xbf\xbf", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 239, |
| 191, |
| 191, |
| padding:5, |
| ], |
| }, |
| } |
| |
| // four bytes, min: 65536 |
| success("StringsValidCase7") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xf0\x90\x80\x80", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 144, |
| 128, |
| 128, |
| padding:4, |
| ], |
| }, |
| } |
| |
| // four bytes, max: 1114111 |
| success("StringsValidCase8") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xf4\x8f\xbf\xbf", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 244, |
| 143, |
| 191, |
| 191, |
| padding:4, |
| ], |
| }, |
| } |
| |
| // 1 above max single byte |
| encode_failure("StringsInvalidCase1") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 above max single byte |
| decode_failure("StringsInvalidCase1") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 128, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 below min two bytes |
| encode_failure("StringsInvalidCase2") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc2\x7f", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 below min two bytes |
| decode_failure("StringsInvalidCase2") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 194, |
| 127, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 above max two bytes |
| encode_failure("StringsInvalidCase3") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xdf\xc0", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 above max two bytes |
| decode_failure("StringsInvalidCase3") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 223, |
| 192, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 below min three bytes |
| encode_failure("StringsInvalidCase4") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xe1\x80\x7f", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 below min three bytes |
| decode_failure("StringsInvalidCase4") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 225, |
| 128, |
| 127, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 above max three bytes |
| encode_failure("StringsInvalidCase5") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xef\xbf\xc0", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 above max three bytes |
| decode_failure("StringsInvalidCase5") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 239, |
| 191, |
| 192, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 below min four bytes |
| encode_failure("StringsInvalidCase6") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x80\x80\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 below min four bytes |
| decode_failure("StringsInvalidCase6") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 128, |
| 128, |
| 128, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 above max four bytes |
| encode_failure("StringsInvalidCase7") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf7\xbf\xbf\xc0", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 1 above max four bytes |
| decode_failure("StringsInvalidCase7") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 247, |
| 191, |
| 191, |
| 192, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| success("StringsValidCase9") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xc2\x80", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 194, |
| 128, |
| padding:6, |
| ], |
| }, |
| } |
| |
| // first byte following two byte value not starting with 0b10 |
| encode_failure("StringsInvalidCase8") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc2\x7f", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // first byte following two byte value not starting with 0b10 |
| decode_failure("StringsInvalidCase8") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 194, |
| 127, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // first byte following three byte value not starting with 0b10 |
| encode_failure("StringsInvalidCase9") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xe1\x7f\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // first byte following three byte value not starting with 0b10 |
| decode_failure("StringsInvalidCase9") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 225, |
| 127, |
| 128, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // second byte following three byte value not starting with 0b10 |
| encode_failure("StringsInvalidCase10") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xe1\x80\x7f", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // second byte following three byte value not starting with 0b10 |
| decode_failure("StringsInvalidCase10") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 225, |
| 128, |
| 127, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| success("StringsValidCase10") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xf0\x90\x80\x80", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 144, |
| 128, |
| 128, |
| padding:4, |
| ], |
| }, |
| } |
| |
| // first byte following four byte value not starting with 0b10 |
| encode_failure("StringsInvalidCase11") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x7f\x80\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // first byte following four byte value not starting with 0b10 |
| decode_failure("StringsInvalidCase11") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 127, |
| 128, |
| 128, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // second byte following four byte value not starting with 0b10 |
| encode_failure("StringsInvalidCase12") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x90\x7f\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // second byte following four byte value not starting with 0b10 |
| decode_failure("StringsInvalidCase12") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 144, |
| 127, |
| 128, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // third byte following four byte value not starting with 0b10 |
| encode_failure("StringsInvalidCase13") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x90\x80\x7f", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // third byte following four byte value not starting with 0b10 |
| decode_failure("StringsInvalidCase13") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 144, |
| 128, |
| 127, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // ascii slash |
| success("StringsValidCase11") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\x2f", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 47, |
| padding:7, |
| ], |
| }, |
| } |
| |
| // slash (2) |
| encode_failure("StringsInvalidCase14") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc0\xaf", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // slash (2) |
| decode_failure("StringsInvalidCase14") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 192, |
| 175, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // slash (3) |
| encode_failure("StringsInvalidCase15") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xe0\x80\xaf", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // slash (3) |
| decode_failure("StringsInvalidCase15") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 224, |
| 128, |
| 175, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // slash (4) |
| encode_failure("StringsInvalidCase16") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x80\x80\xaf", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // slash (4) |
| decode_failure("StringsInvalidCase16") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 128, |
| 128, |
| 175, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+061D |
| success("StringsValidCase12") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xd8\x9d", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 216, |
| 157, |
| padding:6, |
| ], |
| }, |
| } |
| |
| // U+05F6 |
| success("StringsValidCase13") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xd7\xb6", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 215, |
| 182, |
| padding:6, |
| ], |
| }, |
| } |
| |
| // U+0AF4 |
| success("StringsValidCase14") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xe0\xab\xb4", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 224, |
| 171, |
| 180, |
| padding:5, |
| ], |
| }, |
| } |
| |
| // U+0C52 |
| success("StringsValidCase15") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xe0\xb1\x92", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 224, |
| 177, |
| 146, |
| padding:5, |
| ], |
| }, |
| } |
| |
| // U+1E454 |
| success("StringsValidCase16") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xf0\x9e\x91\x94", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 158, |
| 145, |
| 148, |
| padding:4, |
| ], |
| }, |
| } |
| |
| // U+1F978 |
| success("StringsValidCase17") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xf0\x9f\xa5\xb8", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 159, |
| 165, |
| 184, |
| padding:4, |
| ], |
| }, |
| } |
| |
| // empty string |
| success("StringsValidCase18") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(0):8, |
| repeat(0xff):8, |
| |
| // content |
| ], |
| }, |
| } |
| |
| // simply the letter a |
| success("StringsValidCase19") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\x61", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 97, |
| padding:7, |
| ], |
| }, |
| } |
| |
| // euro sign, i.e \xe2\x82\xac |
| success("StringsValidCase20") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xe2\x82\xac", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 226, |
| 130, |
| 172, |
| padding:5, |
| ], |
| }, |
| } |
| |
| // mix and match from earlier cases |
| success("StringsValidCase21") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\x00\xf4\x8f\xbf\xbf\x7f\xf0\x90\x80\x80\xc2\x80", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(12):8, |
| repeat(0xff):8, |
| |
| // content |
| 0, |
| 244, |
| 143, |
| 191, |
| 191, |
| 127, |
| 240, |
| 144, |
| 128, |
| 128, |
| 194, |
| 128, |
| padding:4, |
| ], |
| }, |
| } |
| |
| // mix and match from earlier cases |
| success("StringsValidCase22") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xdf\xbf\xef\xbf\xbf\xe1\x80\x80", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(8):8, |
| repeat(0xff):8, |
| |
| // content |
| 223, |
| 191, |
| 239, |
| 191, |
| 191, |
| 225, |
| 128, |
| 128, |
| ], |
| }, |
| } |
| |
| // UTF-8 BOM |
| success("StringsValidCase23") { |
| bindings_allowlist = [go,rust,], |
| value = StringWrapper { |
| str: "\xef\xbb\xbf", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 239, |
| 187, |
| 191, |
| padding:5, |
| ], |
| }, |
| } |
| |
| // Partial UTF-8 BOM (1) |
| encode_failure("StringsInvalidCase17") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xef", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // Partial UTF-8 BOM (1) |
| decode_failure("StringsInvalidCase17") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 239, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // Partial UTF-8 BOM (2) |
| encode_failure("StringsInvalidCase18") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xef\xbb", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // Partial UTF-8 BOM (2) |
| decode_failure("StringsInvalidCase18") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 239, |
| 187, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // invalid partial sequence |
| encode_failure("StringsInvalidCase19") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xdf\x80\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // invalid partial sequence |
| decode_failure("StringsInvalidCase19") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 223, |
| 128, |
| 128, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // long U+0000, non shortest form |
| encode_failure("StringsInvalidCase20") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xe0\x80\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // long U+0000, non shortest form |
| decode_failure("StringsInvalidCase20") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 224, |
| 128, |
| 128, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| success("StringsValidCase24") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xe1\x80\x80", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 225, |
| 128, |
| 128, |
| padding:5, |
| ], |
| }, |
| } |
| |
| // invalid 2 octet sequence |
| encode_failure("StringsInvalidCase21") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc3\x28", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // invalid 2 octet sequence |
| decode_failure("StringsInvalidCase21") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 195, |
| 40, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| success("StringsValidCase25") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\x0d", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 13, |
| padding:7, |
| ], |
| }, |
| } |
| |
| |
| success("StringsValidCase26") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\x0a", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 10, |
| padding:7, |
| ], |
| }, |
| } |
| |
| |
| success("StringsValidCase27") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\x61", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 97, |
| padding:7, |
| ], |
| }, |
| } |
| |
| |
| success("StringsValidCase28") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xc2\x81", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 194, |
| 129, |
| padding:6, |
| ], |
| }, |
| } |
| |
| |
| success("StringsValidCase29") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xe1\x80\xbf", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 225, |
| 128, |
| 191, |
| padding:5, |
| ], |
| }, |
| } |
| |
| |
| success("StringsValidCase30") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,dart,], |
| value = StringWrapper { |
| str: "\xf1\x80\xa0\xbf", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 241, |
| 128, |
| 160, |
| 191, |
| padding:4, |
| ], |
| }, |
| } |
| |
| // UTF-8 BOM |
| success("StringsValidCase31") { |
| bindings_allowlist = [go,rust,], |
| value = StringWrapper { |
| str: "\xef\xbb\xbf", |
| }, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 239, |
| 187, |
| 191, |
| padding:5, |
| ], |
| }, |
| } |
| |
| |
| encode_failure("StringsInvalidCase22") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc0", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase22") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 192, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase23") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc1", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase23") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 193, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase24") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf5", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase24") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 245, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase25") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf6", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase25") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 246, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase26") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf7", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase26") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 247, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase27") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf8", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase27") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 248, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase28") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf9", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase28") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 249, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase29") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xfa", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase29") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 250, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase30") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xfb", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase30") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 251, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase31") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xfc", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase31") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 252, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase32") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xfd", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase32") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 253, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase33") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xfe", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase33") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 254, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase34") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xff", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase34") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(1):8, |
| repeat(0xff):8, |
| |
| // content |
| 255, |
| padding:7, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+D800, high surrogate, first |
| encode_failure("StringsInvalidCase35") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xed\xa0\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+D800, high surrogate, first |
| decode_failure("StringsInvalidCase35") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 237, |
| 160, |
| 128, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // low surrogate, first |
| encode_failure("StringsInvalidCase36") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xed\xb0\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // low surrogate, first |
| decode_failure("StringsInvalidCase36") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 237, |
| 176, |
| 128, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // low surrogate, last |
| encode_failure("StringsInvalidCase37") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xed\xbf\xbf", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // low surrogate, last |
| decode_failure("StringsInvalidCase37") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 237, |
| 191, |
| 191, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0000 |
| encode_failure("StringsInvalidCase38") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc0\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0000 |
| decode_failure("StringsInvalidCase38") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 192, |
| 128, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // "A" |
| encode_failure("StringsInvalidCase39") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc1\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // "A" |
| decode_failure("StringsInvalidCase39") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 193, |
| 128, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // "B" |
| encode_failure("StringsInvalidCase40") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xc1\x81", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // "B" |
| decode_failure("StringsInvalidCase40") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 193, |
| 129, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0000 |
| encode_failure("StringsInvalidCase41") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xe0\x80\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0000 |
| decode_failure("StringsInvalidCase41") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 224, |
| 128, |
| 128, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0080 |
| encode_failure("StringsInvalidCase42") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xe0\x82\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0080 |
| decode_failure("StringsInvalidCase42") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 224, |
| 130, |
| 128, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+07ff |
| encode_failure("StringsInvalidCase43") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xe0\x9f\xbf", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+07ff |
| decode_failure("StringsInvalidCase43") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(3):8, |
| repeat(0xff):8, |
| |
| // content |
| 224, |
| 159, |
| 191, |
| padding:5, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+000D |
| encode_failure("StringsInvalidCase44") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x80\x80\x8d", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+000D |
| decode_failure("StringsInvalidCase44") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 128, |
| 128, |
| 141, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0091 |
| encode_failure("StringsInvalidCase45") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x80\x82\x91", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0091 |
| decode_failure("StringsInvalidCase45") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 128, |
| 130, |
| 145, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0800 |
| encode_failure("StringsInvalidCase46") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x80\xa0\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+0800 |
| decode_failure("StringsInvalidCase46") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 128, |
| 160, |
| 128, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+FEFF (BOM) |
| encode_failure("StringsInvalidCase47") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf0\x8f\xbb\xbf", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+FEFF (BOM) |
| decode_failure("StringsInvalidCase47") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 240, |
| 143, |
| 187, |
| 191, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+003F |
| encode_failure("StringsInvalidCase48") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf8\x80\x80\x80\xbf", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+003F |
| decode_failure("StringsInvalidCase48") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(5):8, |
| repeat(0xff):8, |
| |
| // content |
| 248, |
| 128, |
| 128, |
| 128, |
| 191, |
| padding:3, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| encode_failure("StringsInvalidCase49") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xfc\x80\x80\x80\xa0\xa5", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| |
| decode_failure("StringsInvalidCase49") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(6):8, |
| repeat(0xff):8, |
| |
| // content |
| 252, |
| 128, |
| 128, |
| 128, |
| 160, |
| 165, |
| padding:2, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+110000 |
| encode_failure("StringsInvalidCase50") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf4\x90\x80\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // U+110000 |
| decode_failure("StringsInvalidCase50") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(4):8, |
| repeat(0xff):8, |
| |
| // content |
| 244, |
| 144, |
| 128, |
| 128, |
| padding:4, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 5 bytes |
| encode_failure("StringsInvalidCase51") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xf8\xa0\xbf\x80\xbf", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 5 bytes |
| decode_failure("StringsInvalidCase51") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(5):8, |
| repeat(0xff):8, |
| |
| // content |
| 248, |
| 160, |
| 191, |
| 128, |
| 191, |
| padding:3, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 6 bytes |
| encode_failure("StringsInvalidCase52") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xfc\x9c\xbf\x80\xbf\x80", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // 6 bytes |
| decode_failure("StringsInvalidCase52") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(6):8, |
| repeat(0xff):8, |
| |
| // content |
| 252, |
| 156, |
| 191, |
| 128, |
| 191, |
| 128, |
| padding:2, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // BOMs in UTF-16 BE |
| encode_failure("StringsInvalidCase53") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xfe\xff", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // BOMs in UTF-16 BE |
| decode_failure("StringsInvalidCase53") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 254, |
| 255, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // BOMs in UTF-16 LE |
| encode_failure("StringsInvalidCase54") { |
| bindings_allowlist = [go,hlcpp,llcpp,], |
| value = StringWrapper { |
| str: "\xff\xfe", |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |
| // BOMs in UTF-16 LE |
| decode_failure("StringsInvalidCase54") { |
| bindings_allowlist = [go,rust,hlcpp,llcpp,], |
| type = StringWrapper, |
| bytes = { |
| v1 = [ |
| // length, present |
| num(2):8, |
| repeat(0xff):8, |
| |
| // content |
| 255, |
| 254, |
| padding:6, |
| ], |
| }, |
| err = STRING_NOT_UTF8, |
| } |
| |