tunit - Reference Guide  1.0.0
Modern c++17 unit testing framework on Windows, macOS, Linux, iOS and android.
ignore_error.h
Go to the documentation of this file.
1 #pragma once
4 #include <stdexcept>
5 #include <string>
6 
8 namespace tunit {
10  class ignore_error : public std::exception {
11  public:
14  explicit ignore_error(const std::string& message) : message_(message) {}
15 
18  explicit ignore_error(const char* message) : message_(message) {}
19 
21  ignore_error(const ignore_error&) = default;
22  ignore_error& operator=(const ignore_error&) = default;
24 
27  const char* what() const noexcept {return this->message_.c_str();}
28 
29  private:
30  std::string message_;
31  };
32 }
ignore_error(const std::string &message)
Create a new instance of ignore_error class.
Definition: ignore_error.h:14
The tunit namespace contains a unit test library.
Definition: abort_error.h:8
const char * what() const noexcept
Returns a string that represents the current ignore_error.
Definition: ignore_error.h:27
Exception thow when ignore.
Definition: ignore_error.h:10
ignore_error(const char *message)
Create a new instance of ignore_error class.
Definition: ignore_error.h:18