Some refactorings:

- Overrides added
 - usages of push_back() replaced with emplace_back()
 - Loop variable made const-refernce
 - NULL replaced with nullptr
 - Names used in the declaration and definition unified
 - size() replaced with empty
 - Identical cases merged
This commit is contained in:
offa
2020-01-21 21:04:42 +01:00
committed by Martin Hořeňovský
parent 587a20b312
commit 2d172dc688
11 changed files with 31 additions and 36 deletions

View File

@@ -24,7 +24,7 @@ std::string ws(int const level) {
template< typename T >
std::ostream& operator<<( std::ostream& os, std::vector<T> const& v ) {
os << "{ ";
for ( auto x : v )
for ( const auto& x : v )
os << x << ", ";
return os << "}";
}
@@ -57,7 +57,7 @@ void print( std::ostream& os, int const level, Catch::MessageInfo const& info )
void print( std::ostream& os, int const level, std::string const& title, std::vector<Catch::MessageInfo> const& v ) {
os << ws(level ) << title << ":\n";
for ( auto x : v )
for ( const auto& x : v )
{
os << ws(level+1) << "{\n";
print( os, level+2, x );
@@ -300,7 +300,7 @@ char const * dashed_line =
struct MyListener : Catch::TestEventListenerBase {
using TestEventListenerBase::TestEventListenerBase; // inherit constructor
// Get rid of Wweak-tables
~MyListener();

View File

@@ -16,7 +16,7 @@ class out_buff : public std::stringbuf {
public:
out_buff(std::FILE* stream):m_stream(stream) {}
~out_buff();
int sync() {
int sync() override {
int ret = 0;
for (unsigned char c : str()) {
if (putc(c, m_stream) == EOF) {