diff --git a/CHANGES.txt b/CHANGES.txt index 9c43a7d..a1bf14e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,11 @@ Changes for lest – lest errors escape testing +version 1.7.2 2014-02-06 + +- Add destructor to message to support GCC 4.6 (Thanks to Peter De Wachter). + + version 1.7.1 2013-09-09 - Improve detection of containers. diff --git a/README.md b/README.md index d427ef3..048a03b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This tiny C++11 test helper is based on ideas and examples by Kevlin Henney [1,2 Let writing tests become irresistibly easy and attractive. -**Contents** +**Contents** - [Example usage](#example-usage) - [Compile and run](#compile-and-run) - [Synopsis](#synopsis) @@ -85,13 +85,13 @@ Synopsis -------- ### Assertions Macros -**EXPECT(** _expr_ **)** +**EXPECT(** _expr_ **)** Evaluate the expression and report failure. If an exception is thrown it is caught, reported and counted as a failure. -**EXPECT_THROWS(** _expr_ **)** +**EXPECT_THROWS(** _expr_ **)** Expect that an exception (of any type) is thrown during evaluation of the expression. -**EXPECT_THROWS_AS(** _expr_, _exception_ **)** +**EXPECT_THROWS_AS(** _expr_, _exception_ **)** Expect that an exception of the specified type is thrown during evaluation of the expression. If an assertion fails, the remainder of the test that assertion is part of is skipped. @@ -99,22 +99,22 @@ If an assertion fails, the remainder of the test that assertion is part of is sk Note that EXPECT(), EXPECT_THROWS() and EXPECT_THROWS_AS() are shortened aliases for lest_EXPECT(), lest_EXPECT_THROWS() and lest_EXPECT_THROWS_AS(). ### Other Macros -**lest_NO_SHORT_ASSERTION_NAMES** +**lest_NO_SHORT_ASSERTION_NAMES** Define this to omit the shortened alias macros for the lest_EXPECT... macros. ### Namespace -namespace **lest** { } +namespace **lest** { } Types and functions are located in namespace lest. ### Tests -struct **test** -{ - const std::string name; - const std::function\ behaviour; +struct **test** +{ + const std::string name; + const std::function\ behaviour; }; ### Functions -template\ +template\ int **run(** test const (& _specification_ )[N], std::ostream & _os_ = std::cout **)** - _specification_ - array of tests - _os_ - stream to report to @@ -124,8 +124,8 @@ int **run(** test const (& _specification_ )[N], std::ostream & _os_ = std::cout Reported to work with --------------------- -- g++ 4.8.1 - clang 3.2 +- g++ 4.6, 4.8.1 - Visual Studio 2013 preview diff --git a/lest.hpp b/lest.hpp index e3275f0..41bbfb8 100644 --- a/lest.hpp +++ b/lest.hpp @@ -87,7 +87,7 @@ struct message : std::runtime_error const location where; const comment note; - ~message() throw() {} + ~message() throw() {} // GCC 4.6 message( std::string kind, location where, std::string expr, std::string note = "" ) : std::runtime_error{ expr }, kind{ kind }, where{ where }, note{ note } {} diff --git a/lest_decompose.hpp b/lest_decompose.hpp index 3f96c8c..8245e74 100644 --- a/lest_decompose.hpp +++ b/lest_decompose.hpp @@ -102,6 +102,8 @@ struct message : std::runtime_error const location where; const comment note; + ~message() throw() {} // GCC 4.6 + message( std::string kind, location where, std::string expr, std::string note = "" ) : std::runtime_error{ expr }, kind{ kind }, where{ where }, note{ note } {} };