Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince committed Sep 17, 2024
1 parent 7bcc66d commit 2823003
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ inline void convertFloatToInt16LE(const float* source,
auto intData = static_cast<char*>(dest);

for (SizeType i = 0; i < numSamples; ++i) {
auto clampedValue = std::clamp(maxVal * static_cast<double>(source[i]), -maxVal, maxVal);
auto clampedValue =
std::clamp(maxVal * static_cast<double>(source[i]), -maxVal, maxVal);
auto intValue =
static_cast<uint16_t>(static_cast<int16_t>(std::round(clampedValue)));
intValue = boost::endian::native_to_little(intValue);
Expand Down
18 changes: 12 additions & 6 deletions tests/examples/testWorkflowExamples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,18 @@ TEST_CASE("workflowExamples")
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
2 changes: 1 addition & 1 deletion tests/testNWBFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ TEST_CASE("createMultipleEcephysDatasets", "[nwb]")
mockSpikeChannelNames,
BaseDataType::F32,
recordingContainers.get());
REQUIRE(resultCreateSES == Status::Success);
REQUIRE(resultCreateSES == Status::Success);

// start recording
Status resultStart = io->startRecording();
Expand Down

0 comments on commit 2823003

Please sign in to comment.