This resolves a long-standing issue: we could not use proper include paths for test-helper code that was defined alongside the tests. Since some test-helper code must now be relocated into the »Vault«-Layer, I took the opportunity to finally resolve this annoyance. The solution is two-fold * introduce a dedicated test-support library * remove the quirks that were necessary to support some plain-C tests Together, this allows to raise the include-directory by one level, and then to adjust all folder names so that they match the namespace
81 lines
1.7 KiB
C++
81 lines
1.7 KiB
C++
/*
|
||
TESTCLIP.hpp - test clip (stub) for checking Model/Session functionality
|
||
|
||
Copyright (C)
|
||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||
|
||
**Lumiera** 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. See the file COPYING for further details.
|
||
|
||
*/
|
||
|
||
/** @file testclip.hpp
|
||
** A stub implementation of the Clip interface for unit testing
|
||
*/
|
||
|
||
|
||
#ifndef MOBJECT_SESSION_TESTCLIP_H
|
||
#define MOBJECT_SESSION_TESTCLIP_H
|
||
|
||
|
||
#include "steam/mobject/session/clip.hpp"
|
||
#include "lib/time/timevalue.hpp"
|
||
|
||
|
||
|
||
using std::shared_ptr;
|
||
using std::string;
|
||
|
||
|
||
namespace steam {
|
||
namespace mobject {
|
||
namespace session {
|
||
namespace test {
|
||
|
||
|
||
class TestPlacement;
|
||
|
||
/**
|
||
* Sample or Test Clip for checking
|
||
* various model, session and builder operations.
|
||
* @todo maybe use this as Mock object to record invoked operations?
|
||
*
|
||
*/
|
||
class TestClip : public mobject::session::Clip
|
||
{
|
||
|
||
TestClip ();
|
||
static void deleter (MObject* mo) { delete (TestClip*)mo; }
|
||
|
||
friend class TestPlacement;
|
||
|
||
public:
|
||
static Placement<Clip> create () ;
|
||
};
|
||
|
||
|
||
class TestPlacement : public Placement<Clip>
|
||
{
|
||
|
||
public:
|
||
TestPlacement (TestClip & subject)
|
||
: Placement<Clip> (subject, &TestClip::deleter)
|
||
{ }
|
||
};
|
||
|
||
|
||
inline Placement<Clip>
|
||
TestClip::create()
|
||
{
|
||
return TestPlacement (*new TestClip);
|
||
}
|
||
|
||
|
||
/* == some test data to check == */
|
||
extern const lib::time::Duration LENGTH_TestClip;
|
||
|
||
|
||
}}}} // namespace steam::mobject::session::test
|
||
#endif
|