summaryrefslogtreecommitdiff
path: root/test/i965_test_environment.cpp
Commit message (Collapse)AuthorAgeFilesLines
* test: fix GCC 7.1.1 warnings/errorsKelly Ledford2017-07-281-1/+2
| | | | | | Fixes #236: add explicit braces to avoid 'ambiguous else' warning. Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
* test: use C random library for random numbersU. Artie Eoff2016-10-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | The speed of random number generation can have a significant impact on test execution time when initializing large arrays of random values. The C++ random number engines and generators are much slower than std::rand. Thus, use C's rand() to generate pseudo-random values within a given [min,max] range. For testing purposes, deterministic sequences would be preferable anyway. That is, if a particular sequence exposes a test failure, then we can reproduce it later. Also, we seed the pseudo-random number generator with the current time so that the sequence is not always the same across executions. The seed is then recorded in the test results so that the sequence can be reproduced if needed. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
* test: move vaInitialize/vaTerminate to a global test environmentU. Artie Eoff2016-10-061-0/+86
Move the VADisplay, vaInitialize and vaTerminate responsibility out of the I965TestFixture class and into a global I965TestEnvironment (::testing::Environment) singleton. The I965TestEnvironment singleton instance is registered with the gtest framework at startup and it's SetUp and TearDown routines are executed before and after all tests are executed. This allows all tests to obtain access to the VADisplay et. al. outside of an I965TestFixture instance. Essentially, this results in only one VADisplay being shared between all executed test cases and one init/term sequence for the entire test program execution. This more closely resembles how several real-world programs would use the driver (i.e. init driver once, encode/decode multiple streams and terminate driver once). Prior to this, each test case had it's own VADisplay instance and init/term sequence. That behavior can still be achieved by executing one test case at a time via the --gtest_filter option. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Reviewed-by: Sean V Kelley <seanvk@posteo.de>