Skip to content

Commit af8fe95

Browse files
committed
Fixes for msvc
1 parent b32dea3 commit af8fe95

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/unit/internals/span.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <gmock/gmock.h>
44
#include <gmock/gmock-matchers.h>
55

6+
#include <array>
7+
68
#include "utils/span.hpp"
79

810
using cpptrace::detail::span;
@@ -13,7 +15,8 @@ namespace {
1315

1416
TEST(SpanTest, Basic) {
1517
std::array<int, 5> arr{1, 2, 3, 4, 5};
16-
auto span = make_span(arr.begin(), arr.end());
18+
// thanks microsoft for using horrible non-standard iterators, otherwise this would test with begin()/end()
19+
auto span = make_span(arr.data(), arr.data() + arr.size());
1720
EXPECT_EQ(span.data(), arr.data());
1821
EXPECT_EQ(span.size(), 5);
1922
EXPECT_EQ(span.data()[0], 1);
@@ -25,7 +28,7 @@ TEST(SpanTest, Basic) {
2528

2629
TEST(SpanTest, PtrSize) {
2730
std::array<int, 5> arr{1, 2, 3, 4, 5};
28-
auto span = make_span(arr.begin(), arr.size());
31+
auto span = make_span(arr.data(), arr.size());
2932
EXPECT_EQ(span.data(), arr.data());
3033
EXPECT_EQ(span.size(), 5);
3134
EXPECT_EQ(span.data()[0], 1);

0 commit comments

Comments
 (0)