diff --git a/src/streaming/vectorized.file.writer.cpp b/src/streaming/vectorized.file.writer.cpp index e4ea039..18b57f8 100644 --- a/src/streaming/vectorized.file.writer.cpp +++ b/src/streaming/vectorized.file.writer.cpp @@ -113,7 +113,7 @@ zarr::VectorizedFileWriter::~VectorizedFileWriter() bool zarr::VectorizedFileWriter::write_vectors( - const std::vector>& buffers, + const std::vector>& buffers, size_t offset) { std::lock_guard lock(mutex_); diff --git a/src/streaming/vectorized.file.writer.hh b/src/streaming/vectorized.file.writer.hh index 405bd5d..92350ea 100644 --- a/src/streaming/vectorized.file.writer.hh +++ b/src/streaming/vectorized.file.writer.hh @@ -20,7 +20,7 @@ class VectorizedFileWriter explicit VectorizedFileWriter(const std::string& path); ~VectorizedFileWriter(); - bool write_vectors(const std::vector>& buffers, + bool write_vectors(const std::vector>& buffers, size_t offset); std::mutex& mutex() { return mutex_; } diff --git a/tests/unit-tests/vectorized-file-write.cpp b/tests/unit-tests/vectorized-file-write.cpp index 3b2c8c2..79ebe6d 100644 --- a/tests/unit-tests/vectorized-file-write.cpp +++ b/tests/unit-tests/vectorized-file-write.cpp @@ -14,19 +14,23 @@ write_to_file(const std::string& filename) zarr::VectorizedFileWriter writer(filename); std::vector> data(10); + std::vector> spans(10); + for (auto i = 0; i < data.size(); ++i) { data[i].resize((i + 1) * 1024); std::fill(data[i].begin(), data[i].end(), std::byte(i)); file_size += data[i].size(); + spans[i] = data[i]; } - CHECK(writer.write_vectors(data, 0)); + CHECK(writer.write_vectors(spans, 0)); // write more data for (auto i = 0; i < 10; ++i) { auto& vec = data[i]; std::fill(vec.begin(), vec.end(), std::byte(i + 10)); + spans[i] = vec; } - CHECK(writer.write_vectors(data, file_size)); + CHECK(writer.write_vectors(spans, file_size)); return 2 * file_size; }