50 std::string
id =
"ID";
52 auto time_start = std::chrono::high_resolution_clock::now();
54 for (
size_t vr = 0; vr < count_vr; ++vr) {
55 t_fpos fpos = 80 + vr * 8004;
58 for (
size_t lrsh = 0; lrsh < count_lr; ++lrsh) {
60 fpos += 8000 / count_lr;
63 std::ostringstream os;
64 os <<
"Sim SVFS:" <<
" vr=" << count_vr <<
" lr=" << count_lr;
66 std::chrono::duration<double> time_exec = std::chrono::high_resolution_clock::now() - time_start;
67 auto result =
TestResult(__PRETTY_FUNCTION__, os.str(), 0,
"", time_exec.count(), svfs.
at(
id).
num_bytes());
69 results.push_back(result);
size_t num_bytes() const noexcept
Gives exact number of data bytes held.
void write(t_fpos fpos, const char *data, size_t len)
Write the data a the given file position.
A SparseVirtualFileSystem is a key/value store where the key is a file ID as a string and the value i...
const SparseVirtualFile & at(const std::string &id) const
Return the const SparseVirtualFile at the given ID.
void insert(const std::string &id, double mod_time)
Inserts a new SparseVirtualFile corresponding to the given ID and file modification timestamp.
Count of tests taht pass and fail.
void add_result(int result)
Add a tests result.
std::vector< TestResult > t_test_results
TestCount test_perf_write_sim_index_svfs(t_test_results &results)
TestCount _test_perf_write_sim_index_svfs(size_t count_vr, size_t count_lr, t_test_results &results)
TestCount test_svfs_all(t_test_results &results)
const char test_data_bytes_512[]
The namespace for all svfsc code.