diff options
author | James Zern <jzern@google.com> | 2022-05-27 19:36:47 -0700 |
---|---|---|
committer | James Zern <jzern@google.com> | 2022-05-27 21:57:11 -0700 |
commit | c304ec38d05040b74de4aacada62c4a336714341 (patch) | |
tree | d636c5e35e3c8743a439846758148102865bd43a /test/y4m_video_source.h | |
parent | 9f1329f8ac88ea5d7c6ae5d6a57221c36cf85ac8 (diff) | |
download | libvpx-c304ec38d05040b74de4aacada62c4a336714341.tar libvpx-c304ec38d05040b74de4aacada62c4a336714341.tar.gz libvpx-c304ec38d05040b74de4aacada62c4a336714341.tar.bz2 libvpx-c304ec38d05040b74de4aacada62c4a336714341.zip |
test/*: normalize use of nullptr
this is preferred over NULL in C++11
Change-Id: Ic48ddcc6dfb8975a57f6713549ad04d93db21415
Diffstat (limited to 'test/y4m_video_source.h')
-rw-r--r-- | test/y4m_video_source.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/y4m_video_source.h b/test/y4m_video_source.h index 89aa2a44f..71fbf3193 100644 --- a/test/y4m_video_source.h +++ b/test/y4m_video_source.h @@ -23,7 +23,7 @@ namespace libvpx_test { class Y4mVideoSource : public VideoSource { public: Y4mVideoSource(const std::string &file_name, unsigned int start, int limit) - : file_name_(file_name), input_file_(NULL), img_(new vpx_image_t()), + : file_name_(file_name), input_file_(nullptr), img_(new vpx_image_t()), start_(start), limit_(limit), frame_(0), framerate_numerator_(0), framerate_denominator_(0), y4m_() {} @@ -35,13 +35,13 @@ class Y4mVideoSource : public VideoSource { virtual void OpenSource() { CloseSource(); input_file_ = OpenTestDataFile(file_name_); - ASSERT_TRUE(input_file_ != NULL) + ASSERT_NE(input_file_, nullptr) << "Input file open failed. Filename: " << file_name_; } virtual void ReadSourceToStart() { - ASSERT_TRUE(input_file_ != NULL); - ASSERT_FALSE(y4m_input_open(&y4m_, input_file_, NULL, 0, 0)); + ASSERT_NE(input_file_, nullptr); + ASSERT_FALSE(y4m_input_open(&y4m_, input_file_, nullptr, 0, 0)); framerate_numerator_ = y4m_.fps_n; framerate_denominator_ = y4m_.fps_d; frame_ = 0; @@ -62,7 +62,7 @@ class Y4mVideoSource : public VideoSource { } virtual vpx_image_t *img() const { - return (frame_ < limit_) ? img_.get() : NULL; + return (frame_ < limit_) ? img_.get() : nullptr; } // Models a stream where Timebase = 1/FPS, so pts == frame. @@ -80,7 +80,7 @@ class Y4mVideoSource : public VideoSource { virtual unsigned int limit() const { return limit_; } virtual void FillFrame() { - ASSERT_TRUE(input_file_ != NULL); + ASSERT_NE(input_file_, nullptr); // Read a frame from input_file. y4m_input_fetch_frame(&y4m_, input_file_, img_.get()); } @@ -101,9 +101,9 @@ class Y4mVideoSource : public VideoSource { void CloseSource() { y4m_input_close(&y4m_); y4m_ = y4m_input(); - if (input_file_ != NULL) { + if (input_file_ != nullptr) { fclose(input_file_); - input_file_ = NULL; + input_file_ = nullptr; } } |