TestGrid.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 <grid.hxx>
22 
23 #include <functional>
24 #include <list>
25 
26 using namespace huc;
27 
28 #ifndef DOXYGEN_SKIP
29 namespace {
30 
31 }
32 #endif /* DOXYGEN_SKIP */
33 
34 // Test Grid Construction
35 TEST(TestGrid, build)
36 {
37  // Empty Grid
38  {
39  Grid<CellInfoBase> grid(0, 0);
40  EXPECT_EQ(grid.Height(), 0);
41  EXPECT_EQ(grid.Width(), 0);
42  }
43 
44  // Empty Connected Grid
45  {
46  Grid<CellInfoBase> grid(0, 0, true);
47  EXPECT_EQ(grid.Height(), 0);
48  EXPECT_EQ(grid.Width(), 0);
49  }
50 
51  // 10 x 10 Grid
52  {
53  Grid<CellInfoBase> grid(10, 10);
54  EXPECT_EQ(grid.Height(), 10);
55  EXPECT_EQ(grid.Width(), 10);
56  }
57 
58  // 10 x 10 Connected Grid
59  {
60  Grid<CellInfoBase> grid(10, 10, true);
61  EXPECT_EQ(grid.Height(), 10);
62  EXPECT_EQ(grid.Width(), 10);
63  }
64 }
65 
66 // TODO Complete UTs for all API!
uint32_t Width() const
Definition: grid.hxx:192
TEST(TestGrid, build)
Definition: TestGrid.cxx:35
uint32_t Height() const
Definition: grid.hxx:193