Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince committed Sep 18, 2024
1 parent bd68ec0 commit f2f8d1a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/hdf5/HDF5IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,4 +741,4 @@ Status HDF5RecordingData::writeDataBlock(
const H5::DataSet* HDF5RecordingData::getDataSet()
{
return dSet.get();
};
}
17 changes: 11 additions & 6 deletions tests/testEcephys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,17 @@ TEST_CASE("ElectricalSeries", "[ecephys]")
SizeType samplesRecorded = 0;
for (SizeType b = 0; b * bufferSize < numSamples; b += 1) {
// copy chunk of data
std::copy(mockData[ch].begin() + static_cast<std::ptrdiff_t>(samplesRecorded),
mockData[ch].begin() + static_cast<std::ptrdiff_t>(samplesRecorded + bufferSize),
dataBuffer.begin());
std::copy(mockTimestamps.begin() + static_cast<std::ptrdiff_t>(samplesRecorded),
mockTimestamps.begin() + static_cast<std::ptrdiff_t>(samplesRecorded + bufferSize),
timestampsBuffer.begin());
std::copy(
mockData[ch].begin() + static_cast<std::ptrdiff_t>(samplesRecorded),
mockData[ch].begin()
+ static_cast<std::ptrdiff_t>(samplesRecorded + bufferSize),
dataBuffer.begin());
std::copy(
mockTimestamps.begin()
+ static_cast<std::ptrdiff_t>(samplesRecorded),
mockTimestamps.begin()
+ static_cast<std::ptrdiff_t>(samplesRecorded + bufferSize),
timestampsBuffer.begin());

es.writeChannel(
ch, dataBuffer.size(), dataBuffer.data(), timestampsBuffer.data());
Expand Down
18 changes: 12 additions & 6 deletions tests/testRecordingWorkflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,18 @@ TEST_CASE("writeContinuousData", "[recording]")
const auto& channelVector = mockRecordingArrays[i];
for (const auto& channel : channelVector) {
// copy data into buffer
std::copy(mockData[channel.globalIndex].begin() + static_cast<std::ptrdiff_t>(samplesRecorded),
mockData[channel.globalIndex].begin() + static_cast<std::ptrdiff_t>(samplesRecorded + bufferSize),
dataBuffer.begin());
std::copy(mockTimestamps.begin() + static_cast<std::ptrdiff_t>(samplesRecorded),
mockTimestamps.begin() + static_cast<std::ptrdiff_t>(samplesRecorded + bufferSize),
timestampsBuffer.begin());
std::copy(
mockData[channel.globalIndex].begin()
+ static_cast<std::ptrdiff_t>(samplesRecorded),
mockData[channel.globalIndex].begin()
+ static_cast<std::ptrdiff_t>(samplesRecorded + bufferSize),
dataBuffer.begin());
std::copy(
mockTimestamps.begin()
+ static_cast<std::ptrdiff_t>(samplesRecorded),
mockTimestamps.begin()
+ static_cast<std::ptrdiff_t>(samplesRecorded + bufferSize),
timestampsBuffer.begin());

// write timeseries data
std::vector<SizeType> positionOffset = {samplesRecorded,
Expand Down

0 comments on commit f2f8d1a

Please sign in to comment.