Example #1
0
//---------------------------------------------------------------------------
//	@function:
//		ConfigureTests
//
//	@doc:
//		Configurations needed before running unittests
//
//---------------------------------------------------------------------------
void ConfigureTests()
{
	// initialize DXL support
	InitDXL();

	CMDCache::Init();

	// load metadata objects into provider file
	{
		CAutoMemoryPool amp;
		IMemoryPool *mp = amp.Pmp();
		CTestUtils::InitProviderFile(mp);

		// detach safety
		(void) amp.Detach();
	}

#ifdef GPOS_DEBUG
	// reset xforms factory to exercise xforms ctors and dtors
	CXformFactory::Pxff()->Shutdown();
	GPOS_RESULT eres = CXformFactory::Init();

	GPOS_ASSERT(GPOS_OK == eres);
#endif // GPOS_DEBUG
}
Example #2
0
//---------------------------------------------------------------------------
//	@function:
//		CColumnFactory::CColumnFactory
//
//	@doc:
//		ctor
//
//---------------------------------------------------------------------------
CColumnFactory::CColumnFactory()
	:
	m_mp(NULL),
	m_phmcrcrs(NULL)
{
	CAutoMemoryPool amp;
	m_mp = amp.Pmp();
	
	// initialize hash table
	m_sht.Init
		(
		m_mp,
		GPOPT_COLFACTORY_HT_BUCKETS,
		GPOS_OFFSET(CColRef, m_link),
		GPOS_OFFSET(CColRef, m_id),
		&(CColRef::m_ulInvalid),
		CColRef::HashValue,
		CColRef::Equals
		);

	// now it's safe to detach the auto pool
	(void) amp.Detach();
}