MeshLib Documentation
Loading...
Searching...
No Matches
MRGTest.h
Go to the documentation of this file.
1#pragma once
2#include "MRStreamOperators.h"
3
4#ifdef MRMESH_NO_GTEST
5
6#undef TEST
7#undef ASSERT_EQ
8#undef EXPECT_EQ
9#undef ASSERT_NE
10#undef EXPECT_NE
11#undef ASSERT_LE
12#undef EXPECT_LE
13#undef ASSERT_GE
14#undef EXPECT_GE
15#undef ASSERT_GT
16#undef EXPECT_GT
17#undef ASSERT_TRUE
18#undef EXPECT_TRUE
19#undef ASSERT_FALSE
20#undef EXPECT_FALSE
21#undef ASSERT_NEAR
22#undef EXPECT_NEAR
23
24#define TEST( a, b ) [[maybe_unused]] static void a##b()
25#define ASSERT_EQ( a, b ) (void)( a == b );
26#define EXPECT_EQ( a, b ) (void)( a == b );
27#define ASSERT_NE( a, b ) (void)( a != b );
28#define EXPECT_NE( a, b ) (void)( a != b );
29#define ASSERT_LE( a, b ) (void)( a <= b );
30#define EXPECT_LE( a, b ) (void)( a <= b );
31#define ASSERT_GE( a, b ) (void)( a >= b );
32#define EXPECT_GE( a, b ) (void)( a >= b );
33#define ASSERT_GT( a, b ) (void)( a > b );
34#define EXPECT_GT( a, b ) (void)( a > b );
35#define ASSERT_TRUE( a ) (void)( a );
36#define EXPECT_TRUE( a ) (void)( a );
37#define ASSERT_FALSE( a ) (void)( !(a) );
38#define EXPECT_FALSE( a ) (void)( !(a) );
39#define ASSERT_NEAR( a, b, e ) (void)( ( a - b ) <= e );
40#define EXPECT_NEAR( a, b, e ) (void)( ( a - b ) <= e );
41
42#else
43
44#include <gtest/gtest.h>
45
46#endif