From faa6481ef12f519c41422131782c401f7d2673a2 Mon Sep 17 00:00:00 2001 From: Jorge Blanco Alonso Date: Thu, 5 Mar 2020 15:21:13 +0100 Subject: [PATCH] Added extra offset to index_pointers * Discussed in https://github.com/AllenInstitute/sonata/issues/62 --- src/reports/data/sonata_data.cpp | 2 +- src/reports/io/hdf5_writer.cpp | 2 +- tests/reports/unit/test_sonatadata.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reports/data/sonata_data.cpp b/src/reports/data/sonata_data.cpp index 28ff247..b43d634 100644 --- a/src/reports/data/sonata_data.cpp +++ b/src/reports/data/sonata_data.cpp @@ -23,7 +23,7 @@ SonataData::SonataData(const std::string& report_name, , hdf5_writer_(std::make_unique(report_name)) , nodes_(nodes) { prepare_buffer(max_buffer_size); - index_pointers_.resize(nodes->size()); + index_pointers_.resize(nodes->size() + 1); time_ = {tstart, tend, dt}; reporting_period_ = static_cast(dt / SonataReport::atomic_step_); diff --git a/src/reports/io/hdf5_writer.cpp b/src/reports/io/hdf5_writer.cpp index 3d00fe7..c8fc573 100644 --- a/src/reports/io/hdf5_writer.cpp +++ b/src/reports/io/hdf5_writer.cpp @@ -173,7 +173,7 @@ void HDF5Writer::write_time(const std::string& dataset_name, const std::array index_pointers = sonata->get_index_pointers(); - std::vector compare = {0, 2, 5}; + std::vector compare = {0, 2, 5, 11}; REQUIRE(index_pointers == compare); } }