AUnit
1.7.1
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
src
aunit
contrib
gtest.h
Go to the documentation of this file.
1
/*
2
MIT License
3
4
Copyright (c) 2018 Chris Johnson
5
6
Permission is hereby granted, free of charge, to any person obtaining a copy
7
of this software and associated documentation files (the "Software"), to deal
8
in the Software without restriction, including without limitation the rights
9
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
copies of the Software, and to permit persons to whom the Software is
11
furnished to do so, subject to the following conditions:
12
13
The above copyright notice and this permission notice shall be included in all
14
copies or substantial portions of the Software.
15
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
SOFTWARE.
23
*/
24
51
#ifndef AUNIT_CONTRIB_GTEST_H
52
#define AUNIT_CONTRIB_GTEST_H
53
54
#define TEST(category, name) test(category##_##name)
55
56
#define ASSERT_EQ(e, a) assertEqual(static_cast<decltype(a)>(e), a)
57
#define ASSERT_NE(e, a) assertNotEqual(static_cast<decltype(a)>(e), a)
58
#define ASSERT_LT(e, a) assertLess(static_cast<decltype(a)>(e), a)
59
#define ASSERT_GT(e, a) assertMore(static_cast<decltype(a)>(e), a)
60
#define ASSERT_LE(e, a) assertLessOrEqual(static_cast<decltype(a)>(e), a)
61
#define ASSERT_GE(e, a) assertMoreOrEqual(static_cast<decltype(a)>(e), a)
62
63
#define ASSERT_STREQ(e, a) assertEqual(static_cast<decltype(a)>(e), a)
64
#define ASSERT_STRNE(e, a) assertNotEqual(static_cast<decltype(a)>(e), a)
65
#define ASSERT_STRCASEEQ(e, a) \
66
assertStringCaseEqual(static_cast<decltype(a)>(e), a)
67
#define ASSERT_STRCASENE(e, a) \
68
assertStringCaseNotEqual(static_cast<decltype(a)>(e), a)
69
70
#define ASSERT_TRUE(x) assertTrue(x)
71
#define ASSERT_FALSE(x) assertFalse(x)
72
73
#define ASSERT_NEAR(e, a, error) assertNear(static_cast<decltype(a)>(e), a, static_cast<decltype(a)>(error))
74
75
#endif
Generated by
1.9.1