summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/span.cpp40
1 files changed, 32 insertions, 8 deletions
diff --git a/test/span.cpp b/test/span.cpp
index d60b769c..ca037c8f 100644
--- a/test/span.cpp
+++ b/test/span.cpp
@@ -72,12 +72,24 @@ protected:
staticSpan = Span<int, 4>{ v };
- staticSpan.begin();
- staticSpan.cbegin();
+ if (*staticSpan.begin() != 1) {
+ std::cout << "Span<static_extent>::begin() failed" << std::endl;
+ return TestFail;
+ }
+ if (*staticSpan.cbegin() != 1) {
+ std::cout << "Span<static_extent>::cbegin() failed" << std::endl;
+ return TestFail;
+ }
staticSpan.end();
staticSpan.cend();
- staticSpan.rbegin();
- staticSpan.crbegin();
+ if (*staticSpan.rbegin() != 4) {
+ std::cout << "Span<static_extent>::rbegin() failed" << std::endl;
+ return TestFail;
+ }
+ if (*staticSpan.crbegin() != 4) {
+ std::cout << "Span<static_extent>::crbegin() failed" << std::endl;
+ return TestFail;
+ }
staticSpan.rend();
staticSpan.crend();
@@ -141,12 +153,24 @@ protected:
dynamicSpan = Span<int>{ a };
- dynamicSpan.begin();
- dynamicSpan.cbegin();
+ if (*dynamicSpan.begin() != 1) {
+ std::cout << "Span<dynamic_extent>::begin() failed" << std::endl;
+ return TestFail;
+ }
+ if (*dynamicSpan.cbegin() != 1) {
+ std::cout << "Span<dynamic_extent>::cbegin() failed" << std::endl;
+ return TestFail;
+ }
dynamicSpan.end();
dynamicSpan.cend();
- dynamicSpan.rbegin();
- dynamicSpan.crbegin();
+ if (*dynamicSpan.rbegin() != 4) {
+ std::cout << "Span<dynamic_extent>::rbegin() failed" << std::endl;
+ return TestFail;
+ }
+ if (*dynamicSpan.crbegin() != 4) {
+ std::cout << "Span<dynamic_extent>::crbegin() failed" << std::endl;
+ return TestFail;
+ }
dynamicSpan.rend();
dynamicSpan.crend();