Fix error: ISO C++ forbids in-class initialization of non-const static member 'm_started'
[catch.git] / projects / SelfTest / ToStringGeneralTests.cpp
blob743882b16cdd144d149ecc6e6213d9624772d320
1 /*
2 * Created by Martin on 17/02/2017.
4 * Distributed under the Boost Software License, Version 1.0. (See accompanying
5 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 */
8 #include "catch.hpp"
11 TEST_CASE( "Character pretty printing" ){
12 SECTION("Specifically escaped"){
13 char tab = '\t';
14 char newline = '\n';
15 char carr_return = '\r';
16 char form_feed = '\f';
17 CHECK(tab == '\t');
18 CHECK(newline == '\n');
19 CHECK(carr_return == '\r');
20 CHECK(form_feed == '\f');
22 SECTION("General chars"){
23 char space = ' ';
24 CHECK(space == ' ');
25 char chars[] = {'a', 'z', 'A', 'Z'};
26 for (int i = 0; i < 4; ++i){
27 char c = chars[i];
28 REQUIRE(c == chars[i]);
31 SECTION("Low ASCII"){
32 char null_terminator = '\0';
33 CHECK(null_terminator == '\0');
34 for (int i = 2; i < 6; ++i){
35 char c = static_cast<char>(i);
36 REQUIRE(c == i);
42 TEST_CASE( "Capture and info messages" ) {
43 SECTION("Capture should stringify like assertions") {
44 int i = 2;
45 CAPTURE(i);
46 REQUIRE(true);
48 SECTION("Info should NOT stringify the way assertions do") {
49 int i = 3;
50 INFO(i);
51 REQUIRE(true);