blob: d87dd5d4c631918146c134a31fd2d2233aebb2f9 [file] [log] [blame]
Phil Nashe6b2b0e2010-11-29 19:40:44 +00001/*
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
15TEST_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 Nasha2d20952010-12-14 09:00:09 +000022 REQUIRE( a != b );
23 REQUIRE( b != a );
Phil Nashe6b2b0e2010-11-29 19:40:44 +000024 }
Phil Nashce319b72010-11-30 06:48:21 +000025
Phil Nashe6b2b0e2010-11-29 19:40:44 +000026 SECTION( "s2", "not equal" )
27 {
Phil Nasha2d20952010-12-14 09:00:09 +000028 REQUIRE_FALSE( a == b);
Phil Nashe6b2b0e2010-11-29 19:40:44 +000029 }
Phil Nashe6b2b0e2010-11-29 19:40:44 +000030}
Phil Nashce319b72010-11-30 06:48:21 +000031
Phil Nashb3ef7fc2010-12-15 19:36:39 +000032TEST_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 Nashce319b72010-11-30 06:48:21 +000049TEST_CASE( "succeeding/Misc/stdout,stderr", "Sends stuff to stdout and stderr" )
50{
51 std::cout << "Some information";
52
53 std::cerr << "An error";
54}