Basic Declarations

System Testing for C

COMMTYPE Instruction

For each communication type, there is a specific data type that identifies the application you are sending messages to. In a test script, the COMMTYPE instruction is used to identify clearly this data type, and then, the communication type.

The COMMTYPE instruction cannot handle basic types. Therefore, you must previously define the type with a typedef statement.

For example, on UNIX systems, the data type for the BSD sockets is an integer. The COMMTYPE instruction is therefore used as follows:

#typedef int bsd_socket_id_t;

COMMTYPE ux_bsd_socket IS bsd_socket_id_t

In the stack example provided with the product, the following line defines a new communication type called appl_comm:

COMMTYPE appl_comm IS appl_id_t

MESSAGE Instruction

The MESSAGE instruction identifies the type of the data exchanged between applications. It also defines a set of reference messages.

The type of the messages exchanged between applications using our stack example is message_t.

The following instruction also declares three reference messages:

MESSAGE message_t: ack, neg_ack, data

CHANNEL Instruction

The CHANNEL instruction is used to declare a communication channel on a specific communication type. Thanks to channels of communication, the user can easily manage a large number of opened connections.

CHANNEL appl_comm: appl_channel_1, appl_channel_2

ADD_ID Instruction

A communication channel is a logical medium of communication that multiplexes several opened connections of the same type between the Virtual Tester and applications under test. When opening a new connection, it has to be linked to a communication channel, so that the Virtual Tester knows about this new connection.

CALL mbx_init( &id ) @ err_ok @ errcode

ADD_ID (appl_channel, id)

In this example, the function call to mbx_init opens a connection between the Virtual Tester and the system under test. This connection is identified by the value of id after the call. The ADD_ID instruction add this new connection to the channel appl_channel.

Related Topics

COMMTYPE | MESSAGE | CHANNEL | ADD_ID | Adaptation layer