Commit Graph

17 Commits

Author SHA1 Message Date
U. Artie Eoff c17bbc0820 test/fixture: consolidate config methods
Define 4 new config methods that provide the functionality
of the existing 11 similar methods.  The usage of the existing
methods will be replaced by the new methods in successive
commits.

These new methods will also give control back to the test
cases to handle config attributes depending on need/use-case
and reduce the number fixture member variables needed.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff ebe0e519d5 test/data: use g_ prefix for global vars, not m_
The m_ prefix for a variable indicates it's a member
variable.  The g_ prefix indicates it's a global variable.

Use the correct prefix in test_data.h for global variables
and update usage accordingly.

Also, cleanup test_data.h formatting.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-22 09:43:28 -08:00
U. Artie Eoff c0ab3b99fc test/fixture: const and var reference corrections
Various const corrections for member functions/params and
pass-by-ref instead of pass-by-val.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff ff0d21efcd test: use common typedefs
Use the new typedefs in tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff 57bd8dbe97 test/fixture: remove shadow variable
m_querySurfaceAttribList was redefined in
doQuerySurfacesWithConfigAttribs which shadows the member
variable of the same name.  Removing the redefinition does
not break tests, so remove it.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-12 08:35:10 +08:00
U. Artie Eoff e6a5bc0f2f test/fixture: add doGetMinSurfaceResolution
Add method to get minimum allowed surface resolution.
If driver does not specify, then assume 1x1 is min.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
U. Artie Eoff dfc6ff4d29 test/fixture: set default max surface resolution
If driver does not specify the max surface resolution,
then assume "any" max is allowed (up to numeric_limits).

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
U. Artie Eoff 2db00b120f test: use Resolution struct instead of std::pair
Use the a Resolution object in tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2018-01-05 08:41:33 -08:00
Victor Toso 61a21b9149 test: Fix leak on getDisplay test
880 (360 direct, 520 indirect) bytes in 1 blocks are definitely lost in loss record 12 of 15
   at 0x4C2EF35: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x503FED9: va_newDisplayContext (in /usr/lib/libva.so.2.0.0)
   by 0x4E39F32: vaGetDisplayDRM (in /usr/lib/libva-drm.so.2.0.0)
   by 0x11ADD1: VAAPI::VAAPIFixture::getDisplay() (test_va_api_fixture.cpp:80)
   by 0x11AE2E: VAAPI::VAAPIFixture_getDisplay_Test::TestBody() (test_va_api_fixture.cpp:527)

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-12-19 10:30:02 -08:00
U. Artie Eoff f3481ced2a test: use new convenience macros
Use new convenience macros to improve logging output.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2017-12-18 12:14:18 -08:00
Victor Toso 5f3de4512e 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>
2017-12-15 08:53:54 -08:00
Victor Toso 9b954dca5c tests: Don't return VADisplay if vaInitialize() fails
Without a proper driver, vaInitialize() will fail at va_openDriver().
There is no point in returning a VADisplay in that case.

Without driver, instead segfault we will get:
    16855 FAILED TESTS

Fix #77

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-12-15 08:53:54 -08:00
U. Artie Eoff 597541534c test: vaMaxNumConfigAttributes is implementation specific
Don't expect vaMaxNumConfigAttributes to be 32.

vaMaxNumConfigAttributes result is defined by the driver
implementation and may not be the same for all drivers.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2017-12-01 13:02:54 -08:00
U. Artie Eoff d52969f3a0 test: allow user-defined driver name for test execution
Some tests manipulate the LIBVA_DRIVER_NAME environment
variable for various reasons.  This causes tests that
execute later on to behave unexpectedly.

Store the original user-defined LIBVA_DRIVER_NAME before
every test runs and restore it to the original value
when each test finishes.  This allows the test suite
to be executed with any VAAPI driver.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2017-12-01 11:29:18 -08:00
Kelly Ledford f6c9dcfed1 test: fix GCC 7.1.1 warnings/errors
Fixes #52: add explicit braces to avoid 'ambiguous else' warning.

Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
2017-07-28 10:00:46 +08:00
Daniel Charles 83d83adb77 skip_tests: skip unsupported profile/entrypoint, record skip tests
add a new test that will printout which profile/entrypoint
combinations will be skipped while running the suite.

Skipped tests are now recording a property and using test_streamable
to print profile/entrypoint without function calling.

Fixes #2

Signed-off-by: Daniel Charles <daniel.charles@intel.com>
2017-02-15 16:03:03 -08:00
Daniel Charles 45c32e3484 gtest: initial Gtest set for VA-API
This initial set of files covers the va.h API for all the
functions used to exercise successfully the VA-API.

Tests are divided per VA-API function with a common Fixture that
contains all calling functions to the VA-API.  For the use cases
covered already there are tests for the proper functionality and also
for expected error situations.

The tests creates combinations with all the inputs to the VA-API function
and then it checks the results based on what the driver implementation reports
as supported

The set of tests can be run on any h/w supported and any driver.

The VendorString test is assuming Intel i965 driver, please help
adding the test for other drivers

More tests will be continously added

Signed-off-by: Daniel Charles <daniel.charles@intel.com>
2016-11-29 11:41:17 -08:00