Closed Bug 862837 Opened 11 years ago Closed 7 years ago

Signaling Unittests should build under Windows

Categories

(Core :: WebRTC: Signaling, defect, P2)

x86_64
Windows 8
defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed
backlog tech-debt

People

(Reporter: ehugg, Assigned: dminor)

References

Details

(Whiteboard: [WebRTC][blocking-webrtc-])

Attachments

(1 file, 2 obsolete files)

Currently the tests in media/webrtc/signaling/test build on OSX and Linux but not Windows.  We need them on Windows for testing and debugging.
Comment on attachment 738536 [details] [diff] [review]
Turn on signaling unittests for windows build


This patch solves a few simple compile and link problems, but the difficult link errors still remain:

   Creating library mediaconduit_unittests.lib and object mediaconduit_unittests.exp

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol __imp__InternetQueryOptionW@16 referenced in function "enum tag_nsresult __cdecl ReadInternetOption(unsigned int,unsigned int &,class nsAString_internal &)" (?ReadInternetOption@@YA?AW4tag_nsresult@@IAAIAAVnsAString_internal@@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol __imp__InternetGetConnectedStateExW@16 referenced in function "enum tag_nsresult __cdecl ReadInternetOption(unsigned int,unsigned int &,class nsAString_internal &)" (?ReadInternetOption@@YA?AW4tag_nsresult@@IAAIAAVnsAString_internal@@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: void __fastcall nsAString_internal::Assign(wchar_t const *,unsigned int)" (?Assign@nsAString_internal@@QAIXPB_WI@Z) referenced in function "enum tag_nsresult __cdecl ReadInternetOption(unsigned int,unsigned int &,class nsAString_internal &)" (?ReadInternetOption@@YA?AW4tag_nsresult@@IAAIAAVnsAString_internal@@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: __thiscall nsAString_internal::nsAString_internal(wchar_t *,unsigned int,unsigned int)" (??0nsAString_internal@@QAE@PA_WII@Z) referenced in function "protected: __thiscall nsString::nsString(wchar_t *,unsigned int,unsigned int)" (??0nsString@@IAE@PA_WII@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "protected: void __fastcall nsAString_internal::Finalize(void)" (?Finalize@nsAString_internal@@IAIXXZ) referenced in function "public: __thiscall nsAString_internal::~nsAString_internal(void)" (??1nsAString_internal@@QAE@XZ)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: int __fastcall nsACString_internal::FindChar(char,unsigned int)const " (?FindChar@nsACString_internal@@QBIHDI@Z) referenced in function "public: virtual enum tag_nsresult __stdcall nsWindowsSystemProxySettings::GetProxyForURI(class nsACString_internal const &,class nsACString_internal const &,class nsACString_internal const &,int,class nsACString_internal &)" (?GetProxyForURI@nsWindowsSystemProxySettings@@UAG?AW4tag_nsresult@@ABVnsACString_internal@@00HAAV3@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: bool __fastcall nsACString_internal::EqualsASCII(char const *,unsigned int)const " (?EqualsASCII@nsACString_internal@@QBI_NPBDI@Z) referenced in function "public: bool __thiscall nsACString_internal::EqualsLiteral<8>(char const (&)[8])const " (??$EqualsLiteral@$07@nsACString_internal@@QBE_NAAY07$$CBD@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: void __fastcall nsACString_internal::Assign(class nsACString_internal const &)" (?Assign@nsACString_internal@@QAIXABV1@@Z) referenced in function "public: __thiscall nsAutoCString::nsAutoCString(class nsACString_internal const &)" (??0nsAutoCString@@QAE@ABVnsACString_internal@@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: void __fastcall nsACString_internal::AssignASCII(char const *,unsigned int)" (?AssignASCII@nsACString_internal@@QAIXPBDI@Z) referenced in function "public: void __fastcall nsACString_internal::AssignASCII(char const *)" (?AssignASCII@nsACString_internal@@QAIXPBD@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: void __fastcall nsACString_internal::Replace(unsigned int,unsigned int,char)" (?Replace@nsACString_internal@@QAIXIID@Z) referenced in function "public: void __thiscall nsACString_internal::Append(char)" (?Append@nsACString_internal@@QAEXD@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: void __fastcall nsACString_internal::Replace(unsigned int,unsigned int,char const *,unsigned int)" (?Replace@nsACString_internal@@QAIXIIPBDI@Z) referenced in function "public: void __thiscall nsACString_internal::Replace(unsigned int,unsigned int,class nsACString_internal const &)" (?Replace@nsACString_internal@@QAEXIIABV1@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: void __fastcall nsACString_internal::SetLength(unsigned int)" (?SetLength@nsACString_internal@@QAIXI@Z) referenced in function "public: void __thiscall nsACString_internal::Truncate(unsigned int)" (?Truncate@nsACString_internal@@QAEXI@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: __thiscall nsACString_internal::nsACString_internal(char *,unsigned int,unsigned int)" (??0nsACString_internal@@QAE@PADII@Z) referenced in function "protected: __thiscall nsCString::nsCString(char *,unsigned int,unsigned int)" (??0nsCString@@IAE@PADII@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "protected: void __fastcall nsACString_internal::Finalize(void)" (?Finalize@nsACString_internal@@IAIXXZ) referenced in function "public: __thiscall nsACString_internal::~nsACString_internal(void)" (??1nsACString_internal@@QAE@XZ)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: void __thiscall nsDependentCSubstring::Rebind(class nsACString_internal const &,unsigned int,unsigned int)" (?Rebind@nsDependentCSubstring@@QAEXABVnsACString_internal@@II@Z) referenced in function "public: __thiscall nsDependentCSubstring::nsDependentCSubstring(class nsACString_internal const &,unsigned int,unsigned int)" (??0nsDependentCSubstring@@QAE@ABVnsACString_internal@@II@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "void __cdecl AppendUTF16toUTF8(class nsAString_internal const &,class nsACString_internal &)" (?AppendUTF16toUTF8@@YAXABVnsAString_internal@@AAVnsACString_internal@@@Z) referenced in function "public: __thiscall NS_ConvertUTF16toUTF8::NS_ConvertUTF16toUTF8(class nsAString_internal const &)" (??0NS_ConvertUTF16toUTF8@@QAE@ABVnsAString_internal@@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "void __cdecl ToLowerCase(class nsACString_internal const &,class nsACString_internal &)" (?ToLowerCase@@YAXABVnsACString_internal@@AAV1@@Z) referenced in function "public: virtual enum tag_nsresult __stdcall nsWindowsSystemProxySettings::GetProxyForURI(class nsACString_internal const &,class nsACString_internal const &,class nsACString_internal const &,int,class nsACString_internal &)" (?GetProxyForURI@nsWindowsSystemProxySettings@@UAG?AW4tag_nsresult@@ABVnsACString_internal@@00HAAV3@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: int __thiscall nsCString::Find(class nsCString const &,bool,int,int)const " (?Find@nsCString@@QBEHABV1@_NHH@Z) referenced in function "public: virtual enum tag_nsresult __stdcall nsWindowsSystemProxySettings::GetProxyForURI(class nsACString_internal const &,class nsACString_internal const &,class nsACString_internal const &,int,class nsACString_internal &)" (?GetProxyForURI@nsWindowsSystemProxySettings@@UAG?AW4tag_nsresult@@ABVnsACString_internal@@00HAAV3@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: int __thiscall nsCString::Find(char const *,bool,int,int)const " (?Find@nsCString@@QBEHPBD_NHH@Z) referenced in function "public: virtual enum tag_nsresult __stdcall nsWindowsSystemProxySettings::GetProxyForURI(class nsACString_internal const &,class nsACString_internal const &,class nsACString_internal const &,int,class nsACString_internal &)" (?GetProxyForURI@nsWindowsSystemProxySettings@@UAG?AW4tag_nsresult@@ABVnsACString_internal@@00HAAV3@@Z)

nsWindowsSystemProxySettings.obj : error LNK2019: unresolved external symbol "public: int __thiscall nsCString::FindCharInSet(char const *,int)const " (?FindCharInSet@nsCString@@QBEHPBDH@Z) referenced in function "public: virtual enum tag_nsresult __stdcall nsWindowsSystemProxySettings::GetProxyForURI(class nsACString_internal const &,class nsACString_internal const &,class nsACString_internal const &,int,class nsACString_internal &)" (?GetProxyForURI@nsWindowsSystemProxySettings@@UAG?AW4tag_nsresult@@ABVnsACString_internal@@00HAAV3@@Z)

nsWindowsSystemProxySettings.obj : error LNK2001: unresolved external symbol "public: static char * nsCharTraits<char>::sEmptyBuffer" (?sEmptyBuffer@?$nsCharTraits@D@@2PADA)

addrs.obj : error LNK2019: unresolved external symbol _GetAdaptersInfo@8 referenced in function _stun_get_win32_addrs

mediaconduit_unittests.exe : fatal error LNK1120: 22 unresolved externals
Comment on attachment 738536 [details] [diff] [review]
Turn on signaling unittests for windows build

Review of attachment 738536 [details] [diff] [review]:
-----------------------------------------------------------------

::: media/webrtc/signaling/test/Makefile.in
@@ +108,5 @@
>  endif
>  
>  ifeq ($(OS_TARGET),WINNT)
> +DEFINES += \
> +  -D_VARIADIC_MAX=10 \

This was required to get gtest to build on VS2012
Whiteboard: [WebRTC][blocking-webrtc-]
I forget why I gave up on this initially on Windows, but I remember falling down some sort of rathole of linker errors.

I think it'd probably be more productive to fix all the signaling unittests to build with the new built-in gtest support.
I will move them all to the built-in gtest if that means we can get them to build on OSX, Linux and Windows.  Is there a unittest in the tree that currently uses the built-in gtest to use as an example?
Assignee: nobody → ethanhugg
Comment on attachment 748209 [details] [diff] [review]
Move signaling unittests to built-it GTest


Uploading this as work-in-progress so I can review it a bit and try it out on each OS.

A couple things I've found so far (besides the obvious problems of using real streams and duplicate symbols from being all linked together):

I'm not sure how we can fix the IsMainThread assertions which used to ifdef'd out because the code was compiled twice.  I need to find a run-time check that will tell me we're in GTest.

I discovered that tbpl never builds with --enable-gtest since it was broken for OSX for a couple weeks (bug 860827).  Im am hopeful that bug 844288 will change that so I'll recheck when it lands.
Attachment #748209 - Attachment is obsolete: true
Attachment #738536 - Attachment is obsolete: true
backlog: --- → tech-debt
Rank: 25
Priority: -- → P2
Assignee: ethanhugg → nobody
This still remains an open problem. And getting coverage would help to get things like bug 1204082 covered (which we currently have to let run w/o coverage or cover in mochitest instead).

If I'm not mistaken all of our unit test are now gtest based, right?
But we still get missing symbols errors for things like _IID_IMediaBuffer, _IID_IMediaObject etc. Has anyone an idea what it takes to get these working on Windows?
See Also: → 1204082
Try run here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5d32c0afaf4b84bdb4d6e0aa967374accfb675a0
Assignee: nobody → dminor
Status: NEW → ASSIGNED
Comment on attachment 8849523 [details]
Bug 862837 - Build signaling unit tests on Windows;

https://reviewboard.mozilla.org/r/122318/#review124554

::: media/webrtc/signaling/gtest/sdp_unittests.cpp:341
(Diff revision 1)
>  }
>  
>  TEST_F(SdpTest, parseRtcpRbRembAllPt) {
>    ParseSdp(kVideoSdp + "a=rtcp-fb:* goog-remb\r\n");
> -  ASSERT_EQ(sdp_attr_get_rtcp_fb_remb_enabled(sdp_ptr_, 1, SDP_ALL_PAYLOADS),
> +  ASSERT_EQ((bool)sdp_attr_get_rtcp_fb_remb_enabled(sdp_ptr_, 1, SDP_ALL_PAYLOADS),
> -                                              true);
> +                                                    true);

Looks like the convention in the file here is space, not tabs.
Attachment #8849523 - Flags: review?(drno) → review+
Comment on attachment 8849523 [details]
Bug 862837 - Build signaling unit tests on Windows;

https://reviewboard.mozilla.org/r/122318/#review124554

> Looks like the convention in the file here is space, not tabs.

Double checked and it is spaces in my commit. The MozReview UI could be a bit clearer about this.
Pushed by dminor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/45468c0cbf03
Build signaling unit tests on Windows; r=drno
https://hg.mozilla.org/mozilla-central/rev/45468c0cbf03
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: