Merging video_full_stack_tests and video_engine_tests.
The reason is that we want to have as few test targets as possible to simplify bot configuration. It's also more convenient for developers since it will be trivial to introduce more perfing tests. R=mflodman@webrtc.org BUG= Review URL: https://webrtc-codereview.appspot.com/2068004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4579 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
d0f4c2185b
commit
abc1ed37c6
48
webrtc/video_engine/test/common/generate_ssrcs.cc
Normal file
48
webrtc/video_engine/test/common/generate_ssrcs.cc
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2013 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/video_engine/test/common/generate_ssrcs.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "webrtc/video_engine/new_include/video_send_stream.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
void GenerateRandomSsrcs(newapi::VideoSendStream::Config* config,
|
||||
std::map<uint32_t, bool>* reserved_ssrcs) {
|
||||
size_t num_ssrcs = config->codec.numberOfSimulcastStreams;
|
||||
std::vector<uint32_t>* ssrcs = &config->rtp.ssrcs;
|
||||
assert(ssrcs->size() == 0);
|
||||
|
||||
if (num_ssrcs == 0) {
|
||||
num_ssrcs = 1;
|
||||
}
|
||||
|
||||
while (ssrcs->size() < num_ssrcs) {
|
||||
uint32_t rand_ssrc = static_cast<uint32_t>(rand() + 1); // NOLINT
|
||||
|
||||
// Make sure the ssrc is unique per-call
|
||||
while (true) {
|
||||
if (!(*reserved_ssrcs)[rand_ssrc]) {
|
||||
(*reserved_ssrcs)[rand_ssrc] = true;
|
||||
break;
|
||||
}
|
||||
++rand_ssrc;
|
||||
}
|
||||
|
||||
ssrcs->push_back(rand_ssrc);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
@ -21,30 +21,8 @@ namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
void GenerateRandomSsrcs(newapi::VideoSendStream::Config* config,
|
||||
std::map<uint32_t, bool>* reserved_ssrcs) {
|
||||
size_t num_ssrcs = config->codec.numberOfSimulcastStreams;
|
||||
std::vector<uint32_t>* ssrcs = &config->rtp.ssrcs;
|
||||
assert(ssrcs->size() == 0);
|
||||
std::map<uint32_t, bool>* reserved_ssrcs);
|
||||
|
||||
if (num_ssrcs == 0) {
|
||||
num_ssrcs = 1;
|
||||
}
|
||||
|
||||
while (ssrcs->size() < num_ssrcs) {
|
||||
uint32_t rand_ssrc = static_cast<uint32_t>(rand() + 1); // NOLINT
|
||||
|
||||
// Make sure the ssrc is unique per-call
|
||||
while (true) {
|
||||
if (!(*reserved_ssrcs)[rand_ssrc]) {
|
||||
(*reserved_ssrcs)[rand_ssrc] = true;
|
||||
break;
|
||||
}
|
||||
++rand_ssrc;
|
||||
}
|
||||
|
||||
ssrcs->push_back(rand_ssrc);
|
||||
}
|
||||
}
|
||||
} // test
|
||||
} // webrtc
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
'common/frame_generator.h',
|
||||
'common/frame_generator_capturer.cc',
|
||||
'common/frame_generator_capturer.h',
|
||||
'common/generate_ssrcs.cc',
|
||||
'common/generate_ssrcs.h',
|
||||
'common/gl/gl_renderer.cc',
|
||||
'common/gl/gl_renderer.h',
|
||||
@ -128,24 +129,12 @@
|
||||
'video_tests_common',
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'video_full_stack_tests',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'full_stack.cc',
|
||||
'test_main.cc',
|
||||
],
|
||||
'dependencies': [
|
||||
'<(DEPTH)/testing/gtest.gyp:gtest',
|
||||
'<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
|
||||
'video_tests_common',
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'video_engine_tests',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'engine_tests.cc',
|
||||
'full_stack.cc',
|
||||
'send_stream_tests.cc',
|
||||
'test_main.cc',
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user