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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 false, // Write mode. | 358 false, // Write mode. |
359 false, // No loop. | 359 false, // No loop. |
360 false); // No text. | 360 false); // No text. |
361 ASSERT_TRUE(file->Open()) << "File could not be opened:\n" | 361 ASSERT_TRUE(file->Open()) << "File could not be opened:\n" |
362 << kOutFileName.c_str(); | 362 << kOutFileName.c_str(); |
363 | 363 |
364 const size_t kBufferLength = 3; | 364 const size_t kBufferLength = 3; |
365 rtc::scoped_ptr<float[]> written_buffer(new float[kBufferLength]); | 365 rtc::scoped_ptr<float[]> written_buffer(new float[kBufferLength]); |
366 rtc::scoped_ptr<float[]> read_buffer(new float[kBufferLength]); | 366 rtc::scoped_ptr<float[]> read_buffer(new float[kBufferLength]); |
367 | 367 |
368 written_buffer[0] = (float)kPi; | 368 written_buffer[0] = kPi; |
369 written_buffer[1] = (float)kE; | 369 written_buffer[1] = kE; |
370 written_buffer[2] = (float)kAvogadro; | 370 written_buffer[2] = kAvogadro; |
371 | 371 |
372 EXPECT_EQ(kBufferLength, WriteFloatBufferToFile(file.get(), | 372 EXPECT_EQ(kBufferLength, WriteFloatBufferToFile(file.get(), |
373 kBufferLength, | 373 kBufferLength, |
374 written_buffer.get())); | 374 written_buffer.get())); |
375 | 375 |
376 file->CloseFile(); | 376 file->CloseFile(); |
377 | 377 |
378 file->OpenFile(kOutFileName.c_str(), | 378 file->OpenFile(kOutFileName.c_str(), |
379 true, // Read only. | 379 true, // Read only. |
380 false, // No loop. | 380 false, // No loop. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, NULL)); | 479 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, NULL)); |
480 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 0, int16_buffer.get())); | 480 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 0, int16_buffer.get())); |
481 | 481 |
482 EXPECT_EQ(0u, WriteDoubleBufferToFile(NULL, 1, double_buffer.get())); | 482 EXPECT_EQ(0u, WriteDoubleBufferToFile(NULL, 1, double_buffer.get())); |
483 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, NULL)); | 483 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, NULL)); |
484 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 0, double_buffer.get())); | 484 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 0, double_buffer.get())); |
485 } | 485 } |
486 | 486 |
487 } // namespace webrtc | 487 } // namespace webrtc |
488 | 488 |
OLD | NEW |