Commit 4322bc18 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan
Browse files

Fix constructor order in unit tests (sanitizer)

The WithParamTest constructor needs to be called first, as the
EncoderTest constructor is called with 'GET_PARAM'.

BUG=aomedia:580

Change-Id: I17f3c02c0a0eec103fb3505301b5eb6dfdef851c
parent ce0a9ea3
...@@ -59,8 +59,8 @@ void GenerateMap(int mb_rows, int mb_cols, const aom_image_t &current, ...@@ -59,8 +59,8 @@ void GenerateMap(int mb_rows, int mb_cols, const aom_image_t &current,
const int kAqModeCyclicRefresh = 3; const int kAqModeCyclicRefresh = 3;
class ActiveMapRefreshTest class ActiveMapRefreshTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
protected: protected:
ActiveMapRefreshTest() : EncoderTest(GET_PARAM(0)) {} ActiveMapRefreshTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~ActiveMapRefreshTest() {} virtual ~ActiveMapRefreshTest() {}
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
namespace { namespace {
class ActiveMapTest class ActiveMapTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
protected: protected:
static const int kWidth = 208; static const int kWidth = 208;
static const int kHeight = 144; static const int kHeight = 144;
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
namespace { namespace {
class AltRefForcedKeyTestLarge class AltRefForcedKeyTestLarge
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
protected: protected:
AltRefForcedKeyTestLarge() AltRefForcedKeyTestLarge()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
......
...@@ -28,8 +28,8 @@ namespace { ...@@ -28,8 +28,8 @@ namespace {
const char kTestVideoName[] = "niklas_1280_720_30.y4m"; const char kTestVideoName[] = "niklas_1280_720_30.y4m";
const int kTestVideoFrames = 10; const int kTestVideoFrames = 10;
class AnsCodecTest : public ::libaom_test::EncoderTest, class AnsCodecTest : public ::libaom_test::CodecTestWithParam<int>,
public ::libaom_test::CodecTestWithParam<int> { public ::libaom_test::EncoderTest {
protected: protected:
AnsCodecTest() AnsCodecTest()
: EncoderTest(GET_PARAM(0)), ans_window_size_log2_(GET_PARAM(1)) {} : EncoderTest(GET_PARAM(0)), ans_window_size_log2_(GET_PARAM(1)) {}
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
namespace { namespace {
class AqSegmentTest class AqSegmentTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
protected: protected:
AqSegmentTest() : EncoderTest(GET_PARAM(0)) {} AqSegmentTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~AqSegmentTest() {} virtual ~AqSegmentTest() {}
......
...@@ -76,9 +76,9 @@ int is_extension_y4m(const char *filename) { ...@@ -76,9 +76,9 @@ int is_extension_y4m(const char *filename) {
} }
class ArfFreqTestLarge class ArfFreqTestLarge
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith3Params<TestVideoParam,
public ::libaom_test::CodecTestWith3Params<TestVideoParam, TestEncodeParam, int>,
TestEncodeParam, int> { public ::libaom_test::EncoderTest {
protected: protected:
ArfFreqTestLarge() ArfFreqTestLarge()
: EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(1)), : EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(1)),
......
...@@ -33,8 +33,8 @@ const int kImgHeight = 576; ...@@ -33,8 +33,8 @@ const int kImgHeight = 576;
// This test tests "tile_encoding_mode = TILE_VR" case. The TILE_NORMAL case is // This test tests "tile_encoding_mode = TILE_VR" case. The TILE_NORMAL case is
// tested by the tile_independence test. // tested by the tile_independence test.
class AV1ExtTileTest class AV1ExtTileTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
protected: protected:
AV1ExtTileTest() AV1ExtTileTest()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
namespace { namespace {
class BordersTest class BordersTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>,
public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { public ::libaom_test::EncoderTest {
protected: protected:
BordersTest() : EncoderTest(GET_PARAM(0)) {} BordersTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~BordersTest() {} virtual ~BordersTest() {}
......
...@@ -21,8 +21,8 @@ namespace { ...@@ -21,8 +21,8 @@ namespace {
const int kMaxPSNR = 100; const int kMaxPSNR = 100;
class CpuSpeedTest class CpuSpeedTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
protected: protected:
CpuSpeedTest() CpuSpeedTest()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
namespace { namespace {
class DatarateTestLarge class DatarateTestLarge
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
public: public:
DatarateTestLarge() : EncoderTest(GET_PARAM(0)) {} DatarateTestLarge() : EncoderTest(GET_PARAM(0)) {}
......
...@@ -93,8 +93,8 @@ TEST_P(DecodePerfTest, PerfTest) { ...@@ -93,8 +93,8 @@ TEST_P(DecodePerfTest, PerfTest) {
// ::testing::ValuesIn(kAV1DecodePerfVectors)); // ::testing::ValuesIn(kAV1DecodePerfVectors));
class AV1NewEncodeDecodePerfTest class AV1NewEncodeDecodePerfTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>,
public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { public ::libaom_test::EncoderTest {
protected: protected:
AV1NewEncodeDecodePerfTest() AV1NewEncodeDecodePerfTest()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), speed_(0), : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), speed_(0),
......
...@@ -56,8 +56,8 @@ const int kEncodePerfTestThreads[] = { 1, 2, 4 }; ...@@ -56,8 +56,8 @@ const int kEncodePerfTestThreads[] = { 1, 2, 4 };
#define NELEMENTS(x) (sizeof((x)) / sizeof((x)[0])) #define NELEMENTS(x) (sizeof((x)) / sizeof((x)[0]))
class AV1EncodePerfTest class AV1EncodePerfTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>,
public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { public ::libaom_test::EncoderTest {
protected: protected:
AV1EncodePerfTest() AV1EncodePerfTest()
: EncoderTest(GET_PARAM(0)), min_psnr_(kMaxPsnr), nframes_(0), : EncoderTest(GET_PARAM(0)), min_psnr_(kMaxPsnr), nframes_(0),
......
...@@ -54,9 +54,10 @@ const EncodeParameters kAV1EncodeParameterSet[] = { ...@@ -54,9 +54,10 @@ const EncodeParameters kAV1EncodeParameterSet[] = {
}; };
class AvxEncoderParmsGetToDecoder class AvxEncoderParmsGetToDecoder
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<EncodeParameters,
public ::libaom_test::CodecTestWith2Params<EncodeParameters, EncodePerfTestVideo>,
EncodePerfTestVideo> { public ::libaom_test::EncoderTest,
{
protected: protected:
AvxEncoderParmsGetToDecoder() AvxEncoderParmsGetToDecoder()
: EncoderTest(GET_PARAM(0)), encode_parms(GET_PARAM(1)) {} : EncoderTest(GET_PARAM(0)), encode_parms(GET_PARAM(1)) {}
......
...@@ -86,9 +86,9 @@ int is_extension_y4m(const char *filename) { ...@@ -86,9 +86,9 @@ int is_extension_y4m(const char *filename) {
} }
class EndToEndTest class EndToEndTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode,
public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode, TestVideoParam, int>,
TestVideoParam, int> { public ::libaom_test::EncoderTest {
protected: protected:
EndToEndTest() EndToEndTest()
: EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(2)), : EncoderTest(GET_PARAM(0)), test_video_param_(GET_PARAM(2)),
......
...@@ -21,8 +21,8 @@ const int kMaxErrorFrames = 12; ...@@ -21,8 +21,8 @@ const int kMaxErrorFrames = 12;
const int kMaxDroppableFrames = 12; const int kMaxDroppableFrames = 12;
class ErrorResilienceTestLarge class ErrorResilienceTestLarge
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>,
public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { public ::libaom_test::EncoderTest {
protected: protected:
ErrorResilienceTestLarge() ErrorResilienceTestLarge()
: EncoderTest(GET_PARAM(0)), psnr_(0.0), nframes_(0), mismatch_psnr_(0.0), : EncoderTest(GET_PARAM(0)), psnr_(0.0), nframes_(0), mismatch_psnr_(0.0),
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
namespace { namespace {
class AVxEncoderThreadTest class AVxEncoderThreadTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
protected: protected:
AVxEncoderThreadTest() AVxEncoderThreadTest()
: EncoderTest(GET_PARAM(0)), encoder_initialized_(false), : EncoderTest(GET_PARAM(0)), encoder_initialized_(false),
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
namespace { namespace {
class AV1FrameSizeTests : public ::libaom_test::EncoderTest, class AV1FrameSizeTests : public ::testing::Test,
public ::testing::Test { public ::libaom_test::EncoderTest {
protected: protected:
AV1FrameSizeTests() AV1FrameSizeTests()
: EncoderTest(&::libaom_test::kAV1), expected_res_(AOM_CODEC_OK) {} : EncoderTest(&::libaom_test::kAV1), expected_res_(AOM_CODEC_OK) {}
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
namespace { namespace {
class LevelTest class LevelTest
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>,
public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> { public ::libaom_test::EncoderTest {
protected: protected:
LevelTest() LevelTest()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
......
...@@ -23,8 +23,8 @@ namespace { ...@@ -23,8 +23,8 @@ namespace {
const int kMaxPsnr = 100; const int kMaxPsnr = 100;
class LosslessTestLarge class LosslessTestLarge
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWithParam<libaom_test::TestMode>,
public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> { public ::libaom_test::EncoderTest {
protected: protected:
LosslessTestLarge() LosslessTestLarge()
: EncoderTest(GET_PARAM(0)), psnr_(kMaxPsnr), nframes_(0), : EncoderTest(GET_PARAM(0)), psnr_(kMaxPsnr), nframes_(0),
......
...@@ -32,9 +32,9 @@ const int kCpuUsedVectors[] = { 1, 5 }; ...@@ -32,9 +32,9 @@ const int kCpuUsedVectors[] = { 1, 5 };
const int kMVTestModes[] = { MAX_EXTREME_MV, MIN_EXTREME_MV }; const int kMVTestModes[] = { MAX_EXTREME_MV, MIN_EXTREME_MV };
class MotionVectorTestLarge class MotionVectorTestLarge
: public ::libaom_test::EncoderTest, : public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode, int,
public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode, int, int>,
int> { public ::libaom_test::EncoderTest {
protected: protected:
MotionVectorTestLarge() MotionVectorTestLarge()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment