We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b32dea3 commit af8fe95Copy full SHA for af8fe95
test/unit/internals/span.cpp
@@ -3,6 +3,8 @@
3
#include <gmock/gmock.h>
4
#include <gmock/gmock-matchers.h>
5
6
+#include <array>
7
+
8
#include "utils/span.hpp"
9
10
using cpptrace::detail::span;
@@ -13,7 +15,8 @@ namespace {
13
15
14
16
TEST(SpanTest, Basic) {
17
std::array<int, 5> arr{1, 2, 3, 4, 5};
- 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());
20
EXPECT_EQ(span.data(), arr.data());
21
EXPECT_EQ(span.size(), 5);
22
EXPECT_EQ(span.data()[0], 1);
@@ -25,7 +28,7 @@ TEST(SpanTest, Basic) {
25
28
26
29
TEST(SpanTest, PtrSize) {
27
30
- auto span = make_span(arr.begin(), arr.size());
31
+ auto span = make_span(arr.data(), arr.size());
32
33
34
0 commit comments