Code Examples.
Code Examples.
The following code block shall create test group for testing simple container test.
ClRcT clTestContainer(
void)
{
clTestCase((
"Container Create test"), clTestContainerCreate());
clTestCase((
"Container Delete test"), clTestContainerDelete());
}
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_OK
Every thing is OK.
Definition: clCommonErrors.h:68
#define clTestGroupInitialize(name)
Start up the Test infrastructure.
Definition: clTestApi.h:111
#define clTestGroupFinalize()
Stop the Test infrastructure.
Definition: clTestApi.h:127
#define clTestCase(name, test)
Run a test case.
Definition: clTestApi.h:176
clTestContainerCreate(void)
{
(
CL_OK == (rc=clTestContainerCreate(CL_CNT_LIST, CL_TST_CNT_CB_STRUCT,
clTest((
"NodeAdd:"), (rc = clTestCntNodeAdd(hCntHead, 2)) ==
CL_OK,
("rc [0x %x]", rc));
clTest((
"NodeAdd:"), (rc = clTestCntNodeAdd(hCntHead, 3)) ==
CL_OK,
("rc [0x %x]", rc));
clTest((
"NodeAdd:"), (rc = clTestCntNodeAdd(hCntHead, 4)) ==
CL_OK,
("rc [0x %x]", rc));
clTest((
"NodeAdd:"), (rc = clTestCntNodeAdd(hCntHead, 5)) ==
CL_OK,
("rc [0x %x]", rc));
("rc [0x %x]", rc));
if( size != 4 )
{
clTestFailure(("Container size get & num of nodes are not proper"));
}
("rc [0x %x]", rc));
}
ClRcT clCntSizeGet(CL_IN ClCntHandleT containerHandle, CL_OUT ClUint32T *pSize)
Returns the size of the Container.
ClRcT clCntDelete(CL_IN ClCntHandleT containerHandle)
Destroys the Container.
@ CL_CNT_UNIQUE_KEY
Container contains unique key.
Definition: clCntApi.h:115
#define CL_TRUE
define the Truth
Definition: clCommon.h:59
#define clTestSuccess(__string)
Indicate that a test passed.
Definition: clTestApi.h:441
#define clTest(string, predicate, errorPrintf)
Run an individual test.
Definition: clTestApi.h:330
#define clTestPrint(x)
Print something to the test console.
Definition: clTestApi.h:474
#define clTestCaseMalfunction(reason, predicate, execOnFailure)
Indicate that this test case cannot be completed, if the predicate fails.
Definition: clTestApi.h:297