mirror of https://github.com/intel/libva-utils.git
test/get_create_config: cleanup test cases
Use const and references appropriately. Streamline logic, variable names and code formatting Also remove useless test. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
parent
d7ccf14a33
commit
79e14c92ed
|
@ -44,95 +44,55 @@ public:
|
||||||
|
|
||||||
TEST_P(VAAPIGetCreateConfig, CreateConfigWithAttributes)
|
TEST_P(VAAPIGetCreateConfig, CreateConfigWithAttributes)
|
||||||
{
|
{
|
||||||
|
const VAProfile& profile = ::testing::get<0>(GetParam());
|
||||||
VAProfile currentProfile = ::testing::get<0>(GetParam());
|
const VAEntrypoint& entrypoint = ::testing::get<1>(GetParam());
|
||||||
VAEntrypoint currentEntrypoint = ::testing::get<1>(GetParam());
|
|
||||||
|
|
||||||
doGetMaxValues();
|
doGetMaxValues();
|
||||||
|
|
||||||
doQueryConfigProfiles();
|
doQueryConfigProfiles();
|
||||||
|
|
||||||
if (doFindProfileInList(currentProfile)) {
|
if (doFindProfileInList(profile)) {
|
||||||
|
doQueryConfigEntrypoints(profile);
|
||||||
doQueryConfigEntrypoints(currentProfile);
|
if (doFindEntrypointInList(entrypoint)) {
|
||||||
if (doFindEntrypointInList(currentEntrypoint)) {
|
|
||||||
// profile and entrypoint are supported
|
// profile and entrypoint are supported
|
||||||
|
|
||||||
doFillConfigAttribList();
|
doFillConfigAttribList();
|
||||||
|
doGetConfigAttributes(profile, entrypoint);
|
||||||
doGetConfigAttributes(currentProfile,
|
doCreateConfigWithAttrib(profile, entrypoint);
|
||||||
currentEntrypoint);
|
|
||||||
|
|
||||||
doCreateConfigWithAttrib(currentProfile,
|
|
||||||
currentEntrypoint);
|
|
||||||
doDestroyConfig();
|
doDestroyConfig();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// entrypoint is not supported by driver
|
// entrypoint is not supported by driver
|
||||||
doCreateConfigToFail(
|
doCreateConfigToFail(profile, entrypoint,
|
||||||
currentProfile, currentEntrypoint,
|
|
||||||
VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
|
VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// profile is not supported by this driver
|
// profile is not supported by this driver
|
||||||
doCreateConfigToFail(currentProfile, currentEntrypoint,
|
doCreateConfigToFail(profile, entrypoint,
|
||||||
VA_STATUS_ERROR_UNSUPPORTED_PROFILE);
|
VA_STATUS_ERROR_UNSUPPORTED_PROFILE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(VAAPIGetCreateConfig, CreateConfigNoAttributes)
|
TEST_P(VAAPIGetCreateConfig, CreateConfigNoAttributes)
|
||||||
{
|
{
|
||||||
VAProfile currentProfile = ::testing::get<0>(GetParam());
|
const VAProfile& profile = ::testing::get<0>(GetParam());
|
||||||
VAEntrypoint currentEntrypoint = ::testing::get<1>(GetParam());
|
const VAEntrypoint& entrypoint = ::testing::get<1>(GetParam());
|
||||||
|
|
||||||
doGetMaxValues();
|
doGetMaxValues();
|
||||||
|
|
||||||
doQueryConfigProfiles();
|
doQueryConfigProfiles();
|
||||||
|
|
||||||
if (doFindProfileInList(currentProfile)) {
|
if (doFindProfileInList(profile)) {
|
||||||
|
doQueryConfigEntrypoints(profile);
|
||||||
doQueryConfigEntrypoints(currentProfile);
|
if (doFindEntrypointInList(entrypoint)) {
|
||||||
if (doFindEntrypointInList(currentEntrypoint)) {
|
|
||||||
// profile and entrypoint are supported
|
// profile and entrypoint are supported
|
||||||
|
doCreateConfigNoAttrib(profile, entrypoint);
|
||||||
doCreateConfigNoAttrib(currentProfile,
|
|
||||||
currentEntrypoint);
|
|
||||||
doDestroyConfig();
|
doDestroyConfig();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// entrypoint is not supported by driver
|
// entrypoint is not supported by driver
|
||||||
doCreateConfigToFail(
|
doCreateConfigToFail(profile, entrypoint,
|
||||||
currentProfile, currentEntrypoint,
|
|
||||||
VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
|
VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// profile is not supported by this driver
|
// profile is not supported by this driver
|
||||||
doCreateConfigToFail(currentProfile, currentEntrypoint,
|
doCreateConfigToFail(profile, entrypoint,
|
||||||
VA_STATUS_ERROR_UNSUPPORTED_PROFILE);
|
VA_STATUS_ERROR_UNSUPPORTED_PROFILE);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(VAAPIGetCreateConfig, UnsupportedProfileEntrypoint)
|
|
||||||
{
|
|
||||||
VAProfile currentProfile = ::testing::get<0>(GetParam());
|
|
||||||
VAEntrypoint currentEntrypoint = ::testing::get<1>(GetParam());
|
|
||||||
|
|
||||||
doGetMaxValues();
|
|
||||||
|
|
||||||
doQueryConfigProfiles();
|
|
||||||
|
|
||||||
if (!doFindProfileInList(currentProfile)) {
|
|
||||||
// non-supported profiles will be skipped from all testing
|
|
||||||
doLogSkipTest(currentProfile, currentEntrypoint);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
doQueryConfigEntrypoints(currentProfile);
|
|
||||||
if (!doFindEntrypointInList(currentEntrypoint)) {
|
|
||||||
// non-supported entrypoints will be skipped from all testing
|
|
||||||
doLogSkipTest(currentProfile, currentEntrypoint);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,4 +101,4 @@ INSTANTIATE_TEST_CASE_P(
|
||||||
::testing::Combine(::testing::ValuesIn(m_vaProfiles),
|
::testing::Combine(::testing::ValuesIn(m_vaProfiles),
|
||||||
::testing::ValuesIn(m_vaEntrypoints)));
|
::testing::ValuesIn(m_vaEntrypoints)));
|
||||||
|
|
||||||
} // VAAPI
|
} // namespace VAAPI
|
||||||
|
|
Loading…
Reference in New Issue