webrtc/modules/audio_processing/aec3/render_delay_controller_metrics_unittest.cc
Oskar Sundbom aa8b67da9d Optional: Use nullopt and implicit construction in /modules/audio_processing
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

R=henrik.lundin@webrtc.org

Bug: None
Change-Id: I733a83f702fe11884d229a1713cfac952727bde8
Reviewed-on: https://webrtc-review.googlesource.com/23601
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20786}
2017-11-20 10:19:30 +00:00

33 lines
1.1 KiB
C++

/*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/render_delay_controller_metrics.h"
#include "api/optional.h"
#include "modules/audio_processing/aec3/aec3_common.h"
#include "test/gtest.h"
namespace webrtc {
// Verify the general functionality of RenderDelayControllerMetrics.
TEST(RenderDelayControllerMetrics, NormalUsage) {
RenderDelayControllerMetrics metrics;
for (int j = 0; j < 3; ++j) {
for (int k = 0; k < kMetricsReportingIntervalBlocks - 1; ++k) {
metrics.Update(rtc::nullopt, 0);
EXPECT_FALSE(metrics.MetricsReported());
}
metrics.Update(rtc::nullopt, 0);
EXPECT_TRUE(metrics.MetricsReported());
}
}
} // namespace webrtc