[libpri-commits] rmudgett: branch 1.4 r1884 - /branches/1.4/rosetest.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Wed Aug 25 12:17:11 CDT 2010


Author: rmudgett
Date: Wed Aug 25 12:17:09 2010
New Revision: 1884

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1884
Log:
Added gripe check to rosetest for invalid operation and error codes.

Modified:
    branches/1.4/rosetest.c

Modified: branches/1.4/rosetest.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/rosetest.c?view=diff&rev=1884&r1=1883&r2=1884
==============================================================================
--- branches/1.4/rosetest.c (original)
+++ branches/1.4/rosetest.c Wed Aug 25 12:17:09 2010
@@ -3023,6 +3023,7 @@
 {
 	unsigned index;
 	unsigned offset;
+	const char *str;
 	static struct pri dummy_ctrl;
 
 	pri_set_message(rose_pri_message);
@@ -3136,7 +3137,12 @@
 	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 @@
 	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");




More information about the libpri-commits mailing list