Showing the changes to test/decode_encode_test.cpp (1 of 1 file). Show all
Unified · Split
| @@ -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 | ||
| 102 | static const DecodeEncodeFileParam kFileParamArray[] = { | 103 | static 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 | ||
| 107 | INSTANTIATE_TEST_CASE_P(DecodeEncodeFile, DecodeEncodeTest, | 108 | INSTANTIATE_TEST_CASE_P(DecodeEncodeFile, DecodeEncodeTest, |