@@ -190,7 +190,7 @@ TEST(TargetTest, Costumes)
190190 auto c3 = std::make_shared<Costume>(" costume3" , " " , " svg" );
191191
192192 TargetMock target;
193- EXPECT_CALL (target, dataSource ()).Times (15 ).WillRepeatedly (Return (nullptr ));
193+ EXPECT_CALL (target, dataSource ()).Times (17 ).WillRepeatedly (Return (nullptr ));
194194
195195 ASSERT_EQ (target.addCostume (c1), 0 );
196196 ASSERT_EQ (target.addCostume (c2), 1 );
@@ -207,6 +207,8 @@ TEST(TargetTest, Costumes)
207207 ASSERT_EQ (target.costumeAt (0 )->name (), c1->name ());
208208 ASSERT_EQ (target.costumeAt (1 )->name (), c2->name ());
209209 ASSERT_EQ (target.costumeAt (2 )->name (), c3->name ());
210+ ASSERT_EQ (target.costumeAt (3 ), nullptr );
211+ ASSERT_EQ (target.costumeAt (-1 ), nullptr );
210212
211213 ASSERT_EQ (target.findCostume (" invalid" ), -1 );
212214 ASSERT_EQ (target.findCostume (" costume1" ), 0 );
@@ -221,7 +223,7 @@ TEST(TargetTest, Costumes)
221223 ASSERT_TRUE (target.costumes ().empty ());
222224
223225 TargetMock target2;
224- EXPECT_CALL (target2, dataSource ()).Times (16 ).WillRepeatedly (Return (&source));
226+ EXPECT_CALL (target2, dataSource ()).Times (18 ).WillRepeatedly (Return (&source));
225227
226228 ASSERT_EQ (target2.addCostume (c1), 0 );
227229 ASSERT_EQ (target2.addCostume (c2), 1 );
@@ -236,6 +238,8 @@ TEST(TargetTest, Costumes)
236238 ASSERT_EQ (target2.costumeAt (0 )->name (), c1->name ());
237239 ASSERT_EQ (target2.costumeAt (1 )->name (), c2->name ());
238240 ASSERT_EQ (target2.costumeAt (2 )->name (), c3->name ());
241+ ASSERT_EQ (target2.costumeAt (3 ), nullptr );
242+ ASSERT_EQ (target2.costumeAt (-1 ), nullptr );
239243
240244 ASSERT_EQ (target2.findCostume (" invalid" ), -1 );
241245 ASSERT_EQ (target2.findCostume (" costume1" ), 0 );
@@ -260,6 +264,8 @@ TEST(TargetTest, Costumes)
260264 ASSERT_EQ (source.costumeAt (1 )->name (), c2->name ());
261265 ASSERT_EQ (source.costumeAt (2 )->name (), c3->name ());
262266 ASSERT_EQ (source.costumeAt (3 )->name (), c4->name ());
267+ ASSERT_EQ (source.costumeAt (4 ), nullptr );
268+ ASSERT_EQ (source.costumeAt (-1 ), nullptr );
263269
264270 ASSERT_EQ (source.findCostume (" invalid" ), -1 );
265271 ASSERT_EQ (source.findCostume (" costume1" ), 0 );
@@ -275,7 +281,7 @@ TEST(TargetTest, Sounds)
275281 auto s3 = std::make_shared<Sound>(" sound3" , " " , " mp3" );
276282
277283 TargetMock target;
278- EXPECT_CALL (target, dataSource ()).Times (15 ).WillRepeatedly (Return (nullptr ));
284+ EXPECT_CALL (target, dataSource ()).Times (17 ).WillRepeatedly (Return (nullptr ));
279285
280286 ASSERT_EQ (target.addSound (s1), 0 );
281287 ASSERT_EQ (target.addSound (s2), 1 );
@@ -292,6 +298,8 @@ TEST(TargetTest, Sounds)
292298 ASSERT_EQ (target.soundAt (0 )->name (), s1->name ());
293299 ASSERT_EQ (target.soundAt (1 )->name (), s2->name ());
294300 ASSERT_EQ (target.soundAt (2 )->name (), s3->name ());
301+ ASSERT_EQ (target.soundAt (3 ), nullptr );
302+ ASSERT_EQ (target.soundAt (-1 ), nullptr );
295303
296304 ASSERT_EQ (target.findSound (" invalid" ), -1 );
297305 ASSERT_EQ (target.findSound (" sound1" ), 0 );
@@ -306,7 +314,7 @@ TEST(TargetTest, Sounds)
306314 ASSERT_TRUE (target.sounds ().empty ());
307315
308316 TargetMock target2;
309- EXPECT_CALL (target2, dataSource ()).Times (16 ).WillRepeatedly (Return (&source));
317+ EXPECT_CALL (target2, dataSource ()).Times (18 ).WillRepeatedly (Return (&source));
310318
311319 ASSERT_EQ (target2.addSound (s1), 0 );
312320 ASSERT_EQ (target2.addSound (s2), 1 );
@@ -321,6 +329,8 @@ TEST(TargetTest, Sounds)
321329 ASSERT_EQ (target2.soundAt (0 )->name (), s1->name ());
322330 ASSERT_EQ (target2.soundAt (1 )->name (), s2->name ());
323331 ASSERT_EQ (target2.soundAt (2 )->name (), s3->name ());
332+ ASSERT_EQ (target2.soundAt (3 ), nullptr );
333+ ASSERT_EQ (target2.soundAt (-1 ), nullptr );
324334
325335 ASSERT_EQ (target2.findSound (" invalid" ), -1 );
326336 ASSERT_EQ (target2.findSound (" sound1" ), 0 );
@@ -345,6 +355,8 @@ TEST(TargetTest, Sounds)
345355 ASSERT_EQ (source.soundAt (1 )->name (), s2->name ());
346356 ASSERT_EQ (source.soundAt (2 )->name (), s3->name ());
347357 ASSERT_EQ (source.soundAt (3 )->name (), s4->name ());
358+ ASSERT_EQ (source.soundAt (4 ), nullptr );
359+ ASSERT_EQ (source.soundAt (-1 ), nullptr );
348360
349361 ASSERT_EQ (source.findSound (" invalid" ), -1 );
350362 ASSERT_EQ (source.findSound (" sound1" ), 0 );
0 commit comments