summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-02-12 07:12:20 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-02-12 07:12:20 +0000
commit22d36b42fbb9db2e0c814a7a1cc9279153fdfa31 (patch)
treeac443055980ad47b0989eac214761745e891d151
parentb2bb64da541aff87fecb2c531288e9f27e691996 (diff)
downloadgoogletest-22d36b42fbb9db2e0c814a7a1cc9279153fdfa31.tar.gz
Fixes off-by-one error in a message about test sharding (by David Glasser).
git-svn-id: http://googletest.googlecode.com/svn/trunk@543 861a406c-534a-0410-8894-cb66d6ee9925
-rw-r--r--src/gtest.cc5
-rw-r--r--test/gtest_output_test_golden_lin.txt2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/gtest.cc b/src/gtest.cc
index 1c58c6f..53a52fb 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -2716,9 +2716,10 @@ void PrettyUnitTestResultPrinter::OnTestIterationStart(
}
if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {
+ const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
ColoredPrintf(COLOR_YELLOW,
- "Note: This is test shard %s of %s.\n",
- internal::posix::GetEnv(kTestShardIndex),
+ "Note: This is test shard %d of %s.\n",
+ static_cast<int>(shard_index) + 1,
internal::posix::GetEnv(kTestTotalShards));
}
diff --git a/test/gtest_output_test_golden_lin.txt b/test/gtest_output_test_golden_lin.txt
index 0ba9968..a1d342d 100644
--- a/test/gtest_output_test_golden_lin.txt
+++ b/test/gtest_output_test_golden_lin.txt
@@ -697,7 +697,7 @@ Note: Google Test filter = *DISABLED_*
[==========] 1 test from 1 test case ran.
[ PASSED ] 1 test.
Note: Google Test filter = PassingTest.*
-Note: This is test shard 1 of 2.
+Note: This is test shard 2 of 2.
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from PassingTest