Changeset 68 for pjproject/trunk/pjlib/src/pjlib-test/exception.c
- Timestamp:
- Nov 21, 2005 4:57:02 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pjlib-test/exception.c
r65 r68 66 66 static int test(void) 67 67 { 68 int rc = 0; 68 69 PJ_USE_EXCEPTION; 69 int rc = 0;70 70 71 71 /* … … 75 75 rc = rc; 76 76 } 77 PJ_CATCH( ID_1 ) { 78 rc = -2; 79 } 80 PJ_DEFAULT { 77 PJ_CATCH_ANY { 81 78 rc = -3; 82 79 } … … 96 93 rc = -10; 97 94 } 98 PJ_CATCH( ID_1 ) { 99 if (!rc) rc = 0; 100 } 101 PJ_DEFAULT { 95 PJ_CATCH_ANY { 102 96 int id = PJ_GET_EXCEPTION(); 103 PJ_LOG(3,("", "...error: got unexpected exception %d (%s)", 104 id, pj_exception_id_name(id))); 105 if (!rc) rc = -20; 97 if (id != ID_1) { 98 PJ_LOG(3,("", "...error: got unexpected exception %d (%s)", 99 id, pj_exception_id_name(id))); 100 if (!rc) rc = -20; 101 } 106 102 } 107 103 PJ_END; … … 118 114 rc = -25; 119 115 } 120 PJ_CATCH( ID_1 ) { 121 if (!rc) rc = -30; 122 } 123 PJ_CATCH( ID_2 ) { 124 if (!rc) rc = 0; 125 } 126 PJ_DEFAULT { 127 if (!rc) rc = -40; 116 PJ_CATCH_ANY { 117 switch (PJ_GET_EXCEPTION()) { 118 case ID_1: 119 if (!rc) rc = -30; break; 120 case ID_2: 121 if (!rc) rc = 0; break; 122 default: 123 if (!rc) rc = -40; 124 break; 125 } 128 126 } 129 127 PJ_END; … … 140 138 rc = -50; 141 139 } 142 PJ_CATCH( ID_2 ) { 143 if (!rc) rc = -60; 144 } 145 PJ_DEFAULT { 146 if (!rc) rc = 0; 140 PJ_CATCH_ANY { 141 switch (PJ_GET_EXCEPTION()) { 142 case ID_1: 143 if (!rc) rc = 0; 144 break; 145 default: 146 if (!rc) rc = -60; 147 break; 148 } 147 149 } 148 150 PJ_END;
Note: See TracChangeset
for help on using the changeset viewer.