Skip to content

Commit

Permalink
Add destructor to message to support GCC 4.6 (Thanks to Peter De Wach…
Browse files Browse the repository at this point in the history
…ter).
  • Loading branch information
martinmoene committed Feb 6, 2014
1 parent ac48a17 commit b68cd15
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -85,36 +85,36 @@ 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.

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;
&emsp;const std::function\<void()\> behaviour;
struct **test**
{
&emsp;const std::string name;
&emsp;const std::function\<void()\> behaviour;
};

### Functions
template\<std::size_t N\>
template\<std::size_t N\>
int **run(** test const (& _specification_ )[N], std::ostream & _os_ = std::cout **)**
- _specification_ - array of tests
- _os_ - stream to report to
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion lest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 } {}
Expand Down
2 changes: 2 additions & 0 deletions lest_decompose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 } {}
};
Expand Down

0 comments on commit b68cd15

Please sign in to comment.