Skip to content

Commit bcf3c2b

Browse files
committed
Fix monitor test ProfiledThread ownership
1 parent ffa5f64 commit bcf3c2b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

ddprof-lib/src/test/cpp/park_state_ut.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ TEST(ProfiledThreadParkStateTest, SecondParkEnterOverwritesTicks) {
8080
}
8181

8282
TEST(ProfiledThreadMonitorStateTest, MonitorFlagLifecycle) {
83-
ProfiledThread *thread = ProfiledThread::forTid(12348);
83+
TestProfiledThread thread = testThread(12348);
8484

8585
u64 start_ticks = 0;
8686
Context monitor_context = {};
@@ -98,11 +98,10 @@ TEST(ProfiledThreadMonitorStateTest, MonitorFlagLifecycle) {
9898

9999
EXPECT_FALSE(thread->monitorExit(OSThreadState::MONITOR_WAIT, start_ticks,
100100
monitor_context, blocker));
101-
ProfiledThread::deleteForTest(thread);
102101
}
103102

104103
TEST(ProfiledThreadMonitorStateTest, ObjectWaitOwnsNestedMonitorContention) {
105-
ProfiledThread *thread = ProfiledThread::forTid(12349);
104+
TestProfiledThread thread = testThread(12349);
106105

107106
EXPECT_TRUE(thread->monitorEnter(100, 11, OSThreadState::OBJECT_WAIT));
108107

@@ -121,7 +120,6 @@ TEST(ProfiledThreadMonitorStateTest, ObjectWaitOwnsNestedMonitorContention) {
121120
monitor_context, blocker));
122121
EXPECT_EQ(100ULL, start_ticks);
123122
EXPECT_EQ(11ULL, blocker);
124-
ProfiledThread::deleteForTest(thread);
125123
}
126124

127125
TEST(WallClockOncePerRunFilterTest, SlotStateTransitions) {

0 commit comments

Comments
 (0)