From 5042e6c74e8174127e3451f5315cd4d05e9ad988 Mon Sep 17 00:00:00 2001 From: Paul Bowen-Huggett Date: Sat, 18 Nov 2023 20:59:25 +0100 Subject: [PATCH] Replace C array with std::array<> (#40) --- unittests/test_dom.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/unittests/test_dom.cpp b/unittests/test_dom.cpp index 583bdec..6eaf8d8 100644 --- a/unittests/test_dom.cpp +++ b/unittests/test_dom.cpp @@ -123,13 +123,14 @@ TEST_F (Dom, Array2) { ASSERT_THAT (root, Optional (VariantWith (_))); auto const &arr = *std::get (*root); // Check the array contents. - std::byte const expected_bytes[] = { + std::array const expected_bytes = {{ std::byte{0xEF}, std::byte{0xBF}, std::byte{0xBD}, // REPLACEMENT CHARACTER std::byte{0x00} // NULL - }; - ASSERT_THAT (arr, ElementsAre (VariantWith (u8string{ - reinterpret_cast (expected_bytes)}))); + }}; + ASSERT_THAT (arr, + ElementsAre (VariantWith (u8string{ + reinterpret_cast (expected_bytes.data ())}))); // Check the parent pointers. EXPECT_EQ (root->parent, nullptr); EXPECT_THAT (arr, Each (Field ("parent", parent_field, Eq (&root.value ()))));