mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-18 02:45:40 +02:00
Added initial built-in matchers for NSString (ObjC)
This commit is contained in:
@@ -53,6 +53,32 @@ namespace Detail
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline std::string makeString
|
||||
(
|
||||
T* p
|
||||
)
|
||||
{
|
||||
if( !p )
|
||||
return INTERNAL_CATCH_STRINGIFY( NULL );
|
||||
std::ostringstream oss;
|
||||
oss << p;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline std::string makeString
|
||||
(
|
||||
const T* p
|
||||
)
|
||||
{
|
||||
if( !p )
|
||||
return INTERNAL_CATCH_STRINGIFY( NULL );
|
||||
std::ostringstream oss;
|
||||
oss << p;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
}// end namespace Detail
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -166,39 +192,6 @@ inline std::string toString
|
||||
{
|
||||
return value ? "true" : "false";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline std::string toString
|
||||
(
|
||||
void* p
|
||||
)
|
||||
{
|
||||
if( !p )
|
||||
return INTERNAL_CATCH_STRINGIFY( NULL );
|
||||
std::ostringstream oss;
|
||||
oss << p;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template<typename T>
|
||||
inline std::string toString
|
||||
(
|
||||
T* p
|
||||
)
|
||||
{
|
||||
return Catch::toString( static_cast<void*>( p ) );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template<typename T>
|
||||
inline std::string toString
|
||||
(
|
||||
const T* p
|
||||
)
|
||||
{
|
||||
return Catch::toString( static_cast<void*>( const_cast<T*>( p ) ) );
|
||||
}
|
||||
|
||||
struct TestFailureException
|
||||
{
|
||||
|
Reference in New Issue
Block a user