From b0a7ae6bf22a6e949b029e33fe1e8735a9837669 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Sun, 9 Feb 2025 13:30:20 -0500 Subject: [PATCH] fixing a test (issue 666) (#667) * fixing a test (issue 666) * simplify --------- Co-authored-by: Daniel Lemire --- tests/convert_utf32_to_utf16be_with_errors_tests.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/convert_utf32_to_utf16be_with_errors_tests.cpp b/tests/convert_utf32_to_utf16be_with_errors_tests.cpp index 6ba8d4fe..286170ae 100644 --- a/tests/convert_utf32_to_utf16be_with_errors_tests.cpp +++ b/tests/convert_utf32_to_utf16be_with_errors_tests.cpp @@ -16,12 +16,10 @@ constexpr int trials = 1000; } // namespace TEST(issue_convert_utf32_to_utf16be_with_errors_fb5c30a7d5815504) { - alignas(4) const unsigned char data[] = {0xef, 0x00, 0x10, 0x00, - 0x00, 0x02, 0x5e, 0x33}; - constexpr std::size_t data_len_bytes = sizeof(data); - constexpr std::size_t data_len = data_len_bytes / sizeof(char32_t); - const auto validation1 = implementation.validate_utf32_with_errors( - (const char32_t *)data, data_len); + const char32_t data[] = {0x001000ef, 0x335e0200}; + constexpr std::size_t data_len = 2; + const auto validation1 = + implementation.validate_utf32_with_errors(data, data_len); ASSERT_EQUAL(validation1.count, 1); ASSERT_EQUAL(validation1.error, simdutf::error_code::TOO_LARGE);