1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
;
; Unknown origin ...
;
; Modifications history :
; -2024-04-15 AC : cleaning (details ...)
;
; -------------------------------------------------
;
pro TEST_OBJ_HASMETHOD_INTERNAL, input, cumul_errors, debug=debug, $
test=test, verbose=verbose
;
errors=0
;
if ~OBJ_VALID(input) then ERRORS_ADD, errors, 'Not an valid OBJ'
;
hasadd = OBJ_HASMETHOD(input,'ADD')
if ~hasadd then ERRORS_ADD, errors, 'Method ADD not available'
;
hasmove= OBJ_HASMETHOD(input,'MOVE')
if ~hasmove then ERRORS_ADD, errors, 'Method MOVE not available'
;
hasremove= OBJ_HASMETHOD(input,'REMOVE')
if ~hasremove then ERRORS_ADD, errors, 'Method REMOVE not available'
;
hastoarray=OBJ_HASMETHOD(input,'TOARRAY')
if ~hastoarray then ERRORS_ADD, errors, 'Method TOARRAY not available'
;
; --------------
;
BANNER_FOR_TESTSUITE, 'TEST_OBJ_HASMETHOD_INTERNAL', errors, /short, verb=verbose
ERRORS_CUMUL, cumul_errors, errors
if KEYWORD_SET(test) then STOP
;
end
;
; ----------------------------
;
pro TEST_OBJ_HASMETHOD, help=help, verbose=verbose, test=test, no_exit=no_exit
;
if KEYWORD_SET(help) then begin
print, 'TEST_OBJ_HASMETHOD, help=help, verbose=verbose, $'
print, ' test=test, no_exit=no_exit'
return
endif
;
cumul_errors=0
;
llist = LIST(FLTARR(4), "hello", 2.)
TEST_OBJ_HASMETHOD_INTERNAL, llist, cumul_errors
mlist = LIST(!pi, "goodbye", FINDGEN(3,4))
TEST_OBJ_HASMETHOD_INTERNAL, mlist, cumul_errors;
;
; ----------------- final message ----------
;
BANNER_FOR_TESTSUITE, 'TEST_OBJ_HASMETHOD', cumul_errors, short=short
;
if (cumul_errors GT 0) AND ~KEYWORD_SET(no_exit) then EXIT, status=1
;
if KEYWORD_SET(test) then STOP
;
end
|