Refactor rtc_unittests into several targets.
Also fix some warnings. NOTRY=True BUG=webrtc:6954 Review-Url: https://codereview.webrtc.org/2611663002 Cr-Commit-Position: refs/heads/master@{#15900}
This commit is contained in:
parent
fd58b61068
commit
da8dcfb43e
177
webrtc/BUILD.gn
177
webrtc/BUILD.gn
@ -360,7 +360,6 @@ if (rtc_include_tests) {
|
||||
# come from a config and can"t be on the target directly.
|
||||
if (is_clang) {
|
||||
cflags = [
|
||||
"-Wno-missing-braces",
|
||||
"-Wno-sign-compare",
|
||||
"-Wno-unused-const-variable",
|
||||
]
|
||||
@ -369,155 +368,14 @@ if (rtc_include_tests) {
|
||||
|
||||
rtc_test("rtc_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"api/fakemetricsobserver.cc",
|
||||
"base/analytics/exp_filter_unittest.cc",
|
||||
"base/analytics/percentile_filter_unittest.cc",
|
||||
"base/array_view_unittest.cc",
|
||||
"base/atomicops_unittest.cc",
|
||||
"base/autodetectproxy_unittest.cc",
|
||||
"base/base64_unittest.cc",
|
||||
"base/basictypes_unittest.cc",
|
||||
"base/bind_unittest.cc",
|
||||
"base/bitbuffer_unittest.cc",
|
||||
"base/buffer_unittest.cc",
|
||||
"base/bufferqueue_unittest.cc",
|
||||
"base/bytebuffer_unittest.cc",
|
||||
"base/byteorder_unittest.cc",
|
||||
"base/callback_unittest.cc",
|
||||
"base/copyonwritebuffer_unittest.cc",
|
||||
"base/crc32_unittest.cc",
|
||||
"base/criticalsection_unittest.cc",
|
||||
"base/event_tracer_unittest.cc",
|
||||
"base/event_unittest.cc",
|
||||
"base/file_unittest.cc",
|
||||
"base/filerotatingstream_unittest.cc",
|
||||
"base/fileutils_unittest.cc",
|
||||
"base/function_view_unittest.cc",
|
||||
"base/helpers_unittest.cc",
|
||||
"base/httpbase_unittest.cc",
|
||||
"base/httpcommon_unittest.cc",
|
||||
"base/httpserver_unittest.cc",
|
||||
"base/ipaddress_unittest.cc",
|
||||
"base/logging_unittest.cc",
|
||||
"base/md5digest_unittest.cc",
|
||||
"base/messagedigest_unittest.cc",
|
||||
"base/messagequeue_unittest.cc",
|
||||
"base/mod_ops_unittest.cc",
|
||||
"base/nat_unittest.cc",
|
||||
"base/network_unittest.cc",
|
||||
"base/onetimeevent_unittest.cc",
|
||||
"base/optional_unittest.cc",
|
||||
"base/optionsfile_unittest.cc",
|
||||
"base/pathutils_unittest.cc",
|
||||
"base/platform_thread_unittest.cc",
|
||||
"base/proxy_unittest.cc",
|
||||
"base/proxydetect_unittest.cc",
|
||||
"base/random_unittest.cc",
|
||||
"base/rate_limiter_unittest.cc",
|
||||
"base/rate_statistics_unittest.cc",
|
||||
"base/ratelimiter_unittest.cc",
|
||||
"base/ratetracker_unittest.cc",
|
||||
"base/refcountedobject_unittest.cc",
|
||||
"base/rollingaccumulator_unittest.cc",
|
||||
"base/rtccertificate_unittest.cc",
|
||||
"base/rtccertificategenerator_unittest.cc",
|
||||
"base/safe_compare_unittest.cc",
|
||||
"base/scopedptrcollection_unittest.cc",
|
||||
"base/sequenced_task_checker_unittest.cc",
|
||||
"base/sha1digest_unittest.cc",
|
||||
"base/sharedexclusivelock_unittest.cc",
|
||||
"base/signalthread_unittest.cc",
|
||||
"base/sigslot_unittest.cc",
|
||||
"base/sigslottester_unittest.cc",
|
||||
"base/stream_unittest.cc",
|
||||
"base/stringencode_unittest.cc",
|
||||
"base/stringutils_unittest.cc",
|
||||
"base/swap_queue_unittest.cc",
|
||||
|
||||
# TODO(ronghuawu): Reenable this test.
|
||||
# "systeminfo_unittest.cc",
|
||||
"base/task_queue_unittest.cc",
|
||||
"base/task_unittest.cc",
|
||||
"base/testclient_unittest.cc",
|
||||
"base/thread_annotations_unittest.cc",
|
||||
"base/thread_checker_unittest.cc",
|
||||
"base/thread_unittest.cc",
|
||||
"base/timestampaligner_unittest.cc",
|
||||
"base/timeutils_unittest.cc",
|
||||
"base/weak_ptr_unittest.cc",
|
||||
"p2p/base/asyncstuntcpsocket_unittest.cc",
|
||||
"p2p/base/dtlstransportchannel_unittest.cc",
|
||||
"p2p/base/fakeportallocator.h",
|
||||
"p2p/base/faketransportcontroller.h",
|
||||
"p2p/base/jseptransport_unittest.cc",
|
||||
"p2p/base/p2ptransportchannel_unittest.cc",
|
||||
"p2p/base/port_unittest.cc",
|
||||
"p2p/base/portallocator_unittest.cc",
|
||||
"p2p/base/pseudotcp_unittest.cc",
|
||||
"p2p/base/relayport_unittest.cc",
|
||||
"p2p/base/relayserver_unittest.cc",
|
||||
"p2p/base/stun_unittest.cc",
|
||||
"p2p/base/stunport_unittest.cc",
|
||||
"p2p/base/stunrequest_unittest.cc",
|
||||
"p2p/base/stunserver_unittest.cc",
|
||||
"p2p/base/tcpport_unittest.cc",
|
||||
"p2p/base/testrelayserver.h",
|
||||
"p2p/base/teststunserver.h",
|
||||
"p2p/base/testturnserver.h",
|
||||
"p2p/base/transportcontroller_unittest.cc",
|
||||
"p2p/base/transportdescriptionfactory_unittest.cc",
|
||||
"p2p/base/turnport_unittest.cc",
|
||||
"p2p/base/turnserver_unittest.cc",
|
||||
"p2p/base/udptransportchannel_unittest.cc",
|
||||
"p2p/client/basicportallocator_unittest.cc",
|
||||
"p2p/stunprober/stunprober_unittest.cc",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
sources += [
|
||||
"base/win32_unittest.cc",
|
||||
"base/win32window_unittest.cc",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_mac) {
|
||||
sources += [ "base/macutils_unittest.cc" ]
|
||||
}
|
||||
|
||||
if (is_posix) {
|
||||
sources += [
|
||||
"base/ssladapter_unittest.cc",
|
||||
"base/sslidentity_unittest.cc",
|
||||
"base/sslstreamadapter_unittest.cc",
|
||||
]
|
||||
}
|
||||
if (rtc_use_quic) {
|
||||
sources += [
|
||||
"p2p/quic/quicconnectionhelper_unittest.cc",
|
||||
"p2p/quic/quicsession_unittest.cc",
|
||||
"p2p/quic/quictransport_unittest.cc",
|
||||
"p2p/quic/quictransportchannel_unittest.cc",
|
||||
"p2p/quic/reliablequicstream_unittest.cc",
|
||||
]
|
||||
}
|
||||
|
||||
configs += [ ":rtc_unittests_config" ]
|
||||
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
"base:rtc_analytics",
|
||||
"base:rtc_base",
|
||||
"base:rtc_base_tests_utils",
|
||||
"base:rtc_task_queue",
|
||||
"p2p:libstunprober",
|
||||
"p2p:rtc_p2p",
|
||||
"//testing/gmock",
|
||||
"//testing/gtest",
|
||||
"base:rtc_analytics_unittests",
|
||||
"base:rtc_base_approved_unittests",
|
||||
"base:rtc_base_unittests",
|
||||
"base:rtc_task_queue_unittests",
|
||||
"p2p:libstunprober_unittests",
|
||||
"p2p:rtc_p2p_unittests",
|
||||
]
|
||||
|
||||
if (rtc_enable_protobuf) {
|
||||
@ -530,28 +388,7 @@ if (rtc_include_tests) {
|
||||
}
|
||||
|
||||
if (is_ios || is_mac) {
|
||||
deps += [
|
||||
"sdk:rtc_sdk_peerconnection_objc",
|
||||
"system_wrappers:system_wrappers_default",
|
||||
"//third_party/ocmock",
|
||||
]
|
||||
sources += [
|
||||
"sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm",
|
||||
"sdk/objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
|
||||
"sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm",
|
||||
"sdk/objc/Framework/UnitTests/RTCIceServerTest.mm",
|
||||
"sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
|
||||
"sdk/objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
|
||||
"sdk/objc/Framework/UnitTests/avformatmappertests.mm",
|
||||
]
|
||||
|
||||
# TODO(tkchin): Cleanup this warning.
|
||||
cflags = [ "-Wno-objc-property-no-attribute" ]
|
||||
|
||||
# |-ObjC| flag needed to make sure category method implementations
|
||||
# are included:
|
||||
# https://developer.apple.com/library/mac/qa/qa1490/_index.html
|
||||
ldflags = [ "-ObjC" ]
|
||||
deps += [ "sdk:rtc_sdk_peerconnection_objc_unittests" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -224,8 +224,6 @@ if (rtc_include_tests) {
|
||||
sources = [
|
||||
"datachannel_unittest.cc",
|
||||
"dtmfsender_unittest.cc",
|
||||
"fakemetricsobserver.cc",
|
||||
"fakemetricsobserver.h",
|
||||
"jsepsessiondescription_unittest.cc",
|
||||
"localaudiosource_unittest.cc",
|
||||
"mediaconstraintsinterface_unittest.cc",
|
||||
@ -307,6 +305,7 @@ if (rtc_include_tests) {
|
||||
}
|
||||
|
||||
deps += [
|
||||
":fakemetricsobserver",
|
||||
":libjingle_peerconnection",
|
||||
"..:webrtc_common",
|
||||
"../base:rtc_base_tests_utils",
|
||||
@ -338,4 +337,20 @@ if (rtc_include_tests) {
|
||||
"//webrtc/test:test_support",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("fakemetricsobserver") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"fakemetricsobserver.cc",
|
||||
"fakemetricsobserver.h",
|
||||
]
|
||||
deps = [
|
||||
":libjingle_peerconnection",
|
||||
"../base:rtc_base_approved",
|
||||
]
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,6 +103,7 @@ rtc_static_library("rtc_base_approved") {
|
||||
"atomicops.h",
|
||||
"base64.cc",
|
||||
"base64.h",
|
||||
"basictypes.h",
|
||||
"bind.h",
|
||||
"bitbuffer.cc",
|
||||
"bitbuffer.h",
|
||||
@ -285,6 +286,61 @@ rtc_static_library("rtc_base_approved") {
|
||||
}
|
||||
}
|
||||
|
||||
if (rtc_include_tests) {
|
||||
rtc_source_set("rtc_base_approved_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"array_view_unittest.cc",
|
||||
"atomicops_unittest.cc",
|
||||
"base64_unittest.cc",
|
||||
"basictypes_unittest.cc",
|
||||
"bind_unittest.cc",
|
||||
"bitbuffer_unittest.cc",
|
||||
"buffer_unittest.cc",
|
||||
"bufferqueue_unittest.cc",
|
||||
"bytebuffer_unittest.cc",
|
||||
"byteorder_unittest.cc",
|
||||
"copyonwritebuffer_unittest.cc",
|
||||
"criticalsection_unittest.cc",
|
||||
"event_tracer_unittest.cc",
|
||||
"event_unittest.cc",
|
||||
"file_unittest.cc",
|
||||
"function_view_unittest.cc",
|
||||
"logging_unittest.cc",
|
||||
"md5digest_unittest.cc",
|
||||
"mod_ops_unittest.cc",
|
||||
"onetimeevent_unittest.cc",
|
||||
"optional_unittest.cc",
|
||||
"pathutils_unittest.cc",
|
||||
"platform_thread_unittest.cc",
|
||||
"random_unittest.cc",
|
||||
"rate_limiter_unittest.cc",
|
||||
"rate_statistics_unittest.cc",
|
||||
"ratetracker_unittest.cc",
|
||||
"refcountedobject_unittest.cc",
|
||||
"safe_compare_unittest.cc",
|
||||
"stringencode_unittest.cc",
|
||||
"stringutils_unittest.cc",
|
||||
"swap_queue_unittest.cc",
|
||||
|
||||
# TODO(ronghuawu): Reenable this test.
|
||||
# "systeminfo_unittest.cc",
|
||||
"thread_annotations_unittest.cc",
|
||||
"thread_checker_unittest.cc",
|
||||
"timestampaligner_unittest.cc",
|
||||
"timeutils_unittest.cc",
|
||||
]
|
||||
deps = [
|
||||
":rtc_base_approved",
|
||||
":rtc_base_tests_utils",
|
||||
]
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
config("enable_libevent_config") {
|
||||
defines = [ "WEBRTC_BUILD_LIBEVENT" ]
|
||||
}
|
||||
@ -338,6 +394,25 @@ rtc_static_library("rtc_task_queue") {
|
||||
}
|
||||
}
|
||||
|
||||
if (rtc_include_tests) {
|
||||
rtc_source_set("rtc_task_queue_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"sequenced_task_checker_unittest.cc",
|
||||
"task_queue_unittest.cc",
|
||||
"weak_ptr_unittest.cc",
|
||||
]
|
||||
deps = [
|
||||
":rtc_base_tests_utils",
|
||||
":rtc_task_queue",
|
||||
]
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rtc_static_library("rtc_analytics") {
|
||||
sources = [
|
||||
"analytics/exp_filter.cc",
|
||||
@ -349,6 +424,20 @@ rtc_static_library("rtc_analytics") {
|
||||
]
|
||||
}
|
||||
|
||||
if (rtc_include_tests) {
|
||||
rtc_source_set("rtc_analytics_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"analytics/exp_filter_unittest.cc",
|
||||
"analytics/percentile_filter_unittest.cc",
|
||||
]
|
||||
deps = [
|
||||
":rtc_analytics",
|
||||
":rtc_base_tests_utils",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
config("rtc_base_warnings_config") {
|
||||
if (is_win && is_clang) {
|
||||
cflags = [
|
||||
@ -686,6 +775,77 @@ rtc_static_library("rtc_base") {
|
||||
}
|
||||
}
|
||||
|
||||
if (rtc_include_tests) {
|
||||
config("rtc_base_unittests_config") {
|
||||
if (is_clang) {
|
||||
cflags = [ "-Wno-unused-const-variable" ]
|
||||
}
|
||||
}
|
||||
rtc_source_set("rtc_base_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"autodetectproxy_unittest.cc",
|
||||
"callback_unittest.cc",
|
||||
"crc32_unittest.cc",
|
||||
"filerotatingstream_unittest.cc",
|
||||
"fileutils_unittest.cc",
|
||||
"helpers_unittest.cc",
|
||||
"httpbase_unittest.cc",
|
||||
"httpcommon_unittest.cc",
|
||||
"httpserver_unittest.cc",
|
||||
"ipaddress_unittest.cc",
|
||||
"messagedigest_unittest.cc",
|
||||
"messagequeue_unittest.cc",
|
||||
"nat_unittest.cc",
|
||||
"network_unittest.cc",
|
||||
"optionsfile_unittest.cc",
|
||||
"proxy_unittest.cc",
|
||||
"proxydetect_unittest.cc",
|
||||
"ratelimiter_unittest.cc",
|
||||
"rollingaccumulator_unittest.cc",
|
||||
"rtccertificate_unittest.cc",
|
||||
"rtccertificategenerator_unittest.cc",
|
||||
"scopedptrcollection_unittest.cc",
|
||||
"sha1digest_unittest.cc",
|
||||
"sharedexclusivelock_unittest.cc",
|
||||
"signalthread_unittest.cc",
|
||||
"sigslot_unittest.cc",
|
||||
"sigslottester_unittest.cc",
|
||||
"stream_unittest.cc",
|
||||
"task_unittest.cc",
|
||||
"testclient_unittest.cc",
|
||||
"thread_unittest.cc",
|
||||
]
|
||||
if (is_win) {
|
||||
sources += [
|
||||
"win32_unittest.cc",
|
||||
"win32window_unittest.cc",
|
||||
]
|
||||
}
|
||||
if (is_mac) {
|
||||
sources += [ "macutils_unittest.cc" ]
|
||||
}
|
||||
if (is_posix) {
|
||||
sources += [
|
||||
"ssladapter_unittest.cc",
|
||||
"sslidentity_unittest.cc",
|
||||
"sslstreamadapter_unittest.cc",
|
||||
]
|
||||
}
|
||||
deps = [
|
||||
":rtc_base_tests_utils",
|
||||
]
|
||||
public_deps = [
|
||||
":rtc_base",
|
||||
]
|
||||
configs += [ ":rtc_base_unittests_config" ]
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rtc_source_set("gtest_prod") {
|
||||
sources = [
|
||||
"gtest_prod_util.h",
|
||||
@ -742,6 +902,7 @@ if (rtc_include_tests) {
|
||||
"../test:test_support",
|
||||
]
|
||||
public_deps = [
|
||||
"//testing/gmock",
|
||||
"//testing/gtest",
|
||||
]
|
||||
|
||||
|
||||
@ -52,11 +52,11 @@ bool VerifyBuffer(uint8_t* buffer, size_t length, uint8_t start_value) {
|
||||
class FileTest : public ::testing::Test {
|
||||
protected:
|
||||
std::string path_;
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
path_ = webrtc::test::TempFilename(webrtc::test::OutputPath(), "test_file");
|
||||
ASSERT_FALSE(path_.empty());
|
||||
}
|
||||
void TearDown() { RemoveFile(path_); }
|
||||
void TearDown() override { RemoveFile(path_); }
|
||||
};
|
||||
|
||||
TEST_F(FileTest, DefaultConstructor) {
|
||||
|
||||
@ -88,12 +88,12 @@ TEST(LogTest, MultipleStreams) {
|
||||
// We should restore the correct global state at the end.
|
||||
class LogThread : public Thread {
|
||||
public:
|
||||
virtual ~LogThread() {
|
||||
~LogThread() override {
|
||||
Stop();
|
||||
}
|
||||
|
||||
private:
|
||||
void Run() {
|
||||
void Run() override {
|
||||
// LS_SENSITIVE to avoid cluttering up any real logging going on
|
||||
LOG(LS_SENSITIVE) << "LOG";
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class RateLimitTest : public ::testing::Test {
|
||||
public:
|
||||
RateLimitTest()
|
||||
: clock_(0), rate_limiter(new RateLimiter(&clock_, kWindowSizeMs)) {}
|
||||
virtual ~RateLimitTest() {}
|
||||
~RateLimitTest() override {}
|
||||
|
||||
void SetUp() override { rate_limiter->SetMaxRate(kMaxRateBps); }
|
||||
|
||||
@ -147,7 +147,7 @@ TEST_F(RateLimitTest, MultiThreadedUsage) {
|
||||
public:
|
||||
explicit SetWindowSizeTask(RateLimiter* rate_limiter)
|
||||
: ThreadTask(rate_limiter) {}
|
||||
virtual ~SetWindowSizeTask() {}
|
||||
~SetWindowSizeTask() override {}
|
||||
|
||||
void DoRun() override {
|
||||
EXPECT_TRUE(rate_limiter_->SetWindowSize(kWindowSizeMs / 2));
|
||||
@ -160,7 +160,7 @@ TEST_F(RateLimitTest, MultiThreadedUsage) {
|
||||
public:
|
||||
explicit SetMaxRateTask(RateLimiter* rate_limiter)
|
||||
: ThreadTask(rate_limiter) {}
|
||||
virtual ~SetMaxRateTask() {}
|
||||
~SetMaxRateTask() override {}
|
||||
|
||||
void DoRun() override { rate_limiter_->SetMaxRate(kMaxRateBps * 2); }
|
||||
} set_max_rate_task(rate_limiter.get());
|
||||
@ -171,7 +171,7 @@ TEST_F(RateLimitTest, MultiThreadedUsage) {
|
||||
public:
|
||||
UseRateTask(RateLimiter* rate_limiter, SimulatedClock* clock)
|
||||
: ThreadTask(rate_limiter), clock_(clock) {}
|
||||
virtual ~UseRateTask() {}
|
||||
~UseRateTask() override {}
|
||||
|
||||
void DoRun() override {
|
||||
EXPECT_TRUE(rate_limiter_->TryUseRate(kRateFillingBytes / 2));
|
||||
|
||||
@ -19,7 +19,7 @@ namespace {
|
||||
class RateTrackerForTest : public RateTracker {
|
||||
public:
|
||||
RateTrackerForTest() : RateTracker(kBucketIntervalMs, 10u), time_(0) {}
|
||||
virtual int64_t Time() const { return time_; }
|
||||
int64_t Time() const override { return time_; }
|
||||
void AdvanceTime(int delta) { time_ += delta; }
|
||||
|
||||
private:
|
||||
|
||||
@ -30,7 +30,7 @@ class RefClass : public RefCountInterface {
|
||||
RefClass() {}
|
||||
|
||||
protected:
|
||||
virtual ~RefClass() {}
|
||||
~RefClass() override {}
|
||||
};
|
||||
|
||||
class RefClassWithRvalue : public RefCountInterface {
|
||||
@ -38,7 +38,7 @@ class RefClassWithRvalue : public RefCountInterface {
|
||||
explicit RefClassWithRvalue(std::unique_ptr<A> a) : a_(std::move(a)) {}
|
||||
|
||||
protected:
|
||||
virtual ~RefClassWithRvalue() {}
|
||||
~RefClassWithRvalue() override {}
|
||||
|
||||
public:
|
||||
std::unique_ptr<A> a_;
|
||||
@ -50,7 +50,7 @@ class RefClassWithMixedValues : public RefCountInterface {
|
||||
: a_(std::move(a)), b_(b), c_(c) {}
|
||||
|
||||
protected:
|
||||
virtual ~RefClassWithMixedValues() {}
|
||||
~RefClassWithMixedValues() override {}
|
||||
|
||||
public:
|
||||
std::unique_ptr<A> a_;
|
||||
|
||||
@ -118,7 +118,7 @@ class TmToSeconds : public testing::Test {
|
||||
// Set use of the test RNG to get deterministic expiration timestamp.
|
||||
rtc::SetRandomTestMode(true);
|
||||
}
|
||||
~TmToSeconds() {
|
||||
~TmToSeconds() override {
|
||||
// Put it back for the next test.
|
||||
rtc::SetRandomTestMode(false);
|
||||
}
|
||||
|
||||
@ -45,9 +45,9 @@ TEST(Win32WindowTest, Basics) {
|
||||
EXPECT_TRUE(wnd.Create(0, L"Test", 0, 0, 0, 0, 100, 100));
|
||||
EXPECT_TRUE(wnd.handle() != NULL);
|
||||
EXPECT_EQ(kDummyResult, ::SendMessage(wnd.handle(), WM_USER, 1, 2));
|
||||
EXPECT_EQ(WM_USER, wnd.msg().message);
|
||||
EXPECT_EQ(1, wnd.msg().wParam);
|
||||
EXPECT_EQ(2, wnd.msg().lParam);
|
||||
EXPECT_EQ(static_cast<UINT>(WM_USER), wnd.msg().message);
|
||||
EXPECT_EQ(1u, wnd.msg().wParam);
|
||||
EXPECT_EQ(2l, wnd.msg().lParam);
|
||||
wnd.Destroy();
|
||||
EXPECT_TRUE(wnd.handle() == NULL);
|
||||
EXPECT_TRUE(wnd.destroyed());
|
||||
|
||||
@ -141,6 +141,59 @@ rtc_static_library("rtc_p2p") {
|
||||
}
|
||||
}
|
||||
|
||||
if (rtc_include_tests) {
|
||||
rtc_source_set("rtc_p2p_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"base/asyncstuntcpsocket_unittest.cc",
|
||||
"base/dtlstransportchannel_unittest.cc",
|
||||
"base/fakeportallocator.h",
|
||||
"base/faketransportcontroller.h",
|
||||
"base/jseptransport_unittest.cc",
|
||||
"base/p2ptransportchannel_unittest.cc",
|
||||
"base/port_unittest.cc",
|
||||
"base/portallocator_unittest.cc",
|
||||
"base/pseudotcp_unittest.cc",
|
||||
"base/relayport_unittest.cc",
|
||||
"base/relayserver_unittest.cc",
|
||||
"base/stun_unittest.cc",
|
||||
"base/stunport_unittest.cc",
|
||||
"base/stunrequest_unittest.cc",
|
||||
"base/stunserver_unittest.cc",
|
||||
"base/tcpport_unittest.cc",
|
||||
"base/testrelayserver.h",
|
||||
"base/teststunserver.h",
|
||||
"base/testturnserver.h",
|
||||
"base/transportcontroller_unittest.cc",
|
||||
"base/transportdescriptionfactory_unittest.cc",
|
||||
"base/turnport_unittest.cc",
|
||||
"base/turnserver_unittest.cc",
|
||||
"base/udptransportchannel_unittest.cc",
|
||||
"client/basicportallocator_unittest.cc",
|
||||
]
|
||||
if (rtc_use_quic) {
|
||||
sources += [
|
||||
"quic/quicconnectionhelper_unittest.cc",
|
||||
"quic/quicsession_unittest.cc",
|
||||
"quic/quictransport_unittest.cc",
|
||||
"quic/quictransportchannel_unittest.cc",
|
||||
"quic/reliablequicstream_unittest.cc",
|
||||
]
|
||||
}
|
||||
deps = [
|
||||
":rtc_p2p",
|
||||
"../api:fakemetricsobserver",
|
||||
"//testing/gmock",
|
||||
"//testing/gtest",
|
||||
]
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
defines = [ "GTEST_RELATIVE_PATH" ]
|
||||
}
|
||||
}
|
||||
|
||||
rtc_static_library("libstunprober") {
|
||||
sources = [
|
||||
"stunprober/stunprober.cc",
|
||||
@ -157,3 +210,22 @@ rtc_static_library("libstunprober") {
|
||||
"../base:rtc_base",
|
||||
]
|
||||
}
|
||||
|
||||
if (rtc_include_tests) {
|
||||
rtc_source_set("libstunprober_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"stunprober/stunprober_unittest.cc",
|
||||
]
|
||||
deps = [
|
||||
":libstunprober",
|
||||
"//testing/gmock",
|
||||
"//testing/gtest",
|
||||
]
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
defines = [ "GTEST_RELATIVE_PATH" ]
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,7 +494,7 @@ const in6_addr kIPv6TestAddress2 = { { { 0x24, 0x01, 0xfa, 0x00,
|
||||
const in_addr kIPv4TestAddress1 = { 0xe64417ac };
|
||||
#elif defined WEBRTC_WIN
|
||||
// Windows in_addr has a union with a uchar[] array first.
|
||||
const in_addr kIPv4TestAddress1 = { { 0x0ac, 0x017, 0x044, 0x0e6 } };
|
||||
const in_addr kIPv4TestAddress1 = { { { 0x0ac, 0x017, 0x044, 0x0e6 } } };
|
||||
#endif
|
||||
const char kTestUserName1[] = "abcdefgh";
|
||||
const char kTestUserName2[] = "abc";
|
||||
|
||||
@ -230,6 +230,40 @@ if (is_ios || is_mac) {
|
||||
}
|
||||
}
|
||||
|
||||
if (rtc_include_tests) {
|
||||
rtc_source_set("rtc_sdk_peerconnection_objc_unittests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"objc/Framework/UnitTests/RTCConfigurationTest.mm",
|
||||
"objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
|
||||
"objc/Framework/UnitTests/RTCIceCandidateTest.mm",
|
||||
"objc/Framework/UnitTests/RTCIceServerTest.mm",
|
||||
"objc/Framework/UnitTests/RTCMediaConstraintsTest.mm",
|
||||
"objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
|
||||
"objc/Framework/UnitTests/avformatmappertests.mm",
|
||||
]
|
||||
deps = [
|
||||
":rtc_sdk_peerconnection_objc",
|
||||
"//third_party/ocmock",
|
||||
"//webrtc/system_wrappers:system_wrappers_default",
|
||||
]
|
||||
|
||||
# TODO(tkchin): Cleanup this warning.
|
||||
cflags = [ "-Wno-objc-property-no-attribute" ]
|
||||
|
||||
# |-ObjC| flag needed to make sure category method implementations
|
||||
# are included:
|
||||
# https://developer.apple.com/library/mac/qa/qa1490/_index.html
|
||||
ldflags = [ "-ObjC" ]
|
||||
|
||||
defines = [ "GTEST_RELATIVE_PATH" ]
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (is_ios) {
|
||||
ios_framework_bundle("rtc_sdk_framework_objc") {
|
||||
info_plist = "objc/Framework/Info.plist"
|
||||
|
||||
@ -160,7 +160,7 @@ TEST(AVFormatMapperTest, SuportedCricketFormats) {
|
||||
webrtc::GetSupportedVideoFormatsForDevice(mockDevice);
|
||||
|
||||
// then
|
||||
EXPECT_EQ(1, result.size());
|
||||
EXPECT_EQ(1u, result.size());
|
||||
|
||||
// make sure the set has the expected format
|
||||
EXPECT_EQ(expectedFormat, *result.begin());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user