23 TEST_CASE(
"デフォルトコンストラクタの呼び出し時,マップのサイズは0になるべき")
27 CHECK_EQ(map_state.GetMapPointSize(), 0);
30 TEST_CASE(
"脚接地点を引数に渡した時,マップの要素は引数のと同じになるべき")
32 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
34 MapState map_state(map_point);
36 SUBCASE(
"マップのサイズは引数と同じサイズになるべき")
38 CHECK(map_state.GetMapPointSize() == map_point.size());
41 SUBCASE(
"追加した順番で脚接地可能点を取得できるべき")
43 CHECK(map_state.GetMapPoint(0) == map_point[0]);
44 CHECK(map_state.GetMapPoint(1) == map_point[1]);
48 TEST_CASE(
"コピーコンストラクタの呼び出し時,コピー元と同じになるべき")
50 SUBCASE(
"初期化時,コピー元と同じデータサイズになるべき")
52 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
54 MapState map_state(map_point);
55 MapState map_state_copy(map_state);
57 CHECK(map_state_copy.GetMapPointSize() == map_state.GetMapPointSize());
60 SUBCASE(
"初期化時,コピー元と同じデータが取得できるべき")
62 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
64 MapState map_state(map_point);
65 MapState map_state_copy(map_state);
67 CHECK(map_state_copy.GetMapPoint(0) == map_state.GetMapPoint(0));
68 CHECK(map_state_copy.GetMapPoint(1) == map_state.GetMapPoint(1));
78 TEST_CASE(
"代入した時,代入元と同じサイズになるべき")
80 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
82 MapState map_state(map_point);
83 MapState map_state_copy = map_state;
85 CHECK(map_state_copy.GetMapPointSize() == map_state.GetMapPointSize());
88 TEST_CASE(
"代入した時,代入元と同じデータが取得できるべき")
90 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
92 MapState map_state(map_point);
93 MapState map_state_copy = map_state;
95 CHECK(map_state_copy.GetMapPoint(0) == map_state.GetMapPoint(0));
96 CHECK(map_state_copy.GetMapPoint(1) == map_state.GetMapPoint(1));
105 TEST_CASE(
"0番目にデータをセットした時,マップのサイズは変わるべきでない")
107 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
108 Vector3 map_point_set = { 7, 8, 9 };
110 MapState map_state(map_point);
112 map_state.SetMapPoint(0, map_point_set);
114 CHECK(map_state.GetMapPointSize() == map_point.size());
117 TEST_CASE(
"0番目にデータをセットした時,0番の脚接地点が書き換わるべき")
119 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
120 Vector3 map_point_set = { 7, 8, 9 };
122 MapState map_state(map_point);
124 map_state.SetMapPoint(0, map_point_set);
126 CHECK(map_state.GetMapPoint(0) == map_point_set);
127 CHECK(map_state.GetMapPoint(1) == map_point[1]);
136 TEST_CASE(
"3つの脚接地点をセットした時,マップのサイズは3になるべき")
140 std::vector<Vector3> map_point_set = { {7, 8, 9}, {10, 11, 12}, {13, 14, 15} };
144 map_state.SetMapPointVec(map_point_set);
146 CHECK(map_state.GetMapPointSize() == map_point_set.size());
149 SUBCASE(
"マップにデータがある時")
151 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
152 std::vector<Vector3> map_point_set = { {7, 8, 9}, {10, 11, 12}, {13, 14, 15} };
154 MapState map_state(map_point);
156 map_state.SetMapPointVec(map_point_set);
158 CHECK(map_state.GetMapPointSize() == map_point_set.size());
162 TEST_CASE(
"3つの脚接地点をセットした時,0番から順に脚接地点が書き換わるべき")
166 std::vector<Vector3> map_point_set = { {7, 8, 9}, {10, 11, 12}, {13, 14, 15} };
170 map_state.SetMapPointVec(map_point_set);
172 CHECK(map_state.GetMapPoint(0) == map_point_set[0]);
173 CHECK(map_state.GetMapPoint(1) == map_point_set[1]);
174 CHECK(map_state.GetMapPoint(2) == map_point_set[2]);
177 SUBCASE(
"マップにデータがある時")
179 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
180 std::vector<Vector3> map_point_set = { {7, 8, 9}, {10, 11, 12}, {13, 14, 15} };
182 MapState map_state(map_point);
184 map_state.SetMapPointVec(map_point_set);
186 CHECK(map_state.GetMapPoint(0) == map_point_set[0]);
187 CHECK(map_state.GetMapPoint(1) == map_point_set[1]);
188 CHECK(map_state.GetMapPoint(2) == map_point_set[2]);
198 TEST_CASE(
"2回呼び出した時,マップのサイズは2増えるべき")
200 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
202 CHECK_EQ(map_point.size(), 2);
204 MapState map_state(map_point);
206 map_state.AddMapPoint({ 7, 8, 9 });
207 map_state.AddMapPoint({ 10, 11, 12 });
209 CHECK_EQ(map_state.GetMapPointSize(), 4);
212 TEST_CASE(
"2回呼び出した時,追加した順番で脚接地可能点を取得できるべき")
214 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
216 MapState map_state(map_point);
218 map_state.AddMapPoint({ 7, 8, 9 });
219 map_state.AddMapPoint({ 10, 11, 12 });
221 CHECK_EQ(map_state.GetMapPoint(0), map_point[0]);
222 CHECK_EQ(map_state.GetMapPoint(1), map_point[1]);
223 CHECK_EQ(map_state.GetMapPoint(2), Vector3(7, 8, 9));
224 CHECK_EQ(map_state.GetMapPoint(3), Vector3(10, 11, 12));
233 TEST_CASE(
"ClearMapPoint")
235 SUBCASE(
"2つの脚接地点を消去した時,マップのサイズは0になるべき")
237 std::vector<Vector3> map_point = { {1, 2, 3}, {4, 5, 6} };
239 MapState map_state(map_point);
241 map_state.ClearMapPoint();
243 CHECK_EQ(map_state.GetMapPointSize(), 0);