Skip to content

Commit 043704a

Browse files
authored
Merge pull request #306 from scratchcpp/engine_test_projects
Add Engine test projects
2 parents a475b03 + da5cb26 commit 043704a

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

test/broadcasts.sb3

2.25 KB
Binary file not shown.

test/engine/engine_test.cpp

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,72 @@ TEST(EngineTest, CloneLimit)
673673
ASSERT_EQ(GET_VAR(stage, "test5")->value().toString(), "2 2 0 0");
674674
}*/
675675

676+
// TODO: Uncomment this after fixing #256 and #257
677+
/*TEST(EngineTest, BroadcastsProject)
678+
{
679+
// TODO: Set "infinite" FPS (#254)
680+
Project p("broadcasts.sb3");
681+
ASSERT_TRUE(p.load());
682+
p.run();
683+
684+
auto engine = p.engine();
685+
686+
Stage *stage = engine->stage();
687+
ASSERT_TRUE(stage);
688+
689+
ASSERT_VAR(stage, "test1");
690+
ASSERT_EQ(GET_VAR(stage, "test1")->value().toInt(), 4);
691+
ASSERT_VAR(stage, "test2");
692+
ASSERT_EQ(GET_VAR(stage, "test2")->value().toInt(), 14);
693+
ASSERT_VAR(stage, "test3");
694+
ASSERT_EQ(GET_VAR(stage, "test3")->value().toInt(), 10);
695+
ASSERT_VAR(stage, "test4");
696+
ASSERT_EQ(GET_VAR(stage, "test4")->value().toInt(), 10);
697+
ASSERT_VAR(stage, "test5");
698+
ASSERT_EQ(GET_VAR(stage, "test5")->value().toString(), "2 2 0 0");
699+
}*/
700+
701+
// TODO: Uncomment this after fixing #305
702+
/*TEST(EngineTest, StopAll)
703+
{
704+
Project p("stop_all.sb3");
705+
ASSERT_TRUE(p.load());
706+
p.run();
707+
708+
auto engine = p.engine();
709+
710+
Stage *stage = engine->stage();
711+
ASSERT_TRUE(stage);
712+
713+
ASSERT_VAR(stage, "i");
714+
ASSERT_EQ(GET_VAR(stage, "i")->value().toInt(), 11);
715+
}*/
716+
717+
// TODO: Uncomment this after fixing #305
718+
/*TEST(EngineTest, StopOtherScriptsInSprite)
719+
{
720+
Project p("stop_other_scripts_in_sprite.sb3");
721+
ASSERT_TRUE(p.load());
722+
p.run();
723+
724+
auto engine = p.engine();
725+
726+
Stage *stage = engine->stage();
727+
ASSERT_TRUE(stage);
728+
729+
ASSERT_VAR(stage, "i");
730+
ASSERT_EQ(GET_VAR(stage, "i")->value().toInt(), 10);
731+
732+
ASSERT_VAR(stage, "j");
733+
ASSERT_EQ(GET_VAR(stage, "j")->value().toInt(), 109);
734+
735+
ASSERT_VAR(stage, "k");
736+
ASSERT_EQ(GET_VAR(stage, "k")->value().toInt(), 10);
737+
738+
ASSERT_VAR(stage, "l");
739+
ASSERT_EQ(GET_VAR(stage, "l")->value().toInt(), 110);
740+
}*/
741+
676742
TEST(EngineTest, NoCrashAfterStop)
677743
{
678744
// Regtest for #186

test/stop_all.sb3

1.6 KB
Binary file not shown.
1.96 KB
Binary file not shown.

0 commit comments

Comments
 (0)