From 303d3e17823cfbef1275191627a5df53e729ffd8 Mon Sep 17 00:00:00 2001 From: "henrik.lundin" Date: Thu, 26 May 2016 05:56:03 -0700 Subject: [PATCH] Fixing neteq_rtpplay A regression happened in https://codereview.webrtc.org/2006723002, causing neteq_rtpplay not to work. The problem was that when the main code was moved inside of the webrtc::test namespace, it was no longer visible to the linker. Meanwhile, the dependency on test_support_main rather than test_support caused the executable to be a gtest. In this fix, the gyp dependencies are corrected, and a main method is added outside of the namespaces. NOTRY=True Review-Url: https://codereview.webrtc.org/2018473002 Cr-Commit-Position: refs/heads/master@{#12918} --- webrtc/modules/audio_coding/neteq/neteq_tests.gypi | 3 ++- webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/audio_coding/neteq/neteq_tests.gypi b/webrtc/modules/audio_coding/neteq/neteq_tests.gypi index bb316e8a81..004556941b 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_tests.gypi +++ b/webrtc/modules/audio_coding/neteq/neteq_tests.gypi @@ -30,7 +30,8 @@ 'type': 'executable', 'dependencies': [ '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', - '<(webrtc_root)/test/test.gyp:test_support_main', + '<(webrtc_root)/test/test.gyp:test_support', + '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default', 'rtc_event_log_source', 'neteq', 'neteq_unittest_tools', diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc index 756a9cf3f0..38ab2e9ba4 100644 --- a/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc +++ b/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc @@ -368,9 +368,7 @@ size_t ReplacePayload(InputAudioFile* replacement_audio_file, return payload_len; } -} // namespace - -int main(int argc, char* argv[]) { +int RunTest(int argc, char* argv[]) { static const int kOutputBlockSizeMs = 10; std::string program_name = argv[0]; @@ -632,5 +630,10 @@ int main(int argc, char* argv[]) { return 0; } +} // namespace } // namespace test } // namespace webrtc + +int main(int argc, char* argv[]) { + webrtc::test::RunTest(argc, argv); +}