diff options
Diffstat (limited to 'absl/crc/internal/crc_memcpy_test.cc')
-rw-r--r-- | absl/crc/internal/crc_memcpy_test.cc | 23 |
1 files changed, 12 insertions, 11 deletions
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 <typename ParamsT> -class x86ParamTestTemplate : public CrcSmallTest, - public ::testing::WithParamInterface<ParamsT> { +class EngineParamTestTemplate : public CrcSmallTest, + public ::testing::WithParamInterface<ParamsT> { protected: - x86ParamTestTemplate() { + EngineParamTestTemplate() { if (GetParam().crc_engine_selector == FALLBACK) { engine_ = std::make_unique<absl::crc_internal::FallbackCrcMemcpyEngine>(); } else if (GetParam().crc_engine_selector == NONTEMPORAL) { @@ -89,14 +89,14 @@ class x86ParamTestTemplate : public CrcSmallTest, std::unique_ptr<absl::crc_internal::CrcMemcpyEngine> engine_; }; struct TestParams { - CrcEngine crc_engine_selector = X86; + CrcEngine crc_engine_selector = ACCELERATED; int vector_lanes = 0; int integer_lanes = 0; }; -using x86ParamTest = x86ParamTestTemplate<TestParams>; +using EngineParamTest = EngineParamTestTemplate<TestParams>; // 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 |