summaryrefslogtreecommitdiff
path: root/docs/html/presentation_tests_8cpp.html
blob: 90e46db9b32f358b08bf1e1552629b558741341b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Rally X: tests/presentationTests.cpp File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="car.PNG"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Rally X
   
   </div>
   <div id="projectbrief">ELEN3009 Project by Justin Wernick and David Schneider</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">tests/presentationTests.cpp File Reference</div>  </div>
</div>
<div class="contents">

<p>Unit tests for the presentation layer of a Rally-X game.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;utility&gt;</code><br/>
<code>#include &lt;list&gt;</code><br/>
<code>#include &lt;gtest/gtest.h&gt;</code><br/>
<code>#include &quot;../source/presentation/BitmapStore.h&quot;</code><br/>
<code>#include &quot;../source/presentation/ColourStore.h&quot;</code><br/>
<code>#include &quot;../source/presentation/GamePanel.h&quot;</code><br/>
<code>#include &quot;../source/presentation/Screen.h&quot;</code><br/>
<code>#include &quot;../source/logic/PlayerCar.h&quot;</code><br/>
<code>#include &quot;../source/logic/EnemyCar.h&quot;</code><br/>
<code>#include &quot;../source/logic/Checkpoint.h&quot;</code><br/>
<code>#include &quot;../source/logic/Rock.h&quot;</code><br/>
<code>#include &quot;../source/logic/Smokescreen.h&quot;</code><br/>
<code>#include &quot;../source/logic/Maze.h&quot;</code><br/>
<code>#include &quot;../source/logic/DestroyedObjectPopup.h&quot;</code><br/>
</div>
<p><a href="presentation_tests_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="presentation_tests_8cpp.html#a1f28e78cfee8247b7031e29d1db8b088">TEST</a> (<a class="el" href="class_bitmap_store.html">BitmapStore</a>, returnsBitmapForAllImages)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tests that all images can be requested without failure occuring.  <a href="#a1f28e78cfee8247b7031e29d1db8b088"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="presentation_tests_8cpp.html#a93e9b8f162d329b2498f62812b5651f9">TEST</a> (<a class="el" href="class_colour_store.html">ColourStore</a>, returnsColourForAllImages)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tests that all colours can be requested without failure occuring.  <a href="#a93e9b8f162d329b2498f62812b5651f9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="presentation_tests_8cpp.html#a09481990af46ae9fd4cced79cce78953">TEST</a> (<a class="el" href="class_screen.html">Screen</a>, exceptionOnBadResolution)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="presentation_tests_8cpp.html#a52ee17980b74b96293db8c102b8245c0">TEST</a> (<a class="el" href="class_screen.html">Screen</a>, noExceptionOnWindowed)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="presentation_tests_8cpp.html#a2f96180c4b643bba6a3e9c97a9467f8f">TEST</a> (<a class="el" href="class_screen.html">Screen</a>, noExceptionOnGoodResolution)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="presentation_tests_8cpp.html#ac0685cd3085971f9d09b22ed8563d766">TEST</a> (<a class="el" href="class_screen_panel.html">ScreenPanel</a>, drawingToCurrentBackBuffer)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tests that when a <a class="el" href="class_screen_panel.html" title="Parent class for panels that are drawn on the screen.">ScreenPanel</a> draws to the back buffer provided.  <a href="#ac0685cd3085971f9d09b22ed8563d766"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="presentation_tests_8cpp.html#a8b8a615a5a6ef5da97b81d626fba41eb">TEST</a> (<a class="el" href="class_screen_panel.html">ScreenPanel</a>, drawingToCurrentBackBufferAfterFlip)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tests that when a <a class="el" href="class_screen_panel.html" title="Parent class for panels that are drawn on the screen.">ScreenPanel</a> draws to the front buffer provided after a flip has been called.  <a href="#a8b8a615a5a6ef5da97b81d626fba41eb"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Unit tests for the presentation layer of a Rally-X game. </p>
<p>The <a class="el" href="class_bitmap_store.html" title="Class for accessing images in ALLEGRO_BITMAP format and low level drawing.">BitmapStore</a> class is tested in its ability to return a bitmap for each image. The appearance of the bitmaps need to be tested manually by running the game and inspecting the various objects.</p>
<p>The <a class="el" href="class_colour_store.html" title="Class for mapping BitmapStore images to colours for use in the minimap.">ColourStore</a> class is tested in its ability to return a colour for each image. The appearance of the colours need to be tested manually by running the game and inspecting the various objects.</p>
<p>The <a class="el" href="class_game_panel.html" title="ScreenPanel to be drawn on the screen to draw the area where the game takes place.">GamePanel</a> and <a class="el" href="class_info_panel.html" title="ScreenPanel to be drawn on the screen to give the player information.">InfoPanel</a> classes depend on their visual appearance in the game. Therefore, they should be tested manually. The technical part of their functionality, creating the back and front buffers and changing between them, is handled by their superclass, <a class="el" href="class_screen_panel.html" title="Parent class for panels that are drawn on the screen.">ScreenPanel</a>.</p>
<p>The <a class="el" href="class_keyboard_handler.html" title="Class for handling keyboard related game inputs from the player.">KeyboardHandler</a> depends on user inputs. It should be tested manually by testing that the player's direction can be controlled, and that smokescreens can be created.</p>
<p>The <a class="el" href="class_screen.html" title="Class for creating a window on the screen.">Screen</a> class's creation with various resolutions and fullscreen settings is tested. An exception should be thrown if the fullscreen resolution is not supported by the current hardware, but not otherwise. The visual appearance and creation of ScreenPanels should be tested manually by running the game.</p>
<p>The <a class="el" href="class_screen_panel.html" title="Parent class for panels that are drawn on the screen.">ScreenPanel</a> class is tested by creating a false back and front display buffer. The buffer that is being drawn to is tested by sampling a pixel in the middle of the buffer.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Justin Wernick </dd>
<dd>
David Schneider </dd></dl>

