From bc484ebf068efa424122d518743afc751fe7833a Mon Sep 17 00:00:00 2001 From: Yaowu Xu <yaowu@google.com> Date: Thu, 8 Aug 2013 18:25:03 -0700 Subject: [PATCH] fix unit test failure on win32 vs2008 build The mix use of double type and simd code caused invalid values stored in double variables, further caused unit tests to fail. The failures were only observed on x86-win32-vs9 build with vs2008. Change-Id: If0131754a3bf217a5ace303b7963e8f5162c34b5 --- test/dct16x16_test.cc | 2 +- test/fdct4x4_test.cc | 2 +- test/fdct8x8_test.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc index 079505475e..89453bcd80 100644 --- a/test/dct16x16_test.cc +++ b/test/dct16x16_test.cc @@ -320,7 +320,7 @@ class FwdTrans16x16Test : public ::testing::TestWithParam<int> { TEST_P(FwdTrans16x16Test, AccuracyCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); int max_error = 0; - double total_error = 0; + int total_error = 0; const int count_test_block = 10000; for (int i = 0; i < count_test_block; ++i) { DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 256); diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc index 9dcc0785d7..39f915ca49 100644 --- a/test/fdct4x4_test.cc +++ b/test/fdct4x4_test.cc @@ -136,7 +136,7 @@ TEST_P(FwdTrans4x4Test, RoundTripErrorCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); int max_error = 0; - double total_error = 0; + int total_error = 0; const int count_test_block = 1000000; for (int i = 0; i < count_test_block; ++i) { DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 16); diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index 50e2e9d4d7..81d242b4da 100644 --- a/test/fdct8x8_test.cc +++ b/test/fdct8x8_test.cc @@ -148,7 +148,7 @@ TEST_P(FwdTrans8x8Test, SignBiasCheck) { TEST_P(FwdTrans8x8Test, RoundTripErrorCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); int max_error = 0; - double total_error = 0; + int total_error = 0; const int count_test_block = 100000; for (int i = 0; i < count_test_block; ++i) { DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); @@ -199,7 +199,7 @@ TEST_P(FwdTrans8x8Test, RoundTripErrorCheck) { TEST_P(FwdTrans8x8Test, ExtremalCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); int max_error = 0; - double total_error = 0; + int total_error = 0; const int count_test_block = 100000; for (int i = 0; i < count_test_block; ++i) { DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64); -- GitLab