A
ankitks
guys,
I have to do some testing, and usally code flows like this. If
something is wrong, flag error. And if it is correct, see if something
else is wrong, flag error! And recursive like that.
if (a != b) {
flag_error();
}
else {
if ( c != d) {
flag_error();
}
else {
if ( e != f) {
flag_error();
}
} //end of else c != d
} //end of else a !=b
it is really annoying to read code later for debugging. Using a !=b ?
flag_error() : c != d ? ...doesn't seem that practical either.
how can I convert this into macro so that I can use it more readable
something like this!
VERIFY a == b OTHERWISE flag_error();
GO_NEXT;
VERIFY c == d OTHERWISE flag_error();
GO_NEXT;
VERIFY e == f OTHERWISE flag_error();
is this recursive macro possible.
Sorry, for asking dumb quesitons. Trying to make life easy, if possible.
I have to do some testing, and usally code flows like this. If
something is wrong, flag error. And if it is correct, see if something
else is wrong, flag error! And recursive like that.
if (a != b) {
flag_error();
}
else {
if ( c != d) {
flag_error();
}
else {
if ( e != f) {
flag_error();
}
} //end of else c != d
} //end of else a !=b
it is really annoying to read code later for debugging. Using a !=b ?
flag_error() : c != d ? ...doesn't seem that practical either.
how can I convert this into macro so that I can use it more readable
something like this!
VERIFY a == b OTHERWISE flag_error();
GO_NEXT;
VERIFY c == d OTHERWISE flag_error();
GO_NEXT;
VERIFY e == f OTHERWISE flag_error();
is this recursive macro possible.
Sorry, for asking dumb quesitons. Trying to make life easy, if possible.