aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--googletest/docs/Primer.md2
-rw-r--r--googletest/samples/sample3_unittest.cc2
-rw-r--r--googletest/src/gtest.cc3
3 files changed, 4 insertions, 3 deletions
diff --git a/googletest/docs/Primer.md b/googletest/docs/Primer.md
index 474c1d2a..be6ad38b 100644
--- a/googletest/docs/Primer.md
+++ b/googletest/docs/Primer.md
@@ -382,7 +382,7 @@ When invoked, the `RUN_ALL_TESTS()` macro:
1. Restores the state of all Google Test flags.
1. Repeats the above steps for the next test, until all tests have run.
-In addition, if the text fixture's constructor generates a fatal failure in
+In addition, if the test fixture's constructor generates a fatal failure in
step 2, there is no point for step 3 - 5 and they are thus skipped. Similarly,
if step 3 generates a fatal failure, step 4 will be skipped.
diff --git a/googletest/samples/sample3_unittest.cc b/googletest/samples/sample3_unittest.cc
index bf3877d0..a4fbe5a0 100644
--- a/googletest/samples/sample3_unittest.cc
+++ b/googletest/samples/sample3_unittest.cc
@@ -72,7 +72,7 @@ class QueueTest : public testing::Test {
// accessed from sub-classes.
// virtual void SetUp() will be called before each test is run. You
- // should define it if you need to initialize the varaibles.
+ // should define it if you need to initialize the variables.
// Otherwise, this can be skipped.
virtual void SetUp() {
q1_.Enqueue(1);
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index e04a1c67..46d8d21b 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -310,7 +310,8 @@ namespace internal {
// than kMaxRange.
UInt32 Random::Generate(UInt32 range) {
// These constants are the same as are used in glibc's rand(3).
- state_ = (1103515245U*state_ + 12345U) % kMaxRange;
+ // Use wider types than necessary to prevent unsigned overflow diagnostics.
+ state_ = static_cast<UInt32>(1103515245ULL*state_ + 12345U) % kMaxRange;
GTEST_CHECK_(range > 0)
<< "Cannot generate a number in the range [0, 0).";