20 assert(ei.
what() ==
"");
22 assert(ei.where() ==
"");
24 assert(ei.
file() ==
"");
25 assert(ei.
line() == 0);
32 e =
ERROR(0,
"Simulated error instance");
35 assert(e.size() == 1);
36 assert(e[0].what() ==
"Simulated error instance");
41 assert(e.size() == 1);
42 assert(e[0].what() ==
"Simulated internal error instance");
49 e =
ERROR(1,
"Simulated error instance");
52 assert(e.size() == 1);
53 assert(e[0].what() ==
"Simulated error instance");
58 assert(e.size() == 1);
59 assert(e[0].what() ==
"Simulated internal error instance");
64 assert(e.size() == 1);
65 assert(e[0].what() ==
"Simulated internal error instance");
70 throw(
ERROR(1,
"Simulated error for test4b"));
95 assert(e.size() == 3);
96 assert(e[0].what() ==
"Simulated error for test4b");
97 assert(e[1].what() ==
"Failure in test4a");
98 assert(e[2].what() ==
"Failure in test4");
130 assert(e.
num() == 1);
132 assert(e.size() == 3);
133 assert(e[0].what() ==
"Simulated error for test5b");
134 assert(e[1].what() ==
"Failure in test5a");
135 assert(e[2].what() ==
"Failure in test5");
151 assert(e1.size() == 4);
152 assert(e1[0].what() ==
"Testing:");
153 assert(e1[1].what() ==
"One...");
154 assert(e1[2].what() ==
"Two...");
155 assert(e1[3].what() ==
"Three...");
159 assert(e2.size() == 4);
160 assert(e2[0].what() ==
"Testing:");
161 assert(e2[1].what() ==
"One...");
162 assert(e2[2].what() ==
"Two...");
163 assert(e2[3].what() ==
"Three...");
166 #ifndef ASSUME_STL_MEMORY_EXCEPTION
169 std::string str =
"a";
172 TRY(str += str,
"Could not append to string");
179 bool identified =
false;
191 assert(errno == ENOMEM);
204 assert(e.
num() == ENOMEM);
205 assert(e.size() == 1);
206 assert(e[0].what() ==
"Out of memory");
209 int main(
int argc,
char const * argv[])
218 #ifndef ASSUME_STL_MEMORY_EXCEPTION
219 #ifdef HAVE_EXCEPTION_ON_ALLOC_FAILURE
Instance of a single error containing a descriptive error message and the location in the file that t...
void push_back(const error_instance &a_e)
const uint16 line(void) const
const std::string what(void) const
const std::string file(void) const
int main(int argc, char const *argv[])
#define INTERNAL_ERROR(e, s)
#define ERROR_INSTANCE(s)