TestSidewinderGen.cxx
Go to the documentation of this file.
1 /*===========================================================================================================
2  *
3  * HUC - Hurna Core
4  *
5  * Copyright (c) Michael Jeulin-Lagarrigue
6  *
7  * Licensed under the MIT License, you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * https://github.com/Hurna/Hurna-Core/blob/master/LICENSE
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License is
13  * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and limitations under the License.
15  *
16  * The above copyright notice and this permission notice shall be included in all copies or
17  * substantial portions of the Software.
18  *
19  *=========================================================================================================*/
20 #include <gtest/gtest.h>
21 #include <sidewinder_generator.hxx>
22 
23 using namespace huc;
24 using namespace maze;
25 
26 #ifndef DOXYGEN_SKIP
27 namespace {
28 
29 }
30 #endif /* DOXYGEN_SKIP */
31 
32 // Test Binary Tree Generator
33 TEST(TestSidewinderGen, build)
34 {
35  // 0 x 0 - No Maze
36  {
37  auto maze = SidewinderGenerator()(0, 0);
38  EXPECT_EQ(maze, nullptr);
39  }
40 
41  // 5 x 0 - No Maze
42  {
43  auto maze = SidewinderGenerator()(5, 0);
44  EXPECT_EQ(maze, nullptr);
45  }
46 
47  // 5 x 10 Maze
48  {
49  auto maze = SidewinderGenerator()(5, 10);
50  EXPECT_EQ(maze->Width(), 5);
51  EXPECT_EQ(maze->Height(), 10);
52  }
53 
54  // 10 x 10 Maze
55  {
56  auto maze = SidewinderGenerator()(10, 10);
57  EXPECT_EQ(maze->Width(), 10);
58  EXPECT_EQ(maze->Height(), 10);
59  }
60 }
TEST(TestSidewinderGen, build)