mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Catches incorrect reporter name as per #107
This commit is contained in:
@@ -36,6 +36,12 @@ namespace Catch {
|
||||
|
||||
Ptr<IReporter> reporter = getCurrentContext().getReporterRegistry().create( reporterName, reporterConfig );
|
||||
|
||||
if( !reporter )
|
||||
{
|
||||
std::cerr << "No reporter registered with name: " << reporterName << "'" << std::endl;
|
||||
return (std::numeric_limits<int>::max)();
|
||||
}
|
||||
|
||||
if( !config.data().stream.empty() ) {
|
||||
if( config.data().stream[0] == '%' )
|
||||
config.useStream( config.data().stream.substr( 1 ) );
|
||||
|
@@ -20,10 +20,12 @@ namespace Catch {
|
||||
public:
|
||||
Ptr() : m_p( NULL ){}
|
||||
Ptr( T* p ) : m_p( p ){
|
||||
m_p->addRef();
|
||||
if( m_p )
|
||||
m_p->addRef();
|
||||
}
|
||||
Ptr( const Ptr& other ) : m_p( other.m_p ){
|
||||
m_p->addRef();
|
||||
if( m_p )
|
||||
m_p->addRef();
|
||||
}
|
||||
~Ptr(){
|
||||
if( m_p )
|
||||
@@ -63,6 +65,9 @@ namespace Catch {
|
||||
const T* operator->() const{
|
||||
return m_p;
|
||||
}
|
||||
bool operator !() const {
|
||||
return m_p == NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
T* m_p;
|
||||
|
Reference in New Issue
Block a user