Commit c4789b85 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

simplification: merge base class 'TransTestBase'

Change-Id: Idf02559fb795cdfdd40b0d7721b4eb01a0c27f2e
parent dddb9f3e
...@@ -33,11 +33,15 @@ namespace { ...@@ -33,11 +33,15 @@ namespace {
typedef void (*IdctFunc)(const tran_low_t *in, tran_low_t *out); typedef void (*IdctFunc)(const tran_low_t *in, tran_low_t *out);
class TransTestBase { typedef std::tr1::tuple<IdctFunc, int, int> IdctParam;
class AV1InvTxfm : public ::testing::TestWithParam<IdctParam> {
public: public:
virtual ~TransTestBase() {} virtual void SetUp() {
inv_txfm_ = GET_PARAM(0);
txfm_size_ = GET_PARAM(1);
max_error_ = GET_PARAM(2);
}
protected:
void RunInvAccuracyCheck() { void RunInvAccuracyCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 5000; const int count_test_block = 5000;
...@@ -63,23 +67,12 @@ class TransTestBase { ...@@ -63,23 +67,12 @@ class TransTestBase {
} }
} }
private:
double max_error_; double max_error_;
int txfm_size_; int txfm_size_;
IdctFunc inv_txfm_; IdctFunc inv_txfm_;
}; };
typedef std::tr1::tuple<IdctFunc, int, int> IdctParam;
class AV1InvTxfm : public TransTestBase,
public ::testing::TestWithParam<IdctParam> {
public:
virtual void SetUp() {
inv_txfm_ = GET_PARAM(0);
txfm_size_ = GET_PARAM(1);
max_error_ = GET_PARAM(2);
}
virtual void TearDown() {}
};
TEST_P(AV1InvTxfm, RunInvAccuracyCheck) { RunInvAccuracyCheck(); } TEST_P(AV1InvTxfm, RunInvAccuracyCheck) { RunInvAccuracyCheck(); }
INSTANTIATE_TEST_CASE_P(C, AV1InvTxfm, INSTANTIATE_TEST_CASE_P(C, AV1InvTxfm,
......
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