tests: Return NULL if you can't get VADisplay
This patch should not change the outcome as m_vaDisplay is NULL for
each failed vaGetDisplayDRM().
This is minor code readability improvement. Another approach would be
to break the loop when we find a valid VADisplay.
While at it, remove the empty line before variable declaration which
is not common in the majority of the source code.
Signed-off-by: Victor Toso <victortoso@redhat.com>
diff --git a/test/test_va_api_fixture.cpp b/test/test_va_api_fixture.cpp
index 4c4e54b..cbd9a04 100644
--- a/test/test_va_api_fixture.cpp
+++ b/test/test_va_api_fixture.cpp
@@ -71,7 +71,6 @@
VADisplay VAAPIFixture::getDisplay()
{
-
uint32_t i;
for (i = 0; i < sizeof(drmDevicePaths) / sizeof(*drmDevicePaths); i++) {
@@ -84,7 +83,7 @@
return m_vaDisplay;
}
- return m_vaDisplay;
+ return NULL;
}
VADisplay VAAPIFixture::doInitialize()