summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-02-12 07:12:20 (GMT)
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-02-12 07:12:20 (GMT)
commit0980b4bd66b496074d9e34d9f05244e700e9406d (patch)
treeac443055980ad47b0989eac214761745e891d151 /src
parent6642ca8cd46cf905b45e8f71532922df4d03800d (diff)
downloadgoogletest-0980b4bd66b496074d9e34d9f05244e700e9406d.zip
googletest-0980b4bd66b496074d9e34d9f05244e700e9406d.tar.gz
googletest-0980b4bd66b496074d9e34d9f05244e700e9406d.tar.bz2
Fixes off-by-one error in a message about test sharding (by David Glasser).
Diffstat (limited to 'src')
-rw-r--r--src/gtest.cc5
1 files changed, 3 insertions, 2 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));
}