Move TestConfig to separate file.

Move functions Set/PrintCodecSettings, NumberOfTemporalLayers to TestConfig.
Add function NumberOfCores.

Bug: none
Change-Id: Ic33d79681d59d62bf34d9c9ff056a751ed3f8da8
Reviewed-on: https://webrtc-review.googlesource.com/13120
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20358}
This commit is contained in:
Åsa Persson
2017-10-19 14:05:50 +02:00
committed by Commit Bot
parent 4696a159ef
commit 2d27fb5a33
13 changed files with 382 additions and 272 deletions

View File

@ -0,0 +1,55 @@
/*
* 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/video_coding/codecs/test/test_config.h"
#include "test/gtest.h"
#include "test/video_codec_settings.h"
namespace webrtc {
namespace test {
namespace {
const int kNumTemporalLayers = 2;
} // namespace
TEST(TestConfig, NumberOfCoresWithUseSingleCore) {
TestConfig config;
config.use_single_core = true;
EXPECT_EQ(1, config.NumberOfCores());
}
TEST(TestConfig, NumberOfCoresWithoutUseSingleCore) {
TestConfig config;
config.use_single_core = false;
EXPECT_GE(config.NumberOfCores(), 1);
}
TEST(TestConfig, NumberOfTemporalLayersIsOne) {
TestConfig config;
webrtc::test::CodecSettings(kVideoCodecH264, &config.codec_settings);
EXPECT_EQ(1, config.NumberOfTemporalLayers());
}
TEST(TestConfig, NumberOfTemporalLayers_Vp8) {
TestConfig config;
webrtc::test::CodecSettings(kVideoCodecVP8, &config.codec_settings);
config.codec_settings.VP8()->numberOfTemporalLayers = kNumTemporalLayers;
EXPECT_EQ(kNumTemporalLayers, config.NumberOfTemporalLayers());
}
TEST(TestConfig, NumberOfTemporalLayers_Vp9) {
TestConfig config;
webrtc::test::CodecSettings(kVideoCodecVP9, &config.codec_settings);
config.codec_settings.VP9()->numberOfTemporalLayers = kNumTemporalLayers;
EXPECT_EQ(kNumTemporalLayers, config.NumberOfTemporalLayers());
}
} // namespace test
} // namespace webrtc