]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/test/example/prg_exec_example.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / test / example / prg_exec_example.cpp
1 // (C) Copyright Gennadiy Rozental 2001-2014.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5
6 // See http://www.boost.org/libs/test for the library home page.
7
8 #include <boost/test/prg_exec_monitor.hpp>
9
10 int add( int i, int j ) { return i+j; }
11
12 int cpp_main( int, char *[] ) // note the name!
13 {
14 // two ways to detect and report the same error:
15 if ( add(2,2) != 4 ) throw "Oops..."; // #1 throws on error
16
17 return add(2,2) == 4 ? 15 : 1; // #2 returns error directly
18 }
19
20 // EOF