Merge pull request #4941

1cfd6f1 unit_tests: strengthen notify test against OS scheduling (moneromooo-monero)
This commit is contained in:
luigi1111 2018-12-31 15:48:52 -06:00
commit 4a78bcd275
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -69,11 +69,22 @@ TEST(notify, works)
tools::Notify notify(spec.c_str()); tools::Notify notify(spec.c_str());
notify.notify("1111111111111111111111111111111111111111111111111111111111111111"); notify.notify("1111111111111111111111111111111111111111111111111111111111111111");
epee::misc_utils::sleep_no_w(100); bool ok = false;
for (int i = 0; i < 10; ++i)
std::string s; {
ASSERT_TRUE(epee::file_io_utils::load_file_to_string(name_template, s)); epee::misc_utils::sleep_no_w(100);
ASSERT_TRUE(s == "1111111111111111111111111111111111111111111111111111111111111111");
std::string s;
if (epee::file_io_utils::load_file_to_string(name_template, s))
{
if (s == "1111111111111111111111111111111111111111111111111111111111111111")
{
ok = true;
break;
}
std::cout << "got: [" << s << "]" << std::endl;
}
}
boost::filesystem::remove(name_template); boost::filesystem::remove(name_template);
ASSERT_TRUE(ok);
} }