StatementTest Class Reference

#include <db/StatementTest.h>

List of all members.


Detailed Description

Definition at line 19 of file StatementTest.h.

Public Member Functions

int countTestCases () const
virtual void registerTests (CppUnit::TestSuite *suite)
void setUp ()
 StatementTest (std::string name)
void tearDown ()
void testAddUsedLocsAssign ()
void testAddUsedLocsBool ()
void testAddUsedLocsBranch ()
void testAddUsedLocsCall ()
void testAddUsedLocsCase ()
void testAddUsedLocsReturn ()
void testBypass ()
void testClone ()
void testEmpty ()
void testEndlessLoop ()
void testExpand ()
void testFindConstants ()
void testFlow ()
void testIsAssign ()
void testIsFlagAssgn ()
void testKill ()
void testLocationSet ()
void testRecursion ()
void testStripSizes ()
void testSubscriptVars ()
void testUse ()
void testUseKill ()
void testUseOverBB ()
void testUseOverKill ()
void testWildLocationSet ()


Constructor & Destructor Documentation

StatementTest::StatementTest std::string  name  )  [inline]
 

Definition at line 23 of file StatementTest.h.


Member Function Documentation

int StatementTest::countTestCases  )  const
 

Definition at line 77 of file StatementTest.cpp.

void StatementTest::registerTests CppUnit::TestSuite *  suite  )  [virtual]
 

Definition at line 48 of file StatementTest.cpp.

References MYTEST, testAddUsedLocsAssign(), testAddUsedLocsBool(), testAddUsedLocsBranch(), testAddUsedLocsCall(), testAddUsedLocsCase(), testAddUsedLocsReturn(), testBypass(), testClone(), testEmpty(), testFindConstants(), testFlow(), testIsAssign(), testIsFlagAssgn(), testKill(), testLocationSet(), testStripSizes(), testSubscriptVars(), testUse(), testUseKill(), testUseOverBB(), testUseOverKill(), and testWildLocationSet().

Referenced by main().

void StatementTest::setUp  ) 
 

Definition at line 88 of file StatementTest.cpp.

References Boomerang::get(), logset, and Boomerang::setLogger().

void StatementTest::tearDown  ) 
 

Definition at line 102 of file StatementTest.cpp.

void StatementTest::testAddUsedLocsAssign  ) 
 

Definition at line 970 of file StatementTest.cpp.

References Statement::addUsedLocs(), LocationSet::clear(), Location::memOf(), opMinus, opMult, LocationSet::print(), Location::regOf(), GotoStatement::setDest(), and Statement::setNumber().

Referenced by registerTests().

void StatementTest::testAddUsedLocsBool  ) 
 

Definition at line 1102 of file StatementTest.cpp.

References Statement::addUsedLocs(), LocationSet::clear(), Location::local(), Location::memOf(), NULL, opEquals, opMinus, opNil, opPlus, LocationSet::print(), PhiAssign::putAt(), Location::regOf(), BoolAssign::setCondExpr(), BoolAssign::setLeftFromList(), and Statement::setNumber().

Referenced by registerTests().

void StatementTest::testAddUsedLocsBranch  ) 
 

Definition at line 1004 of file StatementTest.cpp.

References Statement::addUsedLocs(), Location::memOf(), opFlags, LocationSet::print(), Location::regOf(), BranchStatement::setCondExpr(), GotoStatement::setDest(), and Statement::setNumber().

Referenced by registerTests().

void StatementTest::testAddUsedLocsCall  ) 
 

Definition at line 1046 of file StatementTest.cpp.

References CallStatement::addDefine(), Statement::addUsedLocs(), StatementList::append(), LocationSet::clear(), Location::memOf(), LocationSet::print(), Location::regOf(), CallStatement::setArguments(), GotoStatement::setDest(), and Statement::setNumber().

Referenced by registerTests().

void StatementTest::testAddUsedLocsCase  ) 
 

Definition at line 1027 of file StatementTest.cpp.

References Statement::addUsedLocs(), Location::memOf(), opMinus, LocationSet::print(), SWITCH_INFO::pSwitchVar, Location::regOf(), GotoStatement::setDest(), and CaseStatement::setSwitchInfo().

Referenced by registerTests().

void StatementTest::testAddUsedLocsReturn  ) 
 

Definition at line 1078 of file StatementTest.cpp.

References ReturnStatement::addReturn(), Statement::addUsedLocs(), Location::memOf(), opPlus, LocationSet::print(), Location::regOf(), and Statement::setNumber().

Referenced by registerTests().

void StatementTest::testBypass  ) 
 

Definition at line 1330 of file StatementTest.cpp.

References addr(), StatementList::begin(), Statement::bypass(), Type::clearNamedTypes(), Exp::clone(), FrontEnd::decode(), DataFlow::dominators(), Prog::findProc(), UserProc::getCFG(), UserProc::getDataFlow(), FrontEnd::getMainEntryPoint(), UserProc::getStatements(), GLOBAL1_PENTIUM, UserProc::initStatements(), BinaryFileFactory::Load(), NO_ADDRESS, UserProc::numberStatements(), opEquals, UserProc::promoteSignature(), Location::regOf(), DataFlow::renameBlockVars(), CallStatement::setDestProc(), Prog::setFrontEnd(), and Cfg::sortByAddress().

Referenced by registerTests().

void StatementTest::testClone  ) 
 

Definition at line 882 of file StatementTest.cpp.

References Assign::clone(), NULL, opParam, opPlus, Statement::print(), Assignment::print(), and Location::regOf().

Referenced by registerTests().

void StatementTest::testEmpty  ) 
 

Definition at line 109 of file StatementTest.cpp.

References UserProc::decompile(), Boomerang::get(), UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Cfg::newBB(), Prog::newProc(), Cfg::print(), RET, UserProc::setDecoded(), Cfg::setEntryBB(), Prog::setFrontEnd(), Boomerang::setLogger(), Boomerang::setOutputDirectory(), and Boomerang::vFlag.

Referenced by registerTests().

void StatementTest::testEndlessLoop  ) 
 

Definition at line 549 of file StatementTest.cpp.

References BasicBlock::addInEdge(), UserProc::decompile(), FALL, UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Cfg::newBB(), Prog::newProc(), ONEWAY, opPlus, Cfg::print(), Location::regOf(), UserProc::setDecoded(), Cfg::setEntryBB(), Prog::setFrontEnd(), BasicBlock::setOutEdge(), and Statement::setProc().

void StatementTest::testExpand  ) 
 

void StatementTest::testFindConstants  ) 
 

Definition at line 1428 of file StatementTest.cpp.

References Statement::findConstants(), opPlus, and Location::regOf().

Referenced by registerTests().

void StatementTest::testFlow  ) 
 

Definition at line 155 of file StatementTest.cpp.

References BasicBlock::addInEdge(), ReturnStatement::addReturn(), UserProc::decompile(), FALL, UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Cfg::newBB(), Prog::newProc(), Cfg::print(), Location::regOf(), RET, UserProc::setDecoded(), Cfg::setEntryBB(), Prog::setFrontEnd(), Statement::setNumber(), BasicBlock::setOutEdge(), and Statement::setProc().

Referenced by registerTests().

void StatementTest::testIsAssign  ) 
 

Definition at line 917 of file StatementTest.cpp.

References Statement::isAssign(), Assignment::print(), and Location::regOf().

Referenced by registerTests().

void StatementTest::testIsFlagAssgn  ) 
 

Definition at line 938 of file StatementTest.cpp.

References Statement::isFlagAssgn(), opFlagCall, opFlags, opList, opPlus, Assignment::print(), and Location::regOf().

Referenced by registerTests().

void StatementTest::testKill  ) 
 

Definition at line 217 of file StatementTest.cpp.

References BasicBlock::addInEdge(), ReturnStatement::addReturn(), UserProc::decompile(), FALL, UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Cfg::newBB(), Prog::newProc(), Cfg::print(), Location::regOf(), RET, UserProc::setDecoded(), Cfg::setEntryBB(), Prog::setFrontEnd(), Statement::setNumber(), BasicBlock::setOutEdge(), and Statement::setProc().

Referenced by registerTests().

void StatementTest::testLocationSet  ) 
 

Definition at line 613 of file StatementTest.cpp.

References LocationSet::begin(), Location::clone(), dummy, LocationSet::end(), LocationSet::existsImplicit(), LocationSet::findDifferentRef(), Unary::getSubExp1(), LocationSet::insert(), NULL, opMemOf, opPlus, opRegOf, LocationSet::prints(), Location::regOf(), LocationSet::remove(), Const::setInt(), Statement::setNumber(), LocationSet::size(), and size.

Referenced by registerTests().

void StatementTest::testRecursion  ) 
 

Definition at line 744 of file StatementTest.cpp.

References BasicBlock::addInEdge(), CALL, Prog::decompile(), FALL, UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Location::memOf(), Cfg::newBB(), opPC, opPlus, Cfg::print(), Location::regOf(), RET, CallStatement::setDestProc(), Cfg::setEntryBB(), Prog::setFrontEnd(), and BasicBlock::setOutEdge().

void StatementTest::testStripSizes  ) 
 

Definition at line 1396 of file StatementTest.cpp.

References Location::local(), Location::memOf(), NULL, opDiv, opPlus, opSize, opZfill, Location::regOf(), and Statement::stripSizes().

Referenced by registerTests().

void StatementTest::testSubscriptVars  ) 
 

Definition at line 1160 of file StatementTest.cpp.

References CallStatement::addDefine(), ReturnStatement::addReturn(), StatementList::append(), StatementList::clear(), Location::memOf(), NULL, opEquals, opFlags, opMinus, opMult, opPlus, SWITCH_INFO::pSwitchVar, Location::regOf(), CallStatement::setArguments(), CallStatement::setCalleeReturn(), BoolAssign::setCondExpr(), BranchStatement::setCondExpr(), GotoStatement::setDest(), CallStatement::setDestProc(), Assignment::setLeft(), Statement::setNumber(), CaseStatement::setSwitchInfo(), and Statement::subscriptVar().

Referenced by registerTests().

void StatementTest::testUse  ) 
 

Definition at line 282 of file StatementTest.cpp.

References BasicBlock::addInEdge(), ReturnStatement::addReturn(), UserProc::decompile(), FALL, UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Cfg::newBB(), Prog::newProc(), Cfg::print(), Location::regOf(), RET, UserProc::setDecoded(), Cfg::setEntryBB(), Prog::setFrontEnd(), Statement::setNumber(), BasicBlock::setOutEdge(), and Statement::setProc().

Referenced by registerTests().

void StatementTest::testUseKill  ) 
 

Definition at line 483 of file StatementTest.cpp.

References BasicBlock::addInEdge(), ReturnStatement::addReturn(), UserProc::decompile(), FALL, UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Cfg::newBB(), Prog::newProc(), opPlus, Cfg::print(), Location::regOf(), RET, UserProc::setDecoded(), Cfg::setEntryBB(), Prog::setFrontEnd(), Statement::setNumber(), BasicBlock::setOutEdge(), and Statement::setProc().

Referenced by registerTests().

void StatementTest::testUseOverBB  ) 
 

Definition at line 412 of file StatementTest.cpp.

References BasicBlock::addInEdge(), ReturnStatement::addReturn(), UserProc::decompile(), FALL, UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Cfg::newBB(), Prog::newProc(), Cfg::print(), Location::regOf(), RET, UserProc::setDecoded(), Cfg::setEntryBB(), Prog::setFrontEnd(), Statement::setNumber(), BasicBlock::setOutEdge(), and Statement::setProc().

Referenced by registerTests().

void StatementTest::testUseOverKill  ) 
 

Definition at line 345 of file StatementTest.cpp.

References BasicBlock::addInEdge(), ReturnStatement::addReturn(), UserProc::decompile(), FALL, UserProc::getCFG(), HELLO_PENTIUM, BinaryFileFactory::Load(), Cfg::newBB(), Prog::newProc(), Cfg::print(), Location::regOf(), RET, UserProc::setDecoded(), Cfg::setEntryBB(), Prog::setFrontEnd(), Statement::setNumber(), BasicBlock::setOutEdge(), and Statement::setProc().

Referenced by registerTests().

void StatementTest::testWildLocationSet  ) 
 

Definition at line 696 of file StatementTest.cpp.

References Location::clone(), LocationSet::exists(), LocationSet::findDifferentRef(), LocationSet::insert(), NULL, opRegOf, Location::regOf(), and Statement::setNumber().

Referenced by registerTests().


The documentation for this class was generated from the following files:
Generated on Tue Sep 19 21:18:46 2006 for Boomerang by  doxygen 1.4.6