Add automated tests on function-type FSCommand parameter passing.
[gnash.git] / testsuite / misc-ming.all / BitmapDataTestRunner.cpp
blob8ecfa6ae64f14f6fccec2bc3a5d756e51030bbae
1 //
2 // Copyright (C) 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
18 //
19 //
20 #define INPUT_FILENAME "BitmapDataTest.swf"
22 #include "MovieTester.h"
23 #include "MovieClip.h"
24 #include "DisplayObject.h"
25 #include "DisplayList.h"
26 #include "log.h"
28 #include "check.h"
29 #include <string>
30 #include <cassert>
31 #include <sstream>
33 using namespace gnash;
34 using namespace gnash::geometry;
35 using namespace std;
37 TRYMAIN(_runtest);
38 int
39 trymain(int /*argc*/, char** /*argv*/)
41 string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
42 MovieTester tester(filename);
44 gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
45 dbglogfile.setVerbosity(1);
47 MovieClip* root = tester.getRootMovie();
48 assert(root);
50 const rgba white(255, 255, 255, 255);
51 const rgba blue(0, 0, 255, 255);
52 const rgba cyan(0, 255, 255, 255);
53 const rgba green(0, 255, 0, 255);
54 const rgba yellow(255, 255, 0, 255);
55 const rgba magenta(255, 0, 255, 255);
56 const rgba red(255, 0, 0, 255);
58 // Frame 1
59 tester.advance();
60 check_pixel(15, 15, 1, yellow, 8);
61 check_pixel(80, 80, 1, green, 8);
62 check_pixel(95, 95, 1, green, 8);
64 // Frame 2
65 tester.click();
66 tester.advance();
67 check_pixel(15, 15, 1, yellow, 8);
68 check_pixel(80, 80, 1, green, 8);
69 check_pixel(95, 95, 1, blue, 8);
70 check_pixel(115, 115, 1, blue, 8);
72 // Frame 3
73 tester.click();
74 tester.advance();
75 check_pixel(15, 15, 1, yellow, 8);
76 check_pixel(80, 80, 1, white, 8);
77 check_pixel(95, 95, 1, white, 8);
78 check_pixel(115, 115, 1, white, 8);
80 // Frame 4
81 tester.click();
82 tester.advance();
83 check_pixel(15, 15, 1, red, 8);
84 check_pixel(80, 80, 1, white, 8);
85 check_pixel(95, 95, 1, white, 8);
86 check_pixel(115, 115, 1, white, 8);
88 check_pixel(315, 15, 1, magenta, 8);
90 // Frame 5 (same as previous).
91 tester.click();
92 tester.advance();
93 check_pixel(15, 15, 1, red, 8);
94 check_pixel(80, 80, 1, white, 8);
95 check_pixel(95, 95, 1, white, 8);
96 check_pixel(115, 115, 1, white, 8);
98 check_pixel(315, 15, 1, magenta, 8);
100 // Frame 6
101 tester.click();
102 tester.advance();
103 check_pixel(15, 15, 1, red, 8);
104 check_pixel(80, 80, 1, green, 8);
105 check_pixel(95, 95, 1, blue, 8);
106 check_pixel(115, 115, 1, blue, 8);
108 check_pixel(315, 15, 1, magenta, 8);
110 // Frame 7 (no change)
111 tester.click();
112 tester.advance();
113 check_pixel(15, 15, 1, red, 8);
114 check_pixel(80, 80, 1, green, 8);
115 check_pixel(95, 95, 1, blue, 8);
116 check_pixel(115, 115, 1, blue, 8);
118 check_pixel(315, 15, 1, magenta, 8);
120 // Frame 8
121 tester.click();
122 tester.advance();
123 check_pixel(1, 1, 1, white, 8);
124 check_pixel(15, 15, 1, yellow, 8);
125 check_pixel(30, 30, 1, red, 8);
126 check_pixel(80, 80, 1, green, 8);
127 check_pixel(95, 95, 1, blue, 8);
128 check_pixel(115, 115, 1, blue, 8);
130 check_pixel(315, 15, 1, white, 8);
132 // Frame 9
133 tester.click();
134 tester.advance();
135 check_pixel(1, 1, 1, red, 8);
136 check_pixel(15, 15, 1, red, 8);
137 check_pixel(30, 30, 1, red, 8);
138 check_pixel(95, 95, 1, white, 8);
139 check_pixel(115, 115, 1, white, 8);
141 check_pixel(315, 15, 1, white, 8);
143 // Frame 10 (no change)
144 tester.click();
145 tester.advance();
146 check_pixel(1, 1, 1, red, 8);
147 check_pixel(15, 15, 1, red, 8);
148 check_pixel(30, 30, 1, red, 8);
149 check_pixel(95, 95, 1, white, 8);
150 check_pixel(115, 115, 1, white, 8);
152 check_pixel(315, 15, 1, white, 8);
154 // Frame 11
155 tester.click();
156 tester.advance();
157 check_pixel(1, 1, 1, white, 8);
158 check_pixel(30, 30, 1, blue, 8);
159 check_pixel(95, 95, 1, blue, 8);
160 check_pixel(115, 115, 1, white, 8);
162 check_pixel(315, 15, 1, white, 8);
164 // Frame 12 (no change)
165 tester.click();
166 tester.advance();
167 check_pixel(1, 1, 1, white, 8);
168 check_pixel(30, 30, 1, blue, 8);
169 check_pixel(95, 95, 1, blue, 8);
170 check_pixel(115, 115, 1, white, 8);
172 check_pixel(315, 15, 1, white, 8);
174 // Frame 13 (red square, same as frame 9).
175 tester.click();
176 tester.advance();
177 check_pixel(1, 1, 1, red, 8);
178 check_pixel(15, 15, 1, red, 8);
179 check_pixel(30, 30, 1, red, 8);
180 check_pixel(95, 95, 1, white, 8);
181 check_pixel(115, 115, 1, white, 8);
183 check_pixel(315, 15, 1, white, 8);
185 // Frame 13
186 tester.click();
187 tester.advance();
188 check_pixel(1, 1, 1, white, 8);
189 check_pixel(30, 30, 1, blue, 8);
190 check_pixel(95, 95, 1, blue, 8);
191 check_pixel(115, 115, 1, white, 8);
193 check_pixel(325, 35, 1, blue, 8);
195 // Frame 14 (noise patterns, doesn't make much sense to test externally).
196 tester.click();
197 tester.advance();
199 return 0;