From 2c4ce9b2ad339b0cd2a3a4d67a62e288d5b23ef4 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 7 Sep 2023 07:47:12 -0700 Subject: Rename x86 crc_memcpy tests since they cover ARM as well This is a rename only with no other changes. PiperOrigin-RevId: 563428969 Change-Id: Iefc184bf9a233cb72649bc20b8555f6b662cac6d --- absl/crc/internal/crc_memcpy_test.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'absl/crc') diff --git a/absl/crc/internal/crc_memcpy_test.cc b/absl/crc/internal/crc_memcpy_test.cc index a4c6a012..045a1e5e 100644 --- a/absl/crc/internal/crc_memcpy_test.cc +++ b/absl/crc/internal/crc_memcpy_test.cc @@ -33,7 +33,7 @@ namespace { enum CrcEngine { - X86 = 0, + ACCELERATED = 0, NONTEMPORAL = 1, FALLBACK = 2, }; @@ -66,10 +66,10 @@ typedef CrcMemcpyTest<4500> CrcSmallTest; typedef CrcMemcpyTest<(1 << 24)> CrcLargeTest; // Parametrize the small test so that it can be done with all configurations. template -class x86ParamTestTemplate : public CrcSmallTest, - public ::testing::WithParamInterface { +class EngineParamTestTemplate : public CrcSmallTest, + public ::testing::WithParamInterface { protected: - x86ParamTestTemplate() { + EngineParamTestTemplate() { if (GetParam().crc_engine_selector == FALLBACK) { engine_ = std::make_unique(); } else if (GetParam().crc_engine_selector == NONTEMPORAL) { @@ -89,14 +89,14 @@ class x86ParamTestTemplate : public CrcSmallTest, std::unique_ptr engine_; }; struct TestParams { - CrcEngine crc_engine_selector = X86; + CrcEngine crc_engine_selector = ACCELERATED; int vector_lanes = 0; int integer_lanes = 0; }; -using x86ParamTest = x86ParamTestTemplate; +using EngineParamTest = EngineParamTestTemplate; // SmallCorrectness is designed to exercise every possible set of code paths // in the memcpy code, not including the loop. -TEST_P(x86ParamTest, SmallCorrectnessCheckSourceAlignment) { +TEST_P(EngineParamTest, SmallCorrectnessCheckSourceAlignment) { constexpr size_t kTestSizes[] = {0, 100, 255, 512, 1024, 4000, kMaxCopySize}; for (size_t source_alignment = 0; source_alignment < kAlignment; @@ -130,7 +130,7 @@ TEST_P(x86ParamTest, SmallCorrectnessCheckSourceAlignment) { } } -TEST_P(x86ParamTest, SmallCorrectnessCheckDestAlignment) { +TEST_P(EngineParamTest, SmallCorrectnessCheckDestAlignment) { constexpr size_t kTestSizes[] = {0, 100, 255, 512, 1024, 4000, kMaxCopySize}; for (size_t dest_alignment = 0; dest_alignment < kAlignment; @@ -163,11 +163,12 @@ TEST_P(x86ParamTest, SmallCorrectnessCheckDestAlignment) { } } -INSTANTIATE_TEST_SUITE_P(x86ParamTest, x86ParamTest, +INSTANTIATE_TEST_SUITE_P(EngineParamTest, EngineParamTest, ::testing::Values( // Tests for configurations that may occur in prod. - TestParams{X86, 3, 0}, TestParams{X86, 1, 2}, - TestParams{X86, 1, 0}, + TestParams{ACCELERATED, 3, 0}, + TestParams{ACCELERATED, 1, 2}, + TestParams{ACCELERATED, 1, 0}, // Fallback test. TestParams{FALLBACK, 0, 0}, // Non Temporal -- cgit v1.2.3