2010-02-22 03:52:52 +01:00
|
|
|
|
/*
|
|
|
|
|
|
SessionStructure(Test) - verifying basic Session/Model structure
|
2010-12-17 23:28:49 +01:00
|
|
|
|
|
Copyright: clarify and simplify the file headers
* Lumiera source code always was copyrighted by individual contributors
* there is no entity "Lumiera.org" which holds any copyrights
* Lumiera source code is provided under the GPL Version 2+
== Explanations ==
Lumiera as a whole is distributed under Copyleft, GNU General Public License Version 2 or above.
For this to become legally effective, the ''File COPYING in the root directory is sufficient.''
The licensing header in each file is not strictly necessary, yet considered good practice;
attaching a licence notice increases the likeliness that this information is retained
in case someone extracts individual code files. However, it is not by the presence of some
text, that legally binding licensing terms become effective; rather the fact matters that a
given piece of code was provably copyrighted and published under a license. Even reformatting
the code, renaming some variables or deleting parts of the code will not alter this legal
situation, but rather creates a derivative work, which is likewise covered by the GPL!
The most relevant information in the file header is the notice regarding the
time of the first individual copyright claim. By virtue of this initial copyright,
the first author is entitled to choose the terms of licensing. All further
modifications are permitted and covered by the License. The specific wording
or format of the copyright header is not legally relevant, as long as the
intention to publish under the GPL remains clear. The extended wording was
based on a recommendation by the FSF. It can be shortened, because the full terms
of the license are provided alongside the distribution, in the file COPYING.
2024-11-17 23:42:55 +01:00
|
|
|
|
Copyright (C)
|
|
|
|
|
|
2008, 2011, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
|
Copyright: clarify and simplify the file headers
* Lumiera source code always was copyrighted by individual contributors
* there is no entity "Lumiera.org" which holds any copyrights
* Lumiera source code is provided under the GPL Version 2+
== Explanations ==
Lumiera as a whole is distributed under Copyleft, GNU General Public License Version 2 or above.
For this to become legally effective, the ''File COPYING in the root directory is sufficient.''
The licensing header in each file is not strictly necessary, yet considered good practice;
attaching a licence notice increases the likeliness that this information is retained
in case someone extracts individual code files. However, it is not by the presence of some
text, that legally binding licensing terms become effective; rather the fact matters that a
given piece of code was provably copyrighted and published under a license. Even reformatting
the code, renaming some variables or deleting parts of the code will not alter this legal
situation, but rather creates a derivative work, which is likewise covered by the GPL!
The most relevant information in the file header is the notice regarding the
time of the first individual copyright claim. By virtue of this initial copyright,
the first author is entitled to choose the terms of licensing. All further
modifications are permitted and covered by the License. The specific wording
or format of the copyright header is not legally relevant, as long as the
intention to publish under the GPL remains clear. The extended wording was
based on a recommendation by the FSF. It can be shortened, because the full terms
of the license are provided alongside the distribution, in the file COPYING.
2024-11-17 23:42:55 +01:00
|
|
|
|
**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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
|
Copyright: clarify and simplify the file headers
* Lumiera source code always was copyrighted by individual contributors
* there is no entity "Lumiera.org" which holds any copyrights
* Lumiera source code is provided under the GPL Version 2+
== Explanations ==
Lumiera as a whole is distributed under Copyleft, GNU General Public License Version 2 or above.
For this to become legally effective, the ''File COPYING in the root directory is sufficient.''
The licensing header in each file is not strictly necessary, yet considered good practice;
attaching a licence notice increases the likeliness that this information is retained
in case someone extracts individual code files. However, it is not by the presence of some
text, that legally binding licensing terms become effective; rather the fact matters that a
given piece of code was provably copyrighted and published under a license. Even reformatting
the code, renaming some variables or deleting parts of the code will not alter this legal
situation, but rather creates a derivative work, which is likewise covered by the GPL!
The most relevant information in the file header is the notice regarding the
time of the first individual copyright claim. By virtue of this initial copyright,
the first author is entitled to choose the terms of licensing. All further
modifications are permitted and covered by the License. The specific wording
or format of the copyright header is not legally relevant, as long as the
intention to publish under the GPL remains clear. The extended wording was
based on a recommendation by the FSF. It can be shortened, because the full terms
of the license are provided alongside the distribution, in the file COPYING.
2024-11-17 23:42:55 +01:00
|
|
|
|
* *****************************************************************/
|
2010-02-22 03:52:52 +01:00
|
|
|
|
|
2017-02-22 01:54:20 +01:00
|
|
|
|
/** @file session-structure-test.cpp
|
2017-02-22 03:17:18 +01:00
|
|
|
|
** unit test \ref SessionStructure_test
|
2016-11-03 18:20:10 +01:00
|
|
|
|
*/
|
|
|
|
|
|
|
2010-02-22 03:52:52 +01:00
|
|
|
|
|
|
|
|
|
|
#include "lib/test/run.hpp"
|
2018-11-15 23:42:43 +01:00
|
|
|
|
#include "steam/mobject/session.hpp"
|
2023-04-25 18:27:16 +02:00
|
|
|
|
#include "steam/fixture/fixture.hpp" // TODO only temporarily needed
|
2018-11-15 23:42:43 +01:00
|
|
|
|
#include "steam/assetmanager.hpp" //////??
|
|
|
|
|
|
#include "steam/asset/timeline.hpp"
|
|
|
|
|
|
#include "steam/asset/sequence.hpp"
|
2016-01-07 03:58:29 +01:00
|
|
|
|
//#include "lib/format-cout.hpp"
|
2010-02-25 03:17:18 +01:00
|
|
|
|
#include "lib/util.hpp"
|
2010-02-22 03:52:52 +01:00
|
|
|
|
|
2010-02-25 03:17:18 +01:00
|
|
|
|
using util::isSameObject;
|
2010-02-22 03:52:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
2018-11-15 23:55:13 +01:00
|
|
|
|
namespace steam {
|
2010-02-22 03:52:52 +01:00
|
|
|
|
namespace mobject {
|
|
|
|
|
|
namespace session {
|
|
|
|
|
|
namespace test {
|
|
|
|
|
|
|
|
|
|
|
|
using proc_interface::AssetManager;
|
|
|
|
|
|
using proc_interface::PAsset;
|
|
|
|
|
|
|
2010-03-01 05:36:18 +01:00
|
|
|
|
using asset::PTimeline;
|
|
|
|
|
|
using asset::PSequence;
|
|
|
|
|
|
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
2010-02-22 03:52:52 +01:00
|
|
|
|
|
2013-10-24 23:06:36 +02:00
|
|
|
|
/***************************************************************************//**
|
2010-02-22 03:52:52 +01:00
|
|
|
|
* @test access the current session and verify the correct
|
|
|
|
|
|
* structure of the most important components: The session
|
|
|
|
|
|
* contains an Sequence, we can get at the Fixture, we have at least
|
2015-05-31 02:03:24 +02:00
|
|
|
|
* one Fork and the corresponding Fork-ID (asset) can be retrieved.
|
2010-02-22 03:52:52 +01:00
|
|
|
|
* @todo define further criteria to be checked
|
2015-05-31 02:03:24 +02:00
|
|
|
|
* @todo implement Sequence, Fixture, Session#rebuildFixture, handling of EntryID<Fork>
|
2010-02-22 03:52:52 +01:00
|
|
|
|
*/
|
|
|
|
|
|
class SessionStructure_test : public Test
|
|
|
|
|
|
{
|
|
|
|
|
|
virtual void
|
2010-02-25 03:17:18 +01:00
|
|
|
|
run (Arg)
|
|
|
|
|
|
{
|
|
|
|
|
|
Session::current.reset();
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (Session::current.isUp());
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
|
|
|
|
|
verify_defaultStructure();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
verify_defaultStructure()
|
2010-02-22 03:52:52 +01:00
|
|
|
|
{
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
2010-02-22 03:52:52 +01:00
|
|
|
|
PSess sess = Session::current;
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (sess->isValid());
|
2010-02-22 03:52:52 +01:00
|
|
|
|
|
|
|
|
|
|
UNIMPLEMENTED("the real standard structure of the session"); //////////////////////////TICKET #499
|
|
|
|
|
|
|
|
|
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #546
|
|
|
|
|
|
|
2010-06-15 05:24:05 +02:00
|
|
|
|
/////TODO the following is code from the old session mockup... try to rephrase it into the new (real) session API
|
|
|
|
|
|
//
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (0 <= sess->currEDL().size()); // TODO implement
|
|
|
|
|
|
CHECK (0 <= sess->getFixture()->size()); // TODO implement
|
|
|
|
|
|
CHECK (sess->currEDL().getTracks()->isValid());
|
2010-02-22 03:52:52 +01:00
|
|
|
|
|
2010-06-25 04:43:06 +02:00
|
|
|
|
// PAsset track = sess->currEDL().getTracks()[0]; // TODO obsolete
|
2010-02-22 03:52:52 +01:00
|
|
|
|
// AssetManager& aMang = AssetManager::instance();
|
2010-12-10 02:55:40 +01:00
|
|
|
|
// CHECK (track == aMang.getAsset (track->getID()));
|
2010-02-22 03:52:52 +01:00
|
|
|
|
|
|
|
|
|
|
#endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #546
|
|
|
|
|
|
UNIMPLEMENTED ("how to refer to tracks...");
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (0 < sess->timelines.size());
|
2010-03-01 05:36:18 +01:00
|
|
|
|
PTimeline til = sess->timelines[0];
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (0 < sess->sequences.size());
|
2010-03-01 05:36:18 +01:00
|
|
|
|
PSequence seq = sess->sequences[0];
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
2010-03-12 01:50:33 +01:00
|
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #546
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (isSameObject (seq, til->getSequence()));
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
|
|
|
|
|
//verify default timeline
|
2010-03-01 05:36:18 +01:00
|
|
|
|
Axis& axis = til->getAxis();
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (Time(0) == axis.origin());
|
|
|
|
|
|
CHECK (Time(0) == til->length()); ////////////////////////TICKET #177
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
|
|
|
|
|
//verify global pipes
|
|
|
|
|
|
//TODO
|
|
|
|
|
|
|
|
|
|
|
|
//verify default sequence
|
2015-05-31 02:03:24 +02:00
|
|
|
|
RFork rootFork = seq->rootFork();
|
|
|
|
|
|
CHECK (rootFork->isValid());
|
|
|
|
|
|
CHECK (Time(0) == rootFork->length());
|
|
|
|
|
|
CHECK (0 == rootFork->subForks.size());
|
|
|
|
|
|
CHECK (0 == rootFork->clips.size());
|
2010-02-25 03:17:18 +01:00
|
|
|
|
//TODO verify the output slots of the sequence
|
|
|
|
|
|
|
|
|
|
|
|
//TODO now use the generic query API to discover the same structure.
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (til == *(sess->all<Timeline>()));
|
|
|
|
|
|
CHECK (seq == *(sess->all<Sequence>()));
|
2015-05-31 02:03:24 +02:00
|
|
|
|
CHECK (rootFork == *(sess->all<Fork>()));
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (! sess->all<Clip>());
|
2010-02-25 03:17:18 +01:00
|
|
|
|
|
|
|
|
|
|
QueryFocus& focus = sess->focus();
|
2015-05-31 02:03:24 +02:00
|
|
|
|
CHECK (rootFork == focus.getObject());
|
2010-02-25 03:17:18 +01:00
|
|
|
|
focus.navigate (til);
|
2010-12-10 02:55:40 +01:00
|
|
|
|
CHECK (til.getBinding() == focus.getObject());
|
2015-05-31 02:03:24 +02:00
|
|
|
|
CHECK (rootFork == *(focus.children()));
|
2010-03-12 01:50:33 +01:00
|
|
|
|
#endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #546
|
2010-02-25 03:17:18 +01:00
|
|
|
|
}
|
2010-02-22 03:52:52 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Register this test class... */
|
|
|
|
|
|
LAUNCHER (SessionStructure_test, "unit session");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-11-15 23:55:13 +01:00
|
|
|
|
}}}} // namespace steam::mobject::session::test
|