aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil MacIntosh <neilmac@microsoft.com>2016-08-08 13:48:12 -0700
committerNeil MacIntosh <neilmac@microsoft.com>2016-08-08 13:48:12 -0700
commit32ee66d3201179b261cf498ab41b11966aab6c35 (patch)
tree72eab2b87fbcf0e85ec7ae1b2853d50d033fa823
parent0dd5f56bed0362c84819d84ed1a0d77b025ad422 (diff)
downloadplatform_external_Microsoft-GSL-32ee66d3201179b261cf498ab41b11966aab6c35.tar.gz
platform_external_Microsoft-GSL-32ee66d3201179b261cf498ab41b11966aab6c35.tar.bz2
platform_external_Microsoft-GSL-32ee66d3201179b261cf498ab41b11966aab6c35.zip
Added basic tests for std::begin/end and friends (Issue #252).
-rw-r--r--tests/span_tests.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp
index 55610c7..5e71410 100644
--- a/tests/span_tests.cpp
+++ b/tests/span_tests.cpp
@@ -876,6 +876,19 @@ SUITE(span_tests)
int a[] = { 1, 2, 3, 4 };
span<int> s = a;
+ span<int>::iterator it = s.begin();
+ span<int>::iterator it2 = std::begin(s);
+ CHECK(it == it2);
+
+ it = s.end();
+ it2 = std::end(s);
+ CHECK(it == it2);
+ }
+
+ {
+ int a[] = { 1, 2, 3, 4 };
+ span<int> s = a;
+
auto it = s.begin();
auto first = it;
CHECK(it == first);
@@ -917,6 +930,19 @@ SUITE(span_tests)
TEST(cbegin_cend)
{
{
+ int a[] = { 1, 2, 3, 4 };
+ span<int> s = a;
+
+ span<int>::const_iterator cit = s.cbegin();
+ span<int>::const_iterator cit2 = std::cbegin(s);
+ CHECK(cit == cit2);
+
+ cit = s.cend();
+ cit2 = std::cend(s);
+ CHECK(cit == cit2);
+ }
+
+ {
int a[] = {1, 2, 3, 4};
span<int> s = a;