Lines Matching defs:byte
197 // create expected byte vector
254 // create expected byte vector
295 // create expected byte vector
347 // create expected byte vector
379 // create expected byte vector
410 // create expected byte vector
441 // create expected byte vector
474 // create expected byte vector
512 // create expected byte vector
555 // create expected byte vector
602 // create expected byte vector
638 // create expected byte vector
656 SECTION("24..255 (one-byte uint8_t)")
668 // create expected byte vector
689 SECTION("256..65535 (two-byte uint16_t)")
701 // create expected byte vector
723 SECTION("65536..4294967295 (four-byte uint32_t)")
738 // create expected byte vector
765 SECTION("4294967296..4611686018427387903 (eight-byte uint64_t)")
780 // create expected byte vector
970 SECTION("no byte follows")
973 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0xf9})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
976 SECTION("only one byte follows")
979 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7c})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1081 // create expected byte vector
1093 // check that no null byte is appended
1115 // create expected byte vector
1128 // check that no null byte is appended
1150 // create expected byte vector (hack: create string first)
1161 // check that no null byte is appended
1183 // create expected byte vector (hack: create string first)
1196 // check that no null byte is appended
1261 expected[1] = 0x01; // size (0x0101), byte 0
1262 expected[2] = 0x01; // size (0x0101), byte 1
1276 expected[1] = 0x00; // size (0x00010101), byte 0
1277 expected[2] = 0x01; // size (0x00010101), byte 1
1278 expected[3] = 0x01; // size (0x00010101), byte 2
1279 expected[4] = 0x01; // size (0x00010101), byte 3
1344 // Checking against an expected vector byte by byte is
1351 CHECK(result[1] == 0xff); // size byte (0xff)
1371 // Checking against an expected vector byte by byte is
1378 CHECK(result[1] == 0x01); // byte 0 of size (0x0100)
1379 CHECK(result[2] == 0x00); // byte 1 of size (0x0100)
1400 // Checking against an expected vector byte by byte is
1407 CHECK(result[1] == 0x00); // byte 0 of size (0x00010000)
1408 CHECK(result[2] == 0x01); // byte 1 of size (0x00010000)
1409 CHECK(result[3] == 0x00); // byte 2 of size (0x00010000)
1410 CHECK(result[4] == 0x00); // byte 3 of size (0x00010000)
1426 // create JSON value with byte array containing of N * 'x'
1430 // create expected byte vector
1442 // check that no null byte is appended
1464 // create expected byte vector
1477 // check that no null byte is appended
1499 // create expected byte vector (hack: create string first)
1510 // check that no null byte is appended
1532 // create expected byte vector (hack: create string first)
1545 // check that no null byte is appended
1566 // array with three empty byte strings
1574 // object mapping "foo" to empty byte string
1582 // object mapping "foo" to byte string
1607 SECTION("0x5b (byte array)")
1646 SECTION("empty byte vector")
1649 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>()), "[json.exception.parse_error.110] parse error at byte 1: syntax error while parsing CBOR value: unexpected end of input", json::parse_error&);
1653 SECTION("too short byte vector")
1656 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x18})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1657 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x19})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1658 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x19, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1659 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1a})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1660 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1661 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1662 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1663 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1664 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1665 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1666 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1667 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1668 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1669 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1670 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})), "[json.exception.parse_error.110] parse error at byte 9: syntax error while parsing CBOR number: unexpected end of input", json::parse_error&);
1671 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x62})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR string: unexpected end of input", json::parse_error&);
1672 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x62, 0x60})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR string: unexpected end of input", json::parse_error&);
1673 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x7F})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR string: unexpected end of input", json::parse_error&);
1674 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x7F, 0x60})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR string: unexpected end of input", json::parse_error&);
1675 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x82, 0x01})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR value: unexpected end of input", json::parse_error&);
1676 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x9F, 0x01})), "[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR value: unexpected end of input", json::parse_error&);
1677 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61, 0xF5})), "[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR string: unexpected end of input", json::parse_error&);
1678 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0xA1, 0x61, 0X61})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR value: unexpected end of input", json::parse_error&);
1679 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0X61})), "[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR value: unexpected end of input", json::parse_error&);
1680 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x5F})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR binary: unexpected end of input", json::parse_error&);
1681 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x5F, 0x00})), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing CBOR binary: expected length specification (0x40-0x5B) or indefinite binary array type (0x5F); last byte: 0x00", json::parse_error&);
1682 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x41})), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR binary: unexpected end of input", json::parse_error&);
1718 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1c})), "[json.exception.parse_error.112] parse error at byte 1: syntax error while parsing CBOR value: invalid byte: 0x1C", json::parse_error&);
1721 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0xf8})), "[json.exception.parse_error.112] parse error at byte 1: syntax error while parsing CBOR value: invalid byte: 0xF8", json::parse_error&);
1727 for (auto byte :
1766 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({static_cast<uint8_t>(byte)})), json::parse_error&);
1767 CHECK(json::from_cbor(std::vector<uint8_t>({static_cast<uint8_t>(byte)}), true, false).is_discarded());
1775 CHECK_THROWS_WITH_AS(_ = json::from_cbor(std::vector<uint8_t>({0xa1, 0xff, 0x01})), "[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0xFF", json::parse_error&);
1792 CHECK_THROWS_WITH_AS(_ = json::from_cbor(vec), "[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR value: expected end of input; last byte: 0xF6", json::parse_error&);
1874 AFL-Fuzz. As a result, empty byte vectors and excessive lengths are
2072 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_one-byte-utf-8.json",
2076 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_three-byte-utf-8.json",
2077 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_two-byte-utf-8.json",
2215 /// break cannot be the first byte
2222 const auto byte = static_cast<uint8_t>(i);
2226 auto res = json::from_cbor(std::vector<uint8_t>(1, byte));
2231 // first byte is in the unsupported set
2233 if (unsupported.find(byte) != unsupported.end())
2390 SECTION("byte arrays")
2493 SECTION("0xD8 - 1 byte follows")
2499 v_tagged.insert(v_tagged.begin(), 0x42); // 1 byte
2512 SECTION("missing byte after tag")
2526 SECTION("0xD9 - 2 byte follow")
2532 v_tagged.insert(v_tagged.begin(), 0x42); // 1 byte
2533 v_tagged.insert(v_tagged.begin(), 0x23); // 1 byte
2546 SECTION("missing byte after tag")
2550 v_tagged.insert(v_tagged.begin(), 0x23); // 1 byte
2567 v_tagged.insert(v_tagged.begin(), 0x42); // 1 byte
2568 v_tagged.insert(v_tagged.begin(), 0x23); // 1 byte
2569 v_tagged.insert(v_tagged.begin(), 0x22); // 1 byte
2570 v_tagged.insert(v_tagged.begin(), 0x11); // 1 byte
2587 v_tagged.insert(v_tagged.begin(), 0x23); // 1 byte
2588 v_tagged.insert(v_tagged.begin(), 0x22); // 1 byte
2589 v_tagged.insert(v_tagged.begin(), 0x11); // 1 byte
2606 v_tagged.insert(v_tagged.begin(), 0x42); // 1 byte
2607 v_tagged.insert(v_tagged.begin(), 0x23); // 1 byte
2608 v_tagged.insert(v_tagged.begin(), 0x22); // 1 byte
2609 v_tagged.insert(v_tagged.begin(), 0x11); // 1 byte
2610 v_tagged.insert(v_tagged.begin(), 0x42); // 1 byte
2611 v_tagged.insert(v_tagged.begin(), 0x23); // 1 byte
2612 v_tagged.insert(v_tagged.begin(), 0x22); // 1 byte
2613 v_tagged.insert(v_tagged.begin(), 0x11); // 1 byte
2626 SECTION("missing byte after tag")
2630 v_tagged.insert(v_tagged.begin(), 0x42); // 1 byte
2631 v_tagged.insert(v_tagged.begin(), 0x23); // 1 byte
2632 v_tagged.insert(v_tagged.begin(), 0x22); // 1 byte
2633 v_tagged.insert(v_tagged.begin(), 0x11); // 1 byte
2634 v_tagged.insert(v_tagged.begin(), 0x23); // 1 byte
2635 v_tagged.insert(v_tagged.begin(), 0x22); // 1 byte
2636 v_tagged.insert(v_tagged.begin(), 0x11); // 1 byte
2659 CHECK_THROWS_WITH_AS(_ = json::from_cbor(vec), "[json.exception.parse_error.112] parse error at byte 9: syntax error while parsing CBOR value: invalid byte: 0xD8", json::parse_error);