Skip to content

Commit

Permalink
add some logs (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored Jun 28, 2023
1 parent a79e2d0 commit f1b9722
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/coro_file/tests/test_corofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ TEST_CASE("multithread for balance") {

async_simple::coro::syncAwait(wait_func());

std::cout << "write finished\n";

// read and compare
std::vector<async_simple::coro::Lazy<void>> read_vec;

Expand All @@ -123,7 +125,12 @@ TEST_CASE("multithread for balance") {
size_t read_size;
std::tie(ec, read_size) = co_await file.async_read(buf.data(), buf.size());
CHECK(!ec);
CHECK(str == buf);
bool ok = (str == buf);
if (!ok) {
std::cout << "str: " << str << "\n";
std::cout << "read buf: " << buf << "\n";
}
CHECK(ok);
co_return;
};

Expand All @@ -138,6 +145,7 @@ TEST_CASE("multithread for balance") {
};

async_simple::coro::syncAwait(wait_read_func());
std::cout << "read finished\n";

std::error_code ec;
for (auto& filename : filenames) {
Expand Down

0 comments on commit f1b9722

Please sign in to comment.