44 *
55 * @author Cliff Green, Roxanne Agerone
66 *
7- * @copyright (c) 2019-2024 by Cliff Green, Roxanne Agerone
7+ * @copyright (c) 2019-2025 by Cliff Green, Roxanne Agerone
88 *
99 * Distributed under the Boost Software License, Version 1.0.
1010 * (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1616
1717#include < cstddef> // std::byte
1818#include < cstdint> // std::uint32_t, etc
19+ #include < ranges> // std::views::iota
1920
2021#include " serialize/extract_append.hpp"
2122
22- #include " utility/repeat.hpp"
2323#include " utility/byte_array.hpp"
2424
2525constexpr std::uint32_t val1 = 0xDDCCBBAA ;
@@ -65,8 +65,9 @@ TEST_CASE ( "Append values into a buffer", "[append_val]" ) {
6565 REQUIRE (chops::append_val<std::endian::big>(ptr, val4) == 8u ); ptr += sizeof (val4);
6666 REQUIRE (chops::append_val<std::endian::big>(ptr, val5) == 4u ); ptr += sizeof (val5);
6767 REQUIRE (chops::append_val<std::endian::big>(ptr, val6) == 1u );
68- chops::repeat (arr_sz, [&buf] (int i) {
69- REQUIRE (std::to_integer<int >(buf[i]) == std::to_integer<int >(net_buf_big[i])); } );
68+ for (int i : std::views::iota (0 , arr_sz)) {
69+ REQUIRE (std::to_integer<int >(buf[i]) == std::to_integer<int >(net_buf_big[i]));
70+ }
7071 }
7172 SECTION (" Append_val with multiple values, little endian" ) {
7273 std::byte* ptr = buf;
@@ -76,8 +77,9 @@ TEST_CASE ( "Append values into a buffer", "[append_val]" ) {
7677 REQUIRE (chops::append_val<std::endian::little>(ptr, val4) == 8u ); ptr += sizeof (val4);
7778 REQUIRE (chops::append_val<std::endian::little>(ptr, val5) == 4u ); ptr += sizeof (val5);
7879 REQUIRE (chops::append_val<std::endian::little>(ptr, val6) == 1u );
79- chops::repeat (arr_sz, [&buf] (int i) {
80- REQUIRE (std::to_integer<int >(buf[i]) == std::to_integer<int >(net_buf_little[i])); } );
80+ for (int i : std::views::iota (0 , arr_sz)) {
81+ REQUIRE (std::to_integer<int >(buf[i]) == std::to_integer<int >(net_buf_little[i]));
82+ }
8183 }
8284}
8385
0 commit comments