diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h index 2ebfcd39e..28ab664cd 100644 --- a/googletest/src/gtest-internal-inl.h +++ b/googletest/src/gtest-internal-inl.h @@ -587,7 +587,7 @@ class GTEST_API_ UnitTestImpl { // total_test_suite_count() - 1. If i is not in that range, returns NULL. const TestSuite* GetTestSuite(int i) const { const int index = GetElementOr(test_suite_indices_, i, -1); - return index < 0 ? nullptr : test_suites_[static_cast(i)]; + return index < 0 ? nullptr : test_suites_[static_cast(index)]; } // Legacy API is deprecated but still available