Пример #1
0
void
CallsTest::testGetAllCallees(){
	Calls c;
	CallsExtractor extractor(&c);
	c.insertCalls(1,2);
	c.insertCalls(2,3);
	c.insertCalls(1,3);
	extractor.construct();
	set<int> callees = c.getAllCallees();
	CPPUNIT_ASSERT(callees.size()==2);
	std::set<int>::iterator itr = callees.begin();
	CPPUNIT_ASSERT_EQUAL(2,*itr);
	itr++;
	CPPUNIT_ASSERT_EQUAL(3,*itr);
	return;
}
Пример #2
0
void
CallsTest::testEvaluateGetCallersStar(){
	Calls c;
	CallsExtractor extractor(&c);
	c.insertCalls(1,2);
	c.insertCalls(2,3);
	c.insertCalls(1,4);
	c.insertCalls(4,5);
	extractor.construct();
	set<int> callers = c.evaluateGetCallersStar(5);
	CPPUNIT_ASSERT(callers.size()==2);
	std::set<int>::iterator itr = callers.begin();
	CPPUNIT_ASSERT_EQUAL(1,*itr);
	itr++;
	CPPUNIT_ASSERT_EQUAL(4,*itr);
	return;
}
Пример #3
0
void 
CallsTest::testInsertCalls(){
	Calls c;
	CallsExtractor extractor(&c);
	c.insertCalls(1,2);
	c.insertCalls(2,3);
	c.insertCalls(1,3);
	c.insertCalls(1,4);
	c.insertCalls(4,5);
	extractor.construct();
	CPPUNIT_ASSERT(c.isCalls(1,2));
	CPPUNIT_ASSERT(c.isCalls(1,3));
	CPPUNIT_ASSERT(c.isCalls(1,4));
	CPPUNIT_ASSERT(c.isCalls(2,3));
	CPPUNIT_ASSERT(c.isCalls(4,5));
	CPPUNIT_ASSERT_EQUAL(5,c.getSize());
	return;
}