From 3af76fcf3787878e53ac6a9c14f4023cb6f0e18d Mon Sep 17 00:00:00 2001 From: XLS Team Date: Mon, 8 Apr 2024 21:46:51 -0700 Subject: [PATCH] Automated Code Change PiperOrigin-RevId: 623047419 --- xls/common/math_util_test.cc | 4 +- xls/common/strong_int_test.cc | 72 +++++++++++++++++------------------ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/xls/common/math_util_test.cc b/xls/common/math_util_test.cc index aeefa27269..7f481f23c4 100644 --- a/xls/common/math_util_test.cc +++ b/xls/common/math_util_test.cc @@ -62,7 +62,7 @@ void TestCeilOfRatio(const IntegralType test_data[][kNumTestArguments], template void TestCeilOfRatioUnsigned() { - typedef std::numeric_limits Limits; + using Limits = std::numeric_limits; EXPECT_TRUE(Limits::is_integer); EXPECT_FALSE(Limits::is_signed); const UnsignedIntegralType kMax = Limits::max(); @@ -93,7 +93,7 @@ void TestCeilOfRatioUnsigned() { template void TestCeilOfRatioSigned() { - typedef std::numeric_limits Limits; + using Limits = std::numeric_limits; EXPECT_TRUE(Limits::is_integer); EXPECT_TRUE(Limits::is_signed); const SignedInteger kMin = Limits::min(); diff --git a/xls/common/strong_int_test.cc b/xls/common/strong_int_test.cc index b8472a2060..f8312899d1 100644 --- a/xls/common/strong_int_test.cc +++ b/xls/common/strong_int_test.cc @@ -61,7 +61,7 @@ TYPED_TEST_SUITE(StrongIntTest, SupportedStrongIntTypes); // comparison operators which must themselves be tested. TYPED_TEST(StrongIntTest, TestTraits) { - typedef typename TestFixture::StrongIntTypeUnderTest T; + using T = typename TestFixture::StrongIntTypeUnderTest; EXPECT_TRUE(std::is_standard_layout::value); EXPECT_TRUE(std::is_trivially_copy_constructible::value); EXPECT_TRUE(std::is_trivially_copy_assignable::value); @@ -69,8 +69,8 @@ TYPED_TEST(StrongIntTest, TestTraits) { } TYPED_TEST(StrongIntTest, TestCtors) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; { // Test default construction. T x; @@ -217,17 +217,17 @@ struct PositiveValidator { } // namespace TYPED_TEST(StrongIntTest, TestCtorDeath) { - typedef typename TestFixture::StrongIntTypeUnderTest::ValueType V; + using V = typename TestFixture::StrongIntTypeUnderTest::ValueType; if (std::numeric_limits::is_signed) { struct CustomTag {}; - typedef StrongInt T; + using T = StrongInt; EXPECT_DEATH(T(static_cast(-123)), "PositiveValidator"); } } TYPED_TEST(StrongIntTest, TestMetadata) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; T t; EXPECT_EQ(std::numeric_limits::max(), t.Max()); @@ -235,8 +235,8 @@ TYPED_TEST(StrongIntTest, TestMetadata) { } TYPED_TEST(StrongIntTest, TestUnaryOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; { // Test unary plus and minus of positive values. T x(123); @@ -276,8 +276,8 @@ TYPED_TEST(StrongIntTest, TestUnaryOperators) { } TYPED_TEST(StrongIntTest, TestIncrementDecrementOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; { // Test simple increments and decrements. T x(0); @@ -294,7 +294,7 @@ TYPED_TEST(StrongIntTest, TestIncrementDecrementOperators) { } TYPED_TEST(StrongIntTest, TestAssignmentOperator) { - typedef typename TestFixture::StrongIntTypeUnderTest T; + using T = typename TestFixture::StrongIntTypeUnderTest; { // Test simple assignment from the same type. T x(12); T y(34); @@ -326,8 +326,8 @@ TYPED_TEST(StrongIntTest, TestAssignmentOperator) { } TYPED_TEST(StrongIntTest, TestPlusOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test positive vs. positive addition. TEST_T_OP_T(9, +, 3) @@ -354,8 +354,8 @@ TYPED_TEST(StrongIntTest, TestPlusOperators) { } TYPED_TEST(StrongIntTest, TestMinusOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test positive vs. positive subtraction. TEST_T_OP_T(9, -, 3) @@ -409,8 +409,8 @@ TYPED_TEST(StrongIntTest, TestMinusOperators) { } TYPED_TEST(StrongIntTest, TestMultiplyOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test positive vs. positive multiplication. TEST_T_OP_NUM(9, *, V, 3); @@ -481,8 +481,8 @@ TYPED_TEST(StrongIntTest, TestMultiplyOperators) { } TYPED_TEST(StrongIntTest, TestDivideOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test positive vs. positive division. TEST_T_OP_NUM(9, /, V, 3); @@ -529,8 +529,8 @@ TYPED_TEST(StrongIntTest, TestDivideOperators) { } TYPED_TEST(StrongIntTest, TestModuloOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test positive vs. positive modulo. TEST_T_OP_NUM(7, %, V, 6); @@ -575,8 +575,8 @@ TYPED_TEST(StrongIntTest, TestModuloOperators) { } TYPED_TEST(StrongIntTest, TestLeftShiftOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test basic shift. TEST_T_OP_NUM(0x09, <<, int, 3); @@ -595,8 +595,8 @@ TYPED_TEST(StrongIntTest, TestLeftShiftOperators) { } TYPED_TEST(StrongIntTest, TestRightShiftOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test basic shift. TEST_T_OP_NUM(0x09, >>, int, 3); @@ -615,8 +615,8 @@ TYPED_TEST(StrongIntTest, TestRightShiftOperators) { } TYPED_TEST(StrongIntTest, TestBitAndOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test basic bit-and. TEST_T_OP_T(0x09, &, 0x03); @@ -635,8 +635,8 @@ TYPED_TEST(StrongIntTest, TestBitAndOperators) { } TYPED_TEST(StrongIntTest, TestBitOrOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test basic bit-or. TEST_T_OP_T(0x09, |, 0x03); @@ -655,8 +655,8 @@ TYPED_TEST(StrongIntTest, TestBitOrOperators) { } TYPED_TEST(StrongIntTest, TestBitXorOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; - typedef typename T::ValueType V; + using T = typename TestFixture::StrongIntTypeUnderTest; + using V = typename T::ValueType; // Test basic bit-xor. TEST_T_OP_T(0x09, ^, 0x03); @@ -675,7 +675,7 @@ TYPED_TEST(StrongIntTest, TestBitXorOperators) { } TYPED_TEST(StrongIntTest, TestComparisonOperators) { - typedef typename TestFixture::StrongIntTypeUnderTest T; + using T = typename TestFixture::StrongIntTypeUnderTest; T x(93); @@ -715,7 +715,7 @@ TYPED_TEST(StrongIntTest, TestComparisonOperators) { } TYPED_TEST(StrongIntTest, TestStreamOutputOperator) { - typedef typename TestFixture::StrongIntTypeUnderTest T; + using T = typename TestFixture::StrongIntTypeUnderTest; T x(93); std::ostringstream out; @@ -724,7 +724,7 @@ TYPED_TEST(StrongIntTest, TestStreamOutputOperator) { } TYPED_TEST(StrongIntTest, TestHasher) { - typedef typename TestFixture::StrongIntTypeUnderTest T; + using T = typename TestFixture::StrongIntTypeUnderTest; typename T::Hasher hasher; EXPECT_EQ(hasher(T(0)), hasher(T(0))); @@ -799,7 +799,7 @@ TYPED_TEST(StrongIntTest, ConstexprMinMax) { template bool ExhaustiveTest() { - typedef typename Ttest::ValueType V; + using V = typename Ttest::ValueType; Tbig v_min = std::numeric_limits::min(); Tbig v_max = std::numeric_limits::max(); for (Tbig lhs = v_min; lhs <= v_max; ++lhs) {