diff options
| author | ZXShady | 2025-09-12 00:52:11 +0300 |
|---|---|---|
| committer | Martin Hořeňovský | 2025-10-04 22:10:36 +0200 |
| commit | a9223b2bb363c6e33bf1532b9cba0a472a69a023 (patch) | |
| tree | b91343d28a1adcb7a6c1769fdc9cf8238cf6839d | |
| parent | 363ca5af1816f2a03cf0815f916fe70fed19ba27 (diff) | |
| download | catch3-a9223b2bb363c6e33bf1532b9cba0a472a69a023.tar.gz | |
Outline catch_strnlen's definition into catch_tostring.cpp
| -rw-r--r-- | src/catch2/catch_tostring.cpp | 6 | ||||
| -rw-r--r-- | src/catch2/catch_tostring.hpp | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp index cc686567..20b0a629 100644 --- a/src/catch2/catch_tostring.cpp +++ b/src/catch2/catch_tostring.cpp @@ -57,6 +57,12 @@ namespace Detail { } } // end unnamed namespace + std::size_t catch_strnlen( const char* str, std::size_t n ) { + auto ret = std::char_traits<char>::find( str, n, '\0' ); + if ( ret != nullptr ) { return static_cast<std::size_t>( ret - str ); } + return n; + } + std::string convertIntoString(StringRef string, bool escapeInvisibles) { std::string ret; // This is enough for the "don't escape invisibles" case, and a good diff --git a/src/catch2/catch_tostring.hpp b/src/catch2/catch_tostring.hpp index 41f89413..aca1f7e0 100644 --- a/src/catch2/catch_tostring.hpp +++ b/src/catch2/catch_tostring.hpp @@ -40,13 +40,7 @@ namespace Catch { namespace Detail { - inline std::size_t catch_strnlen(const char *str, std::size_t n) { - auto ret = std::char_traits<char>::find(str, n, '\0'); - if (ret != nullptr) { - return static_cast<std::size_t>(ret - str); - } - return n; - } + std::size_t catch_strnlen(const char *str, std::size_t n); constexpr StringRef unprintableString = "{?}"_sr; |