<p>Definition in file <a class="el" href="presentation_tests_8cpp_source.html">presentationTests.cpp</a>.</p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a1f28e78cfee8247b7031e29d1db8b088"></a><!-- doxytag: member="presentationTests.cpp::TEST" ref="a1f28e78cfee8247b7031e29d1db8b088" args="(BitmapStore, returnsBitmapForAllImages)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_bitmap_store.html">BitmapStore</a>&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">returnsBitmapForAllImages&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tests that all images can be requested without failure occuring. </p>

<p>Definition at line <a class="el" href="presentation_tests_8cpp_source.html#l00055">55</a> of file <a class="el" href="presentation_tests_8cpp_source.html">presentationTests.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a93e9b8f162d329b2498f62812b5651f9"></a><!-- doxytag: member="presentationTests.cpp::TEST" ref="a93e9b8f162d329b2498f62812b5651f9" args="(ColourStore, returnsColourForAllImages)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_colour_store.html">ColourStore</a>&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">returnsColourForAllImages&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tests that all colours can be requested without failure occuring. </p>

<p>Definition at line <a class="el" href="presentation_tests_8cpp_source.html#l00075">75</a> of file <a class="el" href="presentation_tests_8cpp_source.html">presentationTests.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a09481990af46ae9fd4cced79cce78953"></a><!-- doxytag: member="presentationTests.cpp::TEST" ref="a09481990af46ae9fd4cced79cce78953" args="(Screen, exceptionOnBadResolution)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_screen.html">Screen</a>&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">exceptionOnBadResolution&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tests that an exception is thrown if fullscreen mode is requested on an unsupported monitor resolution. </p>

<p>Definition at line <a class="el" href="presentation_tests_8cpp_source.html#l00095">95</a> of file <a class="el" href="presentation_tests_8cpp_source.html">presentationTests.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a52ee17980b74b96293db8c102b8245c0"></a><!-- doxytag: member="presentationTests.cpp::TEST" ref="a52ee17980b74b96293db8c102b8245c0" args="(Screen, noExceptionOnWindowed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_screen.html">Screen</a>&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">noExceptionOnWindowed&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tests that an exception is not thrown if windowed mode is requested on an unsupported monitor resolution. </p>

<p>Definition at line <a class="el" href="presentation_tests_8cpp_source.html#l00106">106</a> of file <a class="el" href="presentation_tests_8cpp_source.html">presentationTests.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a2f96180c4b643bba6a3e9c97a9467f8f"></a><!-- doxytag: member="presentationTests.cpp::TEST" ref="a2f96180c4b643bba6a3e9c97a9467f8f" args="(Screen, noExceptionOnGoodResolution)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_screen.html">Screen</a>&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">noExceptionOnGoodResolution&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tests that an exception is not thrown if fullscreen mode is requested on a supported monitor resolution. </p>

<p>Definition at line <a class="el" href="presentation_tests_8cpp_source.html#l00117">117</a> of file <a class="el" href="presentation_tests_8cpp_source.html">presentationTests.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac0685cd3085971f9d09b22ed8563d766"></a><!-- doxytag: member="presentationTests.cpp::TEST" ref="ac0685cd3085971f9d09b22ed8563d766" args="(ScreenPanel, drawingToCurrentBackBuffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_screen_panel.html">ScreenPanel</a>&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">drawingToCurrentBackBuffer&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tests that when a <a class="el" href="class_screen_panel.html" title="Parent class for panels that are drawn on the screen.">ScreenPanel</a> draws to the back buffer provided. </p>

<p>Definition at line <a class="el" href="presentation_tests_8cpp_source.html#l00129">129</a> of file <a class="el" href="presentation_tests_8cpp_source.html">presentationTests.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a8b8a615a5a6ef5da97b81d626fba41eb"></a><!-- doxytag: member="presentationTests.cpp::TEST" ref="a8b8a615a5a6ef5da97b81d626fba41eb" args="(ScreenPanel, drawingToCurrentBackBufferAfterFlip)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_screen_panel.html">ScreenPanel</a>&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">drawingToCurrentBackBufferAfterFlip&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tests that when a <a class="el" href="class_screen_panel.html" title="Parent class for panels that are drawn on the screen.">ScreenPanel</a> draws to the front buffer provided after a flip has been called. </p>

<p>Definition at line <a class="el" href="presentation_tests_8cpp_source.html#l00189">189</a> of file <a class="el" href="presentation_tests_8cpp_source.html">presentationTests.cpp</a>.</p>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Oct 5 2011 20:08:31 for Rally X by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>