back to test-driven brainstorming again

This commit is contained in:
Fischlurch 2011-07-09 02:44:24 +02:00
parent a199bff92b
commit 7adb8149db
5 changed files with 148 additions and 10 deletions

View file

@ -64,6 +64,12 @@ namespace engine {
public:
virtual ~BufferProvider(); ///< this is an interface
///////TODO: is there any generic way to obtain a BufferDescriptor; then we should expose it here...
virtual BuffHandle lockBufferFor (BufferDescriptor const&) =0;
virtual void releaseBuffer (BuffHandle const&) =0; ////////TODO not quite sure what information to pass here
};

View file

@ -110,7 +110,7 @@ namespace engine {
/**
* Buffer Type information.
* Given a BufferDescriptor, it is possible to allocate a buffer
* of suitable size and type by using BufferProvider::allocateBuffer().
* of suitable size and type by using BufferProvider::lockBuffer().
*/
struct BufferDescriptor
{

View file

@ -0,0 +1,73 @@
/*
DIAGNOSTIC-OUTPUT-SLOT.hpp - helper for testing against the OutputSlot interface
Copyright (C) Lumiera.org
2011, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file diagnostic-output-slot.hpp
** An facility for writing unit-tests against the OutputSlot interface.
**
** @see output-slot-protocol-test.cpp
*/
#ifndef PROC_PLAY_DIAGNOSTIC_OUTPUT_SLOT_H
#define PROC_PLAY_DIAGNOSTIC_OUTPUT_SLOT_H
#include "lib/error.hpp"
#include "proc/play/output-slot.hpp"
//#include "lib/sync.hpp"
//#include <boost/noncopyable.hpp>
//#include <string>
//#include <vector>
//#include <tr1/memory>
//#include <boost/scoped_ptr.hpp>
namespace proc {
namespace play {
//using std::string;
//using std::vector;
//using std::tr1::shared_ptr;
//using boost::scoped_ptr;
/********************************************************************
* Helper for unit tests: Mock output sink.
*
* @todo write type comment
*/
class DiagnosticOutputSlot
: public OutputSlot
{
public:
private:
};
}} // namespace proc::play
#endif

View file

@ -28,7 +28,7 @@
** possibilities can be added and removed dynamically from various components (backend, GUI),
** all using the same resolution and mapping mechanisms
**
** @see output-test-slot.hpp ////TODO
** @see diagnostic-output-slot.hpp ////TODO
*/
@ -54,6 +54,7 @@ namespace proc {
namespace play {
using ::engine::BuffHandle;
using ::engine::BufferProvider;
using lib::time::Time;
//using std::string;
@ -65,14 +66,6 @@ namespace play {
/** established output channel */
class Connection;
class BufferProvider
{
public:
~BufferProvider() { }
BuffHandle lockBufferFor(Time);
};
class DataSink

View file

@ -0,0 +1,66 @@
/*
OutputSlotProtocol(Test) - covering the basic usage cycle of an output slot
Copyright (C) Lumiera.org
2011, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "lib/test/run.hpp"
//#include "lib/util.hpp"
#include "proc/play/diagnostic-output-slot.hpp"
//#include <boost/format.hpp>
//#include <iostream>
//using boost::format;
//using std::string;
//using std::cout;
namespace engine{
namespace test {
// using lib::AllocationCluster;
// using mobject::session::PEffect;
namespace { // Test fixture
}
/*******************************************************************
* @test basic render node properties and behaviour.
*/
class OutputSlotProtocol_test : public Test
{
virtual void
run (Arg)
{
UNIMPLEMENTED ("build a mock output slot and perform a full lifecycle");
}
};
/** Register this test class... */
LAUNCHER (OutputSlotProtocol_test, "unit player");
}} // namespace engine::test