summaryrefslogtreecommitdiff
path: root/test/i965_jpeg_test_data.h
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2016-09-28 13:36:05 -0700
committerSean V Kelley <seanvk@posteo.de>2016-10-03 11:30:43 -0700
commitb3a8049d5cd9e44daa255173f9783cd4f4b2fa55 (patch)
treedf26e7b389a3338df20f852c8e25b442f72e95a1 /test/i965_jpeg_test_data.h
parent034440cd4cee59f76ad211cb80108c1566561d10 (diff)
downloadlibva-intel-driver-b3a8049d5cd9e44daa255173f9783cd4f4b2fa55.tar.gz
test: jpeg/enc: move input creators to data file
Move the ::JPEG::Encode::TestInputCreator's to the i965_jpeg_test_data[.h|.cpp] files. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
Diffstat (limited to 'test/i965_jpeg_test_data.h')
-rw-r--r--test/i965_jpeg_test_data.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index 5f4802e7..cde0cfe8 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -421,6 +421,51 @@ namespace Encode {
std::array<size_t, 3> offsets;
std::array<size_t, 3> sizes;
};
+
+ class TestInputCreator
+ {
+ public:
+ typedef std::shared_ptr<TestInputCreator> Shared;
+ typedef std::shared_ptr<const TestInputCreator> SharedConst;
+
+ TestInput::Shared create(const unsigned) const;
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream&, const TestInputCreator&);
+ friend ::std::ostream& operator<<(
+ ::std::ostream&, const TestInputCreator::Shared&);
+ friend ::std::ostream& operator<<(
+ ::std::ostream&, const TestInputCreator::SharedConst&);
+
+ protected:
+ virtual std::array<unsigned, 2> getResolution() const = 0;
+ virtual void repr(::std::ostream& os) const = 0;
+ };
+
+ class RandomSizeCreator
+ : public TestInputCreator
+ {
+ protected:
+ std::array<unsigned, 2> getResolution() const;
+ void repr(::std::ostream&) const;
+ };
+
+ class FixedSizeCreator
+ : public TestInputCreator
+ {
+ public:
+ FixedSizeCreator(const std::array<unsigned, 2>&);
+
+ protected:
+ std::array<unsigned, 2> getResolution() const;
+ void repr(::std::ostream& os) const;
+
+ private:
+ const std::array<unsigned, 2> res;
+ };
+
+ typedef std::vector<TestInputCreator::SharedConst> InputCreators;
+
} // namespace Encode
} // namespace JPEG