Skip to content

Commit 2634b3c

Browse files
committed
Fix circular buffer test accessing element out of range
1 parent 3d38eb5 commit 2634b3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/circular_buffer_access_tests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ TEST_CASE("Spans and subspans") {
135135
std::array<int32_t, 8> buf{1, 2, 3, 4, 5, 6, 7, 8};
136136
CircularBufferAccess big{buf};
137137

138-
std::span<int32_t> bufspan1{&buf[0], &buf[4]};
139-
std::span<int32_t> bufspan2{&buf[4], &buf[8]};
138+
std::span<int32_t> bufspan1{buf.begin(), buf.begin() + 4};
139+
std::span<int32_t> bufspan2{buf.begin() + 4, buf.end()};
140140

141141
CircularBufferAccess a{bufspan1};
142142
CHECK(a.size() == 4);

0 commit comments

Comments
 (0)