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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 false, // Write mode. | 412 false, // Write mode. |
413 false, // No loop. | 413 false, // No loop. |
414 false); // No text. | 414 false); // No text. |
415 ASSERT_TRUE(file->Open()) << "File could not be opened:\n" | 415 ASSERT_TRUE(file->Open()) << "File could not be opened:\n" |
416 << kOutFileName.c_str(); | 416 << kOutFileName.c_str(); |
417 | 417 |
418 const size_t kBufferLength = 3; | 418 const size_t kBufferLength = 3; |
419 rtc::scoped_ptr<float[]> written_buffer(new float[kBufferLength]); | 419 rtc::scoped_ptr<float[]> written_buffer(new float[kBufferLength]); |
420 rtc::scoped_ptr<float[]> read_buffer(new float[kBufferLength]); | 420 rtc::scoped_ptr<float[]> read_buffer(new float[kBufferLength]); |
421 | 421 |
422 written_buffer[0] = kPi; | 422 written_buffer[0] = static_cast<float>(kPi); |
423 written_buffer[1] = kE; | 423 written_buffer[1] = static_cast<float>(kE); |
424 written_buffer[2] = kAvogadro; | 424 written_buffer[2] = static_cast<float>(kAvogadro); |
425 | 425 |
426 EXPECT_EQ(kBufferLength, WriteFloatBufferToFile(file.get(), | 426 EXPECT_EQ(kBufferLength, WriteFloatBufferToFile(file.get(), |
427 kBufferLength, | 427 kBufferLength, |
428 written_buffer.get())); | 428 written_buffer.get())); |
429 | 429 |
430 file->CloseFile(); | 430 file->CloseFile(); |
431 | 431 |
432 file->OpenFile(kOutFileName.c_str(), | 432 file->OpenFile(kOutFileName.c_str(), |
433 true, // Read only. | 433 true, // Read only. |
434 false, // No loop. | 434 false, // No loop. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, NULL)); | 543 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, NULL)); |
544 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 0, int16_buffer.get())); | 544 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 0, int16_buffer.get())); |
545 | 545 |
546 EXPECT_EQ(0u, WriteDoubleBufferToFile(NULL, 1, double_buffer.get())); | 546 EXPECT_EQ(0u, WriteDoubleBufferToFile(NULL, 1, double_buffer.get())); |
547 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, NULL)); | 547 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, NULL)); |
548 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 0, double_buffer.get())); | 548 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 0, double_buffer.get())); |
549 } | 549 } |
550 | 550 |
551 } // namespace webrtc | 551 } // namespace webrtc |
552 | 552 |
OLD | NEW |