summary refs log tree commit diff stats
path: root/App
diff options
context:
space:
mode:
Diffstat (limited to 'App')
-rw-r--r--App/Version.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/App/Version.h b/App/Version.h index 1167925..2cde34a 100644 --- a/App/Version.h +++ b/App/Version.h
@@ -5,7 +5,7 @@
5 5
6#define MAJOR 5 6#define MAJOR 5
7#define MINOR 0 7#define MINOR 0
8#define PATCH 0 8#define PATCH 1
9 9
10#define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH) 10#define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH)
11#define VERSION MAJOR, MINOR, PATCH 11#define VERSION MAJOR, MINOR, PATCH
a6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include "gtest/gtest.h"
#include "Random.h"

TEST(RandomTests, RandomInRange) {
	int random1 = Random::RandInt(0, 1 << 30);
	int random2 = Random::RandInt(0, 1 << 30);
	ASSERT_NE(random1, random2);
	if (random1 > random2) std::swap(random1, random2);
	int random3 = Random::RandInt(random1, random2);
	ASSERT_GE(random3, random1);
	ASSERT_LE(random3, random2);
}

TEST(RandomTests, SeedWorks) {
	Random::SetSeed(0);
	ASSERT_EQ(2531011, Random::RandInt(0, 1 << 30));
	ASSERT_EQ(505908858, Random::RandInt(0, 1 << 30));
	ASSERT_EQ(318135124, Random::RandInt(0, 1 << 30));
	ASSERT_EQ(159719620, Random::RandInt(0, 1 << 30));
	Random::SetSeed(0);
	ASSERT_EQ(2531011, Random::RandInt(0, 1 << 30));
}

TEST(RandomTests, SeedChangesInitialValue) {
	Random::SetSeed(0);
	int random1 = Random::RandInt(0, 1 << 30);
	Random::SetSeed(1);
	int random2 = Random::RandInt(0, 1 << 30);
	ASSERT_NE(random1, random2);

	Random::SetSeed(2);
	int random3 = Random::RandInt(0, 1 << 30);
	ASSERT_NE(random3, random1);
	ASSERT_NE(random3, random2);
}