Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Added std:: qualification to some functions from C stdlib

This should solve #543, once Clara changes are in as well.
Commit
d0620c3495ad36df1918fbf720ea0946099620e1
Author
Martin Hořeňovský ·
Parents
fd7dde10d359

Files · Download .tar.gz

Changes

 include/internal/catch_approx.hpp          | 4 ++--
 include/internal/catch_common.h            | 1 +
 include/internal/catch_common.hpp          | 2 +-
 include/internal/catch_test_case_info.hpp  | 2 +-
 include/reporters/catch_reporter_bases.hpp | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/internal/catch_approx.hpp b/include/internal/catch_approx.hpp
index f1937427..23f42371 100644
--- a/include/internal/catch_approx.hpp
+++ b/include/internal/catch_approx.hpp
@@ -50,7 +50,7 @@ namespace Detail {
         friend bool operator == ( const T& lhs, Approx const& rhs ) {
             // Thanks to Richard Harris for his help refining this formula
             auto lhs_v = double(lhs);
-            return fabs( lhs_v - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs_v), fabs(rhs.m_value) ) );
+            return std::fabs( lhs_v - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( std::fabs(lhs_v), std::fabs(rhs.m_value) ) );
         }
 
         template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
@@ -94,7 +94,7 @@ namespace Detail {
 #else
         friend bool operator == ( double lhs, Approx const& rhs ) {
             // Thanks to Richard Harris for his help refining this formula
-            return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) );
+            return std::fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( std::fabs(lhs), std::fabs(rhs.m_value) ) );
         }
 
         friend bool operator == ( Approx const& lhs, double rhs ) {
diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h
index a42b558e..455a2fab 100644
--- a/include/internal/catch_common.h
+++ b/include/internal/catch_common.h
@@ -24,6 +24,7 @@
 #include <sstream>
 #include <stdexcept>
 #include <algorithm>
+#include <cctype>
 
 #include "catch_compiler_capabilities.h"
 
diff --git a/include/internal/catch_common.hpp b/include/internal/catch_common.hpp
index 766c3df8..cca775e5 100644
--- a/include/internal/catch_common.hpp
+++ b/include/internal/catch_common.hpp
@@ -33,7 +33,7 @@ namespace Catch {
         return s.find(infix) != std::string::npos;
     }
     char toLowerCh(char c) {
-        return static_cast<char>( ::tolower( c ) );
+        return static_cast<char>( std::tolower( c ) );
     }
     void toLowerInPlace( std::string& s ) {
         std::transform( s.begin(), s.end(), s.begin(), toLowerCh );
diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp
index 3847cc93..abba5d99 100644
--- a/include/internal/catch_test_case_info.hpp
+++ b/include/internal/catch_test_case_info.hpp
@@ -32,7 +32,7 @@ namespace Catch {
             return TestCaseInfo::None;
     }
     inline bool isReservedTag( std::string const& tag ) {
-        return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !isalnum( tag[0] );
+        return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !std::isalnum( tag[0] );
     }
     inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
         if( isReservedTag( tag ) ) {
diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp
index 1469a9e1..e0eda4cc 100644
--- a/include/reporters/catch_reporter_bases.hpp
+++ b/include/reporters/catch_reporter_bases.hpp
@@ -237,7 +237,7 @@ namespace Catch {
     char const* getLineOfChars() {
         static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
         if( !*line ) {
-            memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
+            std::memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
             line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;
         }
         return line;