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

Unified Diff: modules/module_common_types_unittest.cc

Issue 3014683002: Revert of Remove various IDs (Closed)
Patch Set: 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
« no previous file with comments | « modules/include/module_common_types.h ('k') | voice_engine/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/module_common_types_unittest.cc
diff --git a/modules/module_common_types_unittest.cc b/modules/module_common_types_unittest.cc
index c8bb5f98509a40a04aff520fae5bdaf783e29cb6..f601a590512b8f99d794acf46afca03035adbe6b 100644
--- a/modules/module_common_types_unittest.cc
+++ b/modules/module_common_types_unittest.cc
@@ -28,6 +28,7 @@
return true;
}
+constexpr int kId = 16;
constexpr uint32_t kTimestamp = 27;
constexpr int kSampleRateHz = 16000;
constexpr size_t kNumChannels = 1;
@@ -63,9 +64,10 @@
TEST(AudioFrameTest, UpdateFrame) {
AudioFrame frame;
int16_t samples[kNumChannels * kSamplesPerChannel] = {17};
- frame.UpdateFrame(kTimestamp, samples, kSamplesPerChannel, kSampleRateHz,
+ frame.UpdateFrame(kId, kTimestamp, samples, kSamplesPerChannel, kSampleRateHz,
AudioFrame::kPLC, AudioFrame::kVadActive, kNumChannels);
+ EXPECT_EQ(kId, frame.id_);
EXPECT_EQ(kTimestamp, frame.timestamp_);
EXPECT_EQ(kSamplesPerChannel, frame.samples_per_channel_);
EXPECT_EQ(kSampleRateHz, frame.sample_rate_hz_);
@@ -76,7 +78,7 @@
EXPECT_FALSE(frame.muted());
EXPECT_EQ(0, memcmp(samples, frame.data(), sizeof(samples)));
- frame.UpdateFrame(kTimestamp, nullptr /* data*/, kSamplesPerChannel,
+ frame.UpdateFrame(kId, kTimestamp, nullptr /* data*/, kSamplesPerChannel,
kSampleRateHz, AudioFrame::kPLC, AudioFrame::kVadActive,
kNumChannels);
EXPECT_TRUE(frame.muted());
@@ -88,11 +90,12 @@
AudioFrame frame2;
int16_t samples[kNumChannels * kSamplesPerChannel] = {17};
- frame2.UpdateFrame(kTimestamp, samples, kSamplesPerChannel,
+ frame2.UpdateFrame(kId, kTimestamp, samples, kSamplesPerChannel,
kSampleRateHz, AudioFrame::kPLC, AudioFrame::kVadActive,
kNumChannels);
frame1.CopyFrom(frame2);
+ EXPECT_EQ(frame2.id_, frame1.id_);
EXPECT_EQ(frame2.timestamp_, frame1.timestamp_);
EXPECT_EQ(frame2.samples_per_channel_, frame1.samples_per_channel_);
EXPECT_EQ(frame2.sample_rate_hz_, frame1.sample_rate_hz_);
@@ -103,7 +106,7 @@
EXPECT_EQ(frame2.muted(), frame1.muted());
EXPECT_EQ(0, memcmp(frame2.data(), frame1.data(), sizeof(samples)));
- frame2.UpdateFrame(kTimestamp, nullptr /* data */, kSamplesPerChannel,
+ frame2.UpdateFrame(kId, kTimestamp, nullptr /* data */, kSamplesPerChannel,
kSampleRateHz, AudioFrame::kPLC, AudioFrame::kVadActive,
kNumChannels);
frame1.CopyFrom(frame2);
« no previous file with comments | « modules/include/module_common_types.h ('k') | voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698