mirror of
https://github.com/shadps4-emu/ext-fmt.git
synced 2024-11-27 03:30:32 +00:00
Improve scan test
This commit is contained in:
parent
662d784157
commit
4a6f0be5b6
@ -152,6 +152,7 @@ TEST(scan_test, lock) {
|
||||
write_end.close();
|
||||
});
|
||||
|
||||
std::atomic<int> count(0);
|
||||
fmt::buffered_file f = read_end.fdopen("r");
|
||||
auto fun = [&]() {
|
||||
int value = 0;
|
||||
@ -161,12 +162,16 @@ TEST(scan_test, lock) {
|
||||
EXPECT_EQ(value, 42);
|
||||
break;
|
||||
}
|
||||
++count;
|
||||
}
|
||||
};
|
||||
std::thread consumer1(fun);
|
||||
std::thread consumer2(fun);
|
||||
|
||||
producer.join();
|
||||
consumer1.join();
|
||||
consumer2.join();
|
||||
EXPECT_EQ(count, 1000);
|
||||
|
||||
}
|
||||
#endif // FMT_USE_FCNTL
|
||||
|
Loading…
Reference in New Issue
Block a user