outline a test covering the stream type registration lifecycle
This commit is contained in:
parent
f80d0a49bd
commit
8109badf49
3 changed files with 124 additions and 6 deletions
|
|
@ -284,6 +284,10 @@ PLANNED "StreamTypeBasics_test" StreamTypeBasics_test <<END
|
|||
END
|
||||
|
||||
|
||||
PLANNED "StreamTypeLifecycle_test" StreamTypeLifecycle_test <<END
|
||||
END
|
||||
|
||||
|
||||
TEST "TestOption_test" TestOption_test <<END
|
||||
out: Testing invocation with cmdline: ...
|
||||
out: --> Testgroup=ALL
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ using std::cout;
|
|||
|
||||
namespace lumiera {
|
||||
namespace test {
|
||||
|
||||
|
||||
using control::STypeManager;
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* @test check the basic workings of the stream type handling.
|
||||
* create some stream implementation data, build a
|
||||
|
|
@ -72,9 +72,9 @@ namespace lumiera {
|
|||
}
|
||||
};
|
||||
|
||||
LAUNCHER (StreamTypeBasics_test, "unit common");
|
||||
|
||||
|
||||
LAUNCHER (StreamTypeBasics_test, "unit common");
|
||||
|
||||
|
||||
} // namespace test
|
||||
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
114
tests/common/streamtypelifecycletest.cpp
Normal file
114
tests/common/streamtypelifecycletest.cpp
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
StreamTypeLifecycle(Test) - check lifecycle of the stream type registration
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, 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 "common/test/run.hpp"
|
||||
#include "common/util.hpp"
|
||||
|
||||
#include "proc/control/stypemanager.hpp"
|
||||
#include "proc/mobject/session.hpp"
|
||||
//#include "teststreamtypes.hpp"
|
||||
|
||||
#include <iostream>
|
||||
using std::cout;
|
||||
|
||||
|
||||
|
||||
namespace lumiera {
|
||||
namespace test {
|
||||
|
||||
using mobject::Session;
|
||||
using control::STypeManager;
|
||||
using control::ON_STREAMTYPES_RESET;
|
||||
|
||||
|
||||
//////////TODO define a dummy-type-info here
|
||||
//////////TODO
|
||||
|
||||
void
|
||||
setup_basicDummyTypeInfo ()
|
||||
{
|
||||
UNIMPLEMENTED ("setup basic dummy-type-info");
|
||||
}
|
||||
|
||||
namespace // enroll this basic setup to be triggered when the type system is reset
|
||||
{
|
||||
LifecycleHook _schedule_at_reset (ON_STREAMTYPES_RESET, &setup_basicDummyTypeInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* @test check the stream type registration lifecycle.
|
||||
* Any internal or external component (plugin) can extend
|
||||
* the Proc Layer's registry of media stream types.
|
||||
* There is a basic pristine set of type information, which is
|
||||
* restored automatically everytime the STypeManager is reset,
|
||||
* which in turn happenes before loading a (new) Session.
|
||||
*/
|
||||
class StreamTypeLifecycle_test : public Test
|
||||
{
|
||||
virtual void
|
||||
run (Arg arg)
|
||||
{
|
||||
check_pristineState ();
|
||||
register_additional_TypeInfo ();
|
||||
check_pristineState ();
|
||||
}
|
||||
|
||||
|
||||
/** @test this test defines a new (dummy) type info
|
||||
* and schedules it for setop in the pristine state;
|
||||
* check this info is actually present after resetting
|
||||
* the stream type manager, while other additional info
|
||||
* \em not scheduled in this manner is not present
|
||||
* in this state
|
||||
*/
|
||||
void
|
||||
check_pristineState ()
|
||||
{
|
||||
Session::current.reset();
|
||||
TODO ("verify the test-dummy basic type info is present now...");
|
||||
TODO ("verify the additional type info is *not* present");
|
||||
}
|
||||
|
||||
/** @test use the stream type manager to register additional
|
||||
* type info and verify it is used in type resolution.
|
||||
*/
|
||||
void
|
||||
register_additional_TypeInfo ()
|
||||
{
|
||||
TODO ("verify the additional type info is *not* present");
|
||||
|
||||
STypeManager& typeManager = STypeManager::instance();
|
||||
TODO ("use the registration facility to add additional type info");
|
||||
TODO ("verify the additional type info to be present now...");
|
||||
}
|
||||
};
|
||||
|
||||
LAUNCHER (StreamTypeLifecycle_test, "unit common");
|
||||
|
||||
|
||||
} // namespace test
|
||||
|
||||
} // namespace lumiera
|
||||
|
||||
Loading…
Reference in a new issue