2
// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
4
// This program is free software; you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation; either version 3 of the License, or
7
// (at your option) any later version.
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
#include "gnashconfig.h"
22
#include "DisplayList.h"
24
#include "character.h"
27
#include "DummyMovieDefinition.h"
28
#include "DummyCharacter.h"
29
#include "movie_definition.h"
30
#include "ManualClock.h"
40
using namespace gnash;
43
main(int /*argc*/, char** /*argv*/)
45
gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
46
dbglogfile.setVerbosity();
48
// Initialize gnash lib
52
boost::intrusive_ptr<movie_definition> md5 ( new DummyMovieDefinition(5) );
53
boost::intrusive_ptr<movie_definition> md6 ( new DummyMovieDefinition(6) );
56
VM& vm = VM::init(*md5, clock);
58
movie_instance* root = md5->create_movie_instance();
59
vm.getRoot().setRootMovie( root );
63
check_equals(dlist1, dlist1);
65
DisplayList dlist2 = dlist1;
67
check_equals(dlist1, dlist2);
69
// just a couple of characters
70
boost::intrusive_ptr<character> ch1 ( new DummyCharacter(root) );
71
boost::intrusive_ptr<character> ch2 ( new DummyCharacter(root) );
73
dlist1.place_character( ch1.get(), 1);
74
dlist1.place_character( ch2.get(), 2);
76
check(dlist1 != dlist2);
78
dlist2.place_character( ch2.get(), 1);
79
dlist2.place_character( ch1.get(), 2);
81
// Resort dlist1 as depth of it's chars has been changed
82
// by place_character calls above :/
85
check_equals(dlist1, dlist2);