TestPrimsGen.cxx File Reference
#include <gtest/gtest.h>
#include <prims_generator.hxx>
Include dependency graph for TestPrimsGen.cxx:

Go to the source code of this file.

Functions

 TEST (TestPrimsGen, build)
 

Function Documentation

TEST ( TestPrimsGen  ,
build   
)

Definition at line 33 of file TestPrimsGen.cxx.

34 {
35  // 0 x 0 - No Maze
36  {
37  auto maze = PrimsGenerator()(0, 0);
38  EXPECT_EQ(maze, nullptr);
39  }
40 
41  // 5 x 0 - No Maze
42  {
43  auto maze = PrimsGenerator()(5, 0);
44  EXPECT_EQ(maze, nullptr);
45  }
46 
47  // 5 x 10 Maze
48  {
49  auto maze = PrimsGenerator()(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 = PrimsGenerator()(10, 10);
57  EXPECT_EQ(maze->Width(), 10);
58  EXPECT_EQ(maze->Height(), 10);
59  }
60 
61  // 10 x 10 Maze - Start from the middle
62  {
63  auto maze = PrimsGenerator()(10, 10, PrimsGenerator::Point(4, 4));
64  EXPECT_EQ(maze->Width(), 10);
65  EXPECT_EQ(maze->Height(), 10);
66  }
67 
68  // 10 x 10 No Maze - StartPoint out of the box
69  {
70  auto maze = PrimsGenerator()(10, 10, PrimsGenerator::Point(15, 0));
71  EXPECT_EQ(maze, nullptr);
72  }
73 
74  // 10 x 10 No Maze - StartPoint out of the box
75  {
76  auto maze = PrimsGenerator()(10, 10, PrimsGenerator::Point(10, 10));
77  EXPECT_EQ(maze, nullptr);
78  }
79 }
Point struct is a convenient struct use to represent a 2D point for a grid (index position)...
Definition: grid.hxx:56