Skip to content

Commit 92cd9e0

Browse files
committed
Checkout outputs too.
1 parent 9026bb0 commit 92cd9e0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mutex_protected_test.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ TEST(CondVarMutexProtectedTest, ConditionVariableWorks) {
478478
TEST(CondVarMutexProtectedTest, ConditionVariableAnyWorks) {
479479
mutex_protected<int, std::shared_mutex> data = 0;
480480
std::condition_variable_any cv;
481+
mutex_protected<int> out = 0;
481482

482483
const int thread_count = 2;
483484

@@ -488,6 +489,7 @@ TEST(CondVarMutexProtectedTest, ConditionVariableAnyWorks) {
488489
auto locked = data.lock_shared();
489490
cv.wait(*locked.mutex(), [&locked]() { return *locked > 0; });
490491
EXPECT_EQ(*locked, 1);
492+
*out.lock() += *locked;
491493
});
492494
}
493495

@@ -497,6 +499,7 @@ TEST(CondVarMutexProtectedTest, ConditionVariableAnyWorks) {
497499
for (auto& thread : threads) {
498500
thread.join();
499501
}
502+
EXPECT_EQ(*out.lock(), thread_count);
500503
}
501504

502505
} // namespace xyz

0 commit comments

Comments
 (0)