Using native C statements

Component Testing for C

In some cases, it can be necessary to include portions of native C code inside a .ptu test script. You can use the #, @, and ! prefixes to do this.

Analyzed native code - #

When lines are prefixed with the # character, the Test Script Compiler analyzes the line and then copies the line into the generated code. You can use the # prefix to declare test script variables and to include the files that declare the functions under test.

Variable declarations must be placed outside of C test script blocks preferably at the beginning of scenarios and procedures.

Ignored native code - @

When lines are prefixed with the @ character, the Test Script Compiler only copies the line into the test harness and does not analyze the line. You can use the @ prefix to copy instructions into the test harness, when the test script compiler would not understand these instructions. Assembly instructions are examples of these instructions.

Parsed native code - !

When lines are prefixed with the ! character, the Test Script Compiler analyzes the lines, but does not copy the lines into the test harness. You can use the ! prefix to declare variables and types that are built into the compiler.