Phil Nash | e6b2b0e | 2010-11-29 19:40:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * MiscTests.cpp |
| 3 | * Catch - Test |
| 4 | * |
| 5 | * Created by Phil on 29/11/2010. |
| 6 | * Copyright 2010 Two Blue Cubes Ltd. All rights reserved. |
| 7 | * |
| 8 | * Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 9 | * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | #include "../catch.hpp" |
| 14 | |
| 15 | TEST_CASE( "succeeding/Misc/Sections", "random SECTION tests" ) |
| 16 | { |
| 17 | int a = 1; |
| 18 | int b = 2; |
| 19 | |
| 20 | SECTION( "s1", "doesn't equal" ) |
| 21 | { |
Phil Nash | a2d2095 | 2010-12-14 09:00:09 +0000 | [diff] [blame] | 22 | REQUIRE( a != b ); |
| 23 | REQUIRE( b != a ); |
Phil Nash | e6b2b0e | 2010-11-29 19:40:44 +0000 | [diff] [blame] | 24 | } |
Phil Nash | ce319b7 | 2010-11-30 06:48:21 +0000 | [diff] [blame] | 25 | |
Phil Nash | e6b2b0e | 2010-11-29 19:40:44 +0000 | [diff] [blame] | 26 | SECTION( "s2", "not equal" ) |
| 27 | { |
Phil Nash | a2d2095 | 2010-12-14 09:00:09 +0000 | [diff] [blame] | 28 | REQUIRE_FALSE( a == b); |
Phil Nash | e6b2b0e | 2010-11-29 19:40:44 +0000 | [diff] [blame] | 29 | } |
Phil Nash | e6b2b0e | 2010-11-29 19:40:44 +0000 | [diff] [blame] | 30 | } |
Phil Nash | ce319b7 | 2010-11-30 06:48:21 +0000 | [diff] [blame] | 31 | |
Phil Nash | b3ef7fc | 2010-12-15 19:36:39 +0000 | [diff] [blame^] | 32 | TEST_CASE( "succeeding/Misc/Sections/nested", "nested SECTION tests" ) |
| 33 | { |
| 34 | int a = 1; |
| 35 | int b = 2; |
| 36 | |
| 37 | SECTION( "s1", "doesn't equal" ) |
| 38 | { |
| 39 | REQUIRE( a != b ); |
| 40 | REQUIRE( b != a ); |
| 41 | |
| 42 | SECTION( "s2", "not equal" ) |
| 43 | { |
| 44 | REQUIRE_FALSE( a == b); |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
Phil Nash | ce319b7 | 2010-11-30 06:48:21 +0000 | [diff] [blame] | 49 | TEST_CASE( "succeeding/Misc/stdout,stderr", "Sends stuff to stdout and stderr" ) |
| 50 | { |
| 51 | std::cout << "Some information"; |
| 52 | |
| 53 | std::cerr << "An error"; |
| 54 | } |