OSDN Git Service

test: add jpeg entrypoint test
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 7 Sep 2016 20:43:36 +0000 (13:43 -0700)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 31 Oct 2016 01:58:57 +0000 (09:58 +0800)
Add a test to verify the i965_CreateConfig functionality
for the VAProfileJPEGBaseline/VAEntrypointVLD entrypoint
based on platform supported or not.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
(cherry picked from commit ac0b762e70268063a6e55ae7aa85734b1562af6d)

test/i965_jpeg_decode_test.cpp

index 3a1c68f..f65aa77 100644 (file)
 
 namespace JPEG {
 
+class JPEGDecodeTest : public I965TestFixture
+{
+protected:
+    static const VAEntrypoint entrypoint = VAEntrypointVLD;
+};
+
+TEST_F(JPEGDecodeTest, Entrypoint)
+{
+    VAConfigID config = VA_INVALID_ID;
+    ConfigAttribs attributes;
+    struct i965_driver_data *i965(*this);
+
+    ASSERT_PTR(i965);
+
+    if (HAS_JPEG_DECODING(i965)) {
+        config = createConfig(profile, entrypoint, attributes);
+    } else {
+        VAStatus status = i965_CreateConfig(
+            *this, profile, entrypoint, attributes.data(), attributes.size(),
+            &config);
+        EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT, status);
+        EXPECT_INVALID_ID(config);
+    }
+
+    if (config != VA_INVALID_ID)
+        destroyConfig(config);
+}
+
 class FourCCTest
-    : public I965TestFixture
+    : public JPEGDecodeTest
     , public ::testing::WithParamInterface<
         std::tuple<TestPattern::SharedConst, const char*> >
 {
 protected:
-    static const VAEntrypoint entrypoint = VAEntrypointVLD;
-
-    virtual void SetUp() {
-        I965TestFixture::SetUp();
+    virtual void SetUp()
+    {
+        JPEGDecodeTest::SetUp();
 
         std::string sFourcc;
         std::tie(testPattern, sFourcc) = GetParam();