mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-28 07:29:25 +00:00
Replace most naked throws with macros from catch_enforce.h
This is a first step towards support a no-exceptions mode
This commit is contained in:
parent
ef9150fe6f
commit
86da2846af
7 changed files with 28 additions and 34 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "catch_interfaces_generatortracker.h"
|
||||
#include "catch_common.h"
|
||||
#include "catch_enforce.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
@ -76,7 +77,7 @@ namespace Generators {
|
|||
template<typename T>
|
||||
struct NullGenerator : IGenerator<T> {
|
||||
auto get( size_t ) const -> T override {
|
||||
throw std::logic_error("A Null Generator should always be empty" );
|
||||
CATCH_INTERNAL_ERROR("A Null Generator is always empty");
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -198,7 +199,7 @@ namespace Generators {
|
|||
if( index < sizes )
|
||||
return gen[localIndex];
|
||||
}
|
||||
throw std::out_of_range("index out of range");
|
||||
CATCH_INTERNAL_ERROR("Index '" << index << "' is out of range (" << sizes << ')');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue