From 2408a08c0bb177bc6173cea7a0888cdd17ca0f2b Mon Sep 17 00:00:00 2001 From: Oliver Ruebel Date: Thu, 9 Jan 2025 09:49:30 -0800 Subject: [PATCH] Add read test for timestamps.unit and timestamps.interval --- tests/testBase.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/testBase.cpp b/tests/testBase.cpp index f6a822f..95b48f8 100644 --- a/tests/testBase.cpp +++ b/tests/testBase.cpp @@ -179,8 +179,19 @@ TEST_CASE("TimeSeries", "[base]") REQUIRE(readDataContinuityValues == AQNWB::NWB::TimeSeries::ContinuityTypeNames[continuity]); - // TODO Read missing readControlDescription, - // readControl, readTimestampsUnit, readTimestampsInterval, + // Read the timestamps unit + auto readTimestampsUnitWrapper = readTimeSeries->readTimestampsUnit(); + auto readTimestampsUnitValues = readTimestampsUnitWrapper->values().data[0]; + REQUIRE(readTimestampsUnitValues == "seconds"); + + // Read the timestamps interval + auto readTimestampsIntervalWrapper = + readTimeSeries->readTimestampsInterval(); + auto readTimestampsIntervalValues = + readTimestampsIntervalWrapper->values().data[0]; + REQUIRE(readTimestampsIntervalValues == 1); + + // TODO Read missing readControlDescription, readControl, // readStartingTimeUnit, readStartingTimeRate, readStartingTime. Some of // these may not be written yet. }