diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2016-10-05 10:54:27 -0700 |
---|---|---|
committer | Sean V Kelley <seanvk@posteo.de> | 2016-10-06 14:02:55 -0700 |
commit | dd73514209d7942f2d8c8b0bbb541fe6884ea1bc (patch) | |
tree | 663995a4f6ca8efd7a2d67a2edf23fd9d562795a /test | |
parent | 91caa8167d5b6b16ee8c58bd238f8a4773a4707a (diff) |
test: use common I965ConfigTest fixture for jpeg enc/dec
Instantiate the JPEG encode/decode Entrypoint tests from
the common I965ConfigTest fixture with additional test
inputs. Also, separate them into their own files. This
changes their test case names, too.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/i965_jpeg_decode_test.cpp | 22 | ||||
-rw-r--r-- | test/i965_jpeg_encode_test.cpp | 18 | ||||
-rw-r--r-- | test/i965_jpegd_config_test.cpp | 50 | ||||
-rw-r--r-- | test/i965_jpege_config_test.cpp | 57 |
5 files changed, 109 insertions, 40 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 07189e5..08df339 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -62,6 +62,8 @@ test_i965_drv_video_SOURCES = \ i965_jpeg_test_data.cpp \ i965_jpeg_decode_test.cpp \ i965_jpeg_encode_test.cpp \ + i965_jpegd_config_test.cpp \ + i965_jpege_config_test.cpp \ i965_surface_test.cpp \ i965_test_environment.cpp \ i965_test_fixture.cpp \ diff --git a/test/i965_jpeg_decode_test.cpp b/test/i965_jpeg_decode_test.cpp index 6b84625..265793d 100644 --- a/test/i965_jpeg_decode_test.cpp +++ b/test/i965_jpeg_decode_test.cpp @@ -38,28 +38,6 @@ namespace Decode { class JPEGDecodeTest : public I965TestFixture { }; -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 JPEGDecodeTest , public ::testing::WithParamInterface< diff --git a/test/i965_jpeg_encode_test.cpp b/test/i965_jpeg_encode_test.cpp index 86473a9..29c14dc 100644 --- a/test/i965_jpeg_encode_test.cpp +++ b/test/i965_jpeg_encode_test.cpp @@ -64,24 +64,6 @@ protected: VAContextID context; }; -TEST_F(JPEGEncodeTest, Entrypoint) -{ - ConfigAttribs attributes; - struct i965_driver_data *i965(*this); - - ASSERT_PTR(i965); - - if (HAS_JPEG_ENCODING(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); - } -} - class JPEGEncodeInputTest : public JPEGEncodeTest , public ::testing::WithParamInterface< diff --git a/test/i965_jpegd_config_test.cpp b/test/i965_jpegd_config_test.cpp new file mode 100644 index 0000000..4e2216c --- /dev/null +++ b/test/i965_jpegd_config_test.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2016 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "i965_config_test.h" + +namespace JPEG { +namespace Decode { + +VAStatus HasDecodeSupport() +{ + I965TestEnvironment *env(I965TestEnvironment::instance()); + EXPECT_PTR(env); + + struct i965_driver_data *i965(*env); + EXPECT_PTR(i965); + + return HAS_JPEG_DECODING(i965) ? VA_STATUS_SUCCESS : + VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT; +} + +static const std::vector<ConfigTestInput> inputs = { + {VAProfileJPEGBaseline, VAEntrypointVLD, &HasDecodeSupport}, +}; + +INSTANTIATE_TEST_CASE_P( + JPEGDecode, I965ConfigTest, ::testing::ValuesIn(inputs)); + +} // namespace Decode +} // namespace JPEG diff --git a/test/i965_jpege_config_test.cpp b/test/i965_jpege_config_test.cpp new file mode 100644 index 0000000..924eccb --- /dev/null +++ b/test/i965_jpege_config_test.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2016 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "i965_config_test.h" + +namespace JPEG { +namespace Encode { + +VAStatus EntrypointNotSupported() +{ + return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT; +} + +VAStatus HasEncodeSupport() +{ + I965TestEnvironment *env(I965TestEnvironment::instance()); + EXPECT_PTR(env); + + struct i965_driver_data *i965(*env); + EXPECT_PTR(i965); + + return HAS_JPEG_ENCODING(i965) ? VA_STATUS_SUCCESS : + EntrypointNotSupported(); +} + +static const std::vector<ConfigTestInput> inputs = { + {VAProfileJPEGBaseline, VAEntrypointEncPicture, &HasEncodeSupport}, + {VAProfileJPEGBaseline, VAEntrypointEncSlice, &EntrypointNotSupported}, + {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &EntrypointNotSupported}, +}; + +INSTANTIATE_TEST_CASE_P( + JPEGEncode, I965ConfigTest, ::testing::ValuesIn(inputs)); + +} // namespace Encode +} // namespace JPEG |