xref: /openbmc/sdbusplus/test/async/fdio_timed/fdio_timed_write_sync_iterative.cpp (revision 2cd25e64299ecc20e2258727e836a31b7ce6fad3)
1 #include "suite.hpp"
2 
3 #include <sdbusplus/async.hpp>
4 
5 #include <gtest/gtest.h>
6 
7 using namespace std::literals;
8 
TEST_F(FdioTimedTest,TestWriteSyncIterative)9 TEST_F(FdioTimedTest, TestWriteSyncIterative)
10 {
11     bool ran = false;
12     ctx->spawn(testFdTimedEvents(ran, testWriteOperation::writeSync, 100));
13     ctx->spawn(
14         sdbusplus::async::sleep_for(*ctx, 2s) |
15         sdbusplus::async::execution::then([&]() { ctx->request_stop(); }));
16     ctx->run();
17     EXPECT_TRUE(ran);
18 }
19