| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Verify the mixed output. | 122 // Verify the mixed output. |
| 123 FILE* output_file = fopen(output_filename_.c_str(), "rb"); | 123 FILE* output_file = fopen(output_filename_.c_str(), "rb"); |
| 124 ASSERT_TRUE(output_file != NULL); | 124 ASSERT_TRUE(output_file != NULL); |
| 125 int16_t output_value = 0; | 125 int16_t output_value = 0; |
| 126 int samples_read = 0; | 126 int samples_read = 0; |
| 127 while (fread(&output_value, sizeof(output_value), 1, output_file) == 1) { | 127 while (fread(&output_value, sizeof(output_value), 1, output_file) == 1) { |
| 128 samples_read++; | 128 samples_read++; |
| 129 std::ostringstream trace_stream; | 129 std::ostringstream trace_stream; |
| 130 trace_stream << samples_read << " samples read"; | 130 trace_stream << samples_read << " samples read"; |
| 131 SCOPED_TRACE(trace_stream.str()); | 131 SCOPED_TRACE(trace_stream.str()); |
| 132 EXPECT_LE(output_value, max_output_value); | 132 ASSERT_LE(output_value, max_output_value); |
| 133 EXPECT_GE(output_value, min_output_value); | 133 ASSERT_GE(output_value, min_output_value); |
| 134 } | 134 } |
| 135 // Ensure we've at least recorded half as much file as the duration of the | 135 // Ensure we've at least recorded half as much file as the duration of the |
| 136 // test. We have to use a relaxed tolerance here due to filesystem flakiness | 136 // test. We have to use a relaxed tolerance here due to filesystem flakiness |
| 137 // on the bots. | 137 // on the bots. |
| 138 ASSERT_GE((samples_read * 1000.0) / kRecSampleRateHz, kTestDurationMs); | 138 ASSERT_GE((samples_read * 1000.0) / kRecSampleRateHz, kTestDurationMs); |
| 139 // Ensure we read the entire file. | 139 // Ensure we read the entire file. |
| 140 ASSERT_NE(0, feof(output_file)); | 140 ASSERT_NE(0, feof(output_file)); |
| 141 ASSERT_EQ(0, fclose(output_file)); | 141 ASSERT_EQ(0, fclose(output_file)); |
| 142 } | 142 } |
| 143 | 143 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 279 |
| 280 TEST_F(MixingTest, VerifyStereoAndMonoMixing) { | 280 TEST_F(MixingTest, VerifyStereoAndMonoMixing) { |
| 281 const int16_t kInputValue = 1000; | 281 const int16_t kInputValue = 1000; |
| 282 const int16_t kExpectedOutput = kInputValue * 2; | 282 const int16_t kExpectedOutput = kInputValue * 2; |
| 283 RunMixingTest(2, 0, 1, false, kInputValue, 1.1 * kExpectedOutput, | 283 RunMixingTest(2, 0, 1, false, kInputValue, 1.1 * kExpectedOutput, |
| 284 // Lower than 0.9 due to observed flakiness on bots. | 284 // Lower than 0.9 due to observed flakiness on bots. |
| 285 0.8 * kExpectedOutput, kCodecL16); | 285 0.8 * kExpectedOutput, kCodecL16); |
| 286 } | 286 } |
| 287 | 287 |
| 288 } // namespace webrtc | 288 } // namespace webrtc |
| OLD | NEW |