提交 52feb13f 编写于 作者: E Ekta Khanna 提交者: Dhanashree Kashid

Fix broken CAutoPTest & make pipeline green

Previous to c09a0acd, `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: NDhanashree Kashid <dkashid@pivotal.io>
上级 c09a0acd
......@@ -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
......
......@@ -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<ULONG> *papt = GPOS_NEW(pmp) CAutoP<ULONG>;
GPOS_DELETE(papt);
return GPOS_FAILED;
}
#endif // (GPOS_i386 || GPOS_i686 || GPOS_x86_64)
#endif // GPOS_DEBUG
// EOF
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册