summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-09-07 07:47:12 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-09-07 07:48:00 -0700
commit2c4ce9b2ad339b0cd2a3a4d67a62e288d5b23ef4 (patch)
tree9b33dc7566bf81e14caa6b888039a15f48ea8032
parent433289a2586aa959241cf73675eadefaf21211b1 (diff)
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
-rw-r--r--absl/crc/internal/crc_memcpy_test.cc23
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