enable the |ASSERT_NO_QUERY_NEEDED| tests for the |getter_AddRefs()| case as well. bug #26420, r=dougt

This commit is contained in:
scc%netscape.com 2000-02-06 21:17:51 +00:00
Родитель 28eb5e5828
Коммит 18d254421b
4 изменённых файлов: 16 добавлений и 10 удалений

Просмотреть файл

@ -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**()