--- /dev/null
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#ifndef TEST_CLEAR_SYSTEM_STATE_H_
+#define TEST_CLEAR_SYSTEM_STATE_H_
+
+#include "vpx_config.h"
+extern "C" {
+#if ARCH_X86 || ARCH_X86_64
+# include "vpx_ports/x86.h"
+#endif
+}
+
+namespace libvpx_test {
+
+// Reset system to a known state. This function should be used for all non-API
+// test cases.
+inline void ClearSystemState() {
+#if ARCH_X86 || ARCH_X86_64
+ vpx_reset_mmx_state();
+#endif
+}
+
+} // namespace libvpx_test
+#endif // TEST_CLEAR_SYSTEM_STATE_H_
#include "./vpx_config.h"
#include "./vp8_rtcd.h"
}
+#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
output[i] = ((i & 0xF) < 4 && (i < 64)) ? 0 : -1;
}
+ virtual void TearDown() {
+ libvpx_test::ClearSystemState();
+ }
+
idct_fn_t UUT;
short input[16];
unsigned char output[256];
#include <string.h>
#include "test/acm_random.h"
+#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
extern "C" {
using libvpx_test::ACMRandom;
class IntraPredBase {
+ public:
+ virtual void TearDown() {
+ libvpx_test::ClearSystemState();
+ }
+
protected:
void SetupMacroblock(uint8_t *data, int block_size, int stride,
int num_planes) {
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
extern "C" {
namespace {
class Vp8PostProcessingFilterTest
- : public ::testing::TestWithParam<post_proc_func_t> {};
+ : public ::testing::TestWithParam<post_proc_func_t> {
+ public:
+ virtual void TearDown() {
+ libvpx_test::ClearSystemState();
+ }
+};
// Test routine for the VP8 post-processing function
// vp8_post_proc_down_and_across_mb_row_c.
}
#include "test/acm_random.h"
+#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
reference_data_ = NULL;
}
+ virtual void TearDown() {
+ libvpx_test::ClearSystemState();
+ }
+
protected:
// Handle blocks up to 4 blocks 64x64 with stride up to 128
static const int kDataAlignment = 16;
#include <stdlib.h>
#include <string.h>
#include "test/acm_random.h"
+#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
dst_c_ = NULL;
}
+ virtual void TearDown() {
+ libvpx_test::ClearSystemState();
+ }
+
protected:
// Make test arrays big enough for 16x16 functions. Six-tap filters
// need 5 extra pixels outside of the macroblock.
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/acm_random.h"
+#include "test/clear_system_state.h"
#include "test/register_state_check.h"
extern "C" {
#include "vpx_config.h"
namespace {
-class SubtractBlockTest : public ::testing::TestWithParam<subtract_b_fn_t> {};
+class SubtractBlockTest : public ::testing::TestWithParam<subtract_b_fn_t> {
+ public:
+ virtual void TearDown() {
+ libvpx_test::ClearSystemState();
+ }
+};
using libvpx_test::ACMRandom;
+LIBVPX_TEST_SRCS-yes += clear_system_state.h
LIBVPX_TEST_SRCS-yes += register_state_check.h
LIBVPX_TEST_SRCS-yes += test.mk
LIBVPX_TEST_SRCS-yes += acm_random.h
#include "third_party/googletest/src/include/gtest/gtest.h"
+#include "test/clear_system_state.h"
+
#include "vpx/vpx_integer.h"
#include "vpx_config.h"
extern "C" {
virtual void TearDown() {
delete[] src_;
delete[] ref_;
+ libvpx_test::ClearSystemState();
}
protected: