test/test.cpp
/**
 * @brief Test for checking astar and map class methods
 * @section DESCRIPTION Used ASSERT macro instead of EXPECT because 
 *          if there is a failure in initialization tests the test
 *          execution should abort
 */
@brief Test for checking astar and map class methods
@section DESCRIPTION Used ASSERT macro instead of EXPECT because
if there is a failure in initialization tests the test
execution should abort
@brief Test for checking astar and map class methods @section DESCRIPTION Used ASSERT macro instead of EXPECT because if there is a failure in initialization tests the test execution should abort
TEST(astarTest, methodTesting) {
  astar a;
  ASSERT_EQ(a.x_start_, 0);
  astar a1(0, 0, 5, 5);
  ASSERT_EQ(a1.x_goal_, 5);
  astar astar2(0, 0, 2, 2);
  map map2;
  std::vector<std::vector<int>> m1 = map2.create_map();
  std::vector<std::pair<int, int>> path2;
  path2 = astar2.astar_path(m1);
  bool status1 = map2.print_path(m1, path2);
  ASSERT_EQ(status1, 1);
  astar astar1(0, 0, 5, 5);
  map map1;
  std::vector<std::vector<int>> m = map1.create_map();
  m[5][5] = 0;
  std::vector<std::pair<int, int>> path1;
  path1 = astar1.astar_path(m);
  ASSERT_EQ(path1[0].first, -1);
  bool status = map1.print_path(m, path1);
  ASSERT_EQ(status, false);
}
TEST ( astarTest , methodTesting ) { astar a ; ASSERT_EQ ( a . x_start_ , 0 ) ; astar a1 ( 0 , 0 , 5 , 5 ) ; ASSERT_EQ ( a1 . x_goal_ , 5 ) ; astar astar2 ( 0 , 0 , 2 , 2 ) ; map map2 ; std :: vector < std :: vector < int > > m1 = map2 . create_map ( ) ; std :: vector < std :: pair < int , int > > path2 ; path2 = astar2 . astar_path ( m1 ) ; bool status1 = map2 . print_path ( m1 , path2 ) ; ASSERT_EQ ( status1 , 1 ) ; astar astar1 ( 0 , 0 , 5 , 5 ) ; map map1 ; std :: vector < std :: vector < int > > m = map1 . create_map ( ) ; m [ 5 ] [ 5 ] = 0 ; std :: vector < std :: pair < int , int > > path1 ; path1 = astar1 . astar_path ( m ) ; ASSERT_EQ ( path1 [ 0 ] . first , -1 ) ; bool status = map1 . print_path ( m , path1 ) ; ASSERT_EQ ( status , false ) ; }
@brief Test for checking astar and map class methods
 @section DESCRIPTION Used ASSERT macro instead of EXPECT because
          if there is a failure in initialization tests the test
          execution should abort
@brief Test for checking astar and map class methods @section DESCRIPTION Used ASSERT macro instead of EXPECT because if there is a failure in initialization tests the test execution should abort