File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,17 @@ target_link_libraries(
3939)
4040
4141gtest_discover_tests(sprite_test)
42+
43+ # stage_test
44+ add_executable (
45+ stage_test
46+ stage_test.cpp
47+ )
48+
49+ target_link_libraries (
50+ stage_test
51+ GTest::gtest_main
52+ scratchcpp
53+ )
54+
55+ gtest_discover_tests(stage_test)
Original file line number Diff line number Diff line change 1+ #include " scratch/stage.h"
2+ #include " ../common.h"
3+
4+ using namespace libscratchcpp ;
5+
6+ TEST (StageTest, VideoState)
7+ {
8+ Stage stage;
9+ ASSERT_EQ (stage.videoState (), Stage::VideoState::Off); // default
10+ ASSERT_EQ (stage.videoStateStr (), " off" );
11+
12+ stage.setVideoState (Stage::VideoState::On);
13+ ASSERT_EQ (stage.videoStateStr (), " on" );
14+
15+ stage.setVideoState (Stage::VideoState::OnFlipped);
16+ ASSERT_EQ (stage.videoStateStr (), " on-flipped" );
17+
18+ stage.setVideoState (Stage::VideoState::Off);
19+ ASSERT_EQ (stage.videoStateStr (), " off" );
20+ }
You can’t perform that action at this time.
0 commit comments