summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wright <jonathan.wright@arm.com>2020-07-23 16:24:45 +0100
committerJonathan Wright <jonathan.wright@arm.com>2020-08-10 14:51:20 +0100
commitf7731126b8b532d9901f1e3d5386910b290cf87d (patch)
tree1e3722fc996f77eb75ac6200e9b6f2402b136c36
parentdb870dfef8ab97950b4bdf22c66dd6c18326460b (diff)
Refactor floating-point test parameters
Floating-point test parameters differ by platform - specifically x86/x86_64 SSE differs to x86, x86_64 scalar floating-point as well as Arm AArch32, AArch64 and NEON SIMD. This commit updates the floating-point test parameters to reflect the x86/x86_64 SSE special case, rather than assuming that x86/x86_64 platforms running these tests are always executing with SSE SIMD. Bug: 993876 Change-Id: I26df82916634a0f4abb3187aa63b2e7707b536b0
-rw-r--r--BUILD.gn1
-rw-r--r--gtest/cjpeg-gtest-wrapper.cpp6
-rw-r--r--gtest/djpeg-gtest-wrapper.cpp14
-rw-r--r--testimages/testout_3x2_float_prog.jpg (renamed from testimages/testout_3x2_float_prog_arm.jpg)bin5341 -> 5341 bytes
-rw-r--r--testimages/testout_3x2_float_prog_sse.jpg (renamed from testimages/testout_3x2_float_prog_intel.jpg)bin5340 -> 5340 bytes
5 files changed, 9 insertions, 12 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 548aab5..0be68be 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -346,6 +346,7 @@ if (build_with_chromium) {
defines = [
"GTEST",
+ "WITH_SIMD",
"BMP_SUPPORTED",
"PPM_SUPPORTED",
]
diff --git a/gtest/cjpeg-gtest-wrapper.cpp b/gtest/cjpeg-gtest-wrapper.cpp
index 1fa10af..162e5fd 100644
--- a/gtest/cjpeg-gtest-wrapper.cpp
+++ b/gtest/cjpeg-gtest-wrapper.cpp
@@ -206,10 +206,10 @@ TEST(CJPEGTest, FloatProg3x2) {
EXPECT_EQ(cjpeg(9, command_line), 0);
// Compare expected MD5 sum against that of test image.
-#if defined(__arm__) || defined(__aarch64__)
- const std::string EXPECTED_MD5 = "9bca803d2042bd1eb03819e2bf92b3e5";
-#else
+#if defined(WITH_SIMD) && (defined(__i386__) || defined(__x86_64__))
const std::string EXPECTED_MD5 = "343e3f8caf8af5986ebaf0bdc13b5c71";
+#else
+ const std::string EXPECTED_MD5 = "9bca803d2042bd1eb03819e2bf92b3e5";
#endif
EXPECT_TRUE(CompareFileAndMD5(output_path, EXPECTED_MD5));
}
diff --git a/gtest/djpeg-gtest-wrapper.cpp b/gtest/djpeg-gtest-wrapper.cpp
index 43bb1af..933fb6f 100644
--- a/gtest/djpeg-gtest-wrapper.cpp
+++ b/gtest/djpeg-gtest-wrapper.cpp
@@ -756,12 +756,10 @@ TEST(DJPEGTest, GrayISlow565D) {
TEST(DJPEGTest, FloatProg3x2) {
base::FilePath input_image_path;
-#if defined(__arm__) || defined(__aarch64__)
- GetTestFilePath(&input_image_path, "testout_3x2_float_prog_arm.jpg");
-#elif defined(__i386__) || defined(__x86_64__)
- GetTestFilePath(&input_image_path, "testout_3x2_float_prog_intel.jpg");
+#if defined(WITH_SIMD) && (defined(__i386__) || defined(__x86_64__))
+ GetTestFilePath(&input_image_path, "testout_3x2_float_prog_sse.jpg");
#else
-#error "Unknown platform."
+ GetTestFilePath(&input_image_path, "testout_3x2_float_prog.jpg");
#endif
base::FilePath output_path(GetTargetDirectory());
output_path = output_path.AppendASCII("testout_3x2_float.ppm");
@@ -780,12 +778,10 @@ TEST(DJPEGTest, FloatProg3x2) {
EXPECT_EQ(djpeg(6, command_line), 0);
// Compare expected MD5 sum against that of test image.
-#if defined(__arm__) || defined(__aarch64__)
- const std::string EXPECTED_MD5 = "f6bfab038438ed8f5522fbd33595dcdc";
-#elif defined(__i386__) || defined(__x86_64__)
+#if defined(WITH_SIMD) && (defined(__i386__) || defined(__x86_64__))
const std::string EXPECTED_MD5 = "1a75f36e5904d6fc3a85a43da9ad89bb";
#else
-#error "Unknown platform."
+ const std::string EXPECTED_MD5 = "f6bfab038438ed8f5522fbd33595dcdc";
#endif
EXPECT_TRUE(CompareFileAndMD5(output_path, EXPECTED_MD5));
}
diff --git a/testimages/testout_3x2_float_prog_arm.jpg b/testimages/testout_3x2_float_prog.jpg
index 6da8d52..6da8d52 100644
--- a/testimages/testout_3x2_float_prog_arm.jpg
+++ b/testimages/testout_3x2_float_prog.jpg
Binary files differ
diff --git a/testimages/testout_3x2_float_prog_intel.jpg b/testimages/testout_3x2_float_prog_sse.jpg
index 7a27f4b..7a27f4b 100644
--- a/testimages/testout_3x2_float_prog_intel.jpg
+++ b/testimages/testout_3x2_float_prog_sse.jpg
Binary files differ