diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-09-15 21:15:53 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-09-15 21:15:53 +0200 |
| commit | aa49abdf239bae6065fddd0839ec67a404c9748c (patch) | |
| tree | 631fbb2df58aa35df3d60c65c037ef74b1807114 /test/uio.cc | |
| parent | bf41a601fd0447bcf3a2937a595a1cd8ca5c1633 (diff) | |
Add .clang-format
Make it easier to keep a consistent style
Diffstat (limited to 'test/uio.cc')
| -rw-r--r-- | test/uio.cc | 269 |
1 files changed, 154 insertions, 115 deletions
diff --git a/test/uio.cc b/test/uio.cc index ce666c1..7c8d175 100644 --- a/test/uio.cc +++ b/test/uio.cc @@ -1,9 +1,9 @@ -#include <gtest/gtest.h> +#include "uio.hh" #include "io.hh" #include "io_test_helper.hh" -#include "uio.hh" +#include <gtest/gtest.h> #include <string> using namespace std::literals::string_literals; @@ -25,18 +25,23 @@ TEST(uio_u16, empty) { } TEST(uio_u8, sample) { - auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" "es"), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF8}); + auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" + "es"), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF8}); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); EXPECT_EQ(6, ret.value()); - EXPECT_EQ("\xf0\x90\x8D\x85" "es", tmp); + EXPECT_EQ( + "\xf0\x90\x8D\x85" + "es", + tmp); } TEST(uio_u16, sample_be) { - auto uio = u16::open(io::memory("\x00\x24\xD8\x01\xDC\x37"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_BE}); + auto uio = + u16::open(io::memory("\x00\x24\xD8\x01\xDC\x37"s), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_BE}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -47,8 +52,9 @@ TEST(uio_u16, sample_be) { } TEST(uio_u16, sample_le) { - auto uio = u16::open(io::memory("\x24\x00\x01\xD8\x37\xDC"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_LE}); + auto uio = + u16::open(io::memory("\x24\x00\x01\xD8\x37\xDC"s), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_LE}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -59,12 +65,17 @@ TEST(uio_u16, sample_le) { } TEST(uio_u8, sample_detect) { - auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" "es")); + auto uio = + u8::open(io::memory("\xf0\x90\x8D\x85" + "es")); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); EXPECT_EQ(6, ret.value()); - EXPECT_EQ("\xf0\x90\x8D\x85" "es", tmp); + EXPECT_EQ( + "\xf0\x90\x8D\x85" + "es", + tmp); } TEST(uio_u16, sample_detect_be) { @@ -92,8 +103,8 @@ TEST(uio_u16, sample_detect_le) { TEST(uio_u8, invalid) { auto uio = u8::open(io::memory("r\xe4ksm\xf6rg\xe5s"), u::ReaderConfig{ - .strict=true, - .input=u::ReaderInputFormat::UTF8, + .strict = true, + .input = u::ReaderInputFormat::UTF8, }); std::string tmp; auto ret = uio->repeat_read(tmp, 20); @@ -107,7 +118,7 @@ TEST(uio_u8, invalid) { TEST(uio_u8, invalid_detect) { auto uio = u8::open(io::memory("r\xe4ksm\xf6rg\xe5s"), - u::ReaderConfig{.strict=true}); + u::ReaderConfig{.strict = true}); std::string tmp; auto ret = uio->repeat_read(tmp, 20); ASSERT_TRUE(ret.has_value()); @@ -121,8 +132,8 @@ TEST(uio_u8, invalid_detect) { TEST(uio_u8, invalid_replace) { auto uio = u8::open(io::memory("r\xe4ksm\xf6rg\xe5s"), u::ReaderConfig{ - .strict=false, - .input=u::ReaderInputFormat::UTF8, + .strict = false, + .input = u::ReaderInputFormat::UTF8, }); std::string tmp; auto ret = uio->repeat_read(tmp, 20); @@ -133,7 +144,7 @@ TEST(uio_u8, invalid_replace) { TEST(uio_u8, read_error) { auto uio = u8::open(io_make_breaking(io::memory("\xef\xbf\xbd"), 1), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF8}); + u::ReaderConfig{.input = u::ReaderInputFormat::UTF8}); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_FALSE(ret.has_value()); @@ -141,8 +152,9 @@ TEST(uio_u8, read_error) { } TEST(uio_u16, read_error) { - auto uio = u16::open(io_make_breaking(io::memory("\x00\x24"s), 1), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_BE}); + auto uio = + u16::open(io_make_breaking(io::memory("\x00\x24"s), 1), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_BE}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_FALSE(ret.has_value()); @@ -150,11 +162,10 @@ TEST(uio_u16, read_error) { } TEST(uio_u8, read_incomplete_strict) { - auto uio = u8::open(io::memory("\xef"), - u::ReaderConfig{ - .strict=true, - .input=u::ReaderInputFormat::UTF8, - }); + auto uio = u8::open(io::memory("\xef"), u::ReaderConfig{ + .strict = true, + .input = u::ReaderInputFormat::UTF8, + }); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_FALSE(ret.has_value()); @@ -162,11 +173,10 @@ TEST(uio_u8, read_incomplete_strict) { } TEST(uio_u8, read_incomplete) { - auto uio = u8::open(io::memory("\xef"), - u::ReaderConfig{ - .strict=false, - .input=u::ReaderInputFormat::UTF8, - }); + auto uio = u8::open(io::memory("\xef"), u::ReaderConfig{ + .strict = false, + .input = u::ReaderInputFormat::UTF8, + }); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -175,11 +185,11 @@ TEST(uio_u8, read_incomplete) { } TEST(uio_u16, read_incomplete_strict_be) { - auto uio = u16::open(io::memory("\x00"s), - u::ReaderConfig{ - .strict=true, - .input=u::ReaderInputFormat::UTF16_BE, - }); + auto uio = + u16::open(io::memory("\x00"s), u::ReaderConfig{ + .strict = true, + .input = u::ReaderInputFormat::UTF16_BE, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_FALSE(ret.has_value()); @@ -187,11 +197,11 @@ TEST(uio_u16, read_incomplete_strict_be) { } TEST(uio_u16, read_incomplete_be) { - auto uio = u16::open(io::memory("\x00"s), - u::ReaderConfig{ - .strict=false, - .input=u::ReaderInputFormat::UTF16_BE, - }); + auto uio = + u16::open(io::memory("\x00"s), u::ReaderConfig{ + .strict = false, + .input = u::ReaderInputFormat::UTF16_BE, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -200,11 +210,11 @@ TEST(uio_u16, read_incomplete_be) { } TEST(uio_u16, read_incomplete_strict_le) { - auto uio = u16::open(io::memory("$"), - u::ReaderConfig{ - .strict=true, - .input=u::ReaderInputFormat::UTF16_LE, - }); + auto uio = + u16::open(io::memory("$"), u::ReaderConfig{ + .strict = true, + .input = u::ReaderInputFormat::UTF16_LE, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_FALSE(ret.has_value()); @@ -212,11 +222,11 @@ TEST(uio_u16, read_incomplete_strict_le) { } TEST(uio_u16, read_incomplete_le) { - auto uio = u16::open(io::memory("$"), - u::ReaderConfig{ - .strict=false, - .input=u::ReaderInputFormat::UTF16_LE, - }); + auto uio = + u16::open(io::memory("$"), u::ReaderConfig{ + .strict = false, + .input = u::ReaderInputFormat::UTF16_LE, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -225,8 +235,9 @@ TEST(uio_u16, read_incomplete_le) { } TEST(uio_u8, max_too_small) { - auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" "es"), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF8}); + auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" + "es"), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF8}); std::string tmp; auto ret = uio->read(tmp.data(), 0); ASSERT_TRUE(ret.has_value()); @@ -238,8 +249,9 @@ TEST(uio_u8, max_too_small) { } TEST(uio_u16, max_too_small_be) { - auto uio = u16::open(io::memory("\xD8\x01\xDC\x37"), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_BE}); + auto uio = + u16::open(io::memory("\xD8\x01\xDC\x37"), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_BE}); std::u16string tmp; auto ret = uio->read(tmp.data(), 0); ASSERT_TRUE(ret.has_value()); @@ -251,8 +263,9 @@ TEST(uio_u16, max_too_small_be) { } TEST(uio_u16, max_too_small_le) { - auto uio = u16::open(io::memory("\x01\xD8\x37\xDC"), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_LE}); + auto uio = + u16::open(io::memory("\x01\xD8\x37\xDC"), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_LE}); std::u16string tmp; auto ret = uio->read(tmp.data(), 0); ASSERT_TRUE(ret.has_value()); @@ -264,8 +277,9 @@ TEST(uio_u16, max_too_small_le) { } TEST(uio_u8, partial) { - auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" "es"), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF8}); + auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" + "es"), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF8}); std::string tmp; auto ret = uio->repeat_read(tmp, 4); ASSERT_TRUE(ret.has_value()); @@ -279,8 +293,9 @@ TEST(uio_u8, partial) { } TEST(uio_u16, partial_be) { - auto uio = u16::open(io::memory("\x00\x24\xD8\x01\xDC\x37"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_BE}); + auto uio = + u16::open(io::memory("\x00\x24\xD8\x01\xDC\x37"s), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_BE}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 1); ASSERT_TRUE(ret.has_value()); @@ -295,8 +310,9 @@ TEST(uio_u16, partial_be) { } TEST(uio_u16, partial_le) { - auto uio = u16::open(io::memory("\x24\x00\x01\xD8\x37\xDC"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_LE}); + auto uio = + u16::open(io::memory("\x24\x00\x01\xD8\x37\xDC"s), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_LE}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 1); ASSERT_TRUE(ret.has_value()); @@ -312,10 +328,10 @@ TEST(uio_u16, partial_le) { TEST(uio_u16, invalid_be) { auto uio = u16::open(io::memory("\x00\x24\xd8\x01"s), - u::ReaderConfig{ - .strict=true, - .input=u::ReaderInputFormat::UTF16_BE, - }); + u::ReaderConfig{ + .strict = true, + .input = u::ReaderInputFormat::UTF16_BE, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -328,7 +344,7 @@ TEST(uio_u16, invalid_be) { TEST(uio_u16, invalid_detect_be) { auto uio = u16::open(io::memory("\x00\x24\xd8\x01"s), - u::ReaderConfig{.strict=true}); + u::ReaderConfig{.strict = true}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -341,10 +357,10 @@ TEST(uio_u16, invalid_detect_be) { TEST(uio_u16, invalid_replace_be) { auto uio = u16::open(io::memory("\x00\x24\xd8\x01"s), - u::ReaderConfig{ - .strict=false, - .input=u::ReaderInputFormat::UTF16_BE, - }); + u::ReaderConfig{ + .strict = false, + .input = u::ReaderInputFormat::UTF16_BE, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -355,10 +371,10 @@ TEST(uio_u16, invalid_replace_be) { TEST(uio_u16, invalid_le) { auto uio = u16::open(io::memory("\x24\x00\x01\xd8"s), - u::ReaderConfig{ - .strict=true, - .input=u::ReaderInputFormat::UTF16_LE, - }); + u::ReaderConfig{ + .strict = true, + .input = u::ReaderInputFormat::UTF16_LE, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -371,7 +387,7 @@ TEST(uio_u16, invalid_le) { TEST(uio_u16, invalid_detect_le) { auto uio = u16::open(io::memory("\x24\x00\x01\xd8"s), - u::ReaderConfig{.strict=true}); + u::ReaderConfig{.strict = true}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -384,10 +400,10 @@ TEST(uio_u16, invalid_detect_le) { TEST(uio_u16, invalid_replace_le) { auto uio = u16::open(io::memory("\x24\x00\x01\xd8"s), - u::ReaderConfig{ - .strict=false, - .input=u::ReaderInputFormat::UTF16_LE, - }); + u::ReaderConfig{ + .strict = false, + .input = u::ReaderInputFormat::UTF16_LE, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -397,31 +413,40 @@ TEST(uio_u16, invalid_replace_le) { } TEST(uio_u8, bom) { - auto uio = u8::open(io::memory("\xef\xbb\xbf\xf0\x90\x8D\x85" "es"), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF8}); + auto uio = u8::open(io::memory("\xef\xbb\xbf\xf0\x90\x8D\x85" + "es"), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF8}); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); EXPECT_EQ(6, ret.value()); - EXPECT_EQ("\xf0\x90\x8D\x85" "es", tmp); + EXPECT_EQ( + "\xf0\x90\x8D\x85" + "es", + tmp); } TEST(uio_u8, bom_keep) { - auto uio = u8::open(io::memory("\xef\xbb\xbf\xf0\x90\x8D\x85" "es"), + auto uio = u8::open(io::memory("\xef\xbb\xbf\xf0\x90\x8D\x85" + "es"), u::ReaderConfig{ - .input=u::ReaderInputFormat::UTF8, - .skip_bom=false, + .input = u::ReaderInputFormat::UTF8, + .skip_bom = false, }); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); EXPECT_EQ(9, ret.value()); - EXPECT_EQ("\xef\xbb\xbf\xf0\x90\x8D\x85" "es", tmp); + EXPECT_EQ( + "\xef\xbb\xbf\xf0\x90\x8D\x85" + "es", + tmp); } TEST(uio_u16, bom_be) { - auto uio = u16::open(io::memory("\xfe\xff\x00\x24\xD8\x01\xDC\x37"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_BE}); + auto uio = + u16::open(io::memory("\xfe\xff\x00\x24\xD8\x01\xDC\x37"s), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_BE}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -432,8 +457,9 @@ TEST(uio_u16, bom_be) { } TEST(uio_u16, bom_le) { - auto uio = u16::open(io::memory("\xff\xfe\x24\x00\x01\xD8\x37\xDC"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_LE}); + auto uio = + u16::open(io::memory("\xff\xfe\x24\x00\x01\xD8\x37\xDC"s), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_LE}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -445,10 +471,10 @@ TEST(uio_u16, bom_le) { TEST(uio_u16, bom_keep_be) { auto uio = u16::open(io::memory("\xfe\xff\x00\x24\xD8\x01\xDC\x37"s), - u::ReaderConfig{ - .input=u::ReaderInputFormat::UTF16_BE, - .skip_bom=false, - }); + u::ReaderConfig{ + .input = u::ReaderInputFormat::UTF16_BE, + .skip_bom = false, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -461,10 +487,10 @@ TEST(uio_u16, bom_keep_be) { TEST(uio_u16, bom_keep_le) { auto uio = u16::open(io::memory("\xff\xfe\x24\x00\x01\xD8\x37\xDC"s), - u::ReaderConfig{ - .input=u::ReaderInputFormat::UTF16_LE, - .skip_bom=false, - }); + u::ReaderConfig{ + .input = u::ReaderInputFormat::UTF16_LE, + .skip_bom = false, + }); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -476,22 +502,31 @@ TEST(uio_u16, bom_keep_le) { } TEST(uio_u8, bom_detect) { - auto uio = u8::open(io::memory("\xef\xbb\xbf\xf0\x90\x8D\x85" "es")); + auto uio = + u8::open(io::memory("\xef\xbb\xbf\xf0\x90\x8D\x85" + "es")); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); EXPECT_EQ(6, ret.value()); - EXPECT_EQ("\xf0\x90\x8D\x85" "es", tmp); + EXPECT_EQ( + "\xf0\x90\x8D\x85" + "es", + tmp); } TEST(uio_u8, bom_keep_detect) { - auto uio = u8::open(io::memory("\xef\xbb\xbf\xf0\x90\x8D\x85" "es"), - u::ReaderConfig{.skip_bom=false}); + auto uio = u8::open(io::memory("\xef\xbb\xbf\xf0\x90\x8D\x85" + "es"), + u::ReaderConfig{.skip_bom = false}); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); EXPECT_EQ(9, ret.value()); - EXPECT_EQ("\xef\xbb\xbf\xf0\x90\x8D\x85" "es", tmp); + EXPECT_EQ( + "\xef\xbb\xbf\xf0\x90\x8D\x85" + "es", + tmp); } TEST(uio_u16, bom_detect_be) { @@ -518,7 +553,7 @@ TEST(uio_u16, bom_detect_le) { TEST(uio_u16, bom_keep_detect_be) { auto uio = u16::open(io::memory("\xfe\xff\x00\x24\xD8\x01\xDC\x37"s), - u::ReaderConfig{.skip_bom=false}); + u::ReaderConfig{.skip_bom = false}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -531,7 +566,7 @@ TEST(uio_u16, bom_keep_detect_be) { TEST(uio_u16, bom_keep_detect_le) { auto uio = u16::open(io::memory("\xff\xfe\x24\x00\x01\xD8\x37\xDC"s), - u::ReaderConfig{.skip_bom=false}); + u::ReaderConfig{.skip_bom = false}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -544,7 +579,7 @@ TEST(uio_u16, bom_keep_detect_le) { TEST(uio_u8, input_utf16_be) { auto uio = u8::open(io::memory("\x00\x24\xD8\x01\xDC\x37"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_BE}); + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_BE}); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -554,7 +589,7 @@ TEST(uio_u8, input_utf16_be) { TEST(uio_u8, input_utf16_le) { auto uio = u8::open(io::memory("\x24\x00\x01\xD8\x37\xDC"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_LE}); + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_LE}); std::string tmp; auto ret = uio->repeat_read(tmp, 10); ASSERT_TRUE(ret.has_value()); @@ -563,8 +598,9 @@ TEST(uio_u8, input_utf16_le) { } TEST(uio_u16, input_utf8) { - auto uio = u16::open(io::memory("\xf0\x90\x8D\x85" "es"), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF8}); + auto uio = u16::open(io::memory("\xf0\x90\x8D\x85" + "es"), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF8}); std::u16string tmp; auto ret = uio->repeat_read(tmp, 5); ASSERT_TRUE(ret.has_value()); @@ -576,8 +612,9 @@ TEST(uio_u16, input_utf8) { } TEST(uio_u8, skip) { - auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" "es"), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF8}); + auto uio = u8::open(io::memory("\xf0\x90\x8D\x85" + "es"), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF8}); std::string tmp; auto ret = uio->repeat_skip(3); ASSERT_FALSE(ret.has_value()); @@ -592,8 +629,9 @@ TEST(uio_u8, skip) { } TEST(uio_u16, skip_be) { - auto uio = u16::open(io::memory("\x00\x24\xD8\x01\xDC\x37"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_BE}); + auto uio = + u16::open(io::memory("\x00\x24\xD8\x01\xDC\x37"s), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_BE}); std::u16string tmp; auto ret = uio->repeat_skip(4); // Note that this is in bytes ASSERT_TRUE(ret.has_value()); @@ -606,8 +644,9 @@ TEST(uio_u16, skip_be) { } TEST(uio_u16, skip_le) { - auto uio = u16::open(io::memory("\x24\x00\x01\xD8\x37\xDC"s), - u::ReaderConfig{.input=u::ReaderInputFormat::UTF16_LE}); + auto uio = + u16::open(io::memory("\x24\x00\x01\xD8\x37\xDC"s), + u::ReaderConfig{.input = u::ReaderInputFormat::UTF16_LE}); std::u16string tmp; auto ret = uio->repeat_skip(4); // Note that this is in bytes ASSERT_TRUE(ret.has_value()); |
