Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
2319b7aa
Commit
2319b7aa
authored
Jun 18, 2013
by
John Koleszar
Committed by
Gerrit Code Review
Jun 18, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "tests: clear system state after non-API calls"
parents
70884269
5b756748
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
70 additions
and
2 deletions
+70
-2
test/clear_system_state.h
test/clear_system_state.h
+31
-0
test/idct_test.cc
test/idct_test.cc
+5
-0
test/intrapred_test.cc
test/intrapred_test.cc
+6
-0
test/pp_filter_test.cc
test/pp_filter_test.cc
+7
-1
test/sad_test.cc
test/sad_test.cc
+5
-0
test/sixtap_predict_test.cc
test/sixtap_predict_test.cc
+5
-0
test/subtract_test.cc
test/subtract_test.cc
+7
-1
test/test.mk
test/test.mk
+1
-0
test/variance_test.cc
test/variance_test.cc
+3
-0
No files found.
test/clear_system_state.h
0 → 100644
View file @
2319b7aa
/*
* 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_
test/idct_test.cc
View file @
2319b7aa
...
...
@@ -13,6 +13,7 @@ extern "C" {
#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"
...
...
@@ -32,6 +33,10 @@ class IDCTTest : public ::testing::TestWithParam<idct_fn_t> {
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
];
...
...
test/intrapred_test.cc
View file @
2319b7aa
...
...
@@ -11,6 +11,7 @@
#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"
{
...
...
@@ -25,6 +26,11 @@ namespace {
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
)
{
...
...
test/pp_filter_test.cc
View file @
2319b7aa
...
...
@@ -7,6 +7,7 @@
* 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"
{
...
...
@@ -27,7 +28,12 @@ typedef void (*post_proc_func_t)(unsigned char *src_ptr,
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.
...
...
test/sad_test.cc
View file @
2319b7aa
...
...
@@ -26,6 +26,7 @@ extern "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"
...
...
@@ -67,6 +68,10 @@ class SADTestBase : public ::testing::Test {
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
;
...
...
test/sixtap_predict_test.cc
View file @
2319b7aa
...
...
@@ -12,6 +12,7 @@
#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"
...
...
@@ -48,6 +49,10 @@ class SixtapPredictTest : public PARAMS(int, int, sixtap_predict_fn_t) {
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.
...
...
test/subtract_test.cc
View file @
2319b7aa
...
...
@@ -10,6 +10,7 @@
#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"
...
...
@@ -23,7 +24,12 @@ typedef void (*subtract_b_fn_t)(BLOCK *be, BLOCKD *bd, int pitch);
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
;
...
...
test/test.mk
View file @
2319b7aa
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
...
...
test/variance_test.cc
View file @
2319b7aa
...
...
@@ -12,6 +12,8 @@
#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"
{
...
...
@@ -51,6 +53,7 @@ class VarianceTest :
virtual
void
TearDown
()
{
delete
[]
src_
;
delete
[]
ref_
;
libvpx_test
::
ClearSystemState
();
}
protected:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment