Beispiel #1
0
int main(void)
{
	InitTotalStatistics();

	TestFloatHelper();
	TestIntegerHelper();
	TestFastFunctions();
	TestArrayMinimalTemplate();
	TestPropertiesFile();
	TestChars();
	TestMap();
	TestTextParser();
	TestXMLParser();
	TestXMLFile();
	TestLogFile();
	TestDurableSet();
	TestDurableFile();
	TestDurableFileController();
	TestIndexTreeNodeFile();
	TestIndexTreeBlockFile();
	TestIndexedFile();
	TestIndexedFiles();
	TestIndexes();
	TestIndexedHuge();
	TestOperators();
	TestFunctionCaller();
	TestFiles();
	TestPackFilesPacker();
	TestIndexedData();
	TestIndexedDataSmart();
	TestNumber();

	return TestTotalStatistics();
}
Beispiel #2
0
int main(int argc, char **argv)
{
  plan_tests(31);

  TestMap();
  TestWriter();
  TestReader();

  return exit_status();
}
void TestMultimap( const Allocator& a )
{
    // map allocators are pair allocators
    typedef std::pair< const typename Allocator::value_type, int > Pair;
    typedef typename Allocator::template rebind< Pair >::other Alloc;

    typedef std::multimap< typename Allocator::value_type, int,
                           std::less< typename Allocator::value_type >,
                           Alloc > Multimap;

    Multimap m1( Policy< Allocator >::template GetDefaultMap< Multimap >( a ) );
    Multimap m2( Policy< Allocator >::template GetCopiedMap< Multimap >( a ) );

    TestMap( a, m1 );
    TestMap( a, m2 );

    m1.swap( m2 );

    TestMap( a, m1 );
    TestMap( a, m2 );
}
Beispiel #4
0
//---------------------------------------------------------------------------
//	@function:
//		CTreeMapTest::PtmapLoad
//
//	@doc:
//		Create a semantically meaningful tree map by simulating a MEMO 
//		layout
//
//---------------------------------------------------------------------------
CTreeMapTest::TestMap *
CTreeMapTest::PtmapLoad
	(
	IMemoryPool *pmp
	)
{
	TestMap *ptmap = GPOS_NEW(pmp) TestMap(pmp, &Pnd);
	
	// init raw data
	for (ULONG ulPos = 0; ulPos < ulElems; ulPos++)
	{
		rgul[ulPos] = ulPos;
	}

	
	// simulate the following MEMO with individual edge insertions
	struct SEdge
	{
		// number of parent node
		ULONG m_ulParent;
		
		// position of child
		ULONG m_ulPos;
		
		// number of child node
		ULONG m_ulChild;
	}
	rgedge[]=
	{
		// root group: Join [4,3], HashJoin[4,3]{8}, HashJoin[3,4]{9}
		{9, 1, 7}, {9, 0, 6}, {9, 0, 5},
		{8, 0, 7}, {8, 1, 5}, {8, 1, 6},
		
		// group 4: C, TabScan{7} 
		
		// group 3: Join[1,2], HashJoin[1,2]{5}, SortMergeJoin[1,2]{6}
		{5, 0, 0}, {5, 0, 1}, {5, 1, 2}, {5, 1, 3}, {5, 1, 4},
		{6, 0, 1}, {6, 1, 3}, {6, 1, 4},
		
		// group 2: B, TabScan{2}, IndexScan{3}, Sort[2]{4}
		{4, 0, 2}
		
		// group 1: A, TabScan{0}, IndexScan{1}
	};
		
	for (ULONG ul = 0; ul < GPOS_ARRAY_SIZE(rgedge); ul++)
	{
		SEdge &edge = rgedge[ul];
		ptmap->Insert(&rgul[edge.m_ulParent], edge.m_ulPos, &rgul[edge.m_ulChild]);
	}

	return ptmap;
}
Beispiel #5
0
int main(int argc, char **argv)
try {
  plan_tests(31);

  TestMap();
  TestWriter();
  TestReader();

  return exit_status();
} catch (const std::runtime_error &e) {
  PrintException(e);
  return EXIT_FAILURE;
}
void TestWithContainers( const Allocator& a )
{
    TestVector( a );
    TestDeque( a );
    TestList( a );
    TestSet( a );
    TestMultiset( a );
    TestMap( a );
    TestMultimap( a );
    TestString( a );
    TestStack( a );
    TestQueue( a );
    TestPriorityQueue( a );
}
Beispiel #7
0
/*----------------------------------------------------------------------
|       main
+---------------------------------------------------------------------*/
int
main(int /*argc*/, char** /*argv*/)
{

    int result;
    
    result = TestMap();
    if (result) return result;

    result = TestHashMap();
    if (result) return result;
    
    TestPerformance();
    
    return 0;
}
Beispiel #8
0
void TestSuite::Run()
{
	unsigned uiHeapSize = DMM_GetKernelHeapSize() ;

	Assert(TestAtomicSwap()) ;
	Assert(TestListDS()) ;
	Assert(TestListDSPtr()) ;
	Assert(TestBTree1()) ;
	Assert(TestBTree2()) ;
	Assert(TestBTree3()) ;
  Assert(TestMapFwdRwd());
  Assert(TestMap());
  Assert(TestMapReverseEntry());

	printf("\n") ;

	printf("\n Heap Size: (Before, After) = (%d, %d)\n", uiHeapSize, DMM_GetKernelHeapSize()) ;
}
Beispiel #9
0
//---------------------------------------------------------------------------
//	@function:
//		CTreeMapTest::EresUnittest_Basic
//
//	@doc:
//		Basic test
//
//---------------------------------------------------------------------------
GPOS_RESULT
CTreeMapTest::EresUnittest_Basic()
{
	CAutoMemoryPool amp;
	IMemoryPool *pmp = amp.Pmp();

	TestMap *ptmap = NULL;
	
	// create blank map
	ptmap = GPOS_NEW(pmp) TestMap(pmp, &Pnd);
	GPOS_ASSERT(0 == ptmap->UllCount());
	GPOS_DELETE(ptmap);
	
	// create map with test data
	ptmap = PtmapLoad(pmp);
	GPOS_DELETE(ptmap);
	
	return GPOS_OK;
}
Beispiel #10
0
//---------------------------------------------------------------------------
//	@function:
//		CTreeMapTest::EresUnittest_Cycle
//
//	@doc:
//		Introduce cycle in graph; counting must assert
//
//---------------------------------------------------------------------------
GPOS_RESULT
CTreeMapTest::EresUnittest_Cycle()
{
	CAutoMemoryPool amp;
	IMemoryPool *pmp = amp.Pmp();

	TestMap *ptmap = GPOS_NEW(pmp) TestMap(pmp, &Pnd);

	CAutoP<TestMap> a_ptmap;
	a_ptmap = ptmap;
	
	// build cycle
	ptmap->Insert(&rgul[0], 0, &rgul[1]);
	ptmap->Insert(&rgul[1], 0, &rgul[2]);
	ptmap->Insert(&rgul[2], 0, &rgul[1]);

	(void) ptmap->UllCount();

	return GPOS_FAILED;
}
Beispiel #11
0
int main() {
    TestRBTree();
    TestMap();

    return 0;
}