зеркало из https://github.com/mozilla/gecko-dev.git
enable the |ASSERT_NO_QUERY_NEEDED| tests for the |getter_AddRefs()| case as well. bug #26420, r=dougt
This commit is contained in:
Родитель
28eb5e5828
Коммит
18d254421b
|
@ -28,7 +28,12 @@ nsQueryInterface::operator()( const nsIID& aIID, void** answer ) const
|
|||
{
|
||||
nsresult status;
|
||||
if ( mRawPtr )
|
||||
status = mRawPtr->QueryInterface(aIID, answer);
|
||||
{
|
||||
status = mRawPtr->QueryInterface(aIID, answer);
|
||||
#ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
|
||||
NS_WARN_IF_FALSE(NS_SUCCEEDED(status), "interface not found---were you expecting that?");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
status = NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
#ifdef NS_DEBUG
|
||||
#define NSCAP_FEATURE_TEST_DONTQUERY_CASES
|
||||
#define NSCAP_FEATURE_DEBUG_PTR_TYPES
|
||||
#define NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
|
||||
//#define NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -185,7 +185,7 @@ class nsDerivedSafe : public T
|
|||
|
||||
/*
|
||||
Compiler warnings and errors: nsDerivedSafe operator=() hides inherited operator=().
|
||||
If you see that, that means somebody checked in a (XP)COM interface class that declares an
|
||||
If you see that, that means somebody checked in a [XP]COM interface class that declares an
|
||||
|operator=()|, and that's _bad_. So bad, in fact, that this declaration exists explicitly
|
||||
to stop people from doing it.
|
||||
*/
|
||||
|
@ -835,13 +835,11 @@ class nsGetterAddRefs
|
|||
// nothing else to do
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef NSCAP_FEATURE_TEST_DONTQUERY_CASES
|
||||
~nsGetterAddRefs()
|
||||
{
|
||||
mTargetSmartPtr.Assert_NoQueryNeeded();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
operator void**()
|
||||
|
|
|
@ -28,7 +28,12 @@ nsQueryInterface::operator()( const nsIID& aIID, void** answer ) const
|
|||
{
|
||||
nsresult status;
|
||||
if ( mRawPtr )
|
||||
status = mRawPtr->QueryInterface(aIID, answer);
|
||||
{
|
||||
status = mRawPtr->QueryInterface(aIID, answer);
|
||||
#ifdef NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
|
||||
NS_WARN_IF_FALSE(NS_SUCCEEDED(status), "interface not found---were you expecting that?");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
status = NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
#ifdef NS_DEBUG
|
||||
#define NSCAP_FEATURE_TEST_DONTQUERY_CASES
|
||||
#define NSCAP_FEATURE_DEBUG_PTR_TYPES
|
||||
#define NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
|
||||
//#define NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -185,7 +185,7 @@ class nsDerivedSafe : public T
|
|||
|
||||
/*
|
||||
Compiler warnings and errors: nsDerivedSafe operator=() hides inherited operator=().
|
||||
If you see that, that means somebody checked in a (XP)COM interface class that declares an
|
||||
If you see that, that means somebody checked in a [XP]COM interface class that declares an
|
||||
|operator=()|, and that's _bad_. So bad, in fact, that this declaration exists explicitly
|
||||
to stop people from doing it.
|
||||
*/
|
||||
|
@ -835,13 +835,11 @@ class nsGetterAddRefs
|
|||
// nothing else to do
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef NSCAP_FEATURE_TEST_DONTQUERY_CASES
|
||||
~nsGetterAddRefs()
|
||||
{
|
||||
mTargetSmartPtr.Assert_NoQueryNeeded();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
operator void**()
|
||||
|
|
Загрузка…
Ссылка в новой задаче