-
Notifications
You must be signed in to change notification settings - Fork 280
/
cube_direction_test.cpp
39 lines (35 loc) · 1.88 KB
/
cube_direction_test.cpp
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
#include "catch/catch.hpp"
#include "cube_direction.h"
#include "omdata.h"
TEST_CASE( "cube_direction_add_om_direction", "[cube_direction]" )
{
CHECK( cube_direction::north + om_direction::type::north == cube_direction::north );
CHECK( cube_direction::north + om_direction::type::east == cube_direction::east );
CHECK( cube_direction::north + om_direction::type::south == cube_direction::south );
CHECK( cube_direction::north + om_direction::type::west == cube_direction::west );
CHECK( cube_direction::east + om_direction::type::south == cube_direction::west );
CHECK( cube_direction::south + om_direction::type::south == cube_direction::north );
CHECK( cube_direction::west + om_direction::type::south == cube_direction::east );
}
TEST_CASE( "cube_direction_add_int", "[cube_direction]" )
{
CHECK( cube_direction::north + 0 == cube_direction::north );
CHECK( cube_direction::north + 1 == cube_direction::east );
CHECK( cube_direction::north + 2 == cube_direction::south );
CHECK( cube_direction::north + 3 == cube_direction::west );
CHECK( cube_direction::north + 4 == cube_direction::north );
CHECK( cube_direction::east + 2 == cube_direction::west );
CHECK( cube_direction::south + 2 == cube_direction::north );
CHECK( cube_direction::west + 2 == cube_direction::east );
}
TEST_CASE( "cube_direction_subtract_int", "[cube_direction]" )
{
CHECK( cube_direction::north - 0 == cube_direction::north );
CHECK( cube_direction::north - 1 == cube_direction::west );
CHECK( cube_direction::north - 2 == cube_direction::south );
CHECK( cube_direction::north - 3 == cube_direction::east );
CHECK( cube_direction::north - 4 == cube_direction::north );
CHECK( cube_direction::east - 2 == cube_direction::west );
CHECK( cube_direction::south - 2 == cube_direction::north );
CHECK( cube_direction::west - 2 == cube_direction::east );
}