Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: webrtc/modules/audio_processing/transient/file_utils_unittest.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 #define MAYBE_ExpectedErrorReturnValues ExpectedErrorReturnValues 487 #define MAYBE_ExpectedErrorReturnValues ExpectedErrorReturnValues
488 #endif 488 #endif
489 TEST_F(TransientFileUtilsTest, MAYBE_ExpectedErrorReturnValues) { 489 TEST_F(TransientFileUtilsTest, MAYBE_ExpectedErrorReturnValues) {
490 std::string test_filename = kTestFileName; 490 std::string test_filename = kTestFileName;
491 491
492 double value; 492 double value;
493 std::unique_ptr<int16_t[]> int16_buffer(new int16_t[1]); 493 std::unique_ptr<int16_t[]> int16_buffer(new int16_t[1]);
494 std::unique_ptr<double[]> double_buffer(new double[1]); 494 std::unique_ptr<double[]> double_buffer(new double[1]);
495 std::unique_ptr<FileWrapper> file(FileWrapper::Create()); 495 std::unique_ptr<FileWrapper> file(FileWrapper::Create());
496 496
497 EXPECT_EQ(-1, ConvertByteArrayToDouble(NULL, &value)); 497 EXPECT_EQ(-1, ConvertByteArrayToDouble(nullptr, &value));
498 EXPECT_EQ(-1, ConvertByteArrayToDouble(kPiBytes, NULL)); 498 EXPECT_EQ(-1, ConvertByteArrayToDouble(kPiBytes, nullptr));
499 499
500 EXPECT_EQ(-1, ConvertDoubleToByteArray(kPi, NULL)); 500 EXPECT_EQ(-1, ConvertDoubleToByteArray(kPi, nullptr));
501 501
502 // Tests with file not opened. 502 // Tests with file not opened.
503 EXPECT_EQ(0u, ReadInt16BufferFromFile(file.get(), 1, int16_buffer.get())); 503 EXPECT_EQ(0u, ReadInt16BufferFromFile(file.get(), 1, int16_buffer.get()));
504 EXPECT_EQ(0u, ReadInt16FromFileToDoubleBuffer(file.get(), 504 EXPECT_EQ(0u, ReadInt16FromFileToDoubleBuffer(file.get(),
505 1, 505 1,
506 double_buffer.get())); 506 double_buffer.get()));
507 EXPECT_EQ(0u, ReadDoubleBufferFromFile(file.get(), 1, double_buffer.get())); 507 EXPECT_EQ(0u, ReadDoubleBufferFromFile(file.get(), 1, double_buffer.get()));
508 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, int16_buffer.get())); 508 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, int16_buffer.get()));
509 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, double_buffer.get())); 509 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, double_buffer.get()));
510 510
511 file->OpenFile(test_filename.c_str(), true); // Read only. 511 file->OpenFile(test_filename.c_str(), true); // Read only.
512 ASSERT_TRUE(file->is_open()) << "File could not be opened:\n" 512 ASSERT_TRUE(file->is_open()) << "File could not be opened:\n"
513 << kTestFileName.c_str(); 513 << kTestFileName.c_str();
514 514
515 EXPECT_EQ(0u, ReadInt16BufferFromFile(NULL, 1, int16_buffer.get())); 515 EXPECT_EQ(0u, ReadInt16BufferFromFile(nullptr, 1, int16_buffer.get()));
516 EXPECT_EQ(0u, ReadInt16BufferFromFile(file.get(), 1, NULL)); 516 EXPECT_EQ(0u, ReadInt16BufferFromFile(file.get(), 1, nullptr));
517 EXPECT_EQ(0u, ReadInt16BufferFromFile(file.get(), 0, int16_buffer.get())); 517 EXPECT_EQ(0u, ReadInt16BufferFromFile(file.get(), 0, int16_buffer.get()));
518 518
519 EXPECT_EQ(0u, ReadInt16FromFileToDoubleBuffer(NULL, 1, double_buffer.get())); 519 EXPECT_EQ(0u,
520 EXPECT_EQ(0u, ReadInt16FromFileToDoubleBuffer(file.get(), 1, NULL)); 520 ReadInt16FromFileToDoubleBuffer(nullptr, 1, double_buffer.get()));
521 EXPECT_EQ(0u, ReadInt16FromFileToDoubleBuffer(file.get(), 1, nullptr));
521 EXPECT_EQ(0u, ReadInt16FromFileToDoubleBuffer(file.get(), 522 EXPECT_EQ(0u, ReadInt16FromFileToDoubleBuffer(file.get(),
522 0, 523 0,
523 double_buffer.get())); 524 double_buffer.get()));
524 525
525 EXPECT_EQ(0u, ReadDoubleBufferFromFile(NULL, 1, double_buffer.get())); 526 EXPECT_EQ(0u, ReadDoubleBufferFromFile(nullptr, 1, double_buffer.get()));
526 EXPECT_EQ(0u, ReadDoubleBufferFromFile(file.get(), 1, NULL)); 527 EXPECT_EQ(0u, ReadDoubleBufferFromFile(file.get(), 1, nullptr));
527 EXPECT_EQ(0u, ReadDoubleBufferFromFile(file.get(), 0, double_buffer.get())); 528 EXPECT_EQ(0u, ReadDoubleBufferFromFile(file.get(), 0, double_buffer.get()));
528 529
529 EXPECT_EQ(0u, WriteInt16BufferToFile(NULL, 1, int16_buffer.get())); 530 EXPECT_EQ(0u, WriteInt16BufferToFile(nullptr, 1, int16_buffer.get()));
530 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, NULL)); 531 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 1, nullptr));
531 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 0, int16_buffer.get())); 532 EXPECT_EQ(0u, WriteInt16BufferToFile(file.get(), 0, int16_buffer.get()));
532 533
533 EXPECT_EQ(0u, WriteDoubleBufferToFile(NULL, 1, double_buffer.get())); 534 EXPECT_EQ(0u, WriteDoubleBufferToFile(nullptr, 1, double_buffer.get()));
534 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, NULL)); 535 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 1, nullptr));
535 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 0, double_buffer.get())); 536 EXPECT_EQ(0u, WriteDoubleBufferToFile(file.get(), 0, double_buffer.get()));
536 } 537 }
537 538
538 } // namespace webrtc 539 } // namespace webrtc
539 540
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698