FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ASpaceStory/tests/terrainTest.cpp at develop · SpaceBoxInk/ASpaceStory · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
SpaceBoxInk
/
ASpaceStory
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ASpaceStory
/
tests
/
terrainTest.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (39 loc) · 1.38 KB
Breadcrumbs
ASpaceStory
/
tests
/
terrainTest.cpp
Copy path
File metadata and controls
51 lines (39 loc) · 1.38 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
include
"
terrainTest.hpp
"
#
include
"
../src/model/MAssException.hpp
"
#
include
"
../src/model/MCoordonnees.hpp
"
#
include
"
../src/model/MTerrain.hpp
"
#
include
<
cute/cute_test.h
>
#
include
<
cute/cute.h
>
#
include
<
cute/cute_throws.h
>
void
borderTestThrows
()
{
MTerrain t;
int
xOverMax =
MTerrain::getTaille
().
getX
();
int
yOverMax =
MTerrain::getTaille
().
getY
();
ASSERT_THROWSM
(
"
Test (-1,0)
"
,
t
(-
1
,
0
), MExceptionOutOfTerrain);
ASSERT_THROWSM
(
"
Test (0,-1)
"
,
t
(
0
, -
1
), MExceptionOutOfTerrain);
ASSERT_THROWSM
(
"
Test (-1,-1)
"
,
t
(-
1
, -
1
), MExceptionOutOfTerrain);
//
TODO : test to complete
ASSERT_THROWSM
(
"
Test (max+1,0)
"
,
t
(xOverMax,
0
), MExceptionOutOfTerrain);
ASSERT_THROWSM
(
"
Test (0,max+1)
"
,
t
(
0
, yOverMax), MExceptionOutOfTerrain);
ASSERT_THROWSM
(
"
Test (max+1,max)
"
,
t
(xOverMax, yOverMax -
1
), MExceptionOutOfTerrain);
ASSERT_THROWSM
(
"
Test (max,max+1)
"
,
t
(xOverMax -
1
, yOverMax), MExceptionOutOfTerrain);
ASSERT_THROWSM
(
"
Test (max+1,max+1)
"
,
t
(xOverMax, yOverMax), MExceptionOutOfTerrain);
}
void
borderTestNoThrow
()
{
MTerrain t;
int
xOverMax =
MTerrain::getTaille
().
getX
();
int
yOverMax =
MTerrain::getTaille
().
getY
();
t
(
0
,
0
);
t
(xOverMax -
1
,
0
);
t
(
0
, yOverMax -
1
);
t
(xOverMax -
1
, yOverMax -
1
);
}
cute::suite
makeTerrainTestSuite
()
{
cute::suite suite;
suite.
push_back
(
CUTE
(borderTestThrows));
suite.
push_back
(
CUTE
(borderTestNoThrow));
return
suite;
}
Back
|
FazBrowse Home
|
New Git URL