1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

LibCore+Userland: Make Core::Timer::create_single_shot() return ErrorOr

clang-format sure has some interesting opinions about where to put a
method call that comes after a lambda. :thonk:
This commit is contained in:
Sam Atkins 2023-01-11 16:31:10 +00:00 committed by Andreas Kling
parent a15d44f019
commit a8cf0c9371
20 changed files with 42 additions and 36 deletions

View file

@ -39,21 +39,21 @@ TEST_CASE(file_watcher_child_events)
event_count++;
};
auto timer1 = Core::Timer::create_single_shot(500, [&] {
auto timer1 = MUST(Core::Timer::create_single_shot(500, [&] {
int rc = creat("/tmp/testfile", 0777);
EXPECT_NE(rc, -1);
});
}));
timer1->start();
auto timer2 = Core::Timer::create_single_shot(1000, [&] {
auto timer2 = MUST(Core::Timer::create_single_shot(1000, [&] {
int rc = unlink("/tmp/testfile");
EXPECT_NE(rc, -1);
});
}));
timer2->start();
auto catchall_timer = Core::Timer::create_single_shot(2000, [&] {
auto catchall_timer = MUST(Core::Timer::create_single_shot(2000, [&] {
VERIFY_NOT_REACHED();
});
}));
catchall_timer->start();
event_loop.exec();