From 52feb13f53931bf71e2b678cd762d763d8000775 Mon Sep 17 00:00:00 2001 From: Ekta Khanna Date: Fri, 25 Aug 2017 10:49:54 -0700 Subject: [PATCH] Fix broken CAutoPTest & make pipeline green Previous to c09a0ac, `CStackObject()` constructor did a validity check if the pointer is on the stack using `FOnStack()`. Since the function is removed; the following test in `CAutoPTest` is invalid : CAutoPTest::EresUnittest_Allocation() This commit removes the test. Signed-off-by: Dhanashree Kashid --- .../include/unittest/gpos/common/CAutoPTest.h | 5 --- .../src/unittest/gpos/common/CAutoPTest.cpp | 34 ------------------- 2 files changed, 39 deletions(-) diff --git a/libgpos/server/include/unittest/gpos/common/CAutoPTest.h b/libgpos/server/include/unittest/gpos/common/CAutoPTest.h index b2385d851d..c847629edf 100644 --- a/libgpos/server/include/unittest/gpos/common/CAutoPTest.h +++ b/libgpos/server/include/unittest/gpos/common/CAutoPTest.h @@ -41,11 +41,6 @@ namespace gpos // unittests static GPOS_RESULT EresUnittest(); static GPOS_RESULT EresUnittest_Basics(); -#ifdef GPOS_DEBUG -#if (GPOS_i386 || GPOS_i686 || GPOS_x86_64) - static GPOS_RESULT EresUnittest_Allocation(); -#endif // (GPOS_i386 || GPOS_i686 || GPOS_x86_64) -#endif // GPOS_DEBUG }; // class CAutoPTest diff --git a/libgpos/server/src/unittest/gpos/common/CAutoPTest.cpp b/libgpos/server/src/unittest/gpos/common/CAutoPTest.cpp index 7a12a2aeb5..0c879f55bb 100644 --- a/libgpos/server/src/unittest/gpos/common/CAutoPTest.cpp +++ b/libgpos/server/src/unittest/gpos/common/CAutoPTest.cpp @@ -34,12 +34,6 @@ CAutoPTest::EresUnittest() CUnittest rgut[] = { GPOS_UNITTEST_FUNC(CAutoPTest::EresUnittest_Basics) -#ifdef GPOS_DEBUG -#if (GPOS_i386 || GPOS_i686 || GPOS_x86_64) - , - GPOS_UNITTEST_FUNC_ASSERT(CAutoPTest::EresUnittest_Allocation) -#endif // (GPOS_i386 || GPOS_i686 || GPOS_x86_64) -#endif // GPOS_DEBUG }; return CUnittest::EresExecute(rgut, GPOS_ARRAY_SIZE(rgut)); @@ -107,33 +101,5 @@ CAutoPTest::EresUnittest_Basics() return GPOS_OK; } -#ifdef GPOS_DEBUG -#if (GPOS_i386 || GPOS_i686 || GPOS_x86_64) - -//--------------------------------------------------------------------------- -// @function: -// CAutoPTest::EresUnittest_Allocation -// -// @doc: -// Attempt illegal allocation of auto pointer outside of stack -// -//--------------------------------------------------------------------------- -GPOS_RESULT -CAutoPTest::EresUnittest_Allocation() -{ - // create memory pool - CAutoMemoryPool amp; - IMemoryPool *pmp = amp.Pmp(); - - // allocating auto object on heap must assert - CAutoP *papt = GPOS_NEW(pmp) CAutoP; - GPOS_DELETE(papt); - - return GPOS_FAILED; -} - -#endif // (GPOS_i386 || GPOS_i686 || GPOS_x86_64) -#endif // GPOS_DEBUG - // EOF -- GitLab