diff --git a/mozilla/xpcom/glue/nsTArray.h b/mozilla/xpcom/glue/nsTArray.h index 0d9c75cafdb..0b366148a35 100644 --- a/mozilla/xpcom/glue/nsTArray.h +++ b/mozilla/xpcom/glue/nsTArray.h @@ -78,7 +78,7 @@ class NS_COM_GLUE nsTArray_base { return mHdr->mCapacity; } -#if defined(DEBUG) || defined(ENABLE_TESTS) +#ifdef DEBUG void* DebugGetHeader() { return mHdr; } diff --git a/mozilla/xpcom/tests/TestTArray.cpp b/mozilla/xpcom/tests/TestTArray.cpp index 44ccac9df3f..702ded93318 100644 --- a/mozilla/xpcom/tests/TestTArray.cpp +++ b/mozilla/xpcom/tests/TestTArray.cpp @@ -410,6 +410,9 @@ static PRBool test_ptrarray() { //---- +// This test relies too heavily on the existance of DebugGetHeader to be +// useful in non-debug builds. +#ifdef DEBUG static PRBool test_autoarray() { PRUint32 data[] = {4,6,8,2,4,1,5,7,3}; nsAutoTArray array; @@ -473,6 +476,7 @@ static PRBool test_autoarray() { return PR_TRUE; } +#endif //---- @@ -492,7 +496,9 @@ static const struct Test { DECL_TEST(test_comptr_array), DECL_TEST(test_refptr_array), DECL_TEST(test_ptrarray), +#ifdef DEBUG DECL_TEST(test_autoarray), +#endif { nsnull, nsnull } };