1
1
#include " ../RegionFilter.h"
2
2
3
+ #include " caliper/common/Variant.h"
4
+
3
5
#include < gtest/gtest.h>
4
6
5
7
using namespace cali ;
@@ -14,14 +16,14 @@ TEST(RegionFilterTest, IncludeExclude) {
14
16
15
17
RegionFilter f (p.first );
16
18
17
- EXPECT_TRUE (f.pass ( " exact match" ));
18
- EXPECT_FALSE (f.pass ( " some random string" ));
19
- EXPECT_TRUE (f.pass ( " matchme" ));
20
- EXPECT_TRUE (f.pass ( " starts with the magic word" ));
21
- EXPECT_FALSE (f.pass ( " start exclude" ));
22
- EXPECT_TRUE (f.pass ( " mpi_include_me" ));
23
- EXPECT_FALSE (f.pass ( " mpi_exclude_me" ));
24
- EXPECT_FALSE (f.pass ( " sta" ));
19
+ EXPECT_TRUE (f.pass ( Variant ( " exact match" ) ));
20
+ EXPECT_FALSE (f.pass ( Variant ( " some random string" ) ));
21
+ EXPECT_TRUE (f.pass ( Variant ( " matchme" ) ));
22
+ EXPECT_TRUE (f.pass ( Variant ( " starts with the magic word" ) ));
23
+ EXPECT_FALSE (f.pass ( Variant ( " start exclude" ) ));
24
+ EXPECT_TRUE (f.pass ( Variant ( " mpi_include_me" ) ));
25
+ EXPECT_FALSE (f.pass ( Variant ( " mpi_exclude_me" ) ));
26
+ EXPECT_FALSE (f.pass ( Variant ( " sta" ) ));
25
27
}
26
28
27
29
TEST (RegionFilterTest, IncludeOnly) {
@@ -34,12 +36,12 @@ TEST(RegionFilterTest, IncludeOnly) {
34
36
35
37
RegionFilter f (p.first );
36
38
37
- EXPECT_TRUE (f.pass ( " exact match" ));
38
- EXPECT_FALSE (f.pass ( " some random string" ));
39
- EXPECT_TRUE (f.pass ( " matchme" ));
40
- EXPECT_TRUE (f.pass ( " starts with the magic word" ));
41
- EXPECT_TRUE (f.pass ( " mpi_include_me" ));
42
- EXPECT_FALSE (f.pass ( " sta" ));
39
+ EXPECT_TRUE (f.pass ( Variant ( " exact match" ) ));
40
+ EXPECT_FALSE (f.pass ( Variant ( " some random string" ) ));
41
+ EXPECT_TRUE (f.pass ( Variant ( " matchme" ) ));
42
+ EXPECT_TRUE (f.pass ( Variant ( " starts with the magic word" ) ));
43
+ EXPECT_TRUE (f.pass ( Variant ( " mpi_include_me" ) ));
44
+ EXPECT_FALSE (f.pass ( Variant ( " sta" ) ));
43
45
}
44
46
45
47
TEST (RegionFilterTest, ExcludeOnly) {
@@ -52,11 +54,11 @@ TEST(RegionFilterTest, ExcludeOnly) {
52
54
53
55
RegionFilter f (p.first );
54
56
55
- EXPECT_TRUE (f.pass ( " some random string" ));
56
- EXPECT_FALSE (f.pass ( " exclude" ));
57
- EXPECT_TRUE (f.pass ( " mpi_include_me" ));
58
- EXPECT_FALSE (f.pass ( " mpi_exclude_me" ));
59
- EXPECT_TRUE (f.pass ( " mpi" ));
57
+ EXPECT_TRUE (f.pass ( Variant ( " some random string" ) ));
58
+ EXPECT_FALSE (f.pass ( Variant ( " exclude" ) ));
59
+ EXPECT_TRUE (f.pass ( Variant ( " mpi_include_me" ) ));
60
+ EXPECT_FALSE (f.pass ( Variant ( " mpi_exclude_me" ) ));
61
+ EXPECT_TRUE (f.pass ( Variant ( " mpi" ) ));
60
62
}
61
63
62
64
TEST (RegionFilterTest, IncludeRegex) {
@@ -66,9 +68,9 @@ TEST(RegionFilterTest, IncludeRegex) {
66
68
67
69
RegionFilter f (p.first );
68
70
69
- EXPECT_TRUE (f.pass ( " i should match" ));
70
- EXPECT_FALSE (f.pass ( " i should match not" ));
71
- EXPECT_FALSE (f.pass ( " me neither" ));
71
+ EXPECT_TRUE (f.pass ( Variant ( " i should match" ) ));
72
+ EXPECT_FALSE (f.pass ( Variant ( " i should match not" ) ));
73
+ EXPECT_FALSE (f.pass ( Variant ( " me neither" ) ));
72
74
}
73
75
74
76
TEST (RegionFilterTest, ParseError) {
0 commit comments