Commit Graph

16 Commits

Author SHA1 Message Date
Martin Storsjö
96384bd578 Add casts when converting from size_t or std::streamsize to int 2015-01-16 13:38:07 +02: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
huili2
dc3fae4477 astyle all 2014-06-25 18:50:41 -07:00
ganyang
eb6f6ecf40 Add EncoderMB UT test file, and reformat UT files. 2014-04-01 13:55:22 +08:00
sijchen
2fe99d688b add basic me test 2014-03-14 16:40:02 +08:00
Martin Storsjö
b6dd41ebc3 Use gtest functions for comparing hash strings
This prints the mismatched strings if the test failed,
simplifying managing and updating the test suite.
2014-03-03 10:53:31 +02:00
Martin Storsjö
e88348b76d Allow building tests on MSVC versions where stdint.h is missing
Of the supported MSVC versions, only 2008 actually is missing
stdint.h, it is included in MSVC since 2010.
2014-02-24 15:38:37 +02:00
Martin Storsjö
4f5fd952b6 Use the bundled sha1 implementation instead of relying on openssl
This simplifies running tests on platforms where OpenSSL isn't
commonly available.
2014-02-24 15:38:19 +02:00
Martin Storsjö
3a1bc92778 Include <algorithm> for std::min
This fixes building the test code on MSVC 2013.

(Actually building all of the tests on windows still is tricky
due to the OpenSSL dependency for SHA1, but there's a patchset
in review to take care of that.)
2014-02-06 10:55:12 +02:00
jwwang
94bd097fcf minor naming/style/bug fixes 2014-02-05 18:04:32 +08:00
jwwang
0c2227e4b1 Remove temp files using the iterator pattern 2014-02-05 18:00:48 +08:00
jwwang
8247eef9bb refactor and add decode_encode_test to pipeline decoder outoput to encoder test 2014-02-05 18:00:48 +08:00
Varun B Patil
d1d444b622 Removed unused headers in test/ 2014-01-20 22:11:47 +05:30
jwwang
94b79c42b1 minor fixes to the tests 2014-01-08 19:12:21 -08:00
jwwang
6f58a0c1f7 Add encoder test 2014-01-08 19:12:02 -08:00
jwwang
cb0053f860 Add decoder test 2014-01-08 19:11:23 -08:00