assert()

Evaluates an expression to be true, and reports a failure if FALSE.

Syntax

assert(
    expr BOOLEAN,
    msg STRING )
  1. expr is the expression to test.
  2. msg is the error message to report if the expression is FALSE. Only failed assertions are reported.

Usage

Use assert() to check a given condition in the tested application to be true. If the result is false, the GGC marks the check as failed in the resulting report.

In this example, the expected form name in the tested application is "price". If the form name is not valid, an explanatory error message is generated for the test report.

CALL ggc.assert(ggc.getFormName() == "price", SFMT("Form name is not valid, expected: 'price', got: '%1'", getFormName()))