1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 * This attempts to test all the possible variations of |operator==|
8 * used with |nsCOMPtr|s.
12 #include "gtest/gtest.h"
14 #define NS_ICOMPTREQTESTFOO_IID \
16 0x8eb5bbef, 0xd1a3, 0x4659, { \
17 0x9c, 0xf6, 0xfd, 0xf3, 0xe4, 0xd2, 0x00, 0x0e \
21 class nsICOMPtrEqTestFoo
: public nsISupports
{
23 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOMPTREQTESTFOO_IID
)
26 NS_DEFINE_STATIC_IID_ACCESSOR(nsICOMPtrEqTestFoo
, NS_ICOMPTREQTESTFOO_IID
)
28 TEST(COMPtrEq
, NullEquality
)
30 nsCOMPtr
<nsICOMPtrEqTestFoo
> s
;
31 nsICOMPtrEqTestFoo
* r
= nullptr;
32 const nsCOMPtr
<nsICOMPtrEqTestFoo
> sc
;
33 const nsICOMPtrEqTestFoo
* rc
= nullptr;
34 nsICOMPtrEqTestFoo
* const rk
= nullptr;
35 const nsICOMPtrEqTestFoo
* const rkc
= nullptr;
36 nsICOMPtrEqTestFoo
* d
= s
;