Commit Graph

8 Commits

Author SHA1 Message Date
Martin Storsjö
df16cd9d0c Print the random seed at startup
Also add an option for overriding the seed at startup.

This allows reproducing temporary issues by rerunning the test suite
with the same random seed.

Note that if tests are added or removed (or tests are skipped by passing
the --gtest_filter option), or if running on a different libc, the same
seed might result in different random values.
2014-08-06 19:32:25 +03:00
Martin Storsjö
4f594deff9 Don't reset the random number generator within the unit tests
This makes sure we don't accidentally return the same sequence
of random numbers multiple times within one test (which would
be very non-random).

Every time srand(time()) is called, the pseudo random number
generator is initialized to the same value (as long as time()
returned the same value).

By initializing the random number generator once and for all
before starting to run the unit tests, we are sure we don't
need to reinitialize it within all the tests and all the
functions that use random numbers.

This fixes occasional errors in MotionEstimateTest.

MotionEstimateTest was designed to allow the test to occasionally
not succeed - if it didn't succeed, it tried again, up to 100 times.
However, since the YUVPixelDataGenerator function reset the random
seed to time(), every attempt actually ran with the same random
data (as long as all 100 attempts ran within 1 second) - thus if
one attempt in MotionEstimateTest failed, all 100 of them would
fail. If the utility functions don't touch the random seed,
this is not an issue.
2014-07-01 10:20:45 +03:00
zhuling13
8b1b0b6582 for auto testing 2014-06-25 19:57:39 -07:00
huili2
dc3fae4477 astyle all 2014-06-25 18:50:41 -07:00
zhuling13
d6ac7f4a60 add iosutdemo 2014-06-05 01:20:50 -07:00
zhuling13
1e4f367a1d clear up TAP space 2014-05-23 00:59:40 -07:00
zhuling13
9a33512564 Add unittest demo for android platform 2014-05-19 23:19:23 -07:00
Licai Guo
f26bb57415 reorganize tests 2014-03-24 22:14:43 -07:00