Changeset 90
- Timestamp:
- 02/05/10 12:48:47 (2 years ago)
- Location:
- trunk/src
- Files:
-
- 2 modified
-
assert.pro (modified) (1 diff)
-
mguttestcase__define.pro (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/assert.pro
r76 r90 13 13 ; msg : in, optional, type=string, default="Assertion failed" 14 14 ; message to throw if condition is not met 15 ; arg : in, optional, type=string15 ; arg1 : in, optional, type=string 16 16 ; argument for any C format codes in msg 17 ; arg2 : in, optional, type=string 18 ; argument for any C format codes in msg 19 ; arg3 : in, optional, type=string 20 ; argument for any C format codes in msg 21 ; 22 ; :Keywords: 23 ; skip : in, optional, type=boolean 24 ; set to skip test instead of fail 17 25 ;- 18 pro assert, condition, msg, arg 26 pro assert, condition, msg, arg1, arg2, arg3, skip=skip 19 27 compile_opt strictarr, logical_predicate, hidden 20 28 on_error, 2 21 29 22 case n_params() of 23 0: 24 1: if (~condition) then message, 'Assertion failed' 25 2: if (~condition) then message, msg 26 3: if (~condition) then message, string(arg, format='(%"' + msg + '")') 27 endcase 30 if (~condition) then begin 31 if (keyword_set(skip)) then (scope_varfetch('self', level=-1))->skip 32 33 case n_params() of 34 0: 35 1: message, 'Assertion failed' 36 2: message, msg 37 3: message, string(arg1, format='(%"' + msg + '")') 38 4: message, string(arg1, arg2, format='(%"' + msg + '")') 39 5: message, string(arg1, arg2, arg3, format='(%"' + msg + '")') 40 endcase 41 endif 28 42 end -
trunk/src/mguttestcase__define.pro
r88 r90 22 22 compile_opt strictarr 23 23 24 end 25 26 27 ;+ 28 ; Set this test to be skipped. 29 ;- 30 pro mguttestcase::skip 31 compile_opt strictarr 32 33 self.skipped = 1 24 34 end 25 35
