2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc
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.
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.
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
20 #include "gnashconfig.h"
23 #include "PropFlags.h"
33 using namespace gnash
;
36 main(int /*argc*/, char** /*argv*/)
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
>());
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));
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));
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));