all: minor updates
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
// lots of tests (and probably quite a number of redundant tests)
|
||||
// modern compilers will optimize away much of this code
|
||||
|
||||
#if 0 // TODO later
|
||||
// libc++ hardenining
|
||||
#if defined(__clang__) && defined(__clang_major__) && (__clang_major__ + 0 >= 18)
|
||||
#if DEBUG
|
||||
@@ -40,6 +41,7 @@
|
||||
#define _LIBCPP_ENABLE_ASSERTIONS 1
|
||||
#endif
|
||||
#endif
|
||||
#endif // TODO later
|
||||
|
||||
#include "../headers.h"
|
||||
#include <vector>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
// doctest support code implementation
|
||||
**************************************************************************/
|
||||
|
||||
#if 0 // TODO later
|
||||
// libc++ hardenining
|
||||
#if defined(__clang__) && defined(__clang_major__) && (__clang_major__ + 0 >= 18)
|
||||
#if DEBUG
|
||||
@@ -41,6 +42,7 @@
|
||||
#define _LIBCPP_ENABLE_ASSERTIONS 1
|
||||
#endif
|
||||
#endif
|
||||
#endif // TODO later
|
||||
|
||||
#if defined(__has_include)
|
||||
#if __has_include(<features.h>)
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user