TEST CASE

C++ Test Script Language

Syntax

TEST CASE <test case name> { <test case item>}

Location

TEST CLASS, TEST SUITE

Description

The TEST CASE statement describes an object test case, which is the smallest testing structure in a hierarchical C++ Test Driver Script. Test cases appear in test classes and test suites.

<test case name> is a C++ Test Script Language identifier.

<test case item> may be one of the following entities:

  • ON ERROR

  • CHECK EXCEPTION

  • CHECK

  • CHECK PROPERTY

  • CHECK METHOD

  • CHECK STUB

  • CALL

  • COMMENT

  • PRINT

  • Native statement

CALL, CHECK, CHECK PROPERTY, COMMENT, PRINT as well as Native statements are ordered (they are executed sequentially). Other entities are not (they have a global effect on the test case).

ON ERROR and CHECK EXCEPTION may appear only once.

Example

TEST CLASS A {

TEST CASE 1 {

CHECK (x == 1);

#do_something ();

CHECK PROPERTY ok;

}

RUN {

1;

}

}