10
10
11
11
#include " rtsan_test_utilities.h"
12
12
13
- #include " rtsan_context.h"
13
+ #include " rtsan/rtsan.h"
14
+ #include " rtsan/rtsan_context.h"
14
15
15
- TEST (TestRtsanContext, CanCreateContext) { __rtsan::Context context{}; }
16
+ # include < gtest/gtest.h >
16
17
17
- TEST (TestRtsanContext, ExpectNotRealtimeDoesNotDieBeforeRealtimePush) {
18
+ class TestRtsanContext : public ::testing::Test {
19
+ protected:
20
+ void SetUp () override { __rtsan_ensure_initialized (); }
21
+ };
22
+
23
+ TEST_F (TestRtsanContext, ExpectNotRealtimeDoesNotDieBeforeRealtimePush) {
18
24
__rtsan::Context context{};
19
25
ExpectNotRealtime (context, " do_some_stuff" );
20
26
}
21
27
22
- TEST (TestRtsanContext, ExpectNotRealtimeDoesNotDieAfterPushAndPop) {
28
+ TEST_F (TestRtsanContext, ExpectNotRealtimeDoesNotDieAfterPushAndPop) {
23
29
__rtsan::Context context{};
24
30
context.RealtimePush ();
25
31
context.RealtimePop ();
26
32
ExpectNotRealtime (context, " do_some_stuff" );
27
33
}
28
34
29
- TEST (TestRtsanContext, ExpectNotRealtimeDiesAfterRealtimePush) {
35
+ TEST_F (TestRtsanContext, ExpectNotRealtimeDiesAfterRealtimePush) {
30
36
__rtsan::Context context{};
31
37
32
38
context.RealtimePush ();
33
39
EXPECT_DEATH (ExpectNotRealtime (context, " do_some_stuff" ), " " );
34
40
}
35
41
36
- TEST (TestRtsanContext,
37
- ExpectNotRealtimeDiesAfterRealtimeAfterMorePushesThanPops) {
42
+ TEST_F (TestRtsanContext,
43
+ ExpectNotRealtimeDiesAfterRealtimeAfterMorePushesThanPops) {
38
44
__rtsan::Context context{};
39
45
40
46
context.RealtimePush ();
@@ -45,16 +51,16 @@ TEST(TestRtsanContext,
45
51
EXPECT_DEATH (ExpectNotRealtime (context, " do_some_stuff" ), " " );
46
52
}
47
53
48
- TEST (TestRtsanContext, ExpectNotRealtimeDoesNotDieAfterBypassPush) {
54
+ TEST_F (TestRtsanContext, ExpectNotRealtimeDoesNotDieAfterBypassPush) {
49
55
__rtsan::Context context{};
50
56
51
57
context.RealtimePush ();
52
58
context.BypassPush ();
53
59
ExpectNotRealtime (context, " do_some_stuff" );
54
60
}
55
61
56
- TEST (TestRtsanContext,
57
- ExpectNotRealtimeDoesNotDieIfBypassDepthIsGreaterThanZero) {
62
+ TEST_F (TestRtsanContext,
63
+ ExpectNotRealtimeDoesNotDieIfBypassDepthIsGreaterThanZero) {
58
64
__rtsan::Context context{};
59
65
60
66
context.RealtimePush ();
0 commit comments