diff options
Diffstat (limited to 'sax/tst')
| -rw-r--r-- | sax/tst/test_buffer.cc | 2 | ||||
| -rw-r--r-- | sax/tst/test_decoder.cc | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sax/tst/test_buffer.cc b/sax/tst/test_buffer.cc index 13bc6d4..3a40792 100644 --- a/sax/tst/test_buffer.cc +++ b/sax/tst/test_buffer.cc @@ -140,6 +140,8 @@ TEST_P(BufferTest, skip_wrap) { EXPECT_EQ(5u, buf->write(AAAAAAAAAA)); + auto data = buf->rspan(10); + EXPECT_EQ(10u, data.size()); buf->consume(10); EXPECT_TRUE(buf->empty()); } diff --git a/sax/tst/test_decoder.cc b/sax/tst/test_decoder.cc index 86f230b..24434f5 100644 --- a/sax/tst/test_decoder.cc +++ b/sax/tst/test_decoder.cc @@ -54,7 +54,6 @@ TEST(sax, decoder_utf8) { auto delegate = std::make_shared<TestDelegate>(); auto processor = modxml::sax::Processor::create(delegate); std::string input = R"(<?xml version="1.0" encoding="utf-8"?><root />)"; - std::cerr << input << std::endl; EXPECT_TRUE(process_all( *processor.get(), *delegate.get(), @@ -68,7 +67,6 @@ TEST(sax, decoder_utf8_bom) { auto processor = modxml::sax::Processor::create(delegate); std::string input = "\xef\xbb\xbf" R"(<?xml version="1.0" encoding="utf-8"?><root />)"; - std::cerr << input << std::endl; EXPECT_TRUE(process_all( *processor.get(), *delegate.get(), @@ -125,7 +123,7 @@ TEST(sax, decoder_utf16be_bom) { auto delegate = std::make_shared<TestDelegate>(); auto processor = modxml::sax::Processor::create(delegate); std::u16string str = - u"\ufffe" uR"(<?xml version="1.0" encoding="utf-16"?><root />)"; + u"\ufeff" uR"(<?xml version="1.0" encoding="utf-16"?><root />)"; std::vector<uint8_t> input; for (char16_t c : str) { input.push_back(c >> 8); @@ -142,7 +140,7 @@ TEST(sax, decoder_utf16le_bom) { auto delegate = std::make_shared<TestDelegate>(); auto processor = modxml::sax::Processor::create(delegate); std::u16string str = - u"\ufffe" uR"(<?xml version="1.0" encoding="utf-16"?><root />)"; + u"\ufeff" uR"(<?xml version="1.0" encoding="utf-16"?><root />)"; std::vector<uint8_t> input; for (char16_t c : str) { input.push_back(c & 0xff); @@ -207,7 +205,7 @@ TEST(sax, decoder_utf32be_bom) { auto delegate = std::make_shared<TestDelegate>(); auto processor = modxml::sax::Processor::create(delegate); std::u32string str = - U"\ufffe" UR"(<?xml version="1.0" encoding="utf-32"?><root />)"; + U"\ufeff" UR"(<?xml version="1.0" encoding="utf-32"?><root />)"; std::vector<uint8_t> input; for (char32_t c : str) { input.push_back(c >> 24); @@ -226,7 +224,7 @@ TEST(sax, decoder_utf32le_bom) { auto delegate = std::make_shared<TestDelegate>(); auto processor = modxml::sax::Processor::create(delegate); std::u32string str = - U"\ufffe" R"(<?xml version="1.0" encoding="utf-32"?><root />)"; + U"\ufeff" R"(<?xml version="1.0" encoding="utf-32"?><root />)"; std::vector<uint8_t> input; for (char32_t c : str) { input.push_back(c & 0xff); |
