Memory error in cng_unittest
Review URL: https://webrtc-codereview.appspot.com/845008 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2839 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -54,8 +54,8 @@ void CngTest::SetUp() {
|
|||||||
webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm");
|
webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm");
|
||||||
input_file = fopen(file_name.c_str(), "rb");
|
input_file = fopen(file_name.c_str(), "rb");
|
||||||
ASSERT_TRUE(input_file != NULL);
|
ASSERT_TRUE(input_file != NULL);
|
||||||
ASSERT_EQ(480, static_cast<int32_t>(fread(speech_data_, sizeof(int16_t),
|
ASSERT_EQ(640, static_cast<int32_t>(fread(speech_data_, sizeof(int16_t),
|
||||||
480, input_file)));
|
640, input_file)));
|
||||||
fclose(input_file);
|
fclose(input_file);
|
||||||
input_file = NULL;
|
input_file = NULL;
|
||||||
}
|
}
|
||||||
@ -315,6 +315,7 @@ TEST_F(CngTest, CngAutoSid) {
|
|||||||
|
|
||||||
// Free encoder and decoder memory.
|
// Free encoder and decoder memory.
|
||||||
EXPECT_EQ(0, WebRtcCng_FreeEnc(cng_enc_inst_));
|
EXPECT_EQ(0, WebRtcCng_FreeEnc(cng_enc_inst_));
|
||||||
|
EXPECT_EQ(0, WebRtcCng_FreeDec(cng_dec_inst_));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test automatic SID, with very short interval.
|
// Test automatic SID, with very short interval.
|
||||||
@ -341,6 +342,7 @@ TEST_F(CngTest, CngAutoSidShort) {
|
|||||||
|
|
||||||
// Free encoder and decoder memory.
|
// Free encoder and decoder memory.
|
||||||
EXPECT_EQ(0, WebRtcCng_FreeEnc(cng_enc_inst_));
|
EXPECT_EQ(0, WebRtcCng_FreeEnc(cng_enc_inst_));
|
||||||
|
EXPECT_EQ(0, WebRtcCng_FreeDec(cng_dec_inst_));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
Reference in New Issue
Block a user