File: catch_ext.hpp

package info (click to toggle)
mapnik 3.1.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 20,208 kB
  • sloc: cpp: 144,467; python: 30,152; sh: 797; makefile: 166; xml: 140; lisp: 13
file content (22 lines) | stat: -rw-r--r-- 864 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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