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
56 }56 }
57 57
58 virtual void TearDown() {58 virtual void TearDown() {
59 if (tmpFile_ != NULL) {
60 fclose(tmpFile_);
61 remove(tmpFileName_);
62 }
63 BaseDecoderTest::TearDown();59 BaseDecoderTest::TearDown();
64 BaseEncoderTest::TearDown();60 BaseEncoderTest::TearDown();
65 }61 }
@@ -91,17 +87,22 @@ TEST_P(DecodeEncodeTest, CompareOutput) { · 25 unmodified lines
91 return;87 return;
92 }88 }
93 89
90 // force flushing the file
91 fclose(tmpFile_);
92
94 EncodeFile(tmpFileName_, p.width, p.height, p.frameRate, this);93 EncodeFile(tmpFileName_, p.width, p.height, p.frameRate, this);
95 unsigned char digest[SHA_DIGEST_LENGTH];94 unsigned char digest[SHA_DIGEST_LENGTH];
96 SHA1_Final(digest, &ctx_);95 SHA1_Final(digest, &ctx_);
97 if (!HasFatalFailure()) {96 if (!HasFatalFailure()) {
98 ASSERT_TRUE(CompareHash(digest, p.hashStr));97 ASSERT_TRUE(CompareHash(digest, p.hashStr));
99 }98 }
99
100 remove(tmpFileName_);
100}101}
101 102
102static const DecodeEncodeFileParam kFileParamArray[] = {103static const DecodeEncodeFileParam kFileParamArray[] = {
103 {"res/test_vd_1d.264", "c17a760c3bc5d8682aae7f49dddebd2593071711", 320, 192, 12.0f},104 {"res/test_vd_1d.264", "41c672107cfe9e8e8a67b5d08cbd701f6c982ccd", 320, 192, 12.0f},
104 {"res/test_vd_rc.264", "41e3e90f159fade7a89a4540c4fb9f8ac8f4d7da", 320, 192, 12.0f},105 {"res/test_vd_rc.264", "d546ea7c671b42503f8a46ba50bef2a3eaca4c5a", 320, 192, 12.0f},
105};106};
106 107
107INSTANTIATE_TEST_CASE_P(DecodeEncodeFile, DecodeEncodeTest,108INSTANTIATE_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