From ca885e31e95a2c5d64ca8f6a034128862a253fee Mon Sep 17 00:00:00 2001 From: Oliver Lee Date: Mon, 23 Oct 2023 13:13:20 -0700 Subject: [PATCH] Fix UB in Gtest example Replace `int` with `unsigned` to prevent UB from signed integer overflow. --- examples/gtest/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gtest/main.cpp b/examples/gtest/main.cpp index ceaee2a3..8f73c0d7 100644 --- a/examples/gtest/main.cpp +++ b/examples/gtest/main.cpp @@ -70,7 +70,7 @@ class MyTypedFixture : public ::testing::Test { }; // A typed suite can be defined as usual ... -using TestTypes = ::testing::Types; +using TestTypes = ::testing::Types; TYPED_TEST_SUITE(MyTypedFixture, TestTypes, ); // ... and used with properties ...