Changes: 1. Added MockTransport. 2. Added VoiceEngineFixture class to be used in VoE unit tests. This class is in no way final as it is - it will grow as we add more unit tests and our understanding of the Voice Engine grows. 3. Modified VoEBase unit test to use VoiceEngineFixture. 4. Added VoENetwork unit test. R=henrika@webrtc.org, kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/49759004 Cr-Commit-Position: refs/heads/master@{#9118}
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
/*
|
|
* Copyright (c) 2015 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 "webrtc/voice_engine/voice_engine_fixture.h"
|
|
|
|
namespace webrtc {
|
|
|
|
VoiceEngineFixture::VoiceEngineFixture()
|
|
: voe_(VoiceEngine::Create()),
|
|
base_(VoEBase::GetInterface(voe_)),
|
|
network_(VoENetwork::GetInterface(voe_)) {
|
|
EXPECT_NE(nullptr, base_);
|
|
EXPECT_NE(nullptr, network_);
|
|
EXPECT_EQ(0, base_->RegisterVoiceEngineObserver(observer_));
|
|
}
|
|
|
|
VoiceEngineFixture::~VoiceEngineFixture() {
|
|
EXPECT_EQ(2, network_->Release());
|
|
EXPECT_EQ(0, base_->DeRegisterVoiceEngineObserver());
|
|
EXPECT_EQ(0, base_->Terminate());
|
|
EXPECT_EQ(1, base_->Release());
|
|
EXPECT_TRUE(VoiceEngine::Delete(voe_));
|
|
}
|
|
|
|
} // namespace webrtc
|