ref: cc774c8bb07ad14b07326e7d13abca17bec05b58
parent: ba42c02654e9fa72c85e99a115b358f5e5bb7fd9
author: James Zern <[email protected]>
date: Tue Jun 18 15:15:56 EDT 2013
variance_test: use REGISTER_STATE_CHECK Change-Id: Id54ad9a781634f075e990d5bade5be8490959975
--- a/test/variance_test.cc
+++ b/test/variance_test.cc
@@ -13,6 +13,7 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/clear_system_state.h"
+#include "test/register_state_check.h"
#include "vpx/vpx_integer.h"
#include "vpx_config.h"
@@ -151,7 +152,8 @@
for (int j = 0; j <= 255; ++j) {
memset(ref_, j, block_size_);
unsigned int sse;
- const unsigned int var = variance_(src_, width_, ref_, width_, &sse);
+ unsigned int var;
+ REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, width_, &sse));
EXPECT_EQ(0u, var) << "src values: " << i << "ref values: " << j;
}
}
@@ -165,7 +167,8 @@
ref_[j] = rnd.Rand8();
}
unsigned int sse1, sse2;
- const unsigned int var1 = variance_(src_, width_, ref_, width_, &sse1);
+ unsigned int var1;
+ REGISTER_STATE_CHECK(var1 = variance_(src_, width_, ref_, width_, &sse1));
const unsigned int var2 = variance_ref(src_, ref_, log2width_,
log2height_, &sse2);
EXPECT_EQ(sse1, sse2);
@@ -180,7 +183,8 @@
memset(ref_, 255, half);
memset(ref_ + half, 0, half);
unsigned int sse;
- const unsigned int var = variance_(src_, width_, ref_, width_, &sse);
+ unsigned int var;
+ REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, width_, &sse));
const unsigned int expected = block_size_ * 255 * 255 / 4;
EXPECT_EQ(expected, var);
}
@@ -238,8 +242,9 @@
ref_[j] = rnd.Rand8();
}
unsigned int sse1, sse2;
- const unsigned int var1 = subpel_variance_(ref_, width_ + 1, x, y,
- src_, width_, &sse1);
+ unsigned int var1;
+ REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y,
+ src_, width_, &sse1));
const unsigned int var2 = subpel_variance_ref(ref_, src_, log2width_,
log2height_, x, y, &sse2);
EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
@@ -260,8 +265,9 @@
ref_[j] = rnd.Rand8();
}
unsigned int sse1, sse2;
- const unsigned int var1 = subpel_variance_(ref_, width_ + 1, x, y,
- src_, width_, &sse1, sec_);
+ unsigned int var1;
+ REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y,
+ src_, width_, &sse1, sec_));
const unsigned int var2 = subpel_avg_variance_ref(ref_, src_, sec_,
log2width_, log2height_,
x, y, &sse2);