Skip to content

Commit 4e2243f

Browse files
committed
Reset random generator in motion blocks test
1 parent f7687ed commit 4e2243f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/blocks/motion_blocks_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "blocks/motionblocks.h"
1111
#include "blocks/operatorblocks.h"
1212
#include "engine/internal/engine.h"
13+
#include "engine/internal/randomgenerator.h"
1314

1415
using namespace libscratchcpp;
1516

@@ -440,6 +441,8 @@ TEST_F(MotionBlocksTest, PointTowardsImpl)
440441
ASSERT_EQ(vm.registerCount(), 0);
441442
ASSERT_EQ(std::round(sprite.direction() * 100) / 100, intPosResults[i]);
442443
}
444+
445+
MotionBlocks::rng = RandomGenerator::instance().get();
443446
}
444447

445448
TEST_F(MotionBlocksTest, GoToXY)
@@ -621,4 +624,6 @@ TEST_F(MotionBlocksTest, GoToImpl)
621624
ASSERT_EQ(vm.registerCount(), 0);
622625
ASSERT_EQ(sprite.x(), 220);
623626
ASSERT_EQ(sprite.y(), -16);
627+
628+
MotionBlocks::rng = RandomGenerator::instance().get();
624629
}

0 commit comments

Comments
 (0)