From 30e5ba2d08038f493b53ceca5994fd6bc1abca16 Mon Sep 17 00:00:00 2001 From: "cvshook%sicking.cc" Date: Fri, 3 Nov 2006 00:52:40 +0000 Subject: [PATCH] Back out previous checkin, ENABLE_TESTS is not available inside code git-svn-id: svn://10.0.0.236/trunk@214650 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/glue/nsTArray.h | 2 +- mozilla/xpcom/tests/TestTArray.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 } };