ref: be060e21f1d7cbdb25e7897e87485162c655fa14
parent: 47aedcf80821507029adf3adbd809aa8ee55f3b0
author: sijchen@cisco.com <sijchen@cisco.com>
date: Mon Jan 30 10:46:29 EST 2017
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);