ref: 2ca99122d4e561fd3890fdbe28063c2f318b4fd9
parent: 47aedcf80821507029adf3adbd809aa8ee55f3b0
parent: be060e21f1d7cbdb25e7897e87485162c655fa14
author: huili2 <[email protected]>
date: Mon Feb 6 05:23:35 EST 2017
Merge pull request #2653 from sijchen/test_ut [UT] fix the filling of testing data
--- a/test/api/encode_decode_api_test.cpp
+++ b/test/api/encode_decode_api_test.cpp
@@ -82,8 +82,9 @@
void EncodeDecodeTestAPIBase::EncodeOneFrame (int iCheckTypeIndex) {
int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2;
- memset (buf_.data(), iRandValue, (frameSize >> 2));
- memset (buf_.data() + (frameSize >> 2), rand() % 256, (frameSize - (frameSize >> 2)));
+ int lumaSize = EncPic.iPicWidth * EncPic.iPicHeight;
+ memset (buf_.data(), iRandValue, lumaSize);
+ memset (buf_.data() + lumaSize, rand() % 256, (frameSize - lumaSize));
int rv = encoder_->EncodeFrame (&EncPic, &info);
if (0 == iCheckTypeIndex)
ASSERT_TRUE (rv == cmResultSuccess);