From 55a538c80e0428e9837a6d4bf11a1539541a0aad Mon Sep 17 00:00:00 2001 From: Daniel Charles Date: Thu, 10 Nov 2016 15:08:20 -0800 Subject: 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 Reviewed-by: U. Artie Eoff --- test/i965_jpege_config_test.cpp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'test/i965_jpege_config_test.cpp') 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 inputs = { {VAProfileJPEGBaseline, VAEntrypointEncPicture, &HasEncodeSupport}, - {VAProfileJPEGBaseline, VAEntrypointEncSlice, &EntrypointNotSupported}, - {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &EntrypointNotSupported}, + {VAProfileJPEGBaseline, VAEntrypointEncSlice, &NotSupported}, + {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &NotSupported}, }; INSTANTIATE_TEST_CASE_P( -- cgit v1.2.1