greenplumn CRefCountTest 源码
greenplumn CRefCountTest 代码
文件路径:/src/backend/gporca/libgpos/server/include/unittest/gpos/common/CRefCountTest.h
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2008 Greenplum, Inc.
//
// @filename:
// CRefCount.h
//
// @doc:
// Test for CRefCount
//---------------------------------------------------------------------------
#ifndef GPOS_CRefCountTest_H
#define GPOS_CRefCountTest_H
#include "gpos/base.h"
#include "gpos/common/CRefCount.h"
namespace gpos
{
//---------------------------------------------------------------------------
// @class:
// CRefCountTest
//
// @doc:
// Static unit tests
//
//---------------------------------------------------------------------------
class CRefCountTest
{
private:
//---------------------------------------------------------------------------
// @class:
// CDeletableTest
//
// @doc:
// Local class for testing deletable/undeletable objects
//
//---------------------------------------------------------------------------
class CDeletableTest : public CRefCount
{
private:
// is calling object's destructor allowed?
BOOL m_fDeletable{false};
public:
// ctor
CDeletableTest() = default;
// return true if calling object's destructor is allowed
BOOL
Deletable() const override
{
return m_fDeletable;
}
// allow calling object's destructor
void
AllowDeletion()
{
m_fDeletable = true;
}
}; // class CDeletableTest
public:
// unittests
static GPOS_RESULT EresUnittest();
static GPOS_RESULT EresUnittest_CountUpAndDown();
static GPOS_RESULT EresUnittest_DeletableObjects();
#ifdef GPOS_DEBUG
static GPOS_RESULT EresUnittest_Stack();
static GPOS_RESULT EresUnittest_Check();
#endif // GPOS_DEBUG
};
} // namespace gpos
#endif // !GPOS_CRefCountTest_H
// EOF
相关信息
相关文章
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
7、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