Project
Loading...
Searching...
No Matches
test2.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#define BOOST_TEST_MODULE Ex4
13#define BOOST_TEST_DYN_LINK
14#define BOOST_TEST_MAIN
15
16#include <boost/test/unit_test.hpp>
17#include "Ex2/A.h"
18#include "Ex3/A.h"
19#include "Ex4/A.h"
20
21#include <iostream>
22#include <sstream>
23
24BOOST_AUTO_TEST_CASE(AValueShouldBeTheAnswer)
25{
26 ex4::A a;
27 BOOST_CHECK_EQUAL(a.value(), 42);
28}
29
30BOOST_AUTO_TEST_CASE(ACtorShouldSayHello)
31{
32 std::stringstream buffer;
33 std::streambuf* old = std::cout.rdbuf(buffer.rdbuf());
34
35 ex4::A a;
36
37 std::string text = buffer.str();
38
39 std::cout.rdbuf(old);
40
41 BOOST_CHECK_EQUAL(text, "Hello from ex4::A ctor\n");
42}
43
44BOOST_AUTO_TEST_CASE(AAACtorShouldSayHello)
45{
46 std::stringstream buffer;
47 std::streambuf* old = std::cout.rdbuf(buffer.rdbuf());
48
49 ex2::A a;
50 ex3::A b;
51 ex4::A c;
52
53 std::string text = buffer.str();
54
55 std::cout.rdbuf(old);
56
58 "Hello from ex2::A ctor\n"
59 "Hello from ex3::A ctor\n"
60 "Hello from ex4::A ctor\n");
61}
uint32_t c
Definition RawData.h:2
Definition A.h:20
Definition A.h:20
Definition A.h:20
GLuint buffer
Definition glcorearb.h:655
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
BOOST_AUTO_TEST_CASE(AValueShouldBeTheAnswer)
Definition test2.cxx:24
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())