Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.



Boost.Test example 2
is a Boost.Test example.
Technical facts
Operating system(s) or programming environment(s)
IDE(s):
Project type:
C++ standard:
Compiler(s):
Libraries used:
Boost: version 1.55
STL: GNU ISO C++ Library, version 4.9.2
Qt project file: ./CppBoostTestExample2/CppBoostTestExample2.pro
./CppBoostTestExample2/main.cpp
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#define BOOST_TEST_DYN_LINK //Need to add 'LIBS += -lboost_unit_test_framework' to .pro file
#define BOOST_TEST_MODULE Suites
#include <boost/test/unit_test.hpp>
int add(int i, int j)
{
return i + j;
}
BOOST_AUTO_TEST_SUITE(Maths)
BOOST_AUTO_TEST_CASE(universeInOrder)
{
BOOST_CHECK(add(2, 2) == 4);
}
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(Physics)
BOOST_AUTO_TEST_CASE(specialTheory)
{
int e = 32;
int m = 2;
int c = 4;
BOOST_CHECK(e == m * c * c);
}
BOOST_AUTO_TEST_SUITE_END()
#pragma GCC diagnostic pop
|
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.

This page has been created by the tool CodeToHtml