test
test_set_utils.cpp
Go to the documentation of this file.
1
#include "gtest/gtest.h"
2
#include <set>
3
#include <
robot_body_filter/utils/set_utils.hpp
>
4
5
TEST
(SetUtils,
isSetIntersectionEmpty
)
6
{
7
std::set<int> a = { 1, 2, 4, -3 };
8
std::set<int> b = { -1, -2, -4, 3 };
9
std::set<int> c = { 4, 3 };
10
std::set<int> e;
11
12
EXPECT_FALSE
(
robot_body_filter::isSetIntersectionEmpty
(a, a));
13
EXPECT_FALSE
(
robot_body_filter::isSetIntersectionEmpty
(b, b));
14
EXPECT_FALSE
(
robot_body_filter::isSetIntersectionEmpty
(a, c));
15
EXPECT_FALSE
(
robot_body_filter::isSetIntersectionEmpty
(b, c));
16
EXPECT_FALSE
(
robot_body_filter::isSetIntersectionEmpty
(c, a));
17
EXPECT_FALSE
(
robot_body_filter::isSetIntersectionEmpty
(c, b));
18
19
EXPECT_TRUE
(
robot_body_filter::isSetIntersectionEmpty
(a, b));
20
EXPECT_TRUE
(
robot_body_filter::isSetIntersectionEmpty
(b, a));
21
22
// empty set handling
23
EXPECT_TRUE
(
robot_body_filter::isSetIntersectionEmpty
(a, e));
24
EXPECT_TRUE
(
robot_body_filter::isSetIntersectionEmpty
(b, e));
25
EXPECT_TRUE
(
robot_body_filter::isSetIntersectionEmpty
(e, e));
26
}
27
28
int
main
(
int
argc,
char
**argv)
29
{
30
testing::InitGoogleTest(&argc, argv);
31
return
RUN_ALL_TESTS();
32
}
TEST
TEST(SetUtils, isSetIntersectionEmpty)
Definition:
test_set_utils.cpp:5
robot_body_filter::isSetIntersectionEmpty
bool isSetIntersectionEmpty(const std::set< T > &set1, const std::set< T > &set2)
Definition:
set_utils.hpp:8
set_utils.hpp
EXPECT_TRUE
#define EXPECT_TRUE(args)
main
int main(int argc, char **argv)
Definition:
test_set_utils.cpp:28
EXPECT_FALSE
#define EXPECT_FALSE(args)
robot_body_filter
Author(s): Eitan Marder-Eppstein, Tomas Petricek, Martin Pecka
autogenerated on Mon Feb 5 2024 03:33:49