File: catch_ext.hpp

package info (click to toggle)
mapnik 4.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 18,548 kB
  • sloc: cpp: 163,861; python: 1,190; sh: 690; xml: 161; makefile: 123; perl: 28; lisp: 13
file content (25 lines) | stat: -rw-r--r-- 1,936 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef TEST_CATCH_EXT_HPP
#define TEST_CATCH_EXT_HPP

#include "catch.hpp"

#define TRY_CHECK(expr)                                                                                                \
    try                                                                                                                \
    {                                                                                                                  \
        CHECK(expr);                                                                                                   \
    }                                                                                                                  \
    catch (Catch::TestFailureException&)                                                                               \
    {                                                                                                                  \
        /* thrown by CHECK after it catches and reports */                                                             \
        /* an exception from expr => swallow this       */                                                             \
    }

#define TRY_CHECK_FALSE(expr)                                                                                          \
    try                                                                                                                \
    {                                                                                                                  \
        CHECK_FALSE(expr);                                                                                             \
    }                                                                                                                  \
    catch (Catch::TestFailureException&)                                                                               \
    {}

#endif // TEST_CATCH_EXT_HPP