Check whether DoCommand test execution changes the random seed
This commit is contained in:
@@ -49,7 +49,7 @@ static inline void SaveRandomSeeds(SavedRandomSeeds *storage)
|
||||
|
||||
/**
|
||||
* Restores previously saved seeds
|
||||
* @param storage Storage where SaveRandomSeeds() stored th seeds
|
||||
* @param storage Storage where SaveRandomSeeds() stored the seeds
|
||||
*/
|
||||
static inline void RestoreRandomSeeds(const SavedRandomSeeds &storage)
|
||||
{
|
||||
@@ -57,6 +57,22 @@ static inline void RestoreRandomSeeds(const SavedRandomSeeds &storage)
|
||||
_interactive_random = storage.interactive_random;
|
||||
}
|
||||
|
||||
struct GameRandomSeedChecker {
|
||||
private:
|
||||
Randomizer random;
|
||||
|
||||
public:
|
||||
GameRandomSeedChecker()
|
||||
{
|
||||
this->random = _random;
|
||||
}
|
||||
|
||||
bool Check() const
|
||||
{
|
||||
return (this->random.state[0] == _random.state[0] && this->random.state[1] == _random.state[1]);
|
||||
}
|
||||
};
|
||||
|
||||
void SetRandomSeed(uint32 seed);
|
||||
#ifdef RANDOM_DEBUG
|
||||
#ifdef __APPLE__
|
||||
|
Reference in New Issue
Block a user