Skip to content

Commit 3fd14fd

Browse files
[rtsan] Rename callback variable and test function
1 parent 630a2cf commit 3fd14fd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler-rt/lib/rtsan/rtsan_assertions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
namespace __rtsan {
1919

2020
template <typename OnViolationAction>
21-
void ExpectNotRealtime(Context &context, OnViolationAction &&on_violation) {
21+
void ExpectNotRealtime(Context &context, OnViolationAction &&OnViolation) {
2222
CHECK(__rtsan_is_initialized());
2323
if (context.InRealtimeContext() && !context.IsBypassed()) {
2424
context.BypassPush();
25-
on_violation();
25+
OnViolation();
2626
context.BypassPop();
2727
}
2828
}

compiler-rt/lib/rtsan/tests/rtsan_test_assertions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestRtsanAssertions : public ::testing::Test {
2323
void SetUp() override { __rtsan_ensure_initialized(); }
2424
};
2525

26-
static void testExpectNotRealtime(__rtsan::Context &context,
26+
static void ExpectViolationAction(__rtsan::Context &context,
2727
bool expect_violation_callback) {
2828
::testing::MockFunction<void()> mock_on_violation;
2929
EXPECT_CALL(mock_on_violation, Call).Times(expect_violation_callback ? 1 : 0);
@@ -34,15 +34,15 @@ TEST_F(TestRtsanAssertions,
3434
ExpectNotRealtimeDoesNotCallViolationActionIfNotInRealtimeContext) {
3535
__rtsan::Context context{};
3636
ASSERT_FALSE(context.InRealtimeContext());
37-
testExpectNotRealtime(context, false);
37+
ExpectViolationAction(context, false);
3838
}
3939

4040
TEST_F(TestRtsanAssertions,
4141
ExpectNotRealtimeCallsViolationActionIfInRealtimeContext) {
4242
__rtsan::Context context{};
4343
context.RealtimePush();
4444
ASSERT_TRUE(context.InRealtimeContext());
45-
testExpectNotRealtime(context, true);
45+
ExpectViolationAction(context, true);
4646
}
4747

4848
TEST_F(TestRtsanAssertions,
@@ -51,5 +51,5 @@ TEST_F(TestRtsanAssertions,
5151
context.RealtimePush();
5252
context.BypassPush();
5353
ASSERT_TRUE(context.IsBypassed());
54-
testExpectNotRealtime(context, false);
54+
ExpectViolationAction(context, false);
5555
}

0 commit comments

Comments
 (0)