This macro checks the state of a global variable `FUTS_EXPECTED_ERROR`. It is generally called after a code sequence supposed to cause an error. If the global variable is not empty (meaning an error was expected but does not seem to have been caught or handled), the macro triggers an event (via `%generate_event`) to report the test failure with the message 'Did not get expected error'. It also increments the global test counter.
Data Analysis
Type : CREATION_INTERNE
Use of global macro variables (&FUTS_EXPECTED_ERROR, &futs_tst_cnt) to manage test status and counting.
1 Code Block
MACRO DEFINITION
Explanation : Macro definition. It increments the test counter, checks if an error was expected via the global variable, and if so (test failure condition), calls the `%generate_event` macro to report the anomaly.
MESSAGE=Did not get expected error &FUTS_EXPECTED_ERROR,
3
TYPE=,
4
LEVEL=,
5
ATTACHDATA=,
6
ATTACHFILE=,
7
METRIC=,
8
PROPERTIES=,
9
ON_EVENT=,
10
DESCRIPTION=, ABORT= );
11
12
%global FUTS_EXPECTED_ERROR;
13
14
%let futs_tst_cnt = %eval(&futs_tst_cnt.+1);
15
16
%IF &FUTS_EXPECTED_ERROR ne %str() %THEN
17
%generate_event(TYPE=&TYPE, LEVEL=&LEVEL,
18
MESSAGE=&MESSAGE,
19
ATTACHDATA=&ATTACHDATA, ATTACHFILE=&ATTACHFILE,
20
METRIC=&METRIC,
21
PROPERTIES=&PROPERTIES,
22
ON_EVENT=&ON_EVENT,
23
DESCRIPTION=&DESCRIPTION, ABORT=&ABORT);
24
25
%mend assert_error_occurred;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Copyright (c) 2015 John Jacobs. All rights reserved.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.