diff --git a/googlemock/test/gmock_stress_test.cc b/googlemock/test/gmock_stress_test.cc index 9e42cd935..f45cf67a6 100644 --- a/googlemock/test/gmock_stress_test.cc +++ b/googlemock/test/gmock_stress_test.cc @@ -30,6 +30,8 @@ // Tests that Google Mock constructs can be used in a large number of // threads concurrently. +#include + #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -188,7 +190,7 @@ TEST(StressTest, CanUseGMockWithThreads) { &TestPartiallyOrderedExpectationsWithThreads, }; - const int kRoutines = sizeof(test_routines) / sizeof(test_routines[0]); + const int kRoutines = std::size(test_routines); const int kCopiesOfEachRoutine = kMaxTestThreads / kRoutines; const int kTestThreads = kCopiesOfEachRoutine * kRoutines; ThreadWithParam* threads[kTestThreads] = {};