28 %MACRO assertLog (i_errors = 0
30 ,i_desc = Scan log
for errors
35 %IF &g_inTestcase EQ 1 %THEN %DO;
38 %ELSE %IF &g_inTestcase NE 2 %THEN %DO;
39 %PUT &g_error.(SASUNIT): assert must be called after initTestcase;
43 %LOCAL l_casid l_error_count l_warning_count l_result l_errMsg;
48 SELECT max(cas_id) INTO :l_casid FROM target.cas WHERE cas_scnid = &g_scnid;
51 %IF &l_casid = . OR &l_casid = %THEN %DO;
52 %PUT &g_error.(SASUNIT): assert must not be called before initTestcase;
58 i_logfile = &g_log/%sysfunc(putn(&g_scnid,z3.))_%sysfunc(putn(&l_casid,z3.)).log
60 ,i_warning = &g_warning
61 ,r_errors = l_error_count
62 ,r_warnings= l_warning_count
65 %LET l_result = %eval ((
66 &l_error_count NE &i_errors
67 OR &l_warning_count NE &i_warnings
70 %IF (&l_result. EQ 2) %THEN %DO;
71 %LET l_errmsg=%bquote(expected &i_errors. error(s) and &i_warnings. warning(s), but actually there are &l_error_count. error(s) and &l_warning_count warning(s));
74 %_asserts(i_type = assertLog
75 ,i_expected = %str(&i_errors
#&i_warnings)
76 ,i_actual = %str(&l_error_count#&l_warning_count)