enum_name
Loading...
Searching...
No Matches
foo.h
1#pragma once
2#include "doctest/doctest.h"
3#include <type_traits>
4
5DOCTEST_CLANG_SUPPRESS_WARNING("-Wmissing-prototypes")
6DOCTEST_GCC_SUPPRESS_WARNING("-Wmissing-declarations")
7
8#ifdef RETURN_42
9#define TEST_LABEL "[return42] "
10#else
11#define TEST_LABEL "[default] "
12#endif
13
14inline int bar() {
15#ifdef RETURN_42
16 return 42;
17#else
18 return 11;
19#endif
20}
21
22#ifdef DOCTEST_LIBRARY_INCLUDED
23
24#ifdef RETURN_42
25TEST_CASE(TEST_LABEL "bartest"){
26 INFO("Running " TEST_LABEL "bartest"); MESSAGE("");
27 CHECK_EQ(42, bar());
28}
29#endif
30
31#ifndef RETURN_42
32TEST_CASE(TEST_LABEL "bartest"){
33 INFO("Running " TEST_LABEL "bartest"); MESSAGE("");
34 CHECK_EQ(11, bar());
35}
36#endif
37
38TEST_CASE(TEST_LABEL "commontest"){
39 INFO("Running " TEST_LABEL "commontest"); MESSAGE("");
40}
41#endif // DOCTEST_LIBRARY_INCLUDED