2009-06-02 03:31:52 +02:00
|
|
|
/*
|
|
|
|
|
MObjectRef(Test) - validating basic properties of the external MObject reference tag
|
|
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2009, 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"
|
2009-06-06 23:12:51 +02:00
|
|
|
#include "lib/lumitime.hpp"
|
2009-06-07 00:45:55 +02:00
|
|
|
#include "proc/asset/media.hpp"
|
2009-06-02 03:31:52 +02:00
|
|
|
#include "proc/mobject/mobject.hpp"
|
|
|
|
|
#include "proc/mobject/mobject-ref.hpp"
|
|
|
|
|
#include "proc/mobject/placement.hpp"
|
|
|
|
|
#include "proc/mobject/placement-ref.hpp"
|
2009-11-06 19:27:53 +01:00
|
|
|
#include "proc/mobject/session/placement-index.hpp"
|
2009-11-11 05:44:58 +01:00
|
|
|
#include "proc/mobject/session/session-service-mock-index.hpp"
|
2009-06-07 00:45:55 +02:00
|
|
|
#include "proc/mobject/session/clip.hpp"
|
2009-06-06 23:12:51 +02:00
|
|
|
#include "proc/mobject/explicitplacement.hpp"
|
2009-06-02 03:31:52 +02:00
|
|
|
#include "proc/mobject/test-dummy-mobject.hpp"
|
2009-06-07 03:12:07 +02:00
|
|
|
#include "lib/test/test-helper.hpp"
|
2009-06-02 03:31:52 +02:00
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
using lib::test::showSizeof;
|
2009-06-02 03:31:52 +02:00
|
|
|
using std::string;
|
|
|
|
|
using std::cout;
|
2009-06-07 00:45:55 +02:00
|
|
|
using std::endl;
|
2009-06-02 03:31:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace mobject {
|
|
|
|
|
namespace test {
|
|
|
|
|
|
2009-06-07 00:45:55 +02:00
|
|
|
using lumiera::Time;
|
2009-06-06 23:12:51 +02:00
|
|
|
using session::Clip;
|
2009-11-06 19:27:53 +01:00
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
using session::SessionServiceMockIndex;
|
|
|
|
|
using session::PPIdx;
|
2009-12-11 02:49:12 +01:00
|
|
|
|
2009-06-02 03:31:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
|
* @test properties and behaviour of the external reference-mechanism for
|
2009-06-06 23:12:51 +02:00
|
|
|
* MObjects placed into the session. We create a simple, simulated
|
|
|
|
|
* "session" (no real session datastructure) and a mock PlacementIndex.
|
|
|
|
|
* Then we add two Placements, which can be used then to build
|
|
|
|
|
* MObjectRef instances to validate their behaviour.
|
2009-06-02 03:31:52 +02:00
|
|
|
* @see mobject::Placement
|
|
|
|
|
* @see mobject::MObject
|
|
|
|
|
* @see mobject::PlacementRef_test
|
|
|
|
|
*/
|
|
|
|
|
class MObjectRef_test : public Test
|
|
|
|
|
{
|
|
|
|
|
|
2009-06-06 23:12:51 +02:00
|
|
|
typedef Placement<MObject> PMObj;
|
|
|
|
|
typedef Placement<Clip> PClip;
|
|
|
|
|
typedef TestPlacement<TestSubMO1> PSub1;
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 03:31:52 +02:00
|
|
|
virtual void
|
|
|
|
|
run (Arg)
|
|
|
|
|
{
|
2009-06-06 23:12:51 +02:00
|
|
|
|
|
|
|
|
// create data simulating a "Session"
|
2010-01-12 01:48:55 +01:00
|
|
|
PMObj testClip1 = asset::Media::create("test-1", asset::VIDEO)->createClip();
|
|
|
|
|
PMObj testClip2 = asset::Media::create("test-2", asset::VIDEO)->createClip();
|
2009-06-06 23:12:51 +02:00
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
// set up a tie to fixed start positions (i.e. "properties of placement")
|
|
|
|
|
testClip1.chain(Time(10));
|
|
|
|
|
testClip2.chain(Time(20));
|
2009-06-06 23:12:51 +02:00
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
ASSERT (testClip1->isValid());
|
|
|
|
|
ASSERT (testClip2->isValid());
|
|
|
|
|
ASSERT (2 == testClip1.use_count()); // one by the placement and one by the clip-Asset
|
|
|
|
|
ASSERT (2 == testClip2.use_count());
|
2009-06-06 23:12:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Prepare an (test)Index
|
2009-12-11 02:49:12 +01:00
|
|
|
PPIdx index = SessionServiceMockIndex::install();
|
2009-06-06 23:12:51 +02:00
|
|
|
PMO& root = index->getRoot();
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
// Add the Clips to "session" (here: dummy index)
|
|
|
|
|
PMObj::ID clip1ID = index->insert (testClip1, root);
|
|
|
|
|
PMObj::ID clip2ID = index->insert (testClip2, root);
|
2009-06-06 23:12:51 +02:00
|
|
|
ASSERT (2 == index->size());
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
// use the IDs returned on insertion to fetch
|
|
|
|
|
// language references to the placement instance within the index
|
|
|
|
|
// we'll use these language refs as base to create MObejctRef handles.
|
|
|
|
|
PMObj& pClip1 = index->find(clip1ID);
|
|
|
|
|
PMObj& pClip2 = index->find(clip2ID);
|
|
|
|
|
|
2009-06-07 00:45:55 +02:00
|
|
|
// extract various kinds of IDs and refs
|
|
|
|
|
PMObj & rP1 (pClip1);
|
|
|
|
|
PMObj const& rP2 (pClip2);
|
|
|
|
|
PMObj::ID id1 = pClip1.getID();
|
2010-01-12 01:48:55 +01:00
|
|
|
PMObj::Id<Clip> id2 = pClip2.recastID<Clip>(); // explicit unchecked re-declaration of target type
|
2009-06-07 00:45:55 +02:00
|
|
|
LumieraUid luid = id1.get();
|
|
|
|
|
///////////////////////////////////////////TODO: check the C-API representation here
|
|
|
|
|
PlacementRef<Clip> ref1 (id1);
|
|
|
|
|
PlacementRef<MObject> ref2 (pClip2);
|
|
|
|
|
|
2009-06-06 23:12:51 +02:00
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
2009-06-06 23:12:51 +02:00
|
|
|
// -----Tests------------------
|
2009-06-07 00:45:55 +02:00
|
|
|
checkBuildMObjectRef (rP1, &pClip1);
|
|
|
|
|
checkBuildMObjectRef (rP2, &pClip2);
|
|
|
|
|
checkBuildMObjectRef (id1, &pClip1);
|
|
|
|
|
checkBuildMObjectRef (id2, &pClip2);
|
|
|
|
|
checkBuildMObjectRef (luid, &pClip1);
|
|
|
|
|
///////////////////////////////////////////TODO: check the C-API representation here
|
|
|
|
|
checkBuildMObjectRef (ref1, &pClip1);
|
|
|
|
|
checkBuildMObjectRef (ref2, &pClip2);
|
2009-06-07 03:12:07 +02:00
|
|
|
|
2010-01-13 03:29:57 +01:00
|
|
|
checkComparison(rP1,rP2);
|
2009-06-07 03:12:07 +02:00
|
|
|
checkLifecycle (rP1,rP2);
|
|
|
|
|
checkTypeHandling (luid);
|
2009-06-06 23:12:51 +02:00
|
|
|
// -----Tests------------------
|
2010-01-12 01:48:55 +01:00
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
2009-06-06 23:12:51 +02:00
|
|
|
|
|
|
|
|
// verify clean state
|
|
|
|
|
index->remove (pClip1);
|
2010-01-12 01:48:55 +01:00
|
|
|
index->remove (pClip2); // note: this invalidates pClip1 and pClip2;
|
|
|
|
|
ASSERT (!ref1);
|
|
|
|
|
ASSERT (!ref2);
|
2009-06-06 23:12:51 +02:00
|
|
|
ASSERT (0 == index->size());
|
2009-12-11 02:49:12 +01:00
|
|
|
ASSERT (1 == index.use_count());
|
2010-01-12 01:48:55 +01:00
|
|
|
ASSERT (2 == testClip1.use_count());
|
|
|
|
|
ASSERT (2 == testClip2.use_count());
|
2009-12-11 02:49:12 +01:00
|
|
|
index.reset();
|
2009-06-02 03:31:52 +02:00
|
|
|
}
|
2009-06-07 00:45:55 +02:00
|
|
|
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
|
2009-06-07 00:45:55 +02:00
|
|
|
template<typename REF>
|
|
|
|
|
void
|
|
|
|
|
checkBuildMObjectRef (REF refObj, void* placementAdr)
|
|
|
|
|
{
|
|
|
|
|
MORef<Clip> rMO;
|
|
|
|
|
ASSERT (!rMO); // still empty (not bound)
|
|
|
|
|
cout << rMO << endl;
|
|
|
|
|
cout << showSizeof(rMO) << endl;
|
|
|
|
|
|
|
|
|
|
// activate by binding to provided ref
|
|
|
|
|
rMO.activate(refObj);
|
|
|
|
|
ASSERT (rMO); // now bound
|
|
|
|
|
cout << rMO << endl;
|
|
|
|
|
|
|
|
|
|
// access MObject (Clip API)
|
2010-01-12 01:48:55 +01:00
|
|
|
// cout << rMO->operator string() << endl; /////////////////////TICKET #428
|
|
|
|
|
cout << string(rMO->getMedia()->ident) << endl; /////////////////////TICKET #520
|
2009-06-07 00:45:55 +02:00
|
|
|
ASSERT (rMO->isValid());
|
|
|
|
|
|
|
|
|
|
// access the Placement-API
|
2009-06-07 03:12:07 +02:00
|
|
|
ASSERT (3 == rMO.use_count()); // now rMO shares ownership with the Placement
|
2010-01-12 01:48:55 +01:00
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
|
|
|
|
ASSERT (0 < rMO.getStartTime()); // (internally, this resolves to an ExplicitPlacement) /////////TICKET #332
|
2009-06-07 00:45:55 +02:00
|
|
|
ASSERT ( rMO.isCompatible<MObject>());
|
|
|
|
|
ASSERT ( rMO.isCompatible<Clip>());
|
|
|
|
|
ASSERT (!rMO.isCompatible<TestSubMO1>());
|
|
|
|
|
Time start = rMO.getStartTime();
|
2010-01-12 01:48:55 +01:00
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
2009-06-07 00:45:55 +02:00
|
|
|
|
|
|
|
|
// re-link to the Placement (note we get the Clip API!)
|
|
|
|
|
Placement<Clip> & refP = rMO.getPlacement();
|
|
|
|
|
ASSERT (refP);
|
2009-06-07 03:12:07 +02:00
|
|
|
ASSERT (3 == refP.use_count());
|
2009-06-07 00:45:55 +02:00
|
|
|
ASSERT (&refP == placementAdr); // actually denotes the address of the original Placement in the "session"
|
|
|
|
|
cout << string(refP) << endl;
|
2009-06-07 03:12:07 +02:00
|
|
|
|
2009-06-07 00:45:55 +02:00
|
|
|
ExplicitPlacement exPla = refP.resolve();
|
2010-01-12 01:48:55 +01:00
|
|
|
// ASSERT (exPla.time == start); // recovered Placement resolves to the same time as provided by the proxied API
|
2009-06-07 03:12:07 +02:00
|
|
|
ASSERT (4 == refP.use_count()); // but now we've indeed created an additional owner (exPla)
|
|
|
|
|
ASSERT (4 == rMO.use_count());
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-13 03:29:57 +01:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
checkComparison (PMO& p1, PMO& p2)
|
|
|
|
|
{
|
|
|
|
|
PlacementRef<Clip> pRef1 (p1);
|
|
|
|
|
PlacementRef<MObject> pRef2 (p2);
|
|
|
|
|
|
|
|
|
|
MORef<MObject> rM;
|
|
|
|
|
MORef<Clip> rC;
|
|
|
|
|
|
|
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
|
|
|
|
rM.activate (p1);
|
|
|
|
|
rC.activate (p2);
|
|
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
|
|
|
|
ASSERT (rM && rC);
|
|
|
|
|
ASSERT (!(rM == rC) && !(rC == rM));
|
|
|
|
|
ASSERT ( (rM != rC) && (rC != rM));
|
|
|
|
|
|
|
|
|
|
// mixed comparisons
|
|
|
|
|
ASSERT ( (rM == pRef1) && (pRef1 == rM));
|
|
|
|
|
ASSERT ( (rC == pRef2) && (pRef2 == rC));
|
|
|
|
|
ASSERT (!(rM != pRef1) && !(pRef1 != rM));
|
|
|
|
|
ASSERT (!(rC != pRef2) && !(pRef2 != rC));
|
|
|
|
|
ASSERT ( (rM != pRef2) && (pRef2 != rM));
|
|
|
|
|
ASSERT ( (rC != pRef1) && (pRef1 != rC));
|
|
|
|
|
ASSERT (!(rM == pRef2) && !(pRef2 == rM));
|
|
|
|
|
ASSERT (!(rC == pRef1) && !(pRef1 == rC));
|
|
|
|
|
|
|
|
|
|
ASSERT ( (rM == p1.getID()) );
|
|
|
|
|
ASSERT ( (rC == p2.getID()) );
|
|
|
|
|
ASSERT (!(rM != p1.getID()) );
|
|
|
|
|
ASSERT (!(rC != p2.getID()) );
|
|
|
|
|
ASSERT ( (rM != p2.getID()) );
|
|
|
|
|
ASSERT ( (rC != p1.getID()) );
|
|
|
|
|
ASSERT (!(rM == p2.getID()) );
|
|
|
|
|
ASSERT (!(rC == p1.getID()) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
|
|
|
|
rC.activate (p1);
|
|
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
|
|
|
|
ASSERT ( (rM == rC) && (rC == rM));
|
|
|
|
|
ASSERT (!(rM != rC) && !(rC != rM));
|
|
|
|
|
|
|
|
|
|
ASSERT ( (rC == pRef1) && (pRef1 == rC));
|
|
|
|
|
ASSERT (!(rC != pRef1) && !(pRef1 != rC));
|
|
|
|
|
ASSERT ( (rC != pRef2) && (pRef2 != rC));
|
|
|
|
|
ASSERT (!(rC == pRef2) && !(pRef2 == rC));
|
|
|
|
|
|
|
|
|
|
ASSERT ( (rC == p1.getID()) );
|
|
|
|
|
ASSERT (!(rC != p1.getID()) );
|
|
|
|
|
ASSERT ( (rC != p2.getID()) );
|
|
|
|
|
ASSERT (!(rC == p2.getID()) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rM.close();
|
|
|
|
|
ASSERT (!rM);
|
|
|
|
|
ASSERT (!(rM == rC) && !(rC == rM));
|
|
|
|
|
ASSERT ( (rM != rC) && (rC != rM));
|
|
|
|
|
|
|
|
|
|
ASSERT (!(rM == pRef1) && !(pRef1 == rM));
|
|
|
|
|
ASSERT ( (rM != pRef1) && (pRef1 != rM));
|
|
|
|
|
ASSERT (!(rM != pRef2) && !(pRef2 != rM));
|
|
|
|
|
ASSERT ( (rM == pRef2) && (pRef2 == rM));
|
|
|
|
|
|
|
|
|
|
ASSERT (!(rM == p1.getID()) );
|
|
|
|
|
ASSERT ( (rM != p1.getID()) );
|
|
|
|
|
ASSERT (!(rM != p2.getID()) );
|
|
|
|
|
ASSERT ( (rM == p2.getID()) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-06-07 03:12:07 +02:00
|
|
|
void
|
2009-06-09 09:05:19 +02:00
|
|
|
checkLifecylce (PMObj const& p1, PMObj const& p2)
|
2009-06-07 03:12:07 +02:00
|
|
|
{
|
|
|
|
|
ASSERT (2 == p1.use_count());
|
|
|
|
|
ASSERT (2 == p2.use_count());
|
|
|
|
|
|
|
|
|
|
MORef<Clip> rMO;
|
|
|
|
|
ASSERT (!rMO);
|
|
|
|
|
ASSERT (0 == rMO.use_count());
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
2009-06-07 03:12:07 +02:00
|
|
|
rMO.activate(p1);
|
2010-01-12 01:48:55 +01:00
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
2009-06-07 03:12:07 +02:00
|
|
|
ASSERT (rMO);
|
|
|
|
|
ASSERT (rMO->getMedia()->getFilename() == "test-1");
|
2009-06-07 00:45:55 +02:00
|
|
|
ASSERT (3 == rMO.use_count());
|
2009-06-07 03:12:07 +02:00
|
|
|
ASSERT (3 == p1.use_count());
|
|
|
|
|
ASSERT (2 == p2.use_count());
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
2009-06-07 03:12:07 +02:00
|
|
|
rMO.activate(p2);
|
2010-01-12 01:48:55 +01:00
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
2009-06-07 03:12:07 +02:00
|
|
|
ASSERT (rMO);
|
|
|
|
|
ASSERT (rMO->getMedia()->getFilename() == "test-2");
|
|
|
|
|
ASSERT (3 == rMO.use_count());
|
|
|
|
|
ASSERT (2 == p1.use_count());
|
|
|
|
|
ASSERT (3 == p2.use_count());
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
2009-06-07 03:12:07 +02:00
|
|
|
rMO.activate(p2);
|
2010-01-12 01:48:55 +01:00
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
2009-06-07 03:12:07 +02:00
|
|
|
ASSERT (3 == rMO.use_count());
|
|
|
|
|
|
|
|
|
|
rMO.close();
|
|
|
|
|
ASSERT (!rMO);
|
|
|
|
|
ASSERT (2 == p1.use_count());
|
|
|
|
|
ASSERT (2 == p2.use_count());
|
|
|
|
|
|
2009-06-07 03:22:08 +02:00
|
|
|
VERIFY_ERROR (INVALID_PLACEMENTREF, rMO.getPlacement() );
|
2010-01-12 01:48:55 +01:00
|
|
|
// VERIFY_ERROR (INVALID_MOBJECTREF, rMO->getMedia() );
|
2009-06-07 03:12:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
checkTypeHandling (LumieraUid luid)
|
|
|
|
|
{
|
2009-06-07 03:36:27 +02:00
|
|
|
MObjectRef rMObj;
|
|
|
|
|
MORef<Clip> rClip;
|
|
|
|
|
MORef<TestSubMO1> rSub1;
|
2009-06-07 03:12:07 +02:00
|
|
|
|
2009-06-07 03:36:27 +02:00
|
|
|
ASSERT (0 == rMObj.use_count());
|
|
|
|
|
ASSERT (0 == rClip.use_count());
|
|
|
|
|
ASSERT (0 == rSub1.use_count());
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
2009-06-07 03:36:27 +02:00
|
|
|
rMObj.activate(luid);
|
2010-01-12 01:48:55 +01:00
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
2009-06-07 03:36:27 +02:00
|
|
|
ASSERT (3 == rMObj.use_count());
|
|
|
|
|
ASSERT (0 == rClip.use_count());
|
|
|
|
|
ASSERT (0 == rSub1.use_count());
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
2009-06-07 03:36:27 +02:00
|
|
|
rClip.activate(rMObj); // attach on existing MObjectRef
|
2010-01-12 01:48:55 +01:00
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
2009-06-07 03:36:27 +02:00
|
|
|
ASSERT (4 == rMObj.use_count());
|
|
|
|
|
ASSERT (4 == rClip.use_count());
|
|
|
|
|
ASSERT (0 == rSub1.use_count());
|
|
|
|
|
|
|
|
|
|
// impossible, because Clip isn't a subclass of TestSubMO1:
|
2010-01-12 01:48:55 +01:00
|
|
|
#if false //////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 384 !!!!!!!!!
|
2009-06-07 03:36:27 +02:00
|
|
|
VERIFY_ERROR (INVALID_PLACEMENTREF, rSub1.activate(luid) );
|
2010-01-12 01:48:55 +01:00
|
|
|
// VERIFY_ERROR (INVALID_PLACEMENTREF, rSub1 = rMObj );
|
|
|
|
|
#endif ////////////////////////////////////////////////////////////////////////////////////////TODO lots of things unimplemented.....!!!!!
|
2009-06-07 03:36:27 +02:00
|
|
|
|
|
|
|
|
ASSERT (rMObj->isValid());
|
|
|
|
|
ASSERT (rClip->isValid());
|
|
|
|
|
ASSERT (rMObj.getPlacement().getID() == rClip.getPlacement().getID());
|
|
|
|
|
|
|
|
|
|
// doesn't compile, because the function isn't on MObject API:
|
|
|
|
|
// rMObj->getMedia();
|
|
|
|
|
|
|
|
|
|
// can assign, because the actual type is relevant:
|
|
|
|
|
rClip.close();
|
|
|
|
|
ASSERT (3 == rMObj.use_count());
|
|
|
|
|
ASSERT (0 == rClip.use_count());
|
|
|
|
|
|
2010-01-12 01:48:55 +01:00
|
|
|
// rClip = rMObj;
|
2009-06-07 03:36:27 +02:00
|
|
|
ASSERT (4 == rMObj.use_count());
|
|
|
|
|
ASSERT (4 == rClip.use_count());
|
|
|
|
|
|
|
|
|
|
cout << rClip << endl;
|
2010-01-12 01:48:55 +01:00
|
|
|
cout << string(rClip->getMedia()->ident) << endl; //////////TICKET #520
|
2009-06-07 00:45:55 +02:00
|
|
|
}
|
2009-06-02 03:31:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Register this test class... */
|
|
|
|
|
LAUNCHER (MObjectRef_test, "unit session");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}} // namespace mobject::test
|