you must replace your inner main code with a function, so it looks like this:
int main(int argc, char **argv) {
myTestableFunction( argc, argv);
return 0;
}
and the myTestableFunction function you can use in your testcode. It should work like this
void theTest
{
int n = 6;
char args[][] = {"","","","","",""}; myTestableFunction(n, args);
}