Conditions

System Testing for C

The IF statement comprises the keywords IF, THEN, ELSE, and END. It lets you define branches and follows these rules:

The sequence IF (test) THEN must appear on a single line. The keywords ELSE and END IF must each appear separately on their own lines.

Example

HEADER "Instruction IF", "1.0", "1.0"

#int IdConnection;

SCENARIO Main

  COMMENT connection

  CALL socket(AF_UNIX, SOCK_STREAM, 0)@@IdConnection

  IF (IdConnection == -1) THEN

    EXIT

  END IF

END SCENARIO

Related Topics

IterationsMultiple ConditionsIF