- auto t = fopen_boost(path, "wb");
- BOOST_REQUIRE (t);
- for (size_t i = 0; i < size; ++i) {
- uint8_t r = rand() & 0xff;
- fwrite (&r, 1, 1, t);
+ dcp::File random_file(path, "wb");
+ BOOST_REQUIRE (random_file);
+
+ boost::random::mt19937 rng(1);
+ boost::random::uniform_int_distribution<uint64_t> dist(0);
+
+ while (size > 0) {
+ auto this_time = std::min(size, size_t(8));
+ uint64_t random = dist(rng);
+ random_file.write(&random, this_time, 1);
+ size -= this_time;