diff options
author | Daniel Charles <daniel.charles@intel.com> | 2016-11-10 15:08:20 -0800 |
---|---|---|
committer | Sean V Kelley <seanvk@posteo.de> | 2016-11-10 15:46:15 -0800 |
commit | 55a538c80e0428e9837a6d4bf11a1539541a0aad (patch) | |
tree | 48ecbb6f38eda2293f04ada700aeb2514ed3fe6c /test/i965_jpege_config_test.cpp | |
parent | a3000fab93e03318b0e5e2a5b9a799db9a819714 (diff) | |
download | libva-intel-driver-55a538c80e0428e9837a6d4bf11a1539541a0aad.tar.gz |
i965_test_config: return properly unsupported profile
jpege/jpegd and avce/avcd config tests to check against all supported
entrypoints for a profile. UNSUPPORTED_PROFILE is expected
when no entrypoints are available for a given profile, else
expect UNSUPPORTED_ENTRYPOINT.
Signed-off-by: Daniel Charles <daniel.charles@intel.com>
Reviewed-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Diffstat (limited to 'test/i965_jpege_config_test.cpp')
-rw-r--r-- | test/i965_jpege_config_test.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/test/i965_jpege_config_test.cpp b/test/i965_jpege_config_test.cpp index 924eccb4..eb5931d1 100644 --- a/test/i965_jpege_config_test.cpp +++ b/test/i965_jpege_config_test.cpp @@ -27,11 +27,30 @@ namespace JPEG { namespace Encode { +VAStatus ProfileNotSupported() +{ + return VA_STATUS_ERROR_UNSUPPORTED_PROFILE; +} + VAStatus EntrypointNotSupported() { return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT; } +VAStatus NotSupported() +{ + I965TestEnvironment *env(I965TestEnvironment::instance()); + EXPECT_PTR(env); + + struct i965_driver_data *i965(*env); + EXPECT_PTR(i965); + + if (!HAS_JPEG_DECODING(i965)) + return ProfileNotSupported(); + + return EntrypointNotSupported(); +} + VAStatus HasEncodeSupport() { I965TestEnvironment *env(I965TestEnvironment::instance()); @@ -40,14 +59,16 @@ VAStatus HasEncodeSupport() struct i965_driver_data *i965(*env); EXPECT_PTR(i965); - return HAS_JPEG_ENCODING(i965) ? VA_STATUS_SUCCESS : - EntrypointNotSupported(); + if (HAS_JPEG_ENCODING(i965)) + return VA_STATUS_SUCCESS; + + return NotSupported(); } static const std::vector<ConfigTestInput> inputs = { {VAProfileJPEGBaseline, VAEntrypointEncPicture, &HasEncodeSupport}, - {VAProfileJPEGBaseline, VAEntrypointEncSlice, &EntrypointNotSupported}, - {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &EntrypointNotSupported}, + {VAProfileJPEGBaseline, VAEntrypointEncSlice, &NotSupported}, + {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &NotSupported}, }; INSTANTIATE_TEST_CASE_P( |