From 507a3936aa2f7a32f7f45c13734ffbe0ed4a2078 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sun, 21 Jan 2024 14:32:27 +0100 Subject: Fixes --- sax/tst/test_buffer.cc | 2 ++ sax/tst/test_decoder.cc | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sax/tst') 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(); auto processor = modxml::sax::Processor::create(delegate); std::string input = R"()"; - 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"()"; - 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(); auto processor = modxml::sax::Processor::create(delegate); std::u16string str = - u"\ufffe" uR"()"; + u"\ufeff" uR"()"; std::vector 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(); auto processor = modxml::sax::Processor::create(delegate); std::u16string str = - u"\ufffe" uR"()"; + u"\ufeff" uR"()"; std::vector 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(); auto processor = modxml::sax::Processor::create(delegate); std::u32string str = - U"\ufffe" UR"()"; + U"\ufeff" UR"()"; std::vector 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(); auto processor = modxml::sax::Processor::create(delegate); std::u32string str = - U"\ufffe" R"()"; + U"\ufeff" R"()"; std::vector input; for (char32_t c : str) { input.push_back(c & 0xff); -- cgit v1.2.3-70-g09d2