cisco/openh264 — pull request #1036 by mstorsjo (2014-06-28 19:07:40+00:00)
Title: Don't call srand(time()) inside utility functions inside tests

This fixes occasional errors in MotionEstimateTest.

This also helps debugging test failures. When trying to track down
a failed test, the random values should be reproducible. This is
easy to track if srand() is called at most once within a test
run - then one can easily find one individual random seed that
triggers failures, and retry that setup multiple times until the
issue is resolved.

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.