It would be nice if there was a way to tell compilers not to drop the lock stack and thus issue warnings when accessing a symbol that needs a lock inside `Assume`/`Assert`.

Hit by (at least): @ajtowns , @jnewbery , me.
BOOST_CHECK_EQUAL(text, expected_text);
    }
    {
         r
        auto [valid, text] = ReadBinaryFile(tmpfile, expected_text.size() / 2);
        BOOST_CHECK(valid);
        BOOST_CHECK_EQUAL(text, expected_text.substr(0, expected_text.size() / 2));
    }
    {
         r
        fs::path invalid_file = tmpfolder / "invalid_binary.dat";
        auto [valid, text] = ReadBinaryFile(invalid_file);
        BOOST_CHECK(!valid);
        BOOST_CHECK(text.empty());
    }
}
BOOST_AUTO_TEST_CASE(util_WriteBinaryFile)
{
    fs::path tmpfolder = m_args.GetDataDirBase();
    fs::path tmpfile = tmpfolder / "write_binary.dat";
    std::string expected_text = "bitcoin";
    auto valid = WriteBinaryFile(tmpfile, expected_text);
    std::string actual_text;
    std::ifstream file{tmpfile};
    file >> actual_text;
    BOOST_CHECK(valid);
    BOOST_CHECK_EQUAL(actual_text, expected_text);
}
BOOST_AUTO_TEST_SUITE_END()