History

Fix incomplete decocder output for not flushing the temp file

jwwang committed 12 years ago

Commit 596be021 parent 8247eef1 file · +7 −6Browse files

Showing the changes to test/decode_encode_test.cpp (1 of 1 file). Show all

Unified · Split

test/decode_encode_test.cpp+7−6
@@ -56,10 +56,6 @@ class DecodeEncodeTest : public ::testing::TestWithParam<DecodeEncodeFileParam>, · 55 unmodified lines
5656 }
5757
5858 virtual void TearDown() {
59− if (tmpFile_ != NULL) {
60− fclose(tmpFile_);
61− remove(tmpFileName_);
62− }
6359 BaseDecoderTest::TearDown();
6460 BaseEncoderTest::TearDown();
6561 }
@@ -91,17 +87,22 @@ TEST_P(DecodeEncodeTest, CompareOutput) { · 25 unmodified lines
9187 return;
9288 }
9389
90+ // force flushing the file
91+ fclose(tmpFile_);
92+
9493 EncodeFile(tmpFileName_, p.width, p.height, p.frameRate, this);
9594 unsigned char digest[SHA_DIGEST_LENGTH];
9695 SHA1_Final(digest, &ctx_);
9796 if (!HasFatalFailure()) {
9897 ASSERT_TRUE(CompareHash(digest, p.hashStr));
9998 }
99+
100+ remove(tmpFileName_);
100101 }
101102
102103 static const DecodeEncodeFileParam kFileParamArray[] = {
103− {"res/test_vd_1d.264", "c17a760c3bc5d8682aae7f49dddebd2593071711", 320, 192, 12.0f},
104− {"res/test_vd_rc.264", "41e3e90f159fade7a89a4540c4fb9f8ac8f4d7da", 320, 192, 12.0f},
104+ {"res/test_vd_1d.264", "41c672107cfe9e8e8a67b5d08cbd701f6c982ccd", 320, 192, 12.0f},
105+ {"res/test_vd_rc.264", "d546ea7c671b42503f8a46ba50bef2a3eaca4c5a", 320, 192, 12.0f},
105106 };
106107
107108 INSTANTIATE_TEST_CASE_P(DecodeEncodeFile, DecodeEncodeTest,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t