From b32538f3c8d910fd503cc4e25df8e7714dfa3496 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 30 Apr 2018 22:05:44 -0400 Subject: [PATCH] Adds an additional test. --- .../Mac/Clock SignalTests/PCMTrackTests.mm | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/OSBindings/Mac/Clock SignalTests/PCMTrackTests.mm b/OSBindings/Mac/Clock SignalTests/PCMTrackTests.mm index f928f5f70..221ffee3c 100644 --- a/OSBindings/Mac/Clock SignalTests/PCMTrackTests.mm +++ b/OSBindings/Mac/Clock SignalTests/PCMTrackTests.mm @@ -51,4 +51,33 @@ XCTAssert(events[8].length == transition_length, "Time taken in transition between speed zones should be half of a bit length in the first part plus half of a bit length in the second"); } +- (void)testComplicatedTrackSeek { + std::vector segments; + + Storage::Disk::PCMSegment sync_segment; + sync_segment.data.resize(10); + sync_segment.number_of_bits = 10*8; + + Storage::Disk::PCMSegment header_segment; + header_segment.data.resize(14); + header_segment.number_of_bits = 14*8; + + Storage::Disk::PCMSegment data_segment; + data_segment.data.resize(349); + data_segment.number_of_bits = 349*8; + + for(std::size_t c = 0; c < 16; ++c) { + segments.push_back(sync_segment); + segments.push_back(header_segment); + segments.push_back(sync_segment); + segments.push_back(data_segment); + segments.push_back(sync_segment); + } + + Storage::Disk::PCMTrack track(segments); + Storage::Time late_time(967445, 2045454); + track.seek_to(late_time); + track.get_next_event(); +} + @end