set_expected_results()
#
set_expected_results()
initializes the expected test results, including expected errors, expected JSON output, ignored keys, and verbosity settings.
Prototype
void set_expected_results(
const char *name,
json_t *errors_list,
json_t *expected,
const char **ignore_keys,
BOOL verbose
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The name of the test case. |
|
|
A JSON array containing expected error messages. |
|
|
A JSON object representing the expected test output. |
|
|
An array of keys to be ignored during JSON comparison. |
|
|
Flag indicating whether verbose output should be enabled. |
Return Value
This function does not return a value.
Notes
The function resets previously stored expected results before setting new ones.
If verbose
is enabled, the function prints the test name to the console.
The function initializes expected_log_messages
, unexpected_log_messages
, and expected
as JSON arrays if they are not provided.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples