Originally Posted by
Tony Flury
Maybe if you explain why you need the information, what you are actually trying to acheive - then we might have better luck helping you identify the tools you need.
Originally Posted by
trent.josephsen
Perhaps you should describe what problem you're trying to solve, rather than how you want to solve it, and we can suggest other solutions.
Hey Tony, I have to unit test code. For this, I need to know what function calls what, so that I can go and test each function from my code, rather than allowing it's preceding function to call it(like how normally a program works).
For eg.
if main() calls fun1() and fun1() calls fun2() as shown below, I want to test fun2() through my code, rather than calling fun1() and let fun1() call fun2().
Code:
main()
{
fun1();
}
fun1()
{
fun2();
}
fun2(char* someptr)
{
}
My code should be something like,
Code:
printf("\nEnter which function you would like to test");
//At this step, it should show the gprof output on the screen
[1]fun1 [2]fun2
//Say user selects fun2
//Then I do,
printf("\nExecuting test function...");
myptr = address_containing_some_junkvalue_for_testing;
status = fun2(myptr);
if(status == 0)
printf("\nunit test passed ");
else
printf("\nunit test failed ");
Any suggestions ?
Bookmarks