all: minor updates

This commit is contained in:
Markus F.X.J. Oberhumer
2024-02-04 13:37:00 +01:00
parent 41f6945be1
commit 29ce4807fb
6 changed files with 27 additions and 12 deletions
+6 -1
View File
@@ -242,7 +242,7 @@ TEST_CASE("basic xspan usage") {
}
TEST_CASE("xspan array access") {
constexpr size_t N = 16;
const size_t N = 16;
char buf[N];
memset(buf, 0, sizeof(buf));
XSPAN_0_VAR(char, c0, buf, sizeof(buf));
@@ -254,6 +254,7 @@ TEST_CASE("xspan array access") {
cp[i] += 1;
for (size_t i = 0; i != N; ++i)
cs[i] += 1;
#if __cplusplus >= 201103L
for (auto ptr = c0; ptr != c0 + N; ++ptr)
*ptr += 1;
for (auto ptr = c0 + 0; ptr < c0 + N; ++ptr)
@@ -266,6 +267,7 @@ TEST_CASE("xspan array access") {
*ptr += 1;
for (auto ptr = cs + 0; ptr < cs + N; ++ptr)
*ptr += 1;
#endif
}
/*************************************************************************
@@ -685,6 +687,9 @@ TEST_CASE("Span subspan") {
CHECK((as + 2).subspan(0, -2)[0] == 0);
CHECK_THROWS(as.subspan(1, 0)[0]);
CHECK_THROWS(as.subspan(1, 1)[-1]);
CHECK(as.subspan(1)[0] == 1);
CHECK(as.subspan(2)[0] == 2);
CHECK(as.subspan(3)[0] == 3);
}
TEST_CASE("Span constness") {