Make automated FSCommand invocation tests show player-side output.
[gnash.git] / testsuite / libcore.all / PropFlagsTest.cpp
blob1b623496921926f63bda9f8a4f1b564f1873c310
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifdef HAVE_CONFIG_H
20 #include "gnashconfig.h"
21 #endif
23 #include "PropFlags.h"
25 #include <iostream>
26 #include <sstream>
27 #include <cassert>
28 #include <string>
30 #include "check.h"
32 using namespace std;
33 using namespace gnash;
35 int
36 main(int /*argc*/, char** /*argv*/)
39 PropFlags flags;
41 // Check initial state
42 check(!flags.test<PropFlags::readOnly>());
43 check(!flags.test<PropFlags::dontEnum>());
44 check(!flags.test<PropFlags::dontDelete>());
45 check_equals(flags.get_flags(), 0);
47 PropFlags flags2(PropFlags::dontDelete | PropFlags::dontEnum);
48 check(flags2.test<PropFlags::dontEnum>());
49 check(flags2.test<PropFlags::dontDelete>());
50 check(!flags2.test<PropFlags::readOnly>());
52 PropFlags i;
53 check(i.get_visible(5));
54 check(i.get_visible(6));
55 check(i.get_visible(7));
56 check(i.get_visible(8));
57 check(i.get_visible(9));
59 i.set_flags(PropFlags::onlySWF6Up);
60 check(!i.get_visible(5));
61 check(i.get_visible(6));
62 check(i.get_visible(7));
63 check(i.get_visible(8));
64 check(i.get_visible(9));
66 i.set_flags(PropFlags::onlySWF7Up);
67 check(!i.get_visible(5));
68 check(!i.get_visible(6));
69 check(i.get_visible(7));
70 check(i.get_visible(8));
71 check(i.get_visible(9));
73 i.set_flags(PropFlags::onlySWF8Up);
74 check(!i.get_visible(5));
75 check(!i.get_visible(6));
76 check(!i.get_visible(7));
77 check(i.get_visible(8));
78 check(i.get_visible(9));
80 i.set_flags(PropFlags::onlySWF9Up);
81 check(!i.get_visible(5));
82 check(!i.get_visible(6));
83 check(!i.get_visible(7));
84 check(!i.get_visible(8));
85 check(i.get_visible(9));
87 PropFlags i2;
88 i2.set_flags(PropFlags::onlySWF8Up);
89 check(!i2.get_visible(5));
90 check(!i2.get_visible(6));
91 check(!i2.get_visible(7));
92 check(i2.get_visible(8));
93 check(i2.get_visible(9));
95 PropFlags i3;
96 i3.set_flags(PropFlags::ignoreSWF6);
97 check(i3.get_visible(5));
98 check(!i3.get_visible(6));
99 check(i3.get_visible(7));
100 check(i3.get_visible(8));
101 check(i3.get_visible(9));
102 return 0;