| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 TEST_F(VideoQualityAnalysisTest, PrintAnalysisResultsThreeFrames) { | 79 TEST_F(VideoQualityAnalysisTest, PrintAnalysisResultsThreeFrames) { |
| 80 ResultsContainer result; | 80 ResultsContainer result; |
| 81 result.frames.push_back(AnalysisResult(0, 35.0, 0.9)); | 81 result.frames.push_back(AnalysisResult(0, 35.0, 0.9)); |
| 82 result.frames.push_back(AnalysisResult(1, 34.0, 0.8)); | 82 result.frames.push_back(AnalysisResult(1, 34.0, 0.8)); |
| 83 result.frames.push_back(AnalysisResult(2, 33.0, 0.7)); | 83 result.frames.push_back(AnalysisResult(2, 33.0, 0.7)); |
| 84 PrintAnalysisResults(logfile_, "ThreeFrames", &result); | 84 PrintAnalysisResults(logfile_, "ThreeFrames", &result); |
| 85 } | 85 } |
| 86 | 86 |
| 87 TEST_F(VideoQualityAnalysisTest, PrintMaxRepeatedAndSkippedFramesInvalidFile) { | 87 TEST_F(VideoQualityAnalysisTest, PrintMaxRepeatedAndSkippedFramesInvalidFile) { |
| 88 std::string stats_filename = OutputPath() + "non-existing-stats-file.txt"; | 88 std::string stats_filename_ref = |
| 89 OutputPath() + "non-existing-stats-file-1.txt"; |
| 90 std::string stats_filename = OutputPath() + "non-existing-stats-file-2.txt"; |
| 89 remove(stats_filename.c_str()); | 91 remove(stats_filename.c_str()); |
| 90 PrintMaxRepeatedAndSkippedFrames(logfile_, "NonExistingStatsFile", | 92 PrintMaxRepeatedAndSkippedFrames(logfile_, "NonExistingStatsFile", |
| 91 stats_filename); | 93 stats_filename_ref, stats_filename); |
| 92 } | 94 } |
| 93 | 95 |
| 94 TEST_F(VideoQualityAnalysisTest, | 96 TEST_F(VideoQualityAnalysisTest, |
| 95 PrintMaxRepeatedAndSkippedFramesEmptyStatsFile) { | 97 PrintMaxRepeatedAndSkippedFramesEmptyStatsFile) { |
| 96 std::string stats_filename = OutputPath() + "empty-stats.txt"; | 98 std::string stats_filename_ref = OutputPath() + "empty-stats-1.txt"; |
| 99 std::string stats_filename = OutputPath() + "empty-stats-2.txt"; |
| 97 std::ofstream stats_file; | 100 std::ofstream stats_file; |
| 101 stats_file.open(stats_filename_ref.c_str()); |
| 102 stats_file.close(); |
| 98 stats_file.open(stats_filename.c_str()); | 103 stats_file.open(stats_filename.c_str()); |
| 99 stats_file.close(); | 104 stats_file.close(); |
| 100 PrintMaxRepeatedAndSkippedFrames(logfile_, "EmptyStatsFile", stats_filename); | 105 PrintMaxRepeatedAndSkippedFrames(logfile_, "EmptyStatsFile", |
| 106 stats_filename_ref, stats_filename); |
| 101 } | 107 } |
| 102 | 108 |
| 103 TEST_F(VideoQualityAnalysisTest, PrintMaxRepeatedAndSkippedFramesNormalFile) { | 109 TEST_F(VideoQualityAnalysisTest, PrintMaxRepeatedAndSkippedFramesNormalFile) { |
| 104 std::string stats_filename = OutputPath() + "stats.txt"; | 110 std::string stats_filename_ref = OutputPath() + "stats-1.txt"; |
| 111 std::string stats_filename = OutputPath() + "stats-2.txt"; |
| 105 std::ofstream stats_file; | 112 std::ofstream stats_file; |
| 113 |
| 114 stats_file.open(stats_filename_ref.c_str()); |
| 115 stats_file << "frame_0001 0100\n"; |
| 116 stats_file << "frame_0002 0101\n"; |
| 117 stats_file << "frame_0003 0102\n"; |
| 118 stats_file << "frame_0004 0103\n"; |
| 119 stats_file << "frame_0005 0106\n"; |
| 120 stats_file << "frame_0006 0107\n"; |
| 121 stats_file << "frame_0007 0108\n"; |
| 122 stats_file.close(); |
| 123 |
| 106 stats_file.open(stats_filename.c_str()); | 124 stats_file.open(stats_filename.c_str()); |
| 107 stats_file << "frame_0001 0100\n"; | 125 stats_file << "frame_0001 0100\n"; |
| 108 stats_file << "frame_0002 0101\n"; | 126 stats_file << "frame_0002 0101\n"; |
| 109 stats_file << "frame_0003 0101\n"; | 127 stats_file << "frame_0003 0101\n"; |
| 110 stats_file << "frame_0004 0106\n"; | 128 stats_file << "frame_0004 0106\n"; |
| 111 stats_file.close(); | 129 stats_file.close(); |
| 112 | 130 |
| 113 PrintMaxRepeatedAndSkippedFrames(logfile_, "NormalStatsFile", stats_filename); | 131 PrintMaxRepeatedAndSkippedFrames(logfile_, "NormalStatsFile", |
| 132 stats_filename_ref, stats_filename); |
| 114 } | 133 } |
| 115 | 134 |
| 116 | 135 |
| 117 } // namespace test | 136 } // namespace test |
| 118 } // namespace webrtc | 137 } // namespace webrtc |
| OLD | NEW |