From 24a1060ae9cd8d8b187de598b943c49d378f8b1a Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 8 Jan 2012 01:32:45 +0100 Subject: [PATCH] fix inconsistency in OutputSlot protocol test need to distinguish between nominal frame number and the sequence number in the output frame stream --- .../proc/play/diagnostic-output-slot.hpp | 35 ++++++++----------- .../proc/play/output-slot-protocol-test.cpp | 24 ++++++------- 2 files changed, 25 insertions(+), 34 deletions(-) diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp index 7e7a2f91d..e6e971a9d 100644 --- a/tests/components/proc/play/diagnostic-output-slot.hpp +++ b/tests/components/proc/play/diagnostic-output-slot.hpp @@ -404,38 +404,31 @@ namespace play { bool - buffer_was_used (uint channel, FrameID frame) + frame_was_allocated (uint channel, FrameID nominalFrame) { return accessSequence(channel) - .wasAllocated(frame); + .wasAllocated(nominalFrame); } bool - buffer_unused (uint channel, FrameID frame) - { - return !buffer_was_used(channel, frame); - } - - - bool - buffer_was_closed (uint channel, FrameID frame) + output_was_emitted (uint channel, FrameID outputFrame) { diagn::Block const *block = accessSequence(channel) - .accessEmittedBuffer(frame); - return block - && block->was_closed(); - } - - - bool - emitted (uint channel, FrameID frame) - { - diagn::Block const *block = accessSequence(channel) - .accessEmittedBuffer(frame); + .accessEmittedBuffer(outputFrame); return block && block->was_used(); } + + + bool + output_was_closed (uint channel, FrameID outputFrame) + { + diagn::Block const *block = accessSequence(channel) + .accessEmittedBuffer(outputFrame); + return block + && block->was_closed(); + } }; diff --git a/tests/components/proc/play/output-slot-protocol-test.cpp b/tests/components/proc/play/output-slot-protocol-test.cpp index 18b54388f..028346593 100644 --- a/tests/components/proc/play/output-slot-protocol-test.cpp +++ b/tests/components/proc/play/output-slot-protocol-test.cpp @@ -109,19 +109,19 @@ namespace test { // Verify sane operation.... DiagnosticOutputSlot& checker = DiagnosticOutputSlot::access(oSlot); - CHECK (checker.buffer_was_used (0,0)); - CHECK (checker.buffer_unused (0,1)); - CHECK (checker.buffer_was_used (1,0)); - CHECK (checker.buffer_was_used (1,1)); + CHECK ( checker.frame_was_allocated (0,123)); + CHECK (!checker.frame_was_allocated (0,124)); + CHECK ( checker.frame_was_allocated (1,123)); + CHECK ( checker.frame_was_allocated (1,124)); - CHECK (checker.buffer_was_closed (0,0)); - CHECK (checker.buffer_was_closed (1,0)); - CHECK (checker.buffer_was_closed (1,1)); + CHECK (checker.output_was_closed (0,0)); + CHECK (checker.output_was_closed (1,0)); + CHECK (checker.output_was_closed (1,1)); - CHECK ( checker.emitted (0,0)); - CHECK (!checker.emitted (0,1)); - CHECK ( checker.emitted (1,0)); - CHECK ( checker.emitted (1,1)); + CHECK ( checker.output_was_emitted (0,0)); + CHECK (!checker.output_was_emitted (0,1)); + CHECK ( checker.output_was_emitted (1,0)); + CHECK ( checker.output_was_emitted (1,1)); DiagnosticOutputSlot::OutFrames stream0 = checker.getChannel(0); DiagnosticOutputSlot::OutFrames stream1 = checker.getChannel(1); @@ -134,8 +134,6 @@ namespace test { CHECK (*stream1 == testData(1,0)); ++stream1; CHECK (*stream1 == testData(1,1)); ++stream1; CHECK (!stream1); -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #819 -#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #819 } };