Add checks for api/test mocks to make sure they're complete

Also unifies the mock inheritance if they inherited from a ref counted
interface:
 - it should only inherit from the interface
 - it should use make_ref_counted

Bug: webrtc:14594
Change-Id: I7b0514b632ccd0798028b50f19812ac0a196e13c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262423
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38602}
This commit is contained in:
Florent Castelli
2022-05-14 00:57:25 +02:00
committed by WebRTC LUCI CQ
parent 11840ce684
commit e87ec28b80
25 changed files with 154 additions and 62 deletions

View File

@ -17,10 +17,10 @@
#include <utility>
#include <vector>
#include "api/make_ref_counted.h"
#include "api/peer_connection_interface.h"
#include "api/scoped_refptr.h"
#include "api/sctp_transport_interface.h"
#include "rtc_base/ref_counted_object.h"
#include "test/gmock.h"
namespace webrtc {
@ -205,8 +205,7 @@ class MockPeerConnectionInterface : public webrtc::PeerConnectionInterface {
};
static_assert(
!std::is_abstract_v<rtc::RefCountedObject<MockPeerConnectionInterface>>,
"");
!std::is_abstract_v<rtc::RefCountedObject<MockPeerConnectionInterface>>);
} // namespace webrtc