File: catch_ext.hpp

package info (click to toggle)
mapnik 3.0.22%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,260 kB
  • sloc: cpp: 144,587; python: 1,426; sh: 785; makefile: 170; 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