Skip to content

Commit 5b74fb9

Browse files
committed
Use static var to check progress total
Use the changes implemented in #79912 to use a static variable from `Progress` to ensure that the report was created with a non-deterministic total.
1 parent bb71954 commit 5b74fb9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lldb/unittests/Core/ProgressReportTest.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class ProgressReportTest : public ::testing::Test {
3333

3434
TEST_F(ProgressReportTest, TestReportCreation) {
3535
std::chrono::milliseconds timeout(100);
36-
const unsigned long long NO_TOTAL = 1;
3736

3837
// Set up the debugger, make sure that was done properly
3938
ArchSpec arch("x86_64-apple-macosx-");
@@ -76,7 +75,7 @@ TEST_F(ProgressReportTest, TestReportCreation) {
7675
ASSERT_EQ(data->GetDetails(), "Starting report 1");
7776
ASSERT_FALSE(data->IsFinite());
7877
ASSERT_FALSE(data->GetCompleted());
79-
ASSERT_EQ(data->GetTotal(), NO_TOTAL);
78+
ASSERT_EQ(data->GetTotal(), Progress::kNonDeterministicTotal);
8079
ASSERT_EQ(data->GetMessage(), "Progress report 1: Starting report 1");
8180

8281
EXPECT_TRUE(listener_sp->GetEvent(event_sp, timeout));
@@ -85,15 +84,15 @@ TEST_F(ProgressReportTest, TestReportCreation) {
8584
ASSERT_EQ(data->GetDetails(), "Starting report 2");
8685
ASSERT_FALSE(data->IsFinite());
8786
ASSERT_FALSE(data->GetCompleted());
88-
ASSERT_EQ(data->GetTotal(), NO_TOTAL);
87+
ASSERT_EQ(data->GetTotal(), Progress::kNonDeterministicTotal);
8988
ASSERT_EQ(data->GetMessage(), "Progress report 2: Starting report 2");
9089

9190
EXPECT_TRUE(listener_sp->GetEvent(event_sp, timeout));
9291
data = ProgressEventData::GetEventDataFromEvent(event_sp.get());
9392
ASSERT_EQ(data->GetDetails(), "Starting report 3");
9493
ASSERT_FALSE(data->IsFinite());
9594
ASSERT_FALSE(data->GetCompleted());
96-
ASSERT_EQ(data->GetTotal(), NO_TOTAL);
95+
ASSERT_EQ(data->GetTotal(), Progress::kNonDeterministicTotal);
9796
ASSERT_EQ(data->GetMessage(), "Progress report 3: Starting report 3");
9897

9998
// Progress report objects should be destroyed at this point so

0 commit comments

Comments
 (0)