72 if(fun->
getName() ==
"SAFEMALLOC")
77 else if(fun->
getName() ==
"DOUBLEFREEMALLOC")
82 else if(fun->
getName() ==
"DOUBLEFREEMALLOCFN" || fun->
getName() ==
"SAFEMALLOCFP")
88 writeWrnMsg(
"\t can not validate, check function not found, please put it at the right place!!");
98 outs() <<
sucMsg(
"\t SUCCESS :") << funName<<
"\n";
101 outs() <<
sucMsg(
"\t SUCCESS :") << funName <<
" check <src id:" << source->
getId()
102 <<
", cs id:" << (
getSrcCSID(source))->valueOnlyToString() <<
"> at ("
114 <<
", cs id:" << (
getSrcCSID(source))->valueOnlyToString() <<
"> at ("
117 assert(
false &&
"test case failed!");
126 bool expectedFailure =
false;
128 if(fun->
getName() ==
"DOUBLEFREEMALLOCFN")
131 expectedFailure =
true;
133 else if(fun->
getName() ==
"SAFEMALLOCFP")
136 expectedFailure =
true;
138 else if(fun->
getName() ==
"SAFEMALLOC" || fun->
getName() ==
"DOUBLEFREEMALLOC")
144 writeWrnMsg(
"\t can not validate, check function not found, please put it at the right place!!");
154 outs() <<
sucMsg(
"\t EXPECTED-FAILURE :") << funName <<
"\n";
157 outs() <<
sucMsg(
"\t EXPECTED-FAILURE :") << funName <<
" check <src id:" << source->
getId()
158 <<
", cs id:" << (
getSrcCSID(source))->valueOnlyToString() <<
"> at ("
167 assert(
false &&
"test case failed!");
171 <<
" check <src id:" << source->
getId()
172 <<
", cs id:" << (
getSrcCSID(source))->valueOnlyToString() <<
"> at ("
175 assert(
false &&
"test case failed!");
const FunObjVar * getCalledFunction() const
const std::string getSourceLoc() const override
void testsValidation(ProgSlice *slice)
Validate test cases for regression test purpose.
void validateExpectedFailureTests(ProgSlice *slice, const FunObjVar *fun)
void validateSuccessTests(ProgSlice *slice, const FunObjVar *fun)
void reportBug(ProgSlice *slice) override
Report file/close bugs.
std::vector< SVFBugEvent > EventStack
const CallICFGNode * getSrcCSID(const SVFGNode *src)
static const Option< bool > ValidateTests
void evalFinalCond2Event(GenericBug::EventStack &eventStack) const
Add final condition to eventStack.
bool isSatisfiableForPairs()
const SVFGNode * getSource() const
root and sink operations
std::string evalFinalCond() const
Evaluate final condition.
NodeID getId() const
Get ID.
virtual const std::string & getName() const
virtual const FunObjVar * getFun() const
Get the function of this SVFGNode.
std::string sucMsg(const std::string &msg)
Returns successful message by converting a string into green string output.
std::string errMsg(const std::string &msg)
Print error message by converting a string into red string output.
std::ostream & errs()
Overwrite llvm::errs().
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.
std::ostream & outs()
Overwrite llvm::outs().