File: tthrowruntimeerror.cpp

package info (click to toggle)
wsclean 3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,036 kB
  • sloc: cpp: 71,902; python: 9,239; ansic: 230; makefile: 175; sh: 172
file content (21 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "aocommon/throwruntimeerror.h"

#include <boost/test/unit_test.hpp>

#include <string>

BOOST_AUTO_TEST_SUITE(throw_runtime_error)

BOOST_AUTO_TEST_CASE(throw_runtime_error) {
  BOOST_CHECK_EXCEPTION(
      aocommon::ThrowRuntimeError(), std::runtime_error,
      [](const std::runtime_error& e) { return e.what() == std::string(); });

  BOOST_CHECK_EXCEPTION(
      aocommon::ThrowRuntimeError('a', "bc", std::string("def"), 123),
      std::runtime_error, [](const std::runtime_error& e) {
        return e.what() == std::string("abcdef123");
      });
}

BOOST_AUTO_TEST_SUITE_END()