File: tthrowruntimeerror.cpp

package info (click to toggle)
aoflagger 3.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,004 kB
  • sloc: cpp: 67,891; python: 497; sh: 242; makefile: 22
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()