Added gripe check to rosetest for invalid operation and error codes.

git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1884 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Richard Mudgett
2010-08-25 17:17:09 +00:00
parent b612ee46c1
commit 0cada91336

View File

@@ -3023,6 +3023,7 @@ int main(int argc, char *argv[])
{
unsigned index;
unsigned offset;
const char *str;
static struct pri dummy_ctrl;
pri_set_message(rose_pri_message);
@@ -3136,7 +3137,12 @@ int main(int argc, char *argv[])
pri_message(&dummy_ctrl, "\n\n"
"List of operation codes:\n");
for (index = 0; index < ROSE_Num_Operation_Codes; ++index) {
pri_message(&dummy_ctrl, "%d: %s\n", index, rose_operation2str(index));
str = rose_operation2str(index);
if (!strncmp(str, "Invalid code:", 13)) {
pri_error(&dummy_ctrl, "%d: %s\n", index, str);
} else {
pri_message(&dummy_ctrl, "%d: %s\n", index, str);
}
}
pri_message(&dummy_ctrl, "\n\n"
"************************************************************\n");
@@ -3146,7 +3152,12 @@ int main(int argc, char *argv[])
pri_message(&dummy_ctrl, "\n\n"
"List of error codes:\n");
for (index = 0; index < ROSE_ERROR_Num_Codes; ++index) {
pri_message(&dummy_ctrl, "%d: %s\n", index, rose_error2str(index));
str = rose_error2str(index);
if (!strncmp(str, "Invalid code:", 13)) {
pri_error(&dummy_ctrl, "%d: %s\n", index, str);
} else {
pri_message(&dummy_ctrl, "%d: %s\n", index, str);
}
}
pri_message(&dummy_ctrl, "\n\n"
"************************************************************\n");