@@ -909,57 +909,54 @@ TEST_F(LooksBlocksTest, SwitchCostumeTo_Stage)
909909 ASSERT_EQ (stage->costumeIndex (), 0 );
910910}
911911
912- TEST_F (LooksBlocksTest, NextCostume )
912+ TEST_F (LooksBlocksTest, NextCostume_Sprite )
913913{
914- {
915- auto sprite = std::make_shared<Sprite>();
916- auto costume1 = std::make_shared<Costume>(" costume1" , " a" , " png" );
917- auto costume2 = std::make_shared<Costume>(" costume2" , " b" , " png" );
918- auto testCostume = std::make_shared<Costume>(" test" , " c" , " svg" );
919- sprite->addCostume (costume1);
920- sprite->addCostume (costume2);
921- sprite->addCostume (testCostume);
922-
923- ScriptBuilder builder (m_extension.get (), m_engine, sprite);
914+ auto sprite = std::make_shared<Sprite>();
915+ auto costume1 = std::make_shared<Costume>(" costume1" , " a" , " png" );
916+ auto costume2 = std::make_shared<Costume>(" costume2" , " b" , " png" );
917+ auto testCostume = std::make_shared<Costume>(" test" , " c" , " svg" );
918+ sprite->addCostume (costume1);
919+ sprite->addCostume (costume2);
920+ sprite->addCostume (testCostume);
924921
925- builder.addBlock (" looks_nextcostume" );
926- builder.build ();
922+ ScriptBuilder builder (m_extension.get (), m_engine, sprite);
927923
928- sprite->setCostumeIndex (0 );
929- builder.run ();
930- ASSERT_EQ (sprite->costumeIndex (), 1 );
924+ builder.addBlock (" looks_nextcostume" );
925+ builder.build ();
931926
932- builder.run ();
933- ASSERT_EQ (sprite->costumeIndex (), 2 );
927+ sprite->setCostumeIndex (0 );
928+ builder.run ();
929+ ASSERT_EQ (sprite->costumeIndex (), 1 );
934930
935- builder.run ();
936- ASSERT_EQ (sprite->costumeIndex (), 0 );
937- }
931+ builder.run ();
932+ ASSERT_EQ (sprite->costumeIndex (), 2 );
938933
939- m_engine->clear ();
934+ builder.run ();
935+ ASSERT_EQ (sprite->costumeIndex (), 0 );
936+ }
940937
941- {
942- auto stage = std::make_shared<Stage>();
943- auto costume1 = std::make_shared<Costume>(" costume1" , " a" , " png" );
944- auto costume2 = std::make_shared<Costume>(" costume2" , " b" , " png" );
945- auto testCostume = std::make_shared<Costume>(" test" , " c" , " svg" );
946- stage->addCostume (costume1);
947- stage->addCostume (costume2);
948- stage->addCostume (testCostume);
938+ TEST_F (LooksBlocksTest, NextCostume_Stage)
939+ {
940+ auto stage = std::make_shared<Stage>();
941+ auto costume1 = std::make_shared<Costume>(" costume1" , " a" , " png" );
942+ auto costume2 = std::make_shared<Costume>(" costume2" , " b" , " png" );
943+ auto testCostume = std::make_shared<Costume>(" test" , " c" , " svg" );
944+ stage->addCostume (costume1);
945+ stage->addCostume (costume2);
946+ stage->addCostume (testCostume);
949947
950- ScriptBuilder builder (m_extension.get (), m_engine, stage);
948+ ScriptBuilder builder (m_extension.get (), m_engine, stage);
951949
952- builder.addBlock (" looks_nextcostume" );
953- builder.build ();
950+ builder.addBlock (" looks_nextcostume" );
951+ builder.build ();
954952
955- stage->setCostumeIndex (0 );
956- builder.run ();
957- ASSERT_EQ (stage->costumeIndex (), 1 );
953+ stage->setCostumeIndex (0 );
954+ builder.run ();
955+ ASSERT_EQ (stage->costumeIndex (), 1 );
958956
959- builder.run ();
960- ASSERT_EQ (stage->costumeIndex (), 2 );
957+ builder.run ();
958+ ASSERT_EQ (stage->costumeIndex (), 2 );
961959
962- builder.run ();
963- ASSERT_EQ (stage->costumeIndex (), 0 );
964- }
960+ builder.run ();
961+ ASSERT_EQ (stage->costumeIndex (), 0 );
965962}
0 commit comments