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

Unified Diff: webrtc/modules/video_coding/codecs/test/stats_unittest.cc

Issue 3011923002: Clean up Stats class used in VideoProcessor tests. (Closed)
Patch Set: Fix VS compile. Created 3 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/codecs/test/stats_unittest.cc
diff --git a/webrtc/modules/video_coding/codecs/test/stats_unittest.cc b/webrtc/modules/video_coding/codecs/test/stats_unittest.cc
index 55bdfaff91bb935062eef195c19a8960993600c7..24fe2654070c76481d908c1a22c058710cc7d6cf 100644
--- a/webrtc/modules/video_coding/codecs/test/stats_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/test/stats_unittest.cc
@@ -11,36 +11,32 @@
#include "webrtc/modules/video_coding/codecs/test/stats.h"
#include "webrtc/test/gtest.h"
-#include "webrtc/typedefs.h"
namespace webrtc {
namespace test {
TEST(StatsTest, TestEmptyObject) {
Stats stats;
- EXPECT_EQ(0u, stats.stats_.size());
- stats.PrintSummary(); // should not crash
+ stats.PrintSummary(); // Should not crash.
}
TEST(StatsTest, AddSingleFrame) {
- const int kFrameNumber = 0;
Stats stats;
- stats.NewFrame(kFrameNumber);
- EXPECT_EQ(1u, stats.stats_.size());
- FrameStatistic* frame_stat = &stats.stats_[0];
- EXPECT_EQ(kFrameNumber, frame_stat->frame_number);
+ FrameStatistic* frame_stat = stats.AddFrame();
+ EXPECT_EQ(0, frame_stat->frame_number);
+ EXPECT_EQ(1u, stats.size());
}
TEST(StatsTest, AddMultipleFrames) {
Stats stats;
const int kNumFrames = 1000;
for (int i = 0; i < kNumFrames; ++i) {
- FrameStatistic& frame_stat = stats.NewFrame(i);
- EXPECT_EQ(i, frame_stat.frame_number);
+ FrameStatistic* frame_stat = stats.AddFrame();
+ EXPECT_EQ(i, frame_stat->frame_number);
}
- EXPECT_EQ(kNumFrames, static_cast<int>(stats.stats_.size()));
+ EXPECT_EQ(kNumFrames, static_cast<int>(stats.size()));
- stats.PrintSummary(); // should not crash
+ stats.PrintSummary(); // Should not crash.
}
} // namespace test
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/stats.cc ('k') | webrtc/modules/video_coding/codecs/test/videoprocessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698