<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.stridewiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jaimeg</id>
	<title>STRIDE Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.stridewiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jaimeg"/>
	<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Special:Contributions/Jaimeg"/>
	<updated>2026-04-28T04:34:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8993</id>
		<title>Test Macros Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8993"/>
		<updated>2009-01-29T21:10:08Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Simple execution of all test units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Macros Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;&#039;&amp;lt;tt&amp;gt;%STRIDE_DIR%\Samples\TestUnits\TestMacros&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample test macros source code (C and C++ implementations),  and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestMacros.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestMacros.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Macros==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test macros source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; For all C++ test versions, each of the example test classes is grouped in the &#039;&#039;Basic&#039;&#039; namespace.  This is for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover simple uses of each of the macro families. The names of the test methods contain either &#039;&#039;Pass&#039;&#039; or &#039;&#039;Fail&#039;&#039;. All methods containing &#039;&#039;Fail&#039;&#039; illustrates uses of test macros that result in failures. Methods containing &#039;&#039;Pass&#039;&#039; illustrate passing uses. &lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_ExpectBool====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Boolean_Macros|&#039;&#039;srEXPECT_TRUE()&#039;&#039; and &#039;&#039;srEXPECT_FALSE()&#039;&#039;]] test class macros. &lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Comparison====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Comparison_Macros|&#039;&#039;srEXPECT_EQ()&#039;&#039;, &#039;&#039;srEXPECT_NE()&#039;&#039;, &#039;&#039;srEXPECT_GT()&#039;&#039;, &#039;&#039;srEXPECT_GE()&#039;&#039;, &#039;&#039;srEXPECT_LT()&#039;&#039; and &#039;&#039;srEXPECT_LE()&#039;&#039;]] macros. &lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_CString====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the C-string (zero terminated character sequence) macros [[Test_Units#C_String_Comparison_Macros|&#039;&#039;srEXPECT_STREQ()&#039;&#039;, &#039;&#039;srEXPECT_STRNE(&#039;&#039;), &#039;&#039;srEXPECT_STRCASEEQ()&#039;&#039; and &#039;&#039;srEXPECT_STRCASENE()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the exception verification macros [[Test_Units#Exception_Macros|&#039;&#039;srEXPECT_THROW()&#039;&#039;, &#039;&#039;srEXPECT_THROW_ANY()&#039;&#039; and &#039;&#039;srEXPECT_NO_THROW()&#039;&#039;]]. Note there is only C++ implementation for this test.&lt;br /&gt;
&lt;br /&gt;
====01_05_Basic_Predicates====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the predicate based macros [[Test_Units#Predicate_Macros|&#039;&#039;srEXPECT_PRED&amp;lt;n&amp;gt;()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_06_Basic_FloatingPt====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the macro used to test equality (or near equality) of floating point values [[Test_Units#Floating_Point_Macros|&#039;&#039;srEXPECT_NEAR()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_07_Basic_Assert====&lt;br /&gt;
&lt;br /&gt;
This example illustrates the use of the [[Test_Units#General_guidelines_for_all_macros|assertion macros]] (&#039;&#039;srASSERT_xx&#039;&#039;) which, in contrast to the [[Test_Units#General_guidelines_for_all_macros|expectation macros]] (&#039;&#039;srEXPECT_xx&#039;&#039;), cause the rest of the test case code to be bypassed.&lt;br /&gt;
&lt;br /&gt;
==Test Macros Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test macros.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test macros is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test macros.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestMacros.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestMacros.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Macros initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Assert...&lt;br /&gt;
  Running Test Basic::CString...&lt;br /&gt;
  Running Test Basic::Comparison...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::ExpectBool...&lt;br /&gt;
  Running Test Basic::FloatingPt...&lt;br /&gt;
  Running Test Basic::Predicates...&lt;br /&gt;
  Running Test Basic_Assert...&lt;br /&gt;
  Running Test Basic_CString...&lt;br /&gt;
  Running Test Basic_Comparison...&lt;br /&gt;
  Running Test Basic_ExpectBool...&lt;br /&gt;
  Running Test Basic_FloatingPt...&lt;br /&gt;
  Running Test Basic_Predicates...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               13&lt;br /&gt;
    Failed:               15&lt;br /&gt;
    In Progress:          0&lt;br /&gt;
    Not Applicable:       0&lt;br /&gt;
    ...in 13 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestMacros.ssw, a workspace in the TestMacros directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestMacros.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alphabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_MACRO_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_MACRO_NAME&#039;&#039;&#039; is the name of the scl_test_macro test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_macro tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=8992</id>
		<title>Test Units Overview</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=8992"/>
		<updated>2009-01-29T01:27:33Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* ASSERT/EXPECT Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
STRIDE enables testing of C/C++ code through the use of xUnit-style test units. Test units can be written by developers, captured using an SCL pragma, and executed from the host. STRIDE facilitates the execution of some or all of the test units by automatically creating entry points for the execution of test units on the target. &lt;br /&gt;
&lt;br /&gt;
== Using test units  ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites  ===&lt;br /&gt;
&lt;br /&gt;
see [[Desktop Installation#Third Party Components|Perl requirements]]. &lt;br /&gt;
&lt;br /&gt;
===How to get started (Overview)===&lt;br /&gt;
&lt;br /&gt;
The required steps to get started with writing test units are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new Studio workspace (or open an existing one).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Set the workspace to compile in C++ mode (In Studio, choose Tools-&amp;gt;Settings-&amp;gt;Compile as Cpp).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write a test unit. You may create a C++ test class or a C test function as your test unit. Click &#039;&#039;&#039;[[Test_Units#Test_Unit_Requirements|here]]&#039;&#039;&#039; for more information on creating test units.&amp;lt;/li&amp;gt;&lt;br /&gt;
To implement a test unit as a test class:&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class Simple {&lt;br /&gt;
public:&lt;br /&gt;
    int test1(void) { return  0;} // PASS&lt;br /&gt;
    int test2(void) { return 23;} // FAIL &amp;lt;&amp;gt;0&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#pragma scl_test_class(Simple)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Or, as a test function:&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
int test1(void) &lt;br /&gt;
{&lt;br /&gt;
    return 0; // PASS&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int test1(void) &lt;br /&gt;
{&lt;br /&gt;
    return 23; // FAIL &amp;lt;&amp;gt;0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;Simple&amp;quot;, test1, test2)&lt;br /&gt;
&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Compile the workspace &amp;amp; review the &#039;&#039;&#039;Simple&#039;&#039;&#039; interface in the Studio Interface tab&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a script to generate the Intercept Module(IM) &#039;&#039;&#039;after&#039;&#039;&#039; the compilation step.&lt;br /&gt;
:For the simple STUB generation required for test unit execution, you can use the following code&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE qw(in);&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
my $intercept = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;    &lt;br /&gt;
$intercept-&amp;gt;{Path} = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
$intercept-&amp;gt;{Name} = $main::studio-&amp;gt;Workspace-&amp;gt;Name;&lt;br /&gt;
map {$intercept-&amp;gt;Item($_)-&amp;gt;{Stub} = 1} (0..($intercept-&amp;gt;Count - 1));&lt;br /&gt;
$intercept-&amp;gt;Create(); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optionally add custom scripts to automate the building and executing your application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that the Studio workspace include path contains the location to all of your test unit declaration (header) files.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once you have created one or more test units, ensure the following:&lt;br /&gt;
:* Workspace is compiled and saved&lt;br /&gt;
:* Intercept Module is generated (Stubs for all Test Units)&lt;br /&gt;
:* Target application re-built&lt;br /&gt;
:* Target application downloaded &amp;amp; started&lt;br /&gt;
:* STRIDE Connected to Target&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;If your application is running, you can start executing test units.&lt;br /&gt;
:* You can test-execute individual test units interactively using the &#039;&#039;&#039;Studio interface&#039;&#039;&#039; view. To do this, open the user interface view corresponding to the test unit you would like to execute, then call it. The return values will indicate how many tests produced each of four (4) result types. Furthermore, the input to the entry point will allow you to select all methods for execution (the default) or individual methods via a dropdown list of enumerated values.&lt;br /&gt;
:* Once you are confident that the test units are behaving as expected, you can generate one or more execution scripts using the &#039;&#039;&#039;Script Wizard&#039;&#039;&#039;.  Sample &#039;&#039;&#039;[[templates]]&#039;&#039;&#039; for executing test unit entry points are provided in the %STRIDE_DIR%\templates\Script Wizard directory.&lt;br /&gt;
:* When writing scripts to execute test units, the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection is a powerful tool for test unit execution and reporting, and for obtaining test results.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For integration with larger regression test workspaces, we recommend that developers check in their test unit code and, optionally, the template-generated scripts that can be used to execute their test units.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pragmas for Test Units===&lt;br /&gt;
STRIDE supports three pragmas for capturing and qualifying test units: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_class ( class-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test class as captured. Once captured, STRIDE will generate the appropriate code for executing the test methods in the class. See the [[scl_test_class|scl_test_class page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_flist ( test-unit-name , test-function-name { , test-function-name } )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test unit as captured, by the specified test-unit-name. One or more functions (test methods) are associated with the test unit. Once captured, STRIDE will generate the appropriate code for executing the associated test methods. See the [[scl_test_flist|scl_test_flist page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_cclass ( struct-name , init-function-name { , deinit-function-name } )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test unit as captured. Once captured, STRIDE will generate the appropriate code for executing the associated test methods. See the [[scl_test_cclass|scl_test_cclass page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_setup ( test-unit-name , method-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: [optional] Declares a member method to be a setup fixture for the test unit. If specified, the setup method will be called before the execution of each test method. See the [[scl_test_setup|scl_test_setup page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_teardown ( test-unit-name , method-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: [optional] Declares a member method to be a teardown fixture for the test unit. If specified, the teardown method will be called after the execution of each test method. See the [[scl_test_teardown|scl_test_teardown page]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Test Unit Requirements  ==&lt;br /&gt;
&lt;br /&gt;
Several variations on typical xUnit-style test units are supported. The additional supported features include: &lt;br /&gt;
&lt;br /&gt;
*Test status can be set using STRIDE Runtime APIs &#039;&#039;or&#039;&#039; by specifying simple return types for test methods. &lt;br /&gt;
*Simple return types: 0 = PASS; &amp;amp;lt;&amp;amp;gt; 0 = FAIL &lt;br /&gt;
*void return type with no explict status setting is assumed PASS &lt;br /&gt;
*Test writers can create additional child suites and tests at runtime by using Runtime APIs. &lt;br /&gt;
*We do not rely on exceptions for reporting of status.&lt;br /&gt;
&lt;br /&gt;
The STRIDE test class framework has the following requirements of each test class: &lt;br /&gt;
&lt;br /&gt;
*The test class must have a suitable default (no-argument) constructor. &lt;br /&gt;
*The test class must have one or more public methods suitable as test methods. Allowable test methods always take no arguments (void) and return either void or simple integer types (int, short, long, char or bool). At this time, we do not allow typedef types or macros for the return values specification. &lt;br /&gt;
*the scl_test_class pragma must be applied to the class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple example using return values for status  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class Simple {&lt;br /&gt;
public:&lt;br /&gt;
    int tc_Int_ExpectPass(void) {return 0;}&lt;br /&gt;
    int tc_Int_ExpectFail(void) {return -1;}&lt;br /&gt;
    bool tc_Bool_ExpectPass(void) {return true;}&lt;br /&gt;
    bool tc_Bool_ExpectFail(void) {return false;}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(Simple)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
  &lt;br /&gt;
int tf_Int_ExpectPass(void) {return 0;}&lt;br /&gt;
int tf_Int_ExpectFail(void) {return -1;}&lt;br /&gt;
bool tf_Bool_ExpectPass(void) {return true;}&lt;br /&gt;
bool tf_Bool_ExpectFail(void) {return false;}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;Simple&amp;quot;, tf_Int_ExpectPass, tf_Int_ExpectFail, tf_Bool_ExpectPass, tf_Bool_ExpectFail)&lt;br /&gt;
#endif&lt;br /&gt;
   &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple example using runtime test service APIs  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class RuntimeServices_basic {&lt;br /&gt;
public: &lt;br /&gt;
  void tc_ExpectPass(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectFail(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_FAIL, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectInProgress(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(RuntimeServices_basic)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
  &lt;br /&gt;
void tf_ExpectPass(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0); &lt;br /&gt;
}&lt;br /&gt;
void tf_ExpectFail(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_FAIL, 0); &lt;br /&gt;
}&lt;br /&gt;
void tf_ExpectInProgress(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;RuntimeServices_basic&amp;quot;, tf_ExpectPass, tf_ExpectFail, tf_ExpectInProgress)&lt;br /&gt;
#endif&lt;br /&gt;
 &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple example using srTest base class  ===&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class MyTest : public stride::srTest {&lt;br /&gt;
public:&lt;br /&gt;
  void tc_ExpectPass(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
    testCase.SetStatus(srTEST_PASS, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectFail(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
    testCase.SetStatus(srTEST_FAIL, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectInProgress(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  int tc_ChangeMyName(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should have name = MyChangedName&amp;quot;);&lt;br /&gt;
    testCase.SetName(&amp;quot;MyChangedName&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  int tc_ChangeMyDescription(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should have a description set&amp;quot;);&lt;br /&gt;
    testCase.SetDescription(&amp;quot;this is my new description&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(MyTest)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Runtime Test Services  ==&lt;br /&gt;
&lt;br /&gt;
The Runtime Test Services (declared in srTest.h) are a set of APIs in the STRIDE Runtime that facilitate the writing of target based test code. These APIs make up an optional portion of the STRIDE Runtime and can be used to communicate additional information about tests to the host based reporting mechanism. These APIs also allow target test code to create additional test suites and test cases dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
There are 2 alternate ways of accessing these APIs: through C-based functions, or through a C++ base class from which you may derive your C++ test class. These are discussed below in C Test Functions, and C++ Test Classes sections below.&lt;br /&gt;
&lt;br /&gt;
=== C Test Functions ===&lt;br /&gt;
&lt;br /&gt;
The following C APIs are provided: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddSuite|srTestSuiteAddSuite]]&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteSetName|srTestSuiteSetName]]&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteSetDescription|srTestSuiteSetDescription]]&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddTest|srTestSuiteAddTest]]&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetName|srTestCaseSetName]]&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetDescription|srTestCaseSetDescription]]&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseAddComment|srTestCaseAddComment]]&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetStatus|srTestCaseSetStatus]]&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]]&#039;&#039;&#039;: creates an annotation at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestAnnotationAddComment|srTestAnnotationAddComment]]&#039;&#039;&#039;: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddSuite ====&lt;br /&gt;
The srTestSuiteAddSuite() routine is used to add a new test suite to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestSuiteHandle_t srTestSuiteAddSuite(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new test suite is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of test suite. If null, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|srTestSuiteHandle_t &lt;br /&gt;
| Handle of the newly created test suite. srTEST_SUITE_INVALID indicates failure to create test suite.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteHandle_t subSuite =&lt;br /&gt;
  srTestSuiteAddSuite(srTEST_SUITE_DEFAULT, &amp;quot;tf Sub Suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addSuite)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetName ====&lt;br /&gt;
The srTestSuiteSetName() routine is used to set the name of the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestSuiteSetName(srTestSuiteHandle_t tTestSuite, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestSuite &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test suite. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the name of test suite. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_setName(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteSetName(srTEST_SUITE_DEFAULT, &amp;quot;Setting name for default suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_setName)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetDescription ====&lt;br /&gt;
The srTestSuiteSetDescription() routine is used to set the description of the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestSuiteSetDescription(srTestSuiteHandle_t tTestSuite, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestSuite &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test suite. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of test suite. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
void tfsuite_setDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteSetDescription(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                            &amp;quot;Setting description for default suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_setDescription)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddTest ====&lt;br /&gt;
The srTestSuiteAddTest() routine is used to add a new test case to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestCaseHandle_t srTestSuiteAddTest(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new test case is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of test case. If null, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestCaseHandle_t &lt;br /&gt;
| Handle of the newly created test case. srTEST_CASE_INVALID indicates failure to create test case.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addTest(void)&lt;br /&gt;
{&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    char szName[25];&lt;br /&gt;
    sprintf(szName, &amp;quot;dynamic test case %d&amp;quot;, count);&lt;br /&gt;
    srTestCaseHandle_t test = srTestSuiteAddTest(srTEST_SUITE_DEFAULT, szName);&lt;br /&gt;
    srTEST_ADD_COMMENT_WITH_LOCATION(test, &amp;quot;this is a dynamic test case&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addTest)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetName ====&lt;br /&gt;
The srTestCaseSetName() routine is used to set set the name of the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetName(srTestCaseHandle_t tTestCase, const srCHAR *szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the name of test case. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setName(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetName(srTEST_CASE_DEFAULT, &amp;quot;Setting name for default case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setName)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetDescription ====&lt;br /&gt;
The srTestCaseSetDescription() routine is used to set the description of the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetDescription(srTestCaseHandle_t tTestCase, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of test case. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetDescription(srTEST_CASE_DEFAULT,&lt;br /&gt;
                           &amp;quot;Setting description for default case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setDescription)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseAddComment ====&lt;br /&gt;
The srTestCaseAddComment() routine is used to add a comment (aka a log) to be reported with the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseAddComment(srTestCaseHandle_t tTestCase, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string, which can be formatted, representing the comment. Cannot be null.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_addComment(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT,&lt;br /&gt;
                       &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_addComment)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatus ====&lt;br /&gt;
The srTestCaseSetStatus() routine is used to set the result of test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test.&lt;br /&gt;
|-&lt;br /&gt;
| dwDuration &lt;br /&gt;
| Input &lt;br /&gt;
| The duration of the test in clock ticks. Using “0” allows the STRIDE Runtime (Intercept Module) to set the time automatically.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setStatus(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setStatus)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatusEx ====&lt;br /&gt;
The srTestCaseSetStatusEx() routine is used to set the result of test case and allow specification of an extendedFailureCode.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration, srLONG lExtendedFailureCode)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test. dwDuration Input The duration of the test in clock ticks. Using “0” allows the STRIDE Runtime (Intercept Module) to set the time automatically.&lt;br /&gt;
|-&lt;br /&gt;
| lExtendedFailureCode &lt;br /&gt;
| Input &lt;br /&gt;
| The Stride framework uses the extendedFailureCode to capture the numeric results of test method when the test method fails via a numeric (non-void, nonbool) return type.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setStatusEx(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetStatusEx(srTEST_CASE_DEFAULT, srTEST_FAIL, 0, -5);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setStatusEx)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddAnnotation ====&lt;br /&gt;
The srTestSuiteAddAnnotation() routine is used to add a new annotation to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestAnnotationHandle_t srTestSuiteAddAnnotation(rTestSuiteHandle_t tParent, srTestAnnotationLevel_e eLevel, const srCHAR * szName, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new annotation is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| eLevel&lt;br /&gt;
| Input &lt;br /&gt;
| Annotation level. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of annotation. If null, the default host naming scheme will be used.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of annotation. If null, description will be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestAnnotationHandle_t &lt;br /&gt;
| HHandle of the newly created annotation. srTEST_ANNOTATION_INVALID indicates failure to create annotation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addAnnotation(void) &lt;br /&gt;
{&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    char szName[25];&lt;br /&gt;
    sprintf(szName, &amp;quot;annotation %d&amp;quot;, count);&lt;br /&gt;
    srTestAnnotationHandle_t annot = &lt;br /&gt;
                     srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                              srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                              szName,&lt;br /&gt;
                                              &amp;quot;description of annotation&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addAnnotation)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestAnnotationAddComment ====&lt;br /&gt;
The srTestAnnotationAddComment() routine is used to add a comment (aka a log) to be reported with the specified annotation.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestAnnotationAddComment(srTestAnnotationHandle_t tTestAnnotation, const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestAnnotation&lt;br /&gt;
| Input&lt;br /&gt;
| Handle to an annotation created using srTestSuiteAddAnnotation.&lt;br /&gt;
|-&lt;br /&gt;
| szLabel&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string for the label. If null, the default label will be applied.&lt;br /&gt;
|-&lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string, which can be formatted, representing the comment. Cannot be null.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuiteAnnotation_addComment(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestAnnotationHandle_t annot = &lt;br /&gt;
                           srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                                    srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                                    “annot”,&lt;br /&gt;
                                                    “annot description”);&lt;br /&gt;
  srTestAnnotationAddComment(annot,&lt;br /&gt;
                             srNULL,&lt;br /&gt;
                             &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuiteAnnotation_addComment)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C++ Test Classes ===&lt;br /&gt;
The Runtime Test Services C APIs work equally well from C test functions and C++ test classes. If, however, you are using C++ it might be more convinient for you to derive your C++ test classes from the Runtime Test Services C++ base class, &#039;&#039;srTest&#039;&#039;. That way you will have access to a set of simpler to use C++ classes. &lt;br /&gt;
&lt;br /&gt;
The following C++ classes are provided: &lt;br /&gt;
* &#039;&#039;&#039;[[#class srTest|class srTest]]&#039;&#039;&#039; - base test class&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestSuite|class srTestSuite]]&#039;&#039;&#039; - represents a test suite&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestCase|class srTestCase]]&#039;&#039;&#039; - represents a test case&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestAnnotation|class srTestAnnotation]]&#039;&#039;&#039; - represents a test annotation&lt;br /&gt;
&lt;br /&gt;
==== class srTest ====&lt;br /&gt;
The srTest class provides two Member Objects:&lt;br /&gt;
*&#039;&#039;testSuite&#039;&#039; of class srTestSuite &lt;br /&gt;
*&#039;&#039;testCase&#039;&#039;of class srTestCase&lt;br /&gt;
&lt;br /&gt;
==== class srTestSuite ====&lt;br /&gt;
The srTest class provides the folowing methods:&lt;br /&gt;
&lt;br /&gt;
===== method AddSuite =====&lt;br /&gt;
The AddSuite method is used to add a new test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestSuite AddSuite(const srCHAR * szName = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of test suite. If empty, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestSuite &lt;br /&gt;
| Newly created test suite class.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddSuite(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  stride::srTestSuite suite = testSuite.AddSuite(&amp;quot;tc Sub Suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetName =====&lt;br /&gt;
The SetName method is used to set the name of test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the name of test suite. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteSetName(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteSetName(void)&lt;br /&gt;
{&lt;br /&gt;
  testSuite.SetName(&amp;quot;Setting name for suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetDescription =====&lt;br /&gt;
The SetDescription method is used to set the description of test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the description of test suite. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|- &lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteSetDescription(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteSetDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  testSuite.SetDescription(&amp;quot;Setting description for suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddTest =====&lt;br /&gt;
The AddTest method is used to add a new test case to test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestCase AddTest(const srCHAR * szName = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of test case. If empty, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestCase &lt;br /&gt;
| Newly created test case class.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddSuite(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  const std::string prefix(&amp;quot;dynamic test case &amp;quot;);&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    std::stringstream strm;&lt;br /&gt;
    strm &amp;lt;&amp;lt; prefix &amp;lt;&amp;lt; count;&lt;br /&gt;
    stride::srTestCase tc = testSuite.AddTest(strm.str().c_str());&lt;br /&gt;
    tc.AddComment(&amp;quot;this is a dynamic test case&amp;quot;);&lt;br /&gt;
    tc.SetStatus(srTEST_PASS);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddAnnotation =====&lt;br /&gt;
The AddAnnotation method is used to add a new annotation to test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestAnnoation AddAnnotation(srTestAnnotationLevel_e eLevel, const srCHAR * szName = srNULL, const srCHAR * szDescr = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| eLevel&lt;br /&gt;
| Input&lt;br /&gt;
| Annotation level. Cannot be empty.&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of annotation. If empty, the default host naming scheme will be used.&lt;br /&gt;
|- &lt;br /&gt;
| szDescr&lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the description of annotation. If empty, the description will be blank.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestAnnotation&lt;br /&gt;
| Newly created annotation class.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddAnnotation(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddAnnotation(void) &lt;br /&gt;
{&lt;br /&gt;
  const std::string prefixName(&amp;quot;annotation &amp;quot;);&lt;br /&gt;
  const std::string prefixDescr(&amp;quot;description of annotation &amp;quot;);&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    std::stringstream strmName;&lt;br /&gt;
    std::stringstream strmDescr;&lt;br /&gt;
    strmName &amp;lt;&amp;lt; prefixName &amp;lt;&amp;lt; count;&lt;br /&gt;
    strmDescr &amp;lt;&amp;lt; prefixDescr &amp;lt;&amp;lt; count;&lt;br /&gt;
    stride::srTestAnnotation ta = &lt;br /&gt;
               testSuite.AddAnnotation(srTEST_ANNOTATION_LEVEL_INFO,&lt;br /&gt;
                                       strmName.str().c_str(),&lt;br /&gt;
                                       strmDescr.str().c_str());&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== class srTestCase ====&lt;br /&gt;
The srTestCase class provides the following methods:&lt;br /&gt;
&lt;br /&gt;
===== method SetName =====&lt;br /&gt;
The SetName method is used to set the name of test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the name of test case. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetName(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetName(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetName(&amp;quot;Setting name for case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetDescription =====&lt;br /&gt;
The SetDescription method is used to set the description of test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the description of test case. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetDescription(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetDescription(&amp;quot;Setting description for case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddComment =====&lt;br /&gt;
The AddComment method is used to add a comment to test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD AddComment(const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string, which can be formatted, representing the comment. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseAddComment(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseAddComment(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.AddComment(&amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetStatus =====&lt;br /&gt;
The SetStatus method is used to set the result of the default test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetStatus(srTestStatus_e eStatus, srDWORD dwDuration = 0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test.&lt;br /&gt;
|-&lt;br /&gt;
| dwDuration &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| The duration of the test in clock ticks. The default is 0.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetStatus(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetStatus(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetStatus(srTEST_INPROGRESS, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== class srTestAnnotation ====&lt;br /&gt;
The srTestAnnotation class provides the following methods:&lt;br /&gt;
&lt;br /&gt;
===== method AddComment =====&lt;br /&gt;
The AddComment method is used to add a comment to an annotation created under a test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD AddComment(const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szLabel&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string for the label. If null, the default label will be applied.&lt;br /&gt;
|- &lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string, which can be formatted, representing the comment. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAnnotationAddComment(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAnnotationAddComment(void)&lt;br /&gt;
{&lt;br /&gt;
  stride::srTestAnnotation ta = &lt;br /&gt;
                 testSuite.AddAnnotation(srTEST_ANNOTATION_LEVEL_INFO,&lt;br /&gt;
                                         “annot”,&lt;br /&gt;
                                         “annot description”);&lt;br /&gt;
  ta.AddComment(&amp;quot;this comment on annotation should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer to the [[Media:s2sSCLReferenceGuide.pdf|SCL Reference Guide]] or the [[Media:s2sRuntime.pdf|Runtime Developer&#039;s Guide]] for detailed information about any of these APIs.&lt;br /&gt;
&lt;br /&gt;
== ASSERT/EXPECT Macros ==&lt;br /&gt;
&lt;br /&gt;
The STRIDE Test Unit implementation also provides a set of Test Macros available for use within test methods. The macros are optional - you are not required to use them in your test units. They provide shortcuts for testing assertions and automatic report annotation in the case of failures.  &lt;br /&gt;
&lt;br /&gt;
The macros can be used in C++ and C test unit code (Note that there is no C version of exceptions test). &lt;br /&gt;
&lt;br /&gt;
=== General guidelines for all macros ===&lt;br /&gt;
&lt;br /&gt;
srEXPECT_xx macros will set the current test case to fail (if it hasn’t already been set) and produce an annotation in the report if the expectation fails. If the expectation succeeds, there is no action. &lt;br /&gt;
&lt;br /&gt;
srASSERT_xx macros will set the current test case to fail (if it hasn’t already been set) and insert an annotation into the report if the assertion fails. In addition, a return from the current function will occur. srASSERT_xx macros can only be used in test functions which return void. If the assertion succeeds there is no action. &lt;br /&gt;
&lt;br /&gt;
The report annotation produced by a failed macro always includes the source file and line along with details about the condition that failed and the failing values. &lt;br /&gt;
&lt;br /&gt;
=== Boolean Macros ===&lt;br /&gt;
The boolean macros take a single condition expression, &#039;&#039;cond&#039;&#039;, that evaluates to an integral type or bool. The condition will be evaluated once. if &#039;&#039;cond&#039;&#039; evaluates to non-zero the assertion or expectation fails. When a failure occurs the report will be annotated. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_TRUE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_TRUE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| &#039;&#039;cond&#039;&#039; is true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_FALSE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_FALSE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| &#039;&#039;cond&#039;&#039; is false&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Macros ===&lt;br /&gt;
&lt;br /&gt;
Comparison macros take two operands and compare them using the indicated operator. The comparison macros will work for primitive types as well as objects that have the corresponding comparison operator implemented.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_EQ(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_EQ(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; == &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_NE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; != &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039;&amp;lt;nowiki&amp;gt; &amp;lt; &amp;lt;/nowiki&amp;gt;&#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039;&amp;lt;nowiki&amp;gt; &amp;lt;= &amp;lt;/nowiki&amp;gt;&#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; &amp;gt; &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; &amp;gt;= &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== C String Comparison Macros ===&lt;br /&gt;
&lt;br /&gt;
C String Comparison Macros are intended only for use with C-style zero terminated strings. The strings can be char or wchar_t based. In particular, these macros should not be used for object of one or other string class, since such classes have overloaded comparison operators. The standard comparison macros should be used instead. &lt;br /&gt;
&lt;br /&gt;
* The length of a string displayed in the report annotation message is controllable via the following macro: srCFG_TEST_MACROS_MAX_C_STRING_MESSAGE_DISPLAY (found in srtestmacros.h). If a string value is truncated because of the length limit, the text &amp;quot;...(trunc)&amp;quot; will always appear next to it. &lt;br /&gt;
* An empty string will appear in error message output as “”. A null string will appear as NULL with no surrounding quotes. Otherwise all output strings are quoted. &lt;br /&gt;
* The type of str1 and str2 must be compatible with const char* or const wchar_t*. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;C-string comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STREQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STREQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have the same content&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRNE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRNE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have different content&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASEEQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASEEQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have the same content, ignoring case.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASENE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASENE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have different content, ignoring case.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Exception Macros ===&lt;br /&gt;
Exception macros  are used to ensure that expected exceptions are thrown. They require exception support from the target compiler. If the target compiler does not have exception support the macros cannot be used and must be disabled.  The support can be disabled via the macro srCFG_TEST_MACROS_EXCEPTIONS_ON found in srtestmacros.h.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Exceptions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW(statement, ex_type);&lt;br /&gt;
| srASSERT_THROW(statement, ex_type);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; throws an exception of type &#039;&#039;ex_type&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_ANY(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_THROW_ANY(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; throws an exception (type not important)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NO_THROW(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_NO_THROW(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; does not throw an exception&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Predicate Macros ===&lt;br /&gt;
Predicate macros allow user control over the pass/fail decision making in a macro. A predicate is a function returning bool that is implemented by the user but passed to the macro. Other arguments for the predicate are also passed to the macro. The macros allow for predicate functions with up to four parameters. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Predicates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED1(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;)&lt;br /&gt;
| srASSERT_PRED1(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;)&lt;br /&gt;
| &#039;&#039;pred&#039;&#039;(&#039;&#039;val1&#039;&#039;) returns true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED2(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;)&lt;br /&gt;
| srASSERT_PRED2(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;)&lt;br /&gt;
| &#039;&#039;pred&#039;&#039;(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;) returns true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| …(up to arity of 4)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
All predicate macros require a predicate function function which returns bool. The predicate macros allow functions with one to 4 parameters. Following are the report annotations resulting from expectation or assertion failures.&lt;br /&gt;
&lt;br /&gt;
=== Floating Point Macros ===&lt;br /&gt;
Floating point macros are for comparing equivalence (or near equivalence) of floating point numbers. These macros are necessary since because equivalence comparisons for floating point numbers will often fail due to round-off errors. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Floating Point Macros&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NEAR(val1, val2, epsilon);&lt;br /&gt;
| srASSERT_NEAR(val1, val2, epsilon);&lt;br /&gt;
| The absolute value of the difference between val1 and val2 is epsilon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dynamic Test Case Macros ===&lt;br /&gt;
The macros presented so far are not capable of dealing with dynamic test cases. In order to handle dynamic test cases, each of the macros requires another parameter which is the test case to report against. Other than this, these macros provide exactly equivalent functionality to the non-dynamic peer. The dynamic macros are listed below. All require a test case, value of type srTestCaseHandle_t from srtest.h,  to be passed as the first parameter).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;Nonfatal assertion&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;Fatal Assertion&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_TRUE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_TRUE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_FALSE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_FALSE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_EQ_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_EQ_DYN(tc, &#039;&#039;expect&#039;&#039;, &#039;&#039;val&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_NE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;C-string comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STREQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STREQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRNE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRNE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASEEQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASEEQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASENE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASENE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Exceptions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_DYN(statement, ex_type);&lt;br /&gt;
| srASSERT_THROW_DYN(tc, statement, ex_type);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_ANY_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_THROW_ANY_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NO_THROW_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_NO_THROW_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Predicates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED1_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;);&lt;br /&gt;
| srASSERT_PRED1_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED2_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_PRED2_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| …(up to arity of 4)&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Floating Point&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NEAR_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;, &#039;&#039;epsilon&#039;&#039;);&lt;br /&gt;
| srASSERT_NEAR_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;, &#039;&#039;epsilon&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Overloading The &amp;lt;&amp;lt; operator for report annotation (C++ tests only) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;All the macros support the adding to the report annotations using the &amp;lt;&amp;lt; operator. For example:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  srEXPECT_TRUE( a != &amp;lt;nowiki&amp;gt;b) &amp;lt;&amp;lt; “My custom message”; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;As delivered, the macros will support stream operator annotations using all the numeric types, char* and s2String. The user may create custom types to be used a report annotation by providing an implementation of the &amp;lt;&amp;lt; operator for their custom type. &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;The user of the asserting macros package may overload the &amp;lt;&amp;lt; operator in order to annotate reports using a custom class. An example is below. &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;The following will compile and execute successfully given that the &amp;lt;&amp;lt; operator is overloaded as shown:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyCustomClass custom(34); &lt;br /&gt;
&lt;br /&gt;
srEXPECT_FALSE(true) &amp;lt;&amp;lt; custom;&lt;br /&gt;
&lt;br /&gt;
// MyCustomClass implementation&lt;br /&gt;
class MyCustomClass&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   MyCustomClass(int i) : m_int(i) {}&lt;br /&gt;
&lt;br /&gt;
private: &lt;br /&gt;
   int m_int; &lt;br /&gt;
   friend stride::Message&amp;amp; operator&amp;lt;&amp;lt; &lt;br /&gt;
   ( stride::Message&amp;amp; ss, const MyCustomClass&amp;amp; obj);&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
stride::Message&amp;amp; operator&amp;lt;&amp;lt;(stride::Message&amp;amp; ss, const MyCustomClass&amp;amp; obj)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   // format the internals as a string and send on&lt;br /&gt;
   char buf[20]; &lt;br /&gt;
   sprintf(buf, &amp;quot;%d&amp;quot;, obj.m_int); &lt;br /&gt;
   ss &amp;lt;&amp;lt; buf;&lt;br /&gt;
   return ss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting a Test Unit ==&lt;br /&gt;
&lt;br /&gt;
To automate the execution and reporting of a Test Unit a script is required. Scripts can be written by hand or automatically generated using the Script Wizard and a corresponding template script. A scripting tool for executing a test unit is the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection. An [[AutoScript#ascript.TestUnits.Item|Ascript TestUnit]] object assembles all of the reporting information for the test unit and its corresponding test methods. &lt;br /&gt;
&lt;br /&gt;
*Require usage of the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection &lt;br /&gt;
*Can be written by hand (refer below) &lt;br /&gt;
*Can leverage [[Templates|Templates]] via the Script Wizard &lt;br /&gt;
*Order of multiple test units dictated by SUID assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== JScript example for a single test unit  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness a test unit that has been captured using #pragma scl_test_class(Simple). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
// Ensure test unit exists&lt;br /&gt;
if (ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;) != null) &lt;br /&gt;
  ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;).Run();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perl example for a single test unit  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness a test unit that has been captured using #pragma scl_test_class(Simple). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE;&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
my $tu = $main::ascript-&amp;gt;TestUnits-&amp;gt;Item(&amp;quot;Simple&amp;quot;);&lt;br /&gt;
if (defined $tu) {&lt;br /&gt;
  $tu-&amp;gt;Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== JScript example for multiple test units  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness two test units that have been captured using #pragma scl_test_class(Simple1) and #pragma scl_test_class(Simple2). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
var Units = [&amp;quot;Simple1&amp;quot;,&amp;quot;Simple2&amp;quot;];&lt;br /&gt;
  &lt;br /&gt;
// iterate through each function&lt;br /&gt;
for (i in Units)&lt;br /&gt;
{&lt;br /&gt;
  var tu = ascript.TestUnits.Item(Units[i]);&lt;br /&gt;
  if ( tu&amp;amp;nbsp;!= null ) &lt;br /&gt;
    tu.Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perl example for multiple test units  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness two test units that have been captured using #pragma scl_test_class(Simple1) and #pragma scl_test_class(Simple2). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE;&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
# initialize an array with all selected function names&lt;br /&gt;
my @UnitNames = (&amp;quot;Simple1&amp;quot;,&amp;quot;Simple2&amp;quot;);&lt;br /&gt;
foreach (@UnitNames) {   &lt;br /&gt;
  my $tu = $main::ascript-&amp;gt;TestUnits-&amp;gt;Item($_-&amp;gt;[1]);&lt;br /&gt;
  die &amp;quot;TestUnit not found: $_-&amp;gt;[1]\n&amp;quot; unless (defined $tu);&lt;br /&gt;
  $tu-&amp;gt;Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Test Units]]&lt;br /&gt;
[[Category:Reference]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8991</id>
		<title>Test Macros Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8991"/>
		<updated>2009-01-29T00:42:35Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Macros Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;&#039;&amp;lt;tt&amp;gt;%STRIDE_DIR%\Samples\TestUnits\TestMacros&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample test macros source code (C and C++ implementations),  and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestMacros.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestMacros.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Macros==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test macros source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; For all C++ test versions, each of the example test classes is grouped in the &#039;&#039;Basic&#039;&#039; namespace.  This is for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover simple uses of each of the macro families. The names of the test methods contain either &#039;&#039;Pass&#039;&#039; or &#039;&#039;Fail&#039;&#039;. All methods containing &#039;&#039;Fail&#039;&#039; illustrates uses of test macros that result in failures. Methods containing &#039;&#039;Pass&#039;&#039; illustrate passing uses. &lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_ExpectBool====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Boolean_Macros|&#039;&#039;srEXPECT_TRUE()&#039;&#039; and &#039;&#039;srEXPECT_FALSE()&#039;&#039;]] test class macros. &lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Comparison====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Comparison_Macros|&#039;&#039;srEXPECT_EQ()&#039;&#039;, &#039;&#039;srEXPECT_NE()&#039;&#039;, &#039;&#039;srEXPECT_GT()&#039;&#039;, &#039;&#039;srEXPECT_GE()&#039;&#039;, &#039;&#039;srEXPECT_LT()&#039;&#039; and &#039;&#039;srEXPECT_LE()&#039;&#039;]] macros. &lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_CString====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the C-string (zero terminated character sequence) macros [[Test_Units#C_String_Comparison_Macros|&#039;&#039;srEXPECT_STREQ()&#039;&#039;, &#039;&#039;srEXPECT_STRNE(&#039;&#039;), &#039;&#039;srEXPECT_STRCASEEQ()&#039;&#039; and &#039;&#039;srEXPECT_STRCASENE()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the exception verification macros [[Test_Units#Exception_Macros|&#039;&#039;srEXPECT_THROW()&#039;&#039;, &#039;&#039;srEXPECT_THROW_ANY()&#039;&#039; and &#039;&#039;srEXPECT_NO_THROW()&#039;&#039;]]. Note there is only C++ implementation for this test.&lt;br /&gt;
&lt;br /&gt;
====01_05_Basic_Predicates====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the predicate based macros [[Test_Units#Predicate_Macros|&#039;&#039;srEXPECT_PRED&amp;lt;n&amp;gt;()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_06_Basic_FloatingPt====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the macro used to test equality (or near equality) of floating point values [[Test_Units#Floating_Point_Macros|&#039;&#039;srEXPECT_NEAR()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_07_Basic_Assert====&lt;br /&gt;
&lt;br /&gt;
This example illustrates the use of the [[Test_Units#General_guidelines_for_all_macros|assertion macros]] (&#039;&#039;srASSERT_xx&#039;&#039;) which, in contrast to the [[Test_Units#General_guidelines_for_all_macros|expectation macros]] (&#039;&#039;srEXPECT_xx&#039;&#039;), cause the rest of the test case code to be bypassed.&lt;br /&gt;
&lt;br /&gt;
==Test Macros Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test macros.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test macros is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test macros.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestMacros.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestMacros.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Macros initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Assert...&lt;br /&gt;
  Running Test Basic::CString...&lt;br /&gt;
  Running Test Basic::Comparison...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::ExpectBool...&lt;br /&gt;
  Running Test Basic::FloatingPt...&lt;br /&gt;
  Running Test Basic::Predicates...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               13&lt;br /&gt;
    Failed:               15&lt;br /&gt;
    In Progress:          0&lt;br /&gt;
    Not Applicable:       0&lt;br /&gt;
    ...in 15 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestMacros.ssw, a workspace in the TestMacros directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestMacros.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alphabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_MACRO_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_MACRO_NAME&#039;&#039;&#039; is the name of the scl_test_macro test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_macro tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8990</id>
		<title>Test Macros Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8990"/>
		<updated>2009-01-29T00:41:45Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Run Individual */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Macros Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;&#039;&amp;lt;tt&amp;gt;%STRIDE_DIR%\Samples\TestUnits\TestMacros&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample test macros source code (C and C++ implementations),  and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestMacros.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestMacros.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Macros==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test macros source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; For all C++ test versions, each of the example test classes is grouped in the &#039;&#039;Basic&#039;&#039; namespace.  This is for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover simple uses of each of the macro families. The names of the test methods contain either &#039;&#039;Pass&#039;&#039; or &#039;&#039;Fail&#039;&#039;. All methods containing &#039;&#039;Fail&#039;&#039; illustrates uses of test macros that result in failures. Methods containing &#039;&#039;Pass&#039;&#039; illustrate passing uses. &lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_ExpectBool====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Boolean_Macros|&#039;&#039;srEXPECT_TRUE()&#039;&#039; and &#039;&#039;srEXPECT_FALSE()&#039;&#039;]] test class macros. &lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Comparison====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Comparison_Macros|&#039;&#039;srEXPECT_EQ()&#039;&#039;, &#039;&#039;srEXPECT_NE()&#039;&#039;, &#039;&#039;srEXPECT_GT()&#039;&#039;, &#039;&#039;srEXPECT_GE()&#039;&#039;, &#039;&#039;srEXPECT_LT()&#039;&#039; and &#039;&#039;srEXPECT_LE()&#039;&#039;]] macros. &lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_CString====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the C-string (zero terminated character sequence) macros [[Test_Units#C_String_Comparison_Macros|&#039;&#039;srEXPECT_STREQ()&#039;&#039;, &#039;&#039;srEXPECT_STRNE(&#039;&#039;), &#039;&#039;srEXPECT_STRCASEEQ()&#039;&#039; and &#039;&#039;srEXPECT_STRCASENE()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the exception verification macros [[Test_Units#Exception_Macros|&#039;&#039;srEXPECT_THROW()&#039;&#039;, &#039;&#039;srEXPECT_THROW_ANY()&#039;&#039; and &#039;&#039;srEXPECT_NO_THROW()&#039;&#039;]]. Note there is only C++ implementation for this test.&lt;br /&gt;
&lt;br /&gt;
====01_05_Basic_Predicates====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the predicate based macros [[Test_Units#Predicate_Macros|&#039;&#039;srEXPECT_PRED&amp;lt;n&amp;gt;()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_06_Basic_FloatingPt====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the macro used to test equality (or near equality) of floating point values [[Test_Units#Floating_Point_Macros|&#039;&#039;srEXPECT_NEAR()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_07_Basic_Assert====&lt;br /&gt;
&lt;br /&gt;
This example illustrates the use of the [[Test_Units#General_guidelines_for_all_macros|assertion macros]] (&#039;&#039;srASSERT_xx&#039;&#039;) which, in contrast to the [[Test_Units#General_guidelines_for_all_macros|expectation macros]] (&#039;&#039;srEXPECT_xx&#039;&#039;), cause the rest of the test case code to be bypassed.&lt;br /&gt;
&lt;br /&gt;
==Test Macros Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test macros.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test macros is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test macros.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestMacros.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestMacros.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Macros initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Assert...&lt;br /&gt;
  Running Test Basic::CString...&lt;br /&gt;
  Running Test Basic::Comparison...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::ExpectBool...&lt;br /&gt;
  Running Test Basic::FloatingPt...&lt;br /&gt;
  Running Test Basic::Predicates...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               13&lt;br /&gt;
    Failed:               15&lt;br /&gt;
    In Progress:          0&lt;br /&gt;
    Not Applicable:       0&lt;br /&gt;
    ...in 15 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestMacros.ssw, a workspace in the TestMacros directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestMacros.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alphabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_MACRO_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_MACRO_NAME&#039;&#039;&#039; is the name of the scl_test_macro test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_macro tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8989</id>
		<title>Test Macros Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8989"/>
		<updated>2009-01-29T00:37:11Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Macros Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;&#039;&amp;lt;tt&amp;gt;%STRIDE_DIR%\Samples\TestUnits\TestMacros&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample test macros source code (C and C++ implementations),  and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestMacros.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestMacros.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Macros==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test macros source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; For all C++ test versions, each of the example test classes is grouped in the &#039;&#039;Basic&#039;&#039; namespace.  This is for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover simple uses of each of the macro families. The names of the test methods contain either &#039;&#039;Pass&#039;&#039; or &#039;&#039;Fail&#039;&#039;. All methods containing &#039;&#039;Fail&#039;&#039; illustrates uses of test macros that result in failures. Methods containing &#039;&#039;Pass&#039;&#039; illustrate passing uses. &lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_ExpectBool====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Boolean_Macros|&#039;&#039;srEXPECT_TRUE()&#039;&#039; and &#039;&#039;srEXPECT_FALSE()&#039;&#039;]] test class macros. &lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Comparison====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Comparison_Macros|&#039;&#039;srEXPECT_EQ()&#039;&#039;, &#039;&#039;srEXPECT_NE()&#039;&#039;, &#039;&#039;srEXPECT_GT()&#039;&#039;, &#039;&#039;srEXPECT_GE()&#039;&#039;, &#039;&#039;srEXPECT_LT()&#039;&#039; and &#039;&#039;srEXPECT_LE()&#039;&#039;]] macros. &lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_CString====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the C-string (zero terminated character sequence) macros [[Test_Units#C_String_Comparison_Macros|&#039;&#039;srEXPECT_STREQ()&#039;&#039;, &#039;&#039;srEXPECT_STRNE(&#039;&#039;), &#039;&#039;srEXPECT_STRCASEEQ()&#039;&#039; and &#039;&#039;srEXPECT_STRCASENE()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the exception verification macros [[Test_Units#Exception_Macros|&#039;&#039;srEXPECT_THROW()&#039;&#039;, &#039;&#039;srEXPECT_THROW_ANY()&#039;&#039; and &#039;&#039;srEXPECT_NO_THROW()&#039;&#039;]]. Note there is only C++ implementation for this test.&lt;br /&gt;
&lt;br /&gt;
====01_05_Basic_Predicates====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the predicate based macros [[Test_Units#Predicate_Macros|&#039;&#039;srEXPECT_PRED&amp;lt;n&amp;gt;()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_06_Basic_FloatingPt====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the macro used to test equality (or near equality) of floating point values [[Test_Units#Floating_Point_Macros|&#039;&#039;srEXPECT_NEAR()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_07_Basic_Assert====&lt;br /&gt;
&lt;br /&gt;
This example illustrates the use of the [[Test_Units#General_guidelines_for_all_macros|assertion macros]] (&#039;&#039;srASSERT_xx&#039;&#039;) which, in contrast to the [[Test_Units#General_guidelines_for_all_macros|expectation macros]] (&#039;&#039;srEXPECT_xx&#039;&#039;), cause the rest of the test case code to be bypassed.&lt;br /&gt;
&lt;br /&gt;
==Test Macros Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test macros.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test macros is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test macros.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestMacros.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestMacros.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Macros initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Assert...&lt;br /&gt;
  Running Test Basic::CString...&lt;br /&gt;
  Running Test Basic::Comparison...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::ExpectBool...&lt;br /&gt;
  Running Test Basic::FloatingPt...&lt;br /&gt;
  Running Test Basic::Predicates...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               13&lt;br /&gt;
    Failed:               15&lt;br /&gt;
    In Progress:          0&lt;br /&gt;
    Not Applicable:       0&lt;br /&gt;
    ...in 15 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestMacros.ssw, a workspace in the TestMacros directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestMacros.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alphabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_MACRO_NAME&#039;&#039;&#039; is the name of the scl_test_macro test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_macro tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8988</id>
		<title>Test Macros Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8988"/>
		<updated>2009-01-29T00:36:00Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Test Class Macros Execution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Macros Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;&#039;&amp;lt;tt&amp;gt;%STRIDE_DIR%\Samples\TestUnits\TestMacros&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample test macros source code,  and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestMacros.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestMacros.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Macros==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test macros source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; For all C++ test versions, each of the example test classes is grouped in the &#039;&#039;Basic&#039;&#039; namespace.  This is for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover simple uses of each of the macro families. The names of the test methods contain either &#039;&#039;Pass&#039;&#039; or &#039;&#039;Fail&#039;&#039;. All methods containing &#039;&#039;Fail&#039;&#039; illustrates uses of test macros that result in failures. Methods containing &#039;&#039;Pass&#039;&#039; illustrate passing uses. &lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_ExpectBool====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Boolean_Macros|&#039;&#039;srEXPECT_TRUE()&#039;&#039; and &#039;&#039;srEXPECT_FALSE()&#039;&#039;]] test class macros. &lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Comparison====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Comparison_Macros|&#039;&#039;srEXPECT_EQ()&#039;&#039;, &#039;&#039;srEXPECT_NE()&#039;&#039;, &#039;&#039;srEXPECT_GT()&#039;&#039;, &#039;&#039;srEXPECT_GE()&#039;&#039;, &#039;&#039;srEXPECT_LT()&#039;&#039; and &#039;&#039;srEXPECT_LE()&#039;&#039;]] macros. &lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_CString====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the C-string (zero terminated character sequence) macros [[Test_Units#C_String_Comparison_Macros|&#039;&#039;srEXPECT_STREQ()&#039;&#039;, &#039;&#039;srEXPECT_STRNE(&#039;&#039;), &#039;&#039;srEXPECT_STRCASEEQ()&#039;&#039; and &#039;&#039;srEXPECT_STRCASENE()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the exception verification macros [[Test_Units#Exception_Macros|&#039;&#039;srEXPECT_THROW()&#039;&#039;, &#039;&#039;srEXPECT_THROW_ANY()&#039;&#039; and &#039;&#039;srEXPECT_NO_THROW()&#039;&#039;]]. Note there is only C++ implementation for this test.&lt;br /&gt;
&lt;br /&gt;
====01_05_Basic_Predicates====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the predicate based macros [[Test_Units#Predicate_Macros|&#039;&#039;srEXPECT_PRED&amp;lt;n&amp;gt;()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_06_Basic_FloatingPt====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the macro used to test equality (or near equality) of floating point values [[Test_Units#Floating_Point_Macros|&#039;&#039;srEXPECT_NEAR()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_07_Basic_Assert====&lt;br /&gt;
&lt;br /&gt;
This example illustrates the use of the [[Test_Units#General_guidelines_for_all_macros|assertion macros]] (&#039;&#039;srASSERT_xx&#039;&#039;) which, in contrast to the [[Test_Units#General_guidelines_for_all_macros|expectation macros]] (&#039;&#039;srEXPECT_xx&#039;&#039;), cause the rest of the test case code to be bypassed.&lt;br /&gt;
&lt;br /&gt;
==Test Macros Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test macros.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test macros is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test macros.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestMacros.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestMacros.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Macros initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Assert...&lt;br /&gt;
  Running Test Basic::CString...&lt;br /&gt;
  Running Test Basic::Comparison...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::ExpectBool...&lt;br /&gt;
  Running Test Basic::FloatingPt...&lt;br /&gt;
  Running Test Basic::Predicates...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestMacros\TestMacros.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               13&lt;br /&gt;
    Failed:               15&lt;br /&gt;
    In Progress:          0&lt;br /&gt;
    Not Applicable:       0&lt;br /&gt;
    ...in 15 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestMacros.ssw, a workspace in the TestMacros directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestMacros.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alphabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_MACRO_NAME&#039;&#039;&#039; is the name of the scl_test_macro test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_macro tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8987</id>
		<title>Test Macros Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8987"/>
		<updated>2009-01-29T00:07:27Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Sample Test Class Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Macros Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;&#039;&amp;lt;tt&amp;gt;%STRIDE_DIR%\Samples\TestUnits\TestMacros&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample test macros source code,  and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestMacros.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestMacros.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Macros==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test macros source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; For all C++ test versions, each of the example test classes is grouped in the &#039;&#039;Basic&#039;&#039; namespace.  This is for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover simple uses of each of the macro families. The names of the test methods contain either &#039;&#039;Pass&#039;&#039; or &#039;&#039;Fail&#039;&#039;. All methods containing &#039;&#039;Fail&#039;&#039; illustrates uses of test macros that result in failures. Methods containing &#039;&#039;Pass&#039;&#039; illustrate passing uses. &lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_ExpectBool====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Boolean_Macros|&#039;&#039;srEXPECT_TRUE()&#039;&#039; and &#039;&#039;srEXPECT_FALSE()&#039;&#039;]] test class macros. &lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Comparison====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Comparison_Macros|&#039;&#039;srEXPECT_EQ()&#039;&#039;, &#039;&#039;srEXPECT_NE()&#039;&#039;, &#039;&#039;srEXPECT_GT()&#039;&#039;, &#039;&#039;srEXPECT_GE()&#039;&#039;, &#039;&#039;srEXPECT_LT()&#039;&#039; and &#039;&#039;srEXPECT_LE()&#039;&#039;]] macros. &lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_CString====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the C-string (zero terminated character sequence) macros [[Test_Units#C_String_Comparison_Macros|&#039;&#039;srEXPECT_STREQ()&#039;&#039;, &#039;&#039;srEXPECT_STRNE(&#039;&#039;), &#039;&#039;srEXPECT_STRCASEEQ()&#039;&#039; and &#039;&#039;srEXPECT_STRCASENE()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the exception verification macros [[Test_Units#Exception_Macros|&#039;&#039;srEXPECT_THROW()&#039;&#039;, &#039;&#039;srEXPECT_THROW_ANY()&#039;&#039; and &#039;&#039;srEXPECT_NO_THROW()&#039;&#039;]]. Note there is only C++ implementation for this test.&lt;br /&gt;
&lt;br /&gt;
====01_05_Basic_Predicates====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the predicate based macros [[Test_Units#Predicate_Macros|&#039;&#039;srEXPECT_PRED&amp;lt;n&amp;gt;()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_06_Basic_FloatingPt====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the macro used to test equality (or near equality) of floating point values [[Test_Units#Floating_Point_Macros|&#039;&#039;srEXPECT_NEAR()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_07_Basic_Assert====&lt;br /&gt;
&lt;br /&gt;
This example illustrates the use of the [[Test_Units#General_guidelines_for_all_macros|assertion macros]] (&#039;&#039;srASSERT_xx&#039;&#039;) which, in contrast to the [[Test_Units#General_guidelines_for_all_macros|expectation macros]] (&#039;&#039;srEXPECT_xx&#039;&#039;), cause the rest of the test case code to be bypassed.&lt;br /&gt;
&lt;br /&gt;
==Test Class Macros Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test classes.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test classes is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test classes.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestClass.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClassMacros.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Class initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Assert...&lt;br /&gt;
  Running Test Basic::CString...&lt;br /&gt;
  Running Test Basic::Comparison...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::ExpectBool...&lt;br /&gt;
  Running Test Basic::FloatingPt...&lt;br /&gt;
  Running Test Basic::Predicates...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClassMacros\TestClassMacros.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClassMacros\TestClassMacros.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               7&lt;br /&gt;
    Failed:               8&lt;br /&gt;
    In Progress:          0&lt;br /&gt;
    Not Applicable:       0&lt;br /&gt;
    ...in 7 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestClassMacros.ssw, a workspace in the TestClass directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestClassMacros.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alphabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_Class_NAME&#039;&#039;&#039; is the name of the scl_test_class test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_class tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8986</id>
		<title>Test Macros Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8986"/>
		<updated>2009-01-28T23:43:57Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Getting Started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Macros Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;&#039;&amp;lt;tt&amp;gt;%STRIDE_DIR%\Samples\TestUnits\TestMacros&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample test macros source code,  and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestMacros.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestMacros.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Class Macros==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test class source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; each of the example test classes is grouped in the &#039;&#039;Basic&#039;&#039; namespace.  This is for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover simple uses of each of the macro families. The names of the test methods contain either &#039;&#039;Pass&#039;&#039; or &#039;&#039;Fail&#039;&#039;. All methods containing &#039;&#039;Fail&#039;&#039; illustrates uses of test macros that result in failures. Methods containing &#039;&#039;Pass&#039;&#039; illustrate passing uses. &lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_ExpectBool====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Boolean_Macros|&#039;&#039;srEXPECT_TRUE()&#039;&#039; and &#039;&#039;srEXPECT_FALSE()&#039;&#039;]] test class macros. &lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Comparison====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Comparison_Macros|&#039;&#039;srEXPECT_EQ()&#039;&#039;, &#039;&#039;srEXPECT_NE()&#039;&#039;, &#039;&#039;srEXPECT_GT()&#039;&#039;, &#039;&#039;srEXPECT_GE()&#039;&#039;, &#039;&#039;srEXPECT_LT()&#039;&#039; and &#039;&#039;srEXPECT_LE()&#039;&#039;]] macros. &lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_CString====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the C-string (zero terminated character sequence) macros [[Test_Units#C_String_Comparison_Macros|&#039;&#039;srEXPECT_STREQ()&#039;&#039;, &#039;&#039;srEXPECT_STRNE(&#039;&#039;), &#039;&#039;srEXPECT_STRCASEEQ()&#039;&#039; and &#039;&#039;srEXPECT_STRCASENE()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the exception verification macros [[Test_Units#Exception_Macros|&#039;&#039;srEXPECT_THROW()&#039;&#039;, &#039;&#039;srEXPECT_THROW_ANY()&#039;&#039; and &#039;&#039;srEXPECT_NO_THROW()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_05_Basic_Predicates====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the predicate based macros [[Test_Units#Predicate_Macros|&#039;&#039;srEXPECT_PRED&amp;lt;n&amp;gt;()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_06_Basic_FloatingPt====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the macro used to test equality (or near equality) of floating point values [[Test_Units#Floating_Point_Macros|&#039;&#039;srEXPECT_NEAR()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_07_Basic_Assert====&lt;br /&gt;
&lt;br /&gt;
This example illustrates the use of the [[Test_Units#General_guidelines_for_all_macros|assertion macros]] (&#039;&#039;srASSERT_xx&#039;&#039;) which, in contrast to the [[Test_Units#General_guidelines_for_all_macros|expectation macros]] (&#039;&#039;srEXPECT_xx&#039;&#039;), cause the rest of the test case code to by bypassed.&lt;br /&gt;
&lt;br /&gt;
==Test Class Macros Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test classes.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test classes is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test classes.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestClass.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClassMacros.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Class initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Assert...&lt;br /&gt;
  Running Test Basic::CString...&lt;br /&gt;
  Running Test Basic::Comparison...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::ExpectBool...&lt;br /&gt;
  Running Test Basic::FloatingPt...&lt;br /&gt;
  Running Test Basic::Predicates...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClassMacros\TestClassMacros.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClassMacros\TestClassMacros.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               7&lt;br /&gt;
    Failed:               8&lt;br /&gt;
    In Progress:          0&lt;br /&gt;
    Not Applicable:       0&lt;br /&gt;
    ...in 7 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestClassMacros.ssw, a workspace in the TestClass directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestClassMacros.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alphabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_Class_NAME&#039;&#039;&#039; is the name of the scl_test_class test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_class tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8985</id>
		<title>Test Macros Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Macros_Sample&amp;diff=8985"/>
		<updated>2009-01-28T23:36:29Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Macros Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;&#039;&amp;lt;tt&amp;gt;%STRIDE_DIR%\Samples\TestUnits\TestMacros&amp;lt;/tt&amp;gt;&#039;&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample test macros source code,  and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestClass.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestClass.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Class Macros==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test class source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; each of the example test classes is grouped in the &#039;&#039;Basic&#039;&#039; namespace.  This is for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover simple uses of each of the macro families. The names of the test methods contain either &#039;&#039;Pass&#039;&#039; or &#039;&#039;Fail&#039;&#039;. All methods containing &#039;&#039;Fail&#039;&#039; illustrates uses of test macros that result in failures. Methods containing &#039;&#039;Pass&#039;&#039; illustrate passing uses. &lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_ExpectBool====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Boolean_Macros|&#039;&#039;srEXPECT_TRUE()&#039;&#039; and &#039;&#039;srEXPECT_FALSE()&#039;&#039;]] test class macros. &lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Comparison====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates uses of the [[Test_Units#Comparison_Macros|&#039;&#039;srEXPECT_EQ()&#039;&#039;, &#039;&#039;srEXPECT_NE()&#039;&#039;, &#039;&#039;srEXPECT_GT()&#039;&#039;, &#039;&#039;srEXPECT_GE()&#039;&#039;, &#039;&#039;srEXPECT_LT()&#039;&#039; and &#039;&#039;srEXPECT_LE()&#039;&#039;]] macros. &lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_CString====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the C-string (zero terminated character sequence) macros [[Test_Units#C_String_Comparison_Macros|&#039;&#039;srEXPECT_STREQ()&#039;&#039;, &#039;&#039;srEXPECT_STRNE(&#039;&#039;), &#039;&#039;srEXPECT_STRCASEEQ()&#039;&#039; and &#039;&#039;srEXPECT_STRCASENE()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the exception verification macros [[Test_Units#Exception_Macros|&#039;&#039;srEXPECT_THROW()&#039;&#039;, &#039;&#039;srEXPECT_THROW_ANY()&#039;&#039; and &#039;&#039;srEXPECT_NO_THROW()&#039;&#039;]]. &lt;br /&gt;
&lt;br /&gt;
====01_05_Basic_Predicates====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the predicate based macros [[Test_Units#Predicate_Macros|&#039;&#039;srEXPECT_PRED&amp;lt;n&amp;gt;()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_06_Basic_FloatingPt====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates use of the macro used to test equality (or near equality) of floating point values [[Test_Units#Floating_Point_Macros|&#039;&#039;srEXPECT_NEAR()&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
====01_07_Basic_Assert====&lt;br /&gt;
&lt;br /&gt;
This example illustrates the use of the [[Test_Units#General_guidelines_for_all_macros|assertion macros]] (&#039;&#039;srASSERT_xx&#039;&#039;) which, in contrast to the [[Test_Units#General_guidelines_for_all_macros|expectation macros]] (&#039;&#039;srEXPECT_xx&#039;&#039;), cause the rest of the test case code to by bypassed.&lt;br /&gt;
&lt;br /&gt;
==Test Class Macros Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test classes.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test classes is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test classes.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestClass.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClassMacros.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Class initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Assert...&lt;br /&gt;
  Running Test Basic::CString...&lt;br /&gt;
  Running Test Basic::Comparison...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::ExpectBool...&lt;br /&gt;
  Running Test Basic::FloatingPt...&lt;br /&gt;
  Running Test Basic::Predicates...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClassMacros\TestClassMacros.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClassMacros\TestClassMacros.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               7&lt;br /&gt;
    Failed:               8&lt;br /&gt;
    In Progress:          0&lt;br /&gt;
    Not Applicable:       0&lt;br /&gt;
    ...in 7 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestClassMacros.ssw, a workspace in the TestClass directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestClassMacros.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alphabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_Class_NAME&#039;&#039;&#039; is the name of the scl_test_class test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_class tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=8965</id>
		<title>Test Units Overview</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=8965"/>
		<updated>2009-01-23T02:20:28Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Scripting a Test Unit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
STRIDE enables testing of C/C++ code through the use of xUnit-style test units. Test units can be written by developers, captured using an SCL pragma, and executed from the host. STRIDE facilitates the execution of some or all of the test units by automatically creating entry points for the execution of test units on the target. &lt;br /&gt;
&lt;br /&gt;
== Using test units  ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites  ===&lt;br /&gt;
&lt;br /&gt;
see [[Desktop Installation#Third Party Components|Perl requirements]]. &lt;br /&gt;
&lt;br /&gt;
===How to get started (Overview)===&lt;br /&gt;
&lt;br /&gt;
The required steps to get started with writing test units are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new Studio workspace (or open an existing one).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Set the workspace to compile in C++ mode (In Studio, choose Tools-&amp;gt;Settings-&amp;gt;Compile as Cpp).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write a test unit. You may create a C++ test class or a C test function as your test unit. Click &#039;&#039;&#039;[[Test_Units#Test_Unit_Requirements|here]]&#039;&#039;&#039; for more information on creating test units.&amp;lt;/li&amp;gt;&lt;br /&gt;
To implement a test unit as a test class:&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class Simple {&lt;br /&gt;
public:&lt;br /&gt;
    int test1(void) { return  0;} // PASS&lt;br /&gt;
    int test2(void) { return 23;} // FAIL &amp;lt;&amp;gt;0&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#pragma scl_test_class(Simple)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Or, as a test function:&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
int test1(void) &lt;br /&gt;
{&lt;br /&gt;
    return 0; // PASS&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int test1(void) &lt;br /&gt;
{&lt;br /&gt;
    return 23; // FAIL &amp;lt;&amp;gt;0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;Simple&amp;quot;, test1, test2)&lt;br /&gt;
&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Compile the workspace &amp;amp; review the &#039;&#039;&#039;Simple&#039;&#039;&#039; interface in the Studio Interface tab&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a script to generate the Intercept Module(IM) &#039;&#039;&#039;after&#039;&#039;&#039; the compilation step.&lt;br /&gt;
:For the simple STUB generation required for test unit execution, you can use the following code&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE qw(in);&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
my $intercept = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;    &lt;br /&gt;
$intercept-&amp;gt;{Path} = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
$intercept-&amp;gt;{Name} = $main::studio-&amp;gt;Workspace-&amp;gt;Name;&lt;br /&gt;
map {$intercept-&amp;gt;Item($_)-&amp;gt;{Stub} = 1} (0..($intercept-&amp;gt;Count - 1));&lt;br /&gt;
$intercept-&amp;gt;Create(); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optionally add custom scripts to automate the building and executing your application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that the Studio workspace include path contains the location to all of your test unit declaration (header) files.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once you have created one or more test units, ensure the following:&lt;br /&gt;
:* Workspace is compiled and saved&lt;br /&gt;
:* Intercept Module is generated (Stubs for all Test Units)&lt;br /&gt;
:* Target application re-built&lt;br /&gt;
:* Target application downloaded &amp;amp; started&lt;br /&gt;
:* STRIDE Connected to Target&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;If your application is running, you can start executing test units.&lt;br /&gt;
:* You can test-execute individual test units interactively using the &#039;&#039;&#039;Studio interface&#039;&#039;&#039; view. To do this, open the user interface view corresponding to the test unit you would like to execute, then call it. The return values will indicate how many tests produced each of four (4) result types. Furthermore, the input to the entry point will allow you to select all methods for execution (the default) or individual methods via a dropdown list of enumerated values.&lt;br /&gt;
:* Once you are confident that the test units are behaving as expected, you can generate one or more execution scripts using the &#039;&#039;&#039;Script Wizard&#039;&#039;&#039;.  Sample &#039;&#039;&#039;[[templates]]&#039;&#039;&#039; for executing test unit entry points are provided in the %STRIDE_DIR%\templates\Script Wizard directory.&lt;br /&gt;
:* When writing scripts to execute test units, the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection is a powerful tool for test unit execution and reporting, and for obtaining test results.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For integration with larger regression test workspaces, we recommend that developers check in their test unit code and, optionally, the template-generated scripts that can be used to execute their test units.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pragmas for Test Units===&lt;br /&gt;
STRIDE supports three pragmas for capturing and qualifying test units: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_class ( class-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test class as captured. Once captured, STRIDE will generate the appropriate code for executing the test methods in the class. See the [[scl_test_class|scl_test_class page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_flist ( test-unit-name , test-function-name { , test-function-name } )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test unit as captured, by the specified test-unit-name. One or more functions (test methods) are associated with the test unit. Once captured, STRIDE will generate the appropriate code for executing the associated test methods. See the [[scl_test_flist|scl_test_flist page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_cclass ( struct-name , init-function-name { , deinit-function-name } )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test unit as captured. Once captured, STRIDE will generate the appropriate code for executing the associated test methods. See the [[scl_test_cclass|scl_test_cclass page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_setup ( test-unit-name , method-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: [optional] Declares a member method to be a setup fixture for the test unit. If specified, the setup method will be called before the execution of each test method. See the [[scl_test_setup|scl_test_setup page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_teardown ( test-unit-name , method-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: [optional] Declares a member method to be a teardown fixture for the test unit. If specified, the teardown method will be called after the execution of each test method. See the [[scl_test_teardown|scl_test_teardown page]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Test Unit Requirements  ==&lt;br /&gt;
&lt;br /&gt;
Several variations on typical xUnit-style test units are supported. The additional supported features include: &lt;br /&gt;
&lt;br /&gt;
*Test status can be set using STRIDE Runtime APIs &#039;&#039;or&#039;&#039; by specifying simple return types for test methods. &lt;br /&gt;
*Simple return types: 0 = PASS; &amp;amp;lt;&amp;amp;gt; 0 = FAIL &lt;br /&gt;
*void return type with no explict status setting is assumed PASS &lt;br /&gt;
*Test writers can create additional child suites and tests at runtime by using Runtime APIs. &lt;br /&gt;
*We do not rely on exceptions for reporting of status.&lt;br /&gt;
&lt;br /&gt;
The STRIDE test class framework has the following requirements of each test class: &lt;br /&gt;
&lt;br /&gt;
*The test class must have a suitable default (no-argument) constructor. &lt;br /&gt;
*The test class must have one or more public methods suitable as test methods. Allowable test methods always take no arguments (void) and return either void or simple integer types (int, short, long, char or bool). At this time, we do not allow typedef types or macros for the return values specification. &lt;br /&gt;
*the scl_test_class pragma must be applied to the class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple example using return values for status  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class Simple {&lt;br /&gt;
public:&lt;br /&gt;
    int tc_Int_ExpectPass(void) {return 0;}&lt;br /&gt;
    int tc_Int_ExpectFail(void) {return -1;}&lt;br /&gt;
    bool tc_Bool_ExpectPass(void) {return true;}&lt;br /&gt;
    bool tc_Bool_ExpectFail(void) {return false;}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(Simple)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
  &lt;br /&gt;
int tf_Int_ExpectPass(void) {return 0;}&lt;br /&gt;
int tf_Int_ExpectFail(void) {return -1;}&lt;br /&gt;
bool tf_Bool_ExpectPass(void) {return true;}&lt;br /&gt;
bool tf_Bool_ExpectFail(void) {return false;}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;Simple&amp;quot;, tf_Int_ExpectPass, tf_Int_ExpectFail, tf_Bool_ExpectPass, tf_Bool_ExpectFail)&lt;br /&gt;
#endif&lt;br /&gt;
   &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple example using runtime test service APIs  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class RuntimeServices_basic {&lt;br /&gt;
public: &lt;br /&gt;
  void tc_ExpectPass(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectFail(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_FAIL, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectInProgress(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(RuntimeServices_basic)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
  &lt;br /&gt;
void tf_ExpectPass(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0); &lt;br /&gt;
}&lt;br /&gt;
void tf_ExpectFail(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_FAIL, 0); &lt;br /&gt;
}&lt;br /&gt;
void tf_ExpectInProgress(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;RuntimeServices_basic&amp;quot;, tf_ExpectPass, tf_ExpectFail, tf_ExpectInProgress)&lt;br /&gt;
#endif&lt;br /&gt;
 &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple example using srTest base class  ===&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class MyTest : public stride::srTest {&lt;br /&gt;
public:&lt;br /&gt;
  void tc_ExpectPass(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
    testCase.SetStatus(srTEST_PASS, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectFail(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
    testCase.SetStatus(srTEST_FAIL, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectInProgress(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  int tc_ChangeMyName(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should have name = MyChangedName&amp;quot;);&lt;br /&gt;
    testCase.SetName(&amp;quot;MyChangedName&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  int tc_ChangeMyDescription(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should have a description set&amp;quot;);&lt;br /&gt;
    testCase.SetDescription(&amp;quot;this is my new description&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(MyTest)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Runtime Test Services  ==&lt;br /&gt;
&lt;br /&gt;
The Runtime Test Services (declared in srTest.h) are a set of APIs in the STRIDE Runtime that facilitate the writing of target based test code. These APIs make up an optional portion of the STRIDE Runtime and can be used to communicate additional information about tests to the host based reporting mechanism. These APIs also allow target test code to create additional test suites and test cases dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
There are 2 alternate ways of accessing these APIs: through C-based functions, or through a C++ base class from which you may derive your C++ test class. These are discussed below in C Test Functions, and C++ Test Classes sections below.&lt;br /&gt;
&lt;br /&gt;
=== C Test Functions ===&lt;br /&gt;
&lt;br /&gt;
The following C APIs are provided: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddSuite|srTestSuiteAddSuite]]&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteSetName|srTestSuiteSetName]]&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteSetDescription|srTestSuiteSetDescription]]&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddTest|srTestSuiteAddTest]]&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetName|srTestCaseSetName]]&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetDescription|srTestCaseSetDescription]]&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseAddComment|srTestCaseAddComment]]&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetStatus|srTestCaseSetStatus]]&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]]&#039;&#039;&#039;: creates an annotation at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestAnnotationAddComment|srTestAnnotationAddComment]]&#039;&#039;&#039;: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddSuite ====&lt;br /&gt;
The srTestSuiteAddSuite() routine is used to add a new test suite to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestSuiteHandle_t srTestSuiteAddSuite(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new test suite is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of test suite. If null, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|srTestSuiteHandle_t &lt;br /&gt;
| Handle of the newly created test suite. srTEST_SUITE_INVALID indicates failure to create test suite.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteHandle_t subSuite =&lt;br /&gt;
  srTestSuiteAddSuite(srTEST_SUITE_DEFAULT, &amp;quot;tf Sub Suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addSuite)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetName ====&lt;br /&gt;
The srTestSuiteSetName() routine is used to set the name of the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestSuiteSetName(srTestSuiteHandle_t tTestSuite, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestSuite &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test suite. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the name of test suite. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_setName(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteSetName(srTEST_SUITE_DEFAULT, &amp;quot;Setting name for default suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_setName)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetDescription ====&lt;br /&gt;
The srTestSuiteSetDescription() routine is used to set the description of the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestSuiteSetDescription(srTestSuiteHandle_t tTestSuite, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestSuite &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test suite. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of test suite. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
void tfsuite_setDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteSetDescription(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                            &amp;quot;Setting description for default suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_setDescription)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddTest ====&lt;br /&gt;
The srTestSuiteAddTest() routine is used to add a new test case to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestCaseHandle_t srTestSuiteAddTest(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new test case is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of test case. If null, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestCaseHandle_t &lt;br /&gt;
| Handle of the newly created test case. srTEST_CASE_INVALID indicates failure to create test case.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addTest(void)&lt;br /&gt;
{&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    char szName[25];&lt;br /&gt;
    sprintf(szName, &amp;quot;dynamic test case %d&amp;quot;, count);&lt;br /&gt;
    srTestCaseHandle_t test = srTestSuiteAddTest(srTEST_SUITE_DEFAULT, szName);&lt;br /&gt;
    srTEST_ADD_COMMENT_WITH_LOCATION(test, &amp;quot;this is a dynamic test case&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addTest)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetName ====&lt;br /&gt;
The srTestCaseSetName() routine is used to set set the name of the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetName(srTestCaseHandle_t tTestCase, const srCHAR *szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the name of test case. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setName(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetName(srTEST_CASE_DEFAULT, &amp;quot;Setting name for default case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setName)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetDescription ====&lt;br /&gt;
The srTestCaseSetDescription() routine is used to set the description of the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetDescription(srTestCaseHandle_t tTestCase, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of test case. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetDescription(srTEST_CASE_DEFAULT,&lt;br /&gt;
                           &amp;quot;Setting description for default case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setDescription)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseAddComment ====&lt;br /&gt;
The srTestCaseAddComment() routine is used to add a comment (aka a log) to be reported with the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseAddComment(srTestCaseHandle_t tTestCase, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string, which can be formatted, representing the comment. Cannot be null.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_addComment(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT,&lt;br /&gt;
                       &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_addComment)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatus ====&lt;br /&gt;
The srTestCaseSetStatus() routine is used to set the result of test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test.&lt;br /&gt;
|-&lt;br /&gt;
| dwDuration &lt;br /&gt;
| Input &lt;br /&gt;
| The duration of the test in clock ticks. Using “0” allows the STRIDE Runtime (Intercept Module) to set the time automatically.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setStatus(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setStatus)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatusEx ====&lt;br /&gt;
The srTestCaseSetStatusEx() routine is used to set the result of test case and allow specification of an extendedFailureCode.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration, srLONG lExtendedFailureCode)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test. dwDuration Input The duration of the test in clock ticks. Using “0” allows the STRIDE Runtime (Intercept Module) to set the time automatically.&lt;br /&gt;
|-&lt;br /&gt;
| lExtendedFailureCode &lt;br /&gt;
| Input &lt;br /&gt;
| The Stride framework uses the extendedFailureCode to capture the numeric results of test method when the test method fails via a numeric (non-void, nonbool) return type.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setStatusEx(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetStatusEx(srTEST_CASE_DEFAULT, srTEST_FAIL, 0, -5);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setStatusEx)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddAnnotation ====&lt;br /&gt;
The srTestSuiteAddAnnotation() routine is used to add a new annotation to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestAnnotationHandle_t srTestSuiteAddAnnotation(rTestSuiteHandle_t tParent, srTestAnnotationLevel_e eLevel, const srCHAR * szName, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new annotation is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| eLevel&lt;br /&gt;
| Input &lt;br /&gt;
| Annotation level. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of annotation. If null, the default host naming scheme will be used.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of annotation. If null, description will be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestAnnotationHandle_t &lt;br /&gt;
| HHandle of the newly created annotation. srTEST_ANNOTATION_INVALID indicates failure to create annotation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addAnnotation(void) &lt;br /&gt;
{&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    char szName[25];&lt;br /&gt;
    sprintf(szName, &amp;quot;annotation %d&amp;quot;, count);&lt;br /&gt;
    srTestAnnotationHandle_t annot = &lt;br /&gt;
                     srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                              srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                              szName,&lt;br /&gt;
                                              &amp;quot;description of annotation&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addAnnotation)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestAnnotationAddComment ====&lt;br /&gt;
The srTestAnnotationAddComment() routine is used to add a comment (aka a log) to be reported with the specified annotation.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestAnnotationAddComment(srTestAnnotationHandle_t tTestAnnotation, const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestAnnotation&lt;br /&gt;
| Input&lt;br /&gt;
| Handle to an annotation created using srTestSuiteAddAnnotation.&lt;br /&gt;
|-&lt;br /&gt;
| szLabel&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string for the label. If null, the default label will be applied.&lt;br /&gt;
|-&lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string, which can be formatted, representing the comment. Cannot be null.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuiteAnnotation_addComment(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestAnnotationHandle_t annot = &lt;br /&gt;
                           srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                                    srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                                    “annot”,&lt;br /&gt;
                                                    “annot description”);&lt;br /&gt;
  srTestAnnotationAddComment(annot,&lt;br /&gt;
                             srNULL,&lt;br /&gt;
                             &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuiteAnnotation_addComment)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C++ Test Classes ===&lt;br /&gt;
The Runtime Test Services C APIs work equally well from C test functions and C++ test classes. If, however, you are using C++ it might be more convinient for you to derive your C++ test classes from the Runtime Test Services C++ base class, &#039;&#039;srTest&#039;&#039;. That way you will have access to a set of simpler to use C++ classes. &lt;br /&gt;
&lt;br /&gt;
The following C++ classes are provided: &lt;br /&gt;
* &#039;&#039;&#039;[[#class srTest|class srTest]]&#039;&#039;&#039; - base test class&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestSuite|class srTestSuite]]&#039;&#039;&#039; - represents a test suite&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestCase|class srTestCase]]&#039;&#039;&#039; - represents a test case&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestAnnotation|class srTestAnnotation]]&#039;&#039;&#039; - represents a test annotation&lt;br /&gt;
&lt;br /&gt;
==== class srTest ====&lt;br /&gt;
The srTest class provides two Member Objects:&lt;br /&gt;
*&#039;&#039;testSuite&#039;&#039; of class srTestSuite &lt;br /&gt;
*&#039;&#039;testCase&#039;&#039;of class srTestCase&lt;br /&gt;
&lt;br /&gt;
==== class srTestSuite ====&lt;br /&gt;
The srTest class provides the folowing methods:&lt;br /&gt;
&lt;br /&gt;
===== method AddSuite =====&lt;br /&gt;
The AddSuite method is used to add a new test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestSuite AddSuite(const srCHAR * szName = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of test suite. If empty, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestSuite &lt;br /&gt;
| Newly created test suite class.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddSuite(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  stride::srTestSuite suite = testSuite.AddSuite(&amp;quot;tc Sub Suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetName =====&lt;br /&gt;
The SetName method is used to set the name of test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the name of test suite. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteSetName(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteSetName(void)&lt;br /&gt;
{&lt;br /&gt;
  testSuite.SetName(&amp;quot;Setting name for suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetDescription =====&lt;br /&gt;
The SetDescription method is used to set the description of test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the description of test suite. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|- &lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteSetDescription(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteSetDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  testSuite.SetDescription(&amp;quot;Setting description for suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddTest =====&lt;br /&gt;
The AddTest method is used to add a new test case to test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestCase AddTest(const srCHAR * szName = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of test case. If empty, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestCase &lt;br /&gt;
| Newly created test case class.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddSuite(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  const std::string prefix(&amp;quot;dynamic test case &amp;quot;);&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    std::stringstream strm;&lt;br /&gt;
    strm &amp;lt;&amp;lt; prefix &amp;lt;&amp;lt; count;&lt;br /&gt;
    stride::srTestCase tc = testSuite.AddTest(strm.str().c_str());&lt;br /&gt;
    tc.AddComment(&amp;quot;this is a dynamic test case&amp;quot;);&lt;br /&gt;
    tc.SetStatus(srTEST_PASS);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddAnnotation =====&lt;br /&gt;
The AddAnnotation method is used to add a new annotation to test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestAnnoation AddAnnotation(srTestAnnotationLevel_e eLevel, const srCHAR * szName = srNULL, const srCHAR * szDescr = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| eLevel&lt;br /&gt;
| Input&lt;br /&gt;
| Annotation level. Cannot be empty.&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of annotation. If empty, the default host naming scheme will be used.&lt;br /&gt;
|- &lt;br /&gt;
| szDescr&lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the description of annotation. If empty, the description will be blank.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestAnnotation&lt;br /&gt;
| Newly created annotation class.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddAnnotation(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddAnnotation(void) &lt;br /&gt;
{&lt;br /&gt;
  const std::string prefixName(&amp;quot;annotation &amp;quot;);&lt;br /&gt;
  const std::string prefixDescr(&amp;quot;description of annotation &amp;quot;);&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    std::stringstream strmName;&lt;br /&gt;
    std::stringstream strmDescr;&lt;br /&gt;
    strmName &amp;lt;&amp;lt; prefixName &amp;lt;&amp;lt; count;&lt;br /&gt;
    strmDescr &amp;lt;&amp;lt; prefixDescr &amp;lt;&amp;lt; count;&lt;br /&gt;
    stride::srTestAnnotation ta = &lt;br /&gt;
               testSuite.AddAnnotation(srTEST_ANNOTATION_LEVEL_INFO,&lt;br /&gt;
                                       strmName.str().c_str(),&lt;br /&gt;
                                       strmDescr.str().c_str());&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== class srTestCase ====&lt;br /&gt;
The srTestCase class provides the following methods:&lt;br /&gt;
&lt;br /&gt;
===== method SetName =====&lt;br /&gt;
The SetName method is used to set the name of test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the name of test case. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetName(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetName(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetName(&amp;quot;Setting name for case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetDescription =====&lt;br /&gt;
The SetDescription method is used to set the description of test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the description of test case. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetDescription(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetDescription(&amp;quot;Setting description for case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddComment =====&lt;br /&gt;
The AddComment method is used to add a comment to test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD AddComment(const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string, which can be formatted, representing the comment. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseAddComment(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseAddComment(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.AddComment(&amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetStatus =====&lt;br /&gt;
The SetStatus method is used to set the result of the default test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetStatus(srTestStatus_e eStatus, srDWORD dwDuration = 0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test.&lt;br /&gt;
|-&lt;br /&gt;
| dwDuration &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| The duration of the test in clock ticks. The default is 0.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetStatus(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetStatus(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetStatus(srTEST_INPROGRESS, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== class srTestAnnotation ====&lt;br /&gt;
The srTestAnnotation class provides the following methods:&lt;br /&gt;
&lt;br /&gt;
===== method AddComment =====&lt;br /&gt;
The AddComment method is used to add a comment to an annotation created under a test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD AddComment(const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szLabel&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string for the label. If null, the default label will be applied.&lt;br /&gt;
|- &lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string, which can be formatted, representing the comment. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAnnotationAddComment(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAnnotationAddComment(void)&lt;br /&gt;
{&lt;br /&gt;
  stride::srTestAnnotation ta = &lt;br /&gt;
                 testSuite.AddAnnotation(srTEST_ANNOTATION_LEVEL_INFO,&lt;br /&gt;
                                         “annot”,&lt;br /&gt;
                                         “annot description”);&lt;br /&gt;
  ta.AddComment(&amp;quot;this comment on annotation should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer to the [[Media:s2sSCLReferenceGuide.pdf|SCL Reference Guide]] or the [[Media:s2sRuntime.pdf|Runtime Developer&#039;s Guide]] for detailed information about any of these APIs.&lt;br /&gt;
&lt;br /&gt;
== ASSERT/EXPECT Macros ==&lt;br /&gt;
&lt;br /&gt;
The STRIDE Test Unit implementation also provides a set of Test Macros available for use within test methods. The macros are optional - you are not required to use them in your test units. They provide shortcuts for testing assertions and automatic report annotation in the case of failures.  &lt;br /&gt;
&lt;br /&gt;
The macros can currently only be used in C++ test unit code. &lt;br /&gt;
&lt;br /&gt;
=== General guidelines for all macros ===&lt;br /&gt;
&lt;br /&gt;
srEXPECT_xx macros will set the current test case to fail (if it hasn’t already been set) and produce an annotation in the report if the expectation fails. If the expectation succeeds, there is no action. &lt;br /&gt;
&lt;br /&gt;
srASSERT_xx macros will set the current test case to fail (if it hasn’t already been set) and insert an annotation into the report if the assertion fails. In addition, a return from the current function will occur. srASSERT_xx macros can only be used in test functions which return void. If the assertion succeeds there is no action. &lt;br /&gt;
&lt;br /&gt;
The report annotation produced by a failed macro always includes the source file and line along with details about the condition that failed and the failing values. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;All the macros support the adding to the report annotations using the &amp;lt;&amp;lt; operator. For example:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  srEXPECT_TRUE( a != &amp;lt;nowiki&amp;gt;b) &amp;lt;&amp;lt; “My custom message”; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;As delivered, the macros will support stream operator annotations using all the numeric types, char* and s2String. The user may create custom types to be used a report annotation by providing an implementation of the &amp;lt;&amp;lt; operator for their custom type. The details are explained in a section below. &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean Macros ===&lt;br /&gt;
The boolean macros take a single condition expression, &#039;&#039;cond&#039;&#039;, that evaluates to an integral type or bool. The condition will be evaluated once. if &#039;&#039;cond&#039;&#039; evaluates to non-zero the assertion or expectation fails. When a failure occurs the report will be annotated. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_TRUE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_TRUE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| &#039;&#039;cond&#039;&#039; is true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_FALSE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_FALSE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| &#039;&#039;cond&#039;&#039; is false&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Macros ===&lt;br /&gt;
&lt;br /&gt;
Comparison macros take two operands and compare them using the indicated operator. The comparison macros will work for primitive types as well as objects that have the corresponding comparison operator implemented.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_EQ(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_EQ(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; == &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_NE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; != &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039;&amp;lt;nowiki&amp;gt; &amp;lt; &amp;lt;/nowiki&amp;gt;&#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039;&amp;lt;nowiki&amp;gt; &amp;lt;= &amp;lt;/nowiki&amp;gt;&#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; &amp;gt; &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; &amp;gt;= &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== C String Comparison Macros ===&lt;br /&gt;
&lt;br /&gt;
C String Comparison Macros are intended only for use with C-style zero terminated strings. The strings can be char or wchar_t based. In particular, these macros should not be used for object of one or other string class, since such classes have overloaded comparison operators. The standard comparison macros should be used instead. &lt;br /&gt;
&lt;br /&gt;
* The length of a string displayed in the report annotation message is controllable via the following macro: srCFG_TEST_MACROS_MAX_C_STRING_MESSAGE_DISPLAY (found in srtestmacros.h). If a string value is truncated because of the length limit, the text &amp;quot;...(trunc)&amp;quot; will always appear next to it. &lt;br /&gt;
* An empty string will appear in error message output as “”. A null string will appear as NULL with no surrounding quotes. Otherwise all output strings are quoted. &lt;br /&gt;
* The type of str1 and str2 must be compatible with const char* or const wchar_t*. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;C-string comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STREQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STREQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have the same content&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRNE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRNE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have different content&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASEEQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASEEQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have the same content, ignoring case.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASENE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASENE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have different content, ignoring case.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Exception Macros ===&lt;br /&gt;
Exception macros  are used to ensure that expected exceptions are thrown. They require exception support from the target compiler. If the target compiler does not have exception support the macros cannot be used and must be disabled.  The support can be disabled via the macro srCFG_TEST_MACROS_EXCEPTIONS_ON found in srtestmacros.h. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Exceptions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW(statement, ex_type);&lt;br /&gt;
| srASSERT_THROW(statement, ex_type);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; throws an exception of type &#039;&#039;ex_type&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_ANY(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_THROW_ANY(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; throws an exception (type not important)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NO_THROW(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_NO_THROW(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; does not throw an exception&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Predicate Macros ===&lt;br /&gt;
Predicate macros allow user control over the pass/fail decision making in a macro. A predicate is a function returning bool that is implemented by the user but passed to the macro. Other arguments for the predicate are also passed to the macro. The macros allow for predicate functions with up to four parameters. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Predicates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED1(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;)&lt;br /&gt;
| srASSERT_PRED1(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;)&lt;br /&gt;
| &#039;&#039;pred&#039;&#039;(&#039;&#039;val1&#039;&#039;) returns true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED2(&#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;)&lt;br /&gt;
| srASSERT_PRED2(&#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;)&lt;br /&gt;
| &#039;&#039;pred&#039;&#039;(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;) returns true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| …(up to arity of 4)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
All predicate macros require a predicate function function which returns bool. The predicate macros allow functions with one to 4 parameters. Following are the report annotations resulting from expectation or assertion failures.&lt;br /&gt;
&lt;br /&gt;
=== Floating Point Macros ===&lt;br /&gt;
&lt;br /&gt;
Floating point macros are for comparing equivalence (or near equivalence) of floating point numbers. These macros are necessary since because equivalence comparisons for floating point numbers will often fail due to round-off errors. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Floating Point Macros&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NEAR(val1, val2, epsilon);&lt;br /&gt;
| srASSERT_NEAR(val1, val2, epsilon);&lt;br /&gt;
| The absolute value of the difference between val1 and val2 is epsilon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dynamic Test Case Macros ===&lt;br /&gt;
The macros presented so far are not capable of dealing with dynamic test cases. In order to handle dynamic test cases, each of the macros requires another parameter which is the test case to report against. Other than this, these macros provide exactly equivalent functionality to the non-dynamic peer. The dynamic macros are listed below. All require a test case, value of type srTestCaseHandle_t from srtest.h,  to be passed as the first parameter).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;Nonfatal assertion&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;Fatal Assertion&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_TRUE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_TRUE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_FALSE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_FALSE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_EQ_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_EQ_DYN(tc, &#039;&#039;expect&#039;&#039;, &#039;&#039;val&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_NE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;C-string comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STREQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STREQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRNE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRNE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASEEQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASEEQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASENE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASENE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Exceptions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_DYN(statement, ex_type);&lt;br /&gt;
| srASSERT_THROW_DYN(tc, statement, ex_type);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_ANY_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_THROW_ANY_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NO_THROW_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_NO_THROW_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Predicates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED1_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;);&lt;br /&gt;
| srASSERT_PRED1_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED2_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_PRED2_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| …(up to arity of 4)&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Floating Point&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NEAR_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;, &#039;&#039;epsilon&#039;&#039;);&lt;br /&gt;
| srASSERT_NEAR_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;, &#039;&#039;epsilon&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Overloading The &amp;lt;&amp;lt; operator for report annotation ===&lt;br /&gt;
&amp;lt;nowiki&amp;gt;The user of the asserting macros package may overload the &amp;lt;&amp;lt; operator in order to annotate reports using a custom class. An example is below. &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;The following will compile and execute successfully given that the &amp;lt;&amp;lt; operator is overloaded as shown:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyCustomClass custom(34); &lt;br /&gt;
&lt;br /&gt;
srEXPECT_FALSE(true) &amp;lt;&amp;lt; custom;&lt;br /&gt;
&lt;br /&gt;
// MyCustomClass implementation&lt;br /&gt;
class MyCustomClass&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   MyCustomClass(int i) : m_int(i) {}&lt;br /&gt;
&lt;br /&gt;
private: &lt;br /&gt;
   int m_int; &lt;br /&gt;
   friend stride::Message&amp;amp; operator&amp;lt;&amp;lt; &lt;br /&gt;
   ( stride::Message&amp;amp; ss, const MyCustomClass&amp;amp; obj);&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
stride::Message&amp;amp; operator&amp;lt;&amp;lt;(stride::Message&amp;amp; ss, const MyCustomClass&amp;amp; obj)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   // format the internals as a string and send on&lt;br /&gt;
   char buf[20]; &lt;br /&gt;
   sprintf(buf, &amp;quot;%d&amp;quot;, obj.m_int); &lt;br /&gt;
   ss &amp;lt;&amp;lt; buf;&lt;br /&gt;
   return ss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test Macro Configuration ===&lt;br /&gt;
&lt;br /&gt;
The Test Macros are implemented in C++. Because target support for use of the standard libraries and exceptions varies across targets the macro implementation can be configured. &lt;br /&gt;
&lt;br /&gt;
==== Configuring Test Macros When Exceptions Not Available ====&lt;br /&gt;
If the target compiler does not support exceptions (or they are disabled) the Exception Macros must be disabled. This is accomplished by setting srCFG_TEST_MACROS_EXCEPTIONS_ON to 0 in the file srtestmacros.h.&lt;br /&gt;
&lt;br /&gt;
==== Configuring Test Macros When C++ Standard Library is Not Available ====&lt;br /&gt;
If the C++ standard library can be used within the target code, the test macro implementation uses std::string and std::stringstream. If the classes are not available on the target, then an alternate, custom implementation that relies only on C library support can be used. &lt;br /&gt;
&lt;br /&gt;
The choice is configured via srCFG_TEST_MACROS_USE_STANDARD_LIB found within srtestmacros.h&lt;br /&gt;
&lt;br /&gt;
==== Configuring Report Annotation for C-String Comparisons ====&lt;br /&gt;
&lt;br /&gt;
The C-String comparison macros are used to compare strings. When comparisons fail, the values involved in the failed comparison are normally displayed in the report. If the strings are very long, this is probably not desirable. It is possible to constrain the maximum length of the displayed strings using srCFG_TEST_MACROS_MAX_C_STRING_MESSAGE_DISPLAY. String values longer than this value will be truncated in report annotations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scripting a Test Unit ==&lt;br /&gt;
&lt;br /&gt;
To automate the execution and reporting of a Test Unit a script is required. Scripts can be written by hand or automatically generated using the Script Wizard and a corresponding template script. A scripting tool for executing a test unit is the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection. An [[AutoScript#ascript.TestUnits.Item|Ascript TestUnit]] object assembles all of the reporting information for the test unit and its corresponding test methods. &lt;br /&gt;
&lt;br /&gt;
*Require usage of the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection &lt;br /&gt;
*Can be written by hand (refer below) &lt;br /&gt;
*Can leverage [[Templates|Templates]] via the Script Wizard &lt;br /&gt;
*Order of multiple test units dictated by SUID assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== JScript example for a single test unit  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness a test unit that has been captured using #pragma scl_test_class(Simple). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
// Ensure test unit exists&lt;br /&gt;
if (ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;) != null) &lt;br /&gt;
  ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;).Run();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perl example for a single test unit  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness a test unit that has been captured using #pragma scl_test_class(Simple). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE;&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
my $tu = $main::ascript-&amp;gt;TestUnits-&amp;gt;Item(&amp;quot;Simple&amp;quot;);&lt;br /&gt;
if (defined $tu) {&lt;br /&gt;
  $tu-&amp;gt;Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== JScript example for multiple test units  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness two test units that have been captured using #pragma scl_test_class(Simple1) and #pragma scl_test_class(Simple2). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
var Units = [&amp;quot;Simple1&amp;quot;,&amp;quot;Simple2&amp;quot;];&lt;br /&gt;
  &lt;br /&gt;
// iterate through each function&lt;br /&gt;
for (i in Units)&lt;br /&gt;
{&lt;br /&gt;
  var tu = ascript.TestUnits.Item(Units[i]);&lt;br /&gt;
  if ( tu&amp;amp;nbsp;!= null ) &lt;br /&gt;
    tu.Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perl example for multiple test units  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness two test units that have been captured using #pragma scl_test_class(Simple1) and #pragma scl_test_class(Simple2). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE;&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
# initialize an array with all selected function names&lt;br /&gt;
my @UnitNames = (&amp;quot;Simple1&amp;quot;,&amp;quot;Simple2&amp;quot;);&lt;br /&gt;
foreach (@UnitNames) {   &lt;br /&gt;
  my $tu = $main::ascript-&amp;gt;TestUnits-&amp;gt;Item($_-&amp;gt;[1]);&lt;br /&gt;
  die &amp;quot;TestUnit not found: $_-&amp;gt;[1]\n&amp;quot; unless (defined $tu);&lt;br /&gt;
  $tu-&amp;gt;Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Test Units]]&lt;br /&gt;
[[Category:Reference]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Desktop_Installation&amp;diff=8955</id>
		<title>Studio:Desktop Installation</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Desktop_Installation&amp;diff=8955"/>
		<updated>2009-01-23T00:05:14Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Perl */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting Started ==&lt;br /&gt;
STRIDE software, which is typically provided either via an FTP site or on a CD, contains STRIDE Studio and the STRIDE Runtime, as well as other software and utilities. &lt;br /&gt;
&lt;br /&gt;
To install and use STRIDE, your Windows-based PC must have the following &#039;&#039;minimum&#039;&#039; configuration:&lt;br /&gt;
* 30 GB hard disk&lt;br /&gt;
* Windows® XP SP2 or greater&lt;br /&gt;
* 512 KB RAM (recommended: 1 GB )&lt;br /&gt;
* Pentium 4 CPU 2 GHz (recommended: 3.20 GHz)&lt;br /&gt;
* 1024 x 768 display (1280 x 1024 recommended)&lt;br /&gt;
&lt;br /&gt;
=== Obtaining a license and a copy of STRIDE ===&lt;br /&gt;
STRIDE is a license-controlled product.  All users running STRIDE Studio on a Windows PC must have a valid license installed.&lt;br /&gt;
&lt;br /&gt;
If your company is engaged in a VaS or TAGS project with S2 Technologies, current license files, as well as all STRIDE binaries, will be available on your project&#039;s Basecamp site.&lt;br /&gt;
&lt;br /&gt;
If you are not yet a customer of S2 and would like to obtain an evaluation license, email [mailto:sales@s2technologies.com S2 Sales] or call our offices at &#039;&#039;&#039;760-635-2345&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Third Party Components ===&lt;br /&gt;
==== Perl ====&lt;br /&gt;
Many of our additional test utilities and libraries require perl support on the host.  In particular, we require:&lt;br /&gt;
* Distribution of [http://activestate.com/Products/activeperl/ ActiveState perl] &#039;&#039;&#039;5.8.8.822&#039;&#039;&#039;, or a later build of 5.8.x perl.  We &#039;&#039;&#039;DO NOT&#039;&#039;&#039; support perl version 5.10.x at this time due to some bugs in the script component support in perl 5.10. You can download perl distributions from [http://downloads.activestate.com/ActivePerl/Windows/ ActiveState]). These distributions include the PerlScript engine that is required for use with STRIDE.&lt;br /&gt;
* We recommend that the following repositories are added:&lt;br /&gt;
** http://theoryx5.uwinnipeg.ca/ppms&lt;br /&gt;
** http://www.bribes.org/perl/ppm&lt;br /&gt;
** http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58&lt;br /&gt;
You can add a ppm repository using the command line interface as follows:&lt;br /&gt;
 CMD&amp;gt; ppm repo add http://www.bribes.org/perl/ppm&lt;br /&gt;
(change the last argument by specifying [http://win32.perl.org/wiki/index.php?title=PPM_Repositories any other repository])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; PPM uses HTTP to communicate with repositories -- if your HTTP connections require a proxy server, refer to [http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html#ppm_and_proxies the PPM documentation] for information about setting the proxy.&lt;br /&gt;
 &lt;br /&gt;
* The following additional perl packages, which can all be installed using the [http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html Perl Package Manager] (PPM) that comes with ActiveState perl.&lt;br /&gt;
**Win32::API&lt;br /&gt;
**Win32::GUI&lt;br /&gt;
**Win32::GuiTest&lt;br /&gt;
**Win32::ToolHelp&lt;br /&gt;
**XML::DOM&lt;br /&gt;
**Config::IniFiles&lt;br /&gt;
**Getopt::Long&lt;br /&gt;
**NET::DNS&lt;br /&gt;
**Log::Handler&lt;br /&gt;
The simplest way to install these packages is via the command line interface to PPM, e.g&lt;br /&gt;
  CMD&amp;gt; ppm install win32-api&lt;br /&gt;
(change the last argument accordingly for each required package)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Due to bandwidth issues at ActiveState, PPM attempts may fail intermittently. If so, please re-try. &lt;br /&gt;
&lt;br /&gt;
Verify all the packages have been installed via PPM&lt;br /&gt;
  CMD&amp;gt; ppm list&lt;br /&gt;
&lt;br /&gt;
We provide a perl script, &#039;&#039;TestInstallOfPerl.pl&#039;&#039;, that can be used to validate the version and packages that you have installed.  This script is available in &#039;&#039;%STRIDE_DIR%/Scripts&#039;&#039; folder. Run this script from a command prompt by typing &amp;lt;tt&amp;gt;perl TestInstallOfPerl.pl&amp;lt;/tt&amp;gt;. On a properly configured system, it will produce results like:&lt;br /&gt;
&lt;br /&gt;
  ************************************************************&lt;br /&gt;
  Perl/System prerequisites check&lt;br /&gt;
  ************************************************************&lt;br /&gt;
  OK: Perl version looks good (5.010000).&lt;br /&gt;
  OK: Package Win32::API looks good.&lt;br /&gt;
  OK: Package Win32::GUI looks good.&lt;br /&gt;
  OK: Package Win32::GuiTest looks good.&lt;br /&gt;
  OK: Package Win32::ToolHelp looks good.&lt;br /&gt;
  OK: Package XML::DOM looks good.&lt;br /&gt;
  OK: Package Config::IniFiles looks good.&lt;br /&gt;
  OK: Package Getopt::Long looks good.&lt;br /&gt;
  OK: Package NET::DNS looks good.&lt;br /&gt;
  OK: Package Log::Handler looks good.&lt;br /&gt;
  OK: Prerequisites validation successful.&lt;br /&gt;
  ************************************************************&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; For the later 5.8 versions of Perl, you may see several lines of debug code above the line that verifies the NET::DNS package. This debugging code is not a sign of unsuccessful installation and can be ignored. &lt;br /&gt;
       &lt;br /&gt;
You should address any errors that are reported before proceeding.  If you prefer to install perl &#039;&#039;&#039;after&#039;&#039;&#039; installing STRIDE, you &#039;&#039;&#039;must&#039;&#039;&#039; run this script after both are installed to verify the packages and perform the necessary STRIDE component registrations.&lt;br /&gt;
&lt;br /&gt;
== STRIDE Installation ==&lt;br /&gt;
STRIDE is usually installed in the &#039;&#039;&#039;C:\STRIDE&#039;&#039;&#039; directory. Installing the core components will provide everything needed to run STRIDE on the host. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step-by-step instructions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Exit all other Windows applications prior to beginning the STRIDE installation.&lt;br /&gt;
# If you haven&#039;t already done so, obtain a current copy of StrideSetup.exe from you project&#039;s Basecamp site.&lt;br /&gt;
# Select and open &#039;&#039;&#039;StrideSetup.exe&#039;&#039;&#039;.&lt;br /&gt;
# When the Install Wizard appears, click &#039;&#039;&#039;Next&#039;&#039;&#039;.&lt;br /&gt;
# On the &#039;&#039;&#039;License Agreement&#039;&#039;&#039; screen, click &#039;&#039;&#039;I Agree&#039;&#039;&#039; if you agree with the terms of the license and to continue the installation.&amp;lt;br&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; Clicking &#039;&#039;&#039;No&#039;&#039;&#039; will terminate the installation process.&lt;br /&gt;
# Click &#039;&#039;&#039;Install&#039;&#039;&#039; to install the Core Components, which provides the full installation of STRIDE.&lt;br /&gt;
# When the installation is complete, click &#039;&#039;&#039;Finish&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Once the installation is complete, you must have your &#039;&#039;&#039;license&#039;&#039;&#039; information ready before starting STRIDE.  If you have an evaluation or node-locked license, place the license file in &#039;&#039;&#039;C:\STRIDE\lic&#039;&#039;&#039; before launching STRIDE Studio.  If you are using a &#039;&#039;&#039;floating license&#039;&#039;&#039;, you will be prompted for the location of the license server when you first start STRIDE.  After your license setup is complete, you are ready to begin Integrating STRIDE into your Target environment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;It is highly recommended to run through the &#039;&#039;&#039;[[Hello_Stride_Sample | Hello Stride Sample]]&#039;&#039;&#039; after completing the Desktop installation.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Conducting an unattended installation ==&lt;br /&gt;
The STRIDE installer supports silent (unattended) installation and uninstallation. To silently install STRIDE, complete the following steps:&lt;br /&gt;
&lt;br /&gt;
# Open a DOS window.&lt;br /&gt;
# Type start /WAIT /D&amp;quot;C:\TEMP&amp;quot; C:\TEMP\StrideSetup.exe /S&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The statement above assumes that &#039;&#039;&#039;StrideSetup.exe&#039;&#039;&#039; resides in C:\TEMP; you may need to change this path to match your actual StrideSetup.exe location.&lt;br /&gt;
&lt;br /&gt;
== Uninstalling Host ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 1 (via Control Panel)&lt;br /&gt;
# From the &#039;&#039;&#039;Start&#039;&#039;&#039; menu, select &#039;&#039;&#039;Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Double-click &#039;&#039;&#039;Add or Remove Programs&#039;&#039;&#039;.&lt;br /&gt;
# Select &#039;&#039;&#039;Stride&#039;&#039;&#039;, then click &#039;&#039;&#039;Change/Remove&#039;&#039;&#039;.&lt;br /&gt;
# When prompted, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 2 (via STRIDE Program Folder)&lt;br /&gt;
# From the &#039;&#039;&#039;Start&#039;&#039;&#039; menu, go to &#039;&#039;&#039;STRIDE 3.0&#039;&#039;&#039; Program folder.&lt;br /&gt;
# Select &#039;&#039;&#039;STRIDE Uninstall&#039;&#039;&#039;.&lt;br /&gt;
# When prompted, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 3 (via STRIDE Installation Folder)&lt;br /&gt;
# Open the &#039;&#039;&#039;STRIDE installation folder&#039;&#039;&#039; (typically C:\STRIDE).&lt;br /&gt;
# Go to &#039;&#039;&#039;uninstall&#039;&#039;&#039; folder.&lt;br /&gt;
# Select and open &#039;&#039;&#039;STRIDEUninstall.exe&#039;&#039;&#039;.&lt;br /&gt;
# When the Install Wizard appears, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Conducting an unattended uninstallation ===&lt;br /&gt;
The STRIDE installer supports silent (unattended) installation and uninstallation. To silently uninstall STRIDE, complete the following steps:&lt;br /&gt;
&lt;br /&gt;
# Open a DOS window.&lt;br /&gt;
# Type start /WAIT /D&amp;quot;C:\STRIDE\uninstall&amp;quot; C:\STRIDE\uninstall\StrideUninstall.exe &amp;quot;/S _?=C:\STRIDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Desktop_Installation&amp;diff=8954</id>
		<title>Studio:Desktop Installation</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Desktop_Installation&amp;diff=8954"/>
		<updated>2009-01-22T23:59:56Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Perl */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting Started ==&lt;br /&gt;
STRIDE software, which is typically provided either via an FTP site or on a CD, contains STRIDE Studio and the STRIDE Runtime, as well as other software and utilities. &lt;br /&gt;
&lt;br /&gt;
To install and use STRIDE, your Windows-based PC must have the following &#039;&#039;minimum&#039;&#039; configuration:&lt;br /&gt;
* 30 GB hard disk&lt;br /&gt;
* Windows® XP SP2 or greater&lt;br /&gt;
* 512 KB RAM (recommended: 1 GB )&lt;br /&gt;
* Pentium 4 CPU 2 GHz (recommended: 3.20 GHz)&lt;br /&gt;
* 1024 x 768 display (1280 x 1024 recommended)&lt;br /&gt;
&lt;br /&gt;
=== Obtaining a license and a copy of STRIDE ===&lt;br /&gt;
STRIDE is a license-controlled product.  All users running STRIDE Studio on a Windows PC must have a valid license installed.&lt;br /&gt;
&lt;br /&gt;
If your company is engaged in a VaS or TAGS project with S2 Technologies, current license files, as well as all STRIDE binaries, will be available on your project&#039;s Basecamp site.&lt;br /&gt;
&lt;br /&gt;
If you are not yet a customer of S2 and would like to obtain an evaluation license, email [mailto:sales@s2technologies.com S2 Sales] or call our offices at &#039;&#039;&#039;760-635-2345&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Third Party Components ===&lt;br /&gt;
==== Perl ====&lt;br /&gt;
Many of our additional test utilities and libraries require perl support on the host.  In particular, we require:&lt;br /&gt;
* Distribution of [http://activestate.com/Products/activeperl/ ActiveState perl] &#039;&#039;&#039;5.8.8.822&#039;&#039;&#039;, or a later build of 5.8.x perl.  We &#039;&#039;&#039;DO NOT&#039;&#039;&#039; support perl version 5.10.x at this time due to some bugs in the script component support in perl 5.10. You can download perl distributions from [http://downloads.activestate.com/ActivePerl/Windows/ ActiveState]). These distributions include the PerlScript engine that is required for use with STRIDE.&lt;br /&gt;
* We recommend that the following repositories are added:&lt;br /&gt;
** http://theoryx5.uwinnipeg.ca/ppms&lt;br /&gt;
** http://www.bribes.org/perl/ppm&lt;br /&gt;
** http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58&lt;br /&gt;
You can add a ppm repository on the command line as follows:&lt;br /&gt;
 CMD&amp;gt; ppm repo add http://www.bribes.org/perl/ppm&lt;br /&gt;
(change the last argument by specifying [http://win32.perl.org/wiki/index.php?title=PPM_Repositories any other repository])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; PPM uses HTTP to communicate with repositories -- if your HTTP connections require a proxy server, refer to [http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html#ppm_and_proxies the PPM documentation] for information about setting the proxy.&lt;br /&gt;
 &lt;br /&gt;
* The following additional perl packages, which can all be installed using the [http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html Perl Package Manager] (PPM) that comes with ActiveState perl.&lt;br /&gt;
**Win32::API&lt;br /&gt;
**Win32::GUI&lt;br /&gt;
**Win32::GuiTest&lt;br /&gt;
**Win32::ToolHelp&lt;br /&gt;
**XML::DOM&lt;br /&gt;
**Config::IniFiles&lt;br /&gt;
**Getopt::Long&lt;br /&gt;
**NET::DNS&lt;br /&gt;
**Log::Handler&lt;br /&gt;
The simplest way to install these packages is via the command line interface to PPM, e.g&lt;br /&gt;
  CMD&amp;gt; ppm install win32-api&lt;br /&gt;
(change the last argument accordingly for each required package)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Due to bandwidth issues at ActiveState, PPM attempts may fail intermittently. If so, please re-try. &lt;br /&gt;
&lt;br /&gt;
Verify all the packages have been installed via PPM&lt;br /&gt;
  CMD&amp;gt; ppm list&lt;br /&gt;
&lt;br /&gt;
We provide a perl script, &#039;&#039;TestInstallOfPerl.pl&#039;&#039;, that can be used to validate the version and packages that you have installed.  This script is available in &#039;&#039;%STRIDE_DIR%/Scripts&#039;&#039; folder. Run this script from a command prompt by typing &amp;lt;tt&amp;gt;perl TestInstallOfPerl.pl&amp;lt;/tt&amp;gt;. On a properly configured system, it will produce results like:&lt;br /&gt;
&lt;br /&gt;
  ************************************************************&lt;br /&gt;
  Perl/System prerequisites check&lt;br /&gt;
  ************************************************************&lt;br /&gt;
  OK: Perl version looks good (5.010000).&lt;br /&gt;
  OK: Package Win32::API looks good.&lt;br /&gt;
  OK: Package Win32::GUI looks good.&lt;br /&gt;
  OK: Package Win32::GuiTest looks good.&lt;br /&gt;
  OK: Package Win32::ToolHelp looks good.&lt;br /&gt;
  OK: Package XML::DOM looks good.&lt;br /&gt;
  OK: Package Config::IniFiles looks good.&lt;br /&gt;
  OK: Package Getopt::Long looks good.&lt;br /&gt;
  OK: Package NET::DNS looks good.&lt;br /&gt;
  OK: Package Log::Handler looks good.&lt;br /&gt;
  OK: Prerequisites validation successful.&lt;br /&gt;
  ************************************************************&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; For the later 5.8 versions of Perl, you may see several lines of debug code above the line that verifies the NET::DNS package. This debugging code is not a sign of unsuccessful installation and can be ignored. &lt;br /&gt;
       &lt;br /&gt;
You should address any errors that are reported before proceeding.  If you prefer to install perl &#039;&#039;&#039;after&#039;&#039;&#039; installing STRIDE, you &#039;&#039;&#039;must&#039;&#039;&#039; run this script after both are installed to verify the packages and perform the necessary STRIDE component registrations.&lt;br /&gt;
&lt;br /&gt;
== STRIDE Installation ==&lt;br /&gt;
STRIDE is usually installed in the &#039;&#039;&#039;C:\STRIDE&#039;&#039;&#039; directory. Installing the core components will provide everything needed to run STRIDE on the host. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step-by-step instructions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Exit all other Windows applications prior to beginning the STRIDE installation.&lt;br /&gt;
# If you haven&#039;t already done so, obtain a current copy of StrideSetup.exe from you project&#039;s Basecamp site.&lt;br /&gt;
# Select and open &#039;&#039;&#039;StrideSetup.exe&#039;&#039;&#039;.&lt;br /&gt;
# When the Install Wizard appears, click &#039;&#039;&#039;Next&#039;&#039;&#039;.&lt;br /&gt;
# On the &#039;&#039;&#039;License Agreement&#039;&#039;&#039; screen, click &#039;&#039;&#039;I Agree&#039;&#039;&#039; if you agree with the terms of the license and to continue the installation.&amp;lt;br&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; Clicking &#039;&#039;&#039;No&#039;&#039;&#039; will terminate the installation process.&lt;br /&gt;
# Click &#039;&#039;&#039;Install&#039;&#039;&#039; to install the Core Components, which provides the full installation of STRIDE.&lt;br /&gt;
# When the installation is complete, click &#039;&#039;&#039;Finish&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Once the installation is complete, you must have your &#039;&#039;&#039;license&#039;&#039;&#039; information ready before starting STRIDE.  If you have an evaluation or node-locked license, place the license file in &#039;&#039;&#039;C:\STRIDE\lic&#039;&#039;&#039; before launching STRIDE Studio.  If you are using a &#039;&#039;&#039;floating license&#039;&#039;&#039;, you will be prompted for the location of the license server when you first start STRIDE.  After your license setup is complete, you are ready to begin Integrating STRIDE into your Target environment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;It is highly recommended to run through the &#039;&#039;&#039;[[Hello_Stride_Sample | Hello Stride Sample]]&#039;&#039;&#039; after completing the Desktop installation.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Conducting an unattended installation ==&lt;br /&gt;
The STRIDE installer supports silent (unattended) installation and uninstallation. To silently install STRIDE, complete the following steps:&lt;br /&gt;
&lt;br /&gt;
# Open a DOS window.&lt;br /&gt;
# Type start /WAIT /D&amp;quot;C:\TEMP&amp;quot; C:\TEMP\StrideSetup.exe /S&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The statement above assumes that &#039;&#039;&#039;StrideSetup.exe&#039;&#039;&#039; resides in C:\TEMP; you may need to change this path to match your actual StrideSetup.exe location.&lt;br /&gt;
&lt;br /&gt;
== Uninstalling Host ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 1 (via Control Panel)&lt;br /&gt;
# From the &#039;&#039;&#039;Start&#039;&#039;&#039; menu, select &#039;&#039;&#039;Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Double-click &#039;&#039;&#039;Add or Remove Programs&#039;&#039;&#039;.&lt;br /&gt;
# Select &#039;&#039;&#039;Stride&#039;&#039;&#039;, then click &#039;&#039;&#039;Change/Remove&#039;&#039;&#039;.&lt;br /&gt;
# When prompted, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 2 (via STRIDE Program Folder)&lt;br /&gt;
# From the &#039;&#039;&#039;Start&#039;&#039;&#039; menu, go to &#039;&#039;&#039;STRIDE 3.0&#039;&#039;&#039; Program folder.&lt;br /&gt;
# Select &#039;&#039;&#039;STRIDE Uninstall&#039;&#039;&#039;.&lt;br /&gt;
# When prompted, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 3 (via STRIDE Installation Folder)&lt;br /&gt;
# Open the &#039;&#039;&#039;STRIDE installation folder&#039;&#039;&#039; (typically C:\STRIDE).&lt;br /&gt;
# Go to &#039;&#039;&#039;uninstall&#039;&#039;&#039; folder.&lt;br /&gt;
# Select and open &#039;&#039;&#039;STRIDEUninstall.exe&#039;&#039;&#039;.&lt;br /&gt;
# When the Install Wizard appears, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Conducting an unattended uninstallation ===&lt;br /&gt;
The STRIDE installer supports silent (unattended) installation and uninstallation. To silently uninstall STRIDE, complete the following steps:&lt;br /&gt;
&lt;br /&gt;
# Open a DOS window.&lt;br /&gt;
# Type start /WAIT /D&amp;quot;C:\STRIDE\uninstall&amp;quot; C:\STRIDE\uninstall\StrideUninstall.exe &amp;quot;/S _?=C:\STRIDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Desktop_Installation&amp;diff=8953</id>
		<title>Studio:Desktop Installation</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Desktop_Installation&amp;diff=8953"/>
		<updated>2009-01-22T23:40:21Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Perl */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting Started ==&lt;br /&gt;
STRIDE software, which is typically provided either via an FTP site or on a CD, contains STRIDE Studio and the STRIDE Runtime, as well as other software and utilities. &lt;br /&gt;
&lt;br /&gt;
To install and use STRIDE, your Windows-based PC must have the following &#039;&#039;minimum&#039;&#039; configuration:&lt;br /&gt;
* 30 GB hard disk&lt;br /&gt;
* Windows® XP SP2 or greater&lt;br /&gt;
* 512 KB RAM (recommended: 1 GB )&lt;br /&gt;
* Pentium 4 CPU 2 GHz (recommended: 3.20 GHz)&lt;br /&gt;
* 1024 x 768 display (1280 x 1024 recommended)&lt;br /&gt;
&lt;br /&gt;
=== Obtaining a license and a copy of STRIDE ===&lt;br /&gt;
STRIDE is a license-controlled product.  All users running STRIDE Studio on a Windows PC must have a valid license installed.&lt;br /&gt;
&lt;br /&gt;
If your company is engaged in a VaS or TAGS project with S2 Technologies, current license files, as well as all STRIDE binaries, will be available on your project&#039;s Basecamp site.&lt;br /&gt;
&lt;br /&gt;
If you are not yet a customer of S2 and would like to obtain an evaluation license, email [mailto:sales@s2technologies.com S2 Sales] or call our offices at &#039;&#039;&#039;760-635-2345&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Third Party Components ===&lt;br /&gt;
==== Perl ====&lt;br /&gt;
Many of our additional test utilities and libraries require perl support on the host.  In particular, we require:&lt;br /&gt;
* Distribution of [http://activestate.com/Products/activeperl/ ActiveState perl] &#039;&#039;&#039;5.8.8.822&#039;&#039;&#039;, or a later build of 5.8.x perl.  We &#039;&#039;&#039;DO NOT&#039;&#039;&#039; support perl version 5.10.x at this time due to some bugs in the script component support in perl 5.10. You can download perl distributions from [http://downloads.activestate.com/ActivePerl/Windows/ ActiveState]). These distributions include the PerlScript engine that is required for use with STRIDE.&lt;br /&gt;
* The following additional perl packages, which can all be installed using the [http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html Perl Package Manager] (PPM) that comes with ActiveState perl.&lt;br /&gt;
**Win32::API&lt;br /&gt;
**Win32::GUI&lt;br /&gt;
**Win32::GuiTest&lt;br /&gt;
**Win32::ToolHelp&lt;br /&gt;
**XML::DOM&lt;br /&gt;
**Config::IniFiles&lt;br /&gt;
**Getopt::Long&lt;br /&gt;
**NET::DNS&lt;br /&gt;
**Log::Handler&lt;br /&gt;
The simplest way to install these packages is via the command line interface to PPM, e.g&lt;br /&gt;
  CMD&amp;gt; ppm install win32-api&lt;br /&gt;
(change the last argument accordingly for each required package)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Due to bandwidth issues at ActiveState, PPM attempts may fail intermittently. If so, please re-try. You may also try adding a ppm repository:&lt;br /&gt;
  CMD&amp;gt; ppm repo add http://www.bribes.org/perl/ppm&lt;br /&gt;
(change the last argument by specifying [http://win32.perl.org/wiki/index.php?title=PPM_Repositories any other repository])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; PPM uses HTTP to communicate with repositories -- if your HTTP connections require a proxy server, refer to [http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html#ppm_and_proxies the PPM documentation] for information about setting the proxy.&lt;br /&gt;
&lt;br /&gt;
Verify all the packages have been installed via PPM&lt;br /&gt;
  CMD&amp;gt; ppm list&lt;br /&gt;
&lt;br /&gt;
We provide a perl script, &#039;&#039;TestInstallOfPerl.pl&#039;&#039;, that can be used to validate the version and packages that you have installed.  This script is available in &#039;&#039;%STRIDE_DIR%/Scripts&#039;&#039; folder. Run this script from a command prompt by typing &amp;lt;tt&amp;gt;perl TestInstallOfPerl.pl&amp;lt;/tt&amp;gt;. On a properly configured system, it will produce results like:&lt;br /&gt;
&lt;br /&gt;
  ************************************************************&lt;br /&gt;
  Perl/System prerequisites check&lt;br /&gt;
  ************************************************************&lt;br /&gt;
  OK: Perl version looks good (5.010000).&lt;br /&gt;
  OK: Package Win32::API looks good.&lt;br /&gt;
  OK: Package Win32::GUI looks good.&lt;br /&gt;
  OK: Package Win32::GuiTest looks good.&lt;br /&gt;
  OK: Package Win32::ToolHelp looks good.&lt;br /&gt;
  OK: Package XML::DOM looks good.&lt;br /&gt;
  OK: Package Config::IniFiles looks good.&lt;br /&gt;
  OK: Package Getopt::Long looks good.&lt;br /&gt;
  OK: Package NET::DNS looks good.&lt;br /&gt;
  OK: Package Log::Handler looks good.&lt;br /&gt;
  OK: Prerequisites validation successful.&lt;br /&gt;
  ************************************************************&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; For the later 5.8 versions of Perl, you may see several lines of debug code above the line that verifies the NET::DNS package. This debugging code is not a sign of unsuccessful installation and can be ignored. &lt;br /&gt;
       &lt;br /&gt;
You should address any errors that are reported before proceeding.  If you prefer to install perl &#039;&#039;&#039;after&#039;&#039;&#039; installing STRIDE, you &#039;&#039;&#039;must&#039;&#039;&#039; run this script after both are installed to verify the packages and perform the necessary STRIDE component registrations.&lt;br /&gt;
&lt;br /&gt;
== STRIDE Installation ==&lt;br /&gt;
STRIDE is usually installed in the &#039;&#039;&#039;C:\STRIDE&#039;&#039;&#039; directory. Installing the core components will provide everything needed to run STRIDE on the host. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step-by-step instructions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Exit all other Windows applications prior to beginning the STRIDE installation.&lt;br /&gt;
# If you haven&#039;t already done so, obtain a current copy of StrideSetup.exe from you project&#039;s Basecamp site.&lt;br /&gt;
# Select and open &#039;&#039;&#039;StrideSetup.exe&#039;&#039;&#039;.&lt;br /&gt;
# When the Install Wizard appears, click &#039;&#039;&#039;Next&#039;&#039;&#039;.&lt;br /&gt;
# On the &#039;&#039;&#039;License Agreement&#039;&#039;&#039; screen, click &#039;&#039;&#039;I Agree&#039;&#039;&#039; if you agree with the terms of the license and to continue the installation.&amp;lt;br&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; Clicking &#039;&#039;&#039;No&#039;&#039;&#039; will terminate the installation process.&lt;br /&gt;
# Click &#039;&#039;&#039;Install&#039;&#039;&#039; to install the Core Components, which provides the full installation of STRIDE.&lt;br /&gt;
# When the installation is complete, click &#039;&#039;&#039;Finish&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Once the installation is complete, you must have your &#039;&#039;&#039;license&#039;&#039;&#039; information ready before starting STRIDE.  If you have an evaluation or node-locked license, place the license file in &#039;&#039;&#039;C:\STRIDE\lic&#039;&#039;&#039; before launching STRIDE Studio.  If you are using a &#039;&#039;&#039;floating license&#039;&#039;&#039;, you will be prompted for the location of the license server when you first start STRIDE.  After your license setup is complete, you are ready to begin Integrating STRIDE into your Target environment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;It is highly recommended to run through the &#039;&#039;&#039;[[Hello_Stride_Sample | Hello Stride Sample]]&#039;&#039;&#039; after completing the Desktop installation.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Conducting an unattended installation ==&lt;br /&gt;
The STRIDE installer supports silent (unattended) installation and uninstallation. To silently install STRIDE, complete the following steps:&lt;br /&gt;
&lt;br /&gt;
# Open a DOS window.&lt;br /&gt;
# Type start /WAIT /D&amp;quot;C:\TEMP&amp;quot; C:\TEMP\StrideSetup.exe /S&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The statement above assumes that &#039;&#039;&#039;StrideSetup.exe&#039;&#039;&#039; resides in C:\TEMP; you may need to change this path to match your actual StrideSetup.exe location.&lt;br /&gt;
&lt;br /&gt;
== Uninstalling Host ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 1 (via Control Panel)&lt;br /&gt;
# From the &#039;&#039;&#039;Start&#039;&#039;&#039; menu, select &#039;&#039;&#039;Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Double-click &#039;&#039;&#039;Add or Remove Programs&#039;&#039;&#039;.&lt;br /&gt;
# Select &#039;&#039;&#039;Stride&#039;&#039;&#039;, then click &#039;&#039;&#039;Change/Remove&#039;&#039;&#039;.&lt;br /&gt;
# When prompted, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 2 (via STRIDE Program Folder)&lt;br /&gt;
# From the &#039;&#039;&#039;Start&#039;&#039;&#039; menu, go to &#039;&#039;&#039;STRIDE 3.0&#039;&#039;&#039; Program folder.&lt;br /&gt;
# Select &#039;&#039;&#039;STRIDE Uninstall&#039;&#039;&#039;.&lt;br /&gt;
# When prompted, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 3 (via STRIDE Installation Folder)&lt;br /&gt;
# Open the &#039;&#039;&#039;STRIDE installation folder&#039;&#039;&#039; (typically C:\STRIDE).&lt;br /&gt;
# Go to &#039;&#039;&#039;uninstall&#039;&#039;&#039; folder.&lt;br /&gt;
# Select and open &#039;&#039;&#039;STRIDEUninstall.exe&#039;&#039;&#039;.&lt;br /&gt;
# When the Install Wizard appears, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Conducting an unattended uninstallation ===&lt;br /&gt;
The STRIDE installer supports silent (unattended) installation and uninstallation. To silently uninstall STRIDE, complete the following steps:&lt;br /&gt;
&lt;br /&gt;
# Open a DOS window.&lt;br /&gt;
# Type start /WAIT /D&amp;quot;C:\STRIDE\uninstall&amp;quot; C:\STRIDE\uninstall\StrideUninstall.exe &amp;quot;/S _?=C:\STRIDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Desktop_Installation&amp;diff=8952</id>
		<title>Studio:Desktop Installation</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Desktop_Installation&amp;diff=8952"/>
		<updated>2009-01-22T23:18:00Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Perl */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting Started ==&lt;br /&gt;
STRIDE software, which is typically provided either via an FTP site or on a CD, contains STRIDE Studio and the STRIDE Runtime, as well as other software and utilities. &lt;br /&gt;
&lt;br /&gt;
To install and use STRIDE, your Windows-based PC must have the following &#039;&#039;minimum&#039;&#039; configuration:&lt;br /&gt;
* 30 GB hard disk&lt;br /&gt;
* Windows® XP SP2 or greater&lt;br /&gt;
* 512 KB RAM (recommended: 1 GB )&lt;br /&gt;
* Pentium 4 CPU 2 GHz (recommended: 3.20 GHz)&lt;br /&gt;
* 1024 x 768 display (1280 x 1024 recommended)&lt;br /&gt;
&lt;br /&gt;
=== Obtaining a license and a copy of STRIDE ===&lt;br /&gt;
STRIDE is a license-controlled product.  All users running STRIDE Studio on a Windows PC must have a valid license installed.&lt;br /&gt;
&lt;br /&gt;
If your company is engaged in a VaS or TAGS project with S2 Technologies, current license files, as well as all STRIDE binaries, will be available on your project&#039;s Basecamp site.&lt;br /&gt;
&lt;br /&gt;
If you are not yet a customer of S2 and would like to obtain an evaluation license, email [mailto:sales@s2technologies.com S2 Sales] or call our offices at &#039;&#039;&#039;760-635-2345&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Third Party Components ===&lt;br /&gt;
==== Perl ====&lt;br /&gt;
Many of our additional test utilities and libraries require perl support on the host.  In particular, we require:&lt;br /&gt;
* Distribution of [http://activestate.com/Products/activeperl/ ActiveState perl] &#039;&#039;&#039;5.8.8.822&#039;&#039;&#039;, or a later build of 5.8.x perl.  We &#039;&#039;&#039;DO NOT&#039;&#039;&#039; support perl version 5.10.x at this time due to some bugs in the script component support in perl 5.10. You can download perl distributions from [http://downloads.activestate.com/ActivePerl/Windows/ ActiveState]). These distributions include the PerlScript engine that is required for use with STRIDE.&lt;br /&gt;
* The following additional perl packages, which can all be installed using the [http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html Perl Package Manager] (PPM) that comes with ActiveState perl.&lt;br /&gt;
**Win32::API&lt;br /&gt;
**Win32::GUI&lt;br /&gt;
**Win32::GuiTest&lt;br /&gt;
**Win32::ToolHelp&lt;br /&gt;
**XML::DOM&lt;br /&gt;
**Config::IniFiles&lt;br /&gt;
**Getopt::Long&lt;br /&gt;
**NET::DNS&lt;br /&gt;
**Log::Handler&lt;br /&gt;
The simplest way to install these packages is via the command line interface to PPM, e.g&lt;br /&gt;
  CMD&amp;gt; ppm install win32-api&lt;br /&gt;
(change the last argument accordingly for each required package)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Due to bandwidth issues at ActiveState, PPM attempts may fail intermittently. If so, please re-try. You may also try adding a ppm repository:&lt;br /&gt;
  CMD&amp;gt; ppm repo add http://www.bribes.org/perl/ppm&lt;br /&gt;
(change the last argument by specifying [http://win32.perl.org/wiki/index.php?title=PPM_Repositories any other repository])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; PPM uses HTTP to communicate with repositories -- if your HTTP connections require a proxy server, refer to [http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/ActivePerl-faq2.html#ppm_and_proxies the PPM documentation] for information about setting the proxy.&lt;br /&gt;
&lt;br /&gt;
Verify all the packages have been installed via PPM&lt;br /&gt;
  CMD&amp;gt; ppm list&lt;br /&gt;
&lt;br /&gt;
We provide a perl script, &#039;&#039;TestInstallOfPerl.pl&#039;&#039;, that can be used to validate the version and packages that you have installed.  This script is available in &#039;&#039;%STRIDE_DIR%/Scripts&#039;&#039; folder. Run this script from a command prompt by typing &amp;lt;tt&amp;gt;perl TestInstallOfPerl.pl&amp;lt;/tt&amp;gt;. On a properly configured system, it will produce results like:&lt;br /&gt;
&lt;br /&gt;
  ************************************************************&lt;br /&gt;
  Perl/System prerequisites check&lt;br /&gt;
  ************************************************************&lt;br /&gt;
  OK: Perl version looks good (5.010000).&lt;br /&gt;
  OK: Package Win32::API looks good.&lt;br /&gt;
  OK: Package Win32::GUI looks good.&lt;br /&gt;
  OK: Package Win32::GuiTest looks good.&lt;br /&gt;
  OK: Package Win32::ToolHelp looks good.&lt;br /&gt;
  OK: Package XML::DOM looks good.&lt;br /&gt;
  OK: Package Config::IniFiles looks good.&lt;br /&gt;
  OK: Package Getopt::Long looks good.&lt;br /&gt;
  OK: Package NET::DNS looks good.&lt;br /&gt;
  OK: Package Log::Handler looks good.&lt;br /&gt;
  OK: Prerequisites validation successful.&lt;br /&gt;
  ************************************************************&lt;br /&gt;
&lt;br /&gt;
Note: For the later 5.8 versions of Perl, you may see several lines of debug code above the line that verifies the NET::DNS package. This is debugging code is not a sign of unsuccessful installation and can be ignored. &lt;br /&gt;
       &lt;br /&gt;
You should address any errors that are reported before proceeding.  If you prefer to install perl &#039;&#039;&#039;after&#039;&#039;&#039; installing STRIDE, you &#039;&#039;&#039;must&#039;&#039;&#039; run this script after both are installed to verify the packages and perform the necessary STRIDE component registrations.&lt;br /&gt;
&lt;br /&gt;
== STRIDE Installation ==&lt;br /&gt;
STRIDE is usually installed in the &#039;&#039;&#039;C:\STRIDE&#039;&#039;&#039; directory. Installing the core components will provide everything needed to run STRIDE on the host. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step-by-step instructions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Exit all other Windows applications prior to beginning the STRIDE installation.&lt;br /&gt;
# If you haven&#039;t already done so, obtain a current copy of StrideSetup.exe from you project&#039;s Basecamp site.&lt;br /&gt;
# Select and open &#039;&#039;&#039;StrideSetup.exe&#039;&#039;&#039;.&lt;br /&gt;
# When the Install Wizard appears, click &#039;&#039;&#039;Next&#039;&#039;&#039;.&lt;br /&gt;
# On the &#039;&#039;&#039;License Agreement&#039;&#039;&#039; screen, click &#039;&#039;&#039;I Agree&#039;&#039;&#039; if you agree with the terms of the license and to continue the installation.&amp;lt;br&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; Clicking &#039;&#039;&#039;No&#039;&#039;&#039; will terminate the installation process.&lt;br /&gt;
# Click &#039;&#039;&#039;Install&#039;&#039;&#039; to install the Core Components, which provides the full installation of STRIDE.&lt;br /&gt;
# When the installation is complete, click &#039;&#039;&#039;Finish&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Once the installation is complete, you must have your &#039;&#039;&#039;license&#039;&#039;&#039; information ready before starting STRIDE.  If you have an evaluation or node-locked license, place the license file in &#039;&#039;&#039;C:\STRIDE\lic&#039;&#039;&#039; before launching STRIDE Studio.  If you are using a &#039;&#039;&#039;floating license&#039;&#039;&#039;, you will be prompted for the location of the license server when you first start STRIDE.  After your license setup is complete, you are ready to begin Integrating STRIDE into your Target environment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;It is highly recommended to run through the &#039;&#039;&#039;[[Hello_Stride_Sample | Hello Stride Sample]]&#039;&#039;&#039; after completing the Desktop installation.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Conducting an unattended installation ==&lt;br /&gt;
The STRIDE installer supports silent (unattended) installation and uninstallation. To silently install STRIDE, complete the following steps:&lt;br /&gt;
&lt;br /&gt;
# Open a DOS window.&lt;br /&gt;
# Type start /WAIT /D&amp;quot;C:\TEMP&amp;quot; C:\TEMP\StrideSetup.exe /S&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The statement above assumes that &#039;&#039;&#039;StrideSetup.exe&#039;&#039;&#039; resides in C:\TEMP; you may need to change this path to match your actual StrideSetup.exe location.&lt;br /&gt;
&lt;br /&gt;
== Uninstalling Host ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 1 (via Control Panel)&lt;br /&gt;
# From the &#039;&#039;&#039;Start&#039;&#039;&#039; menu, select &#039;&#039;&#039;Control Panel&#039;&#039;&#039;.&lt;br /&gt;
# Double-click &#039;&#039;&#039;Add or Remove Programs&#039;&#039;&#039;.&lt;br /&gt;
# Select &#039;&#039;&#039;Stride&#039;&#039;&#039;, then click &#039;&#039;&#039;Change/Remove&#039;&#039;&#039;.&lt;br /&gt;
# When prompted, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 2 (via STRIDE Program Folder)&lt;br /&gt;
# From the &#039;&#039;&#039;Start&#039;&#039;&#039; menu, go to &#039;&#039;&#039;STRIDE 3.0&#039;&#039;&#039; Program folder.&lt;br /&gt;
# Select &#039;&#039;&#039;STRIDE Uninstall&#039;&#039;&#039;.&lt;br /&gt;
# When prompted, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 3 (via STRIDE Installation Folder)&lt;br /&gt;
# Open the &#039;&#039;&#039;STRIDE installation folder&#039;&#039;&#039; (typically C:\STRIDE).&lt;br /&gt;
# Go to &#039;&#039;&#039;uninstall&#039;&#039;&#039; folder.&lt;br /&gt;
# Select and open &#039;&#039;&#039;STRIDEUninstall.exe&#039;&#039;&#039;.&lt;br /&gt;
# When the Install Wizard appears, click &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
# When the uninstall is complete, click &#039;&#039;&#039;Close&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Conducting an unattended uninstallation ===&lt;br /&gt;
The STRIDE installer supports silent (unattended) installation and uninstallation. To silently uninstall STRIDE, complete the following steps:&lt;br /&gt;
&lt;br /&gt;
# Open a DOS window.&lt;br /&gt;
# Type start /WAIT /D&amp;quot;C:\STRIDE\uninstall&amp;quot; C:\STRIDE\uninstall\StrideUninstall.exe &amp;quot;/S _?=C:\STRIDE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=8950</id>
		<title>Test Units Overview</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=8950"/>
		<updated>2009-01-22T21:00:19Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Floating Point Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
STRIDE enables testing of C/C++ code through the use of xUnit-style test units. Test units can be written by developers, captured using an SCL pragma, and executed from the host. STRIDE facilitates the execution of some or all of the test units by automatically creating entry points for the execution of test units on the target. &lt;br /&gt;
&lt;br /&gt;
== Using test units  ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites  ===&lt;br /&gt;
&lt;br /&gt;
see [[Desktop Installation#Third Party Components|Perl requirements]]. &lt;br /&gt;
&lt;br /&gt;
===How to get started (Overview)===&lt;br /&gt;
&lt;br /&gt;
The required steps to get started with writing test units are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new Studio workspace (or open an existing one).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Set the workspace to compile in C++ mode (In Studio, choose Tools-&amp;gt;Settings-&amp;gt;Compile as Cpp).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write a test unit. You may create a C++ test class or a C test function as your test unit. Click &#039;&#039;&#039;[[Test_Units#Test_Unit_Requirements|here]]&#039;&#039;&#039; for more information on creating test units.&amp;lt;/li&amp;gt;&lt;br /&gt;
To implement a test unit as a test class:&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class Simple {&lt;br /&gt;
public:&lt;br /&gt;
    int test1(void) { return  0;} // PASS&lt;br /&gt;
    int test2(void) { return 23;} // FAIL &amp;lt;&amp;gt;0&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#pragma scl_test_class(Simple)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Or, as a test function:&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
int test1(void) &lt;br /&gt;
{&lt;br /&gt;
    return 0; // PASS&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int test1(void) &lt;br /&gt;
{&lt;br /&gt;
    return 23; // FAIL &amp;lt;&amp;gt;0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;Simple&amp;quot;, test1, test2)&lt;br /&gt;
&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Compile the workspace &amp;amp; review the &#039;&#039;&#039;Simple&#039;&#039;&#039; interface in the Studio Interface tab&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a script to generate the Intercept Module(IM) &#039;&#039;&#039;after&#039;&#039;&#039; the compilation step.&lt;br /&gt;
:For the simple STUB generation required for test unit execution, you can use the following code&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE qw(in);&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
my $intercept = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;    &lt;br /&gt;
$intercept-&amp;gt;{Path} = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
$intercept-&amp;gt;{Name} = $main::studio-&amp;gt;Workspace-&amp;gt;Name;&lt;br /&gt;
map {$intercept-&amp;gt;Item($_)-&amp;gt;{Stub} = 1} (0..($intercept-&amp;gt;Count - 1));&lt;br /&gt;
$intercept-&amp;gt;Create(); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optionally add custom scripts to automate the building and executing your application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that the Studio workspace include path contains the location to all of your test unit declaration (header) files.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once you have created one or more test units, ensure the following:&lt;br /&gt;
:* Workspace is compiled and saved&lt;br /&gt;
:* Intercept Module is generated (Stubs for all Test Units)&lt;br /&gt;
:* Target application re-built&lt;br /&gt;
:* Target application downloaded &amp;amp; started&lt;br /&gt;
:* STRIDE Connected to Target&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;If your application is running, you can start executing test units.&lt;br /&gt;
:* You can test-execute individual test units interactively using the &#039;&#039;&#039;Studio interface&#039;&#039;&#039; view. To do this, open the user interface view corresponding to the test unit you would like to execute, then call it. The return values will indicate how many tests produced each of four (4) result types. Furthermore, the input to the entry point will allow you to select all methods for execution (the default) or individual methods via a dropdown list of enumerated values.&lt;br /&gt;
:* Once you are confident that the test units are behaving as expected, you can generate one or more execution scripts using the &#039;&#039;&#039;Script Wizard&#039;&#039;&#039;.  Sample &#039;&#039;&#039;[[templates]]&#039;&#039;&#039; for executing test unit entry points are provided in the %STRIDE_DIR%\templates\Script Wizard directory.&lt;br /&gt;
:* When writing scripts to execute test units, the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection is a powerful tool for test unit execution and reporting, and for obtaining test results.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For integration with larger regression test workspaces, we recommend that developers check in their test unit code and, optionally, the template-generated scripts that can be used to execute their test units.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pragmas for Test Units===&lt;br /&gt;
STRIDE supports three pragmas for capturing and qualifying test units: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_class ( class-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test class as captured. Once captured, STRIDE will generate the appropriate code for executing the test methods in the class. See the [[scl_test_class|scl_test_class page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_flist ( test-unit-name , test-function-name { , test-function-name } )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test unit as captured, by the specified test-unit-name. One or more functions (test methods) are associated with the test unit. Once captured, STRIDE will generate the appropriate code for executing the associated test methods. See the [[scl_test_flist|scl_test_flist page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_cclass ( struct-name , init-function-name { , deinit-function-name } )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test unit as captured. Once captured, STRIDE will generate the appropriate code for executing the associated test methods. See the [[scl_test_cclass|scl_test_cclass page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_setup ( test-unit-name , method-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: [optional] Declares a member method to be a setup fixture for the test unit. If specified, the setup method will be called before the execution of each test method. See the [[scl_test_setup|scl_test_setup page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_teardown ( test-unit-name , method-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: [optional] Declares a member method to be a teardown fixture for the test unit. If specified, the teardown method will be called after the execution of each test method. See the [[scl_test_teardown|scl_test_teardown page]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Test Unit Requirements  ==&lt;br /&gt;
&lt;br /&gt;
Several variations on typical xUnit-style test units are supported. The additional supported features include: &lt;br /&gt;
&lt;br /&gt;
*Test status can be set using STRIDE Runtime APIs &#039;&#039;or&#039;&#039; by specifying simple return types for test methods. &lt;br /&gt;
*Simple return types: 0 = PASS; &amp;amp;lt;&amp;amp;gt; 0 = FAIL &lt;br /&gt;
*void return type with no explict status setting is assumed PASS &lt;br /&gt;
*Test writers can create additional child suites and tests at runtime by using Runtime APIs. &lt;br /&gt;
*We do not rely on exceptions for reporting of status.&lt;br /&gt;
&lt;br /&gt;
The STRIDE test class framework has the following requirements of each test class: &lt;br /&gt;
&lt;br /&gt;
*The test class must have a suitable default (no-argument) constructor. &lt;br /&gt;
*The test class must have one or more public methods suitable as test methods. Allowable test methods always take no arguments (void) and return either void or simple integer types (int, short, long, char or bool). At this time, we do not allow typedef types or macros for the return values specification. &lt;br /&gt;
*the scl_test_class pragma must be applied to the class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple example using return values for status  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class Simple {&lt;br /&gt;
public:&lt;br /&gt;
    int tc_Int_ExpectPass(void) {return 0;}&lt;br /&gt;
    int tc_Int_ExpectFail(void) {return -1;}&lt;br /&gt;
    bool tc_Bool_ExpectPass(void) {return true;}&lt;br /&gt;
    bool tc_Bool_ExpectFail(void) {return false;}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(Simple)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
  &lt;br /&gt;
int tf_Int_ExpectPass(void) {return 0;}&lt;br /&gt;
int tf_Int_ExpectFail(void) {return -1;}&lt;br /&gt;
bool tf_Bool_ExpectPass(void) {return true;}&lt;br /&gt;
bool tf_Bool_ExpectFail(void) {return false;}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;Simple&amp;quot;, tf_Int_ExpectPass, tf_Int_ExpectFail, tf_Bool_ExpectPass, tf_Bool_ExpectFail)&lt;br /&gt;
#endif&lt;br /&gt;
   &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple example using runtime test service APIs  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class RuntimeServices_basic {&lt;br /&gt;
public: &lt;br /&gt;
  void tc_ExpectPass(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectFail(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_FAIL, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectInProgress(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(RuntimeServices_basic)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
  &lt;br /&gt;
void tf_ExpectPass(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0); &lt;br /&gt;
}&lt;br /&gt;
void tf_ExpectFail(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_FAIL, 0); &lt;br /&gt;
}&lt;br /&gt;
void tf_ExpectInProgress(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;RuntimeServices_basic&amp;quot;, tf_ExpectPass, tf_ExpectFail, tf_ExpectInProgress)&lt;br /&gt;
#endif&lt;br /&gt;
 &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple example using srTest base class  ===&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class MyTest : public stride::srTest {&lt;br /&gt;
public:&lt;br /&gt;
  void tc_ExpectPass(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
    testCase.SetStatus(srTEST_PASS, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectFail(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
    testCase.SetStatus(srTEST_FAIL, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectInProgress(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  int tc_ChangeMyName(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should have name = MyChangedName&amp;quot;);&lt;br /&gt;
    testCase.SetName(&amp;quot;MyChangedName&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  int tc_ChangeMyDescription(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should have a description set&amp;quot;);&lt;br /&gt;
    testCase.SetDescription(&amp;quot;this is my new description&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(MyTest)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Runtime Test Services  ==&lt;br /&gt;
&lt;br /&gt;
The Runtime Test Services (declared in srTest.h) are a set of APIs in the STRIDE Runtime that facilitate the writing of target based test code. These APIs make up an optional portion of the STRIDE Runtime and can be used to communicate additional information about tests to the host based reporting mechanism. These APIs also allow target test code to create additional test suites and test cases dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
There are 2 alternate ways of accessing these APIs: through C-based functions, or through a C++ base class from which you may derive your C++ test class. These are discussed below in C Test Functions, and C++ Test Classes sections below.&lt;br /&gt;
&lt;br /&gt;
=== C Test Functions ===&lt;br /&gt;
&lt;br /&gt;
The following C APIs are provided: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddSuite|srTestSuiteAddSuite]]&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteSetName|srTestSuiteSetName]]&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteSetDescription|srTestSuiteSetDescription]]&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddTest|srTestSuiteAddTest]]&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetName|srTestCaseSetName]]&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetDescription|srTestCaseSetDescription]]&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseAddComment|srTestCaseAddComment]]&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetStatus|srTestCaseSetStatus]]&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]]&#039;&#039;&#039;: creates an annotation at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestAnnotationAddComment|srTestAnnotationAddComment]]&#039;&#039;&#039;: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddSuite ====&lt;br /&gt;
The srTestSuiteAddSuite() routine is used to add a new test suite to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestSuiteHandle_t srTestSuiteAddSuite(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new test suite is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of test suite. If null, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|srTestSuiteHandle_t &lt;br /&gt;
| Handle of the newly created test suite. srTEST_SUITE_INVALID indicates failure to create test suite.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteHandle_t subSuite =&lt;br /&gt;
  srTestSuiteAddSuite(srTEST_SUITE_DEFAULT, &amp;quot;tf Sub Suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addSuite)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetName ====&lt;br /&gt;
The srTestSuiteSetName() routine is used to set the name of the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestSuiteSetName(srTestSuiteHandle_t tTestSuite, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestSuite &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test suite. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the name of test suite. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_setName(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteSetName(srTEST_SUITE_DEFAULT, &amp;quot;Setting name for default suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_setName)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetDescription ====&lt;br /&gt;
The srTestSuiteSetDescription() routine is used to set the description of the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestSuiteSetDescription(srTestSuiteHandle_t tTestSuite, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestSuite &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test suite. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of test suite. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
void tfsuite_setDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteSetDescription(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                            &amp;quot;Setting description for default suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_setDescription)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddTest ====&lt;br /&gt;
The srTestSuiteAddTest() routine is used to add a new test case to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestCaseHandle_t srTestSuiteAddTest(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new test case is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of test case. If null, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestCaseHandle_t &lt;br /&gt;
| Handle of the newly created test case. srTEST_CASE_INVALID indicates failure to create test case.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addTest(void)&lt;br /&gt;
{&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    char szName[25];&lt;br /&gt;
    sprintf(szName, &amp;quot;dynamic test case %d&amp;quot;, count);&lt;br /&gt;
    srTestCaseHandle_t test = srTestSuiteAddTest(srTEST_SUITE_DEFAULT, szName);&lt;br /&gt;
    srTEST_ADD_COMMENT_WITH_LOCATION(test, &amp;quot;this is a dynamic test case&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addTest)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetName ====&lt;br /&gt;
The srTestCaseSetName() routine is used to set set the name of the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetName(srTestCaseHandle_t tTestCase, const srCHAR *szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the name of test case. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setName(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetName(srTEST_CASE_DEFAULT, &amp;quot;Setting name for default case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setName)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetDescription ====&lt;br /&gt;
The srTestCaseSetDescription() routine is used to set the description of the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetDescription(srTestCaseHandle_t tTestCase, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of test case. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetDescription(srTEST_CASE_DEFAULT,&lt;br /&gt;
                           &amp;quot;Setting description for default case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setDescription)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseAddComment ====&lt;br /&gt;
The srTestCaseAddComment() routine is used to add a comment (aka a log) to be reported with the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseAddComment(srTestCaseHandle_t tTestCase, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string, which can be formatted, representing the comment. Cannot be null.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_addComment(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT,&lt;br /&gt;
                       &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_addComment)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatus ====&lt;br /&gt;
The srTestCaseSetStatus() routine is used to set the result of test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test.&lt;br /&gt;
|-&lt;br /&gt;
| dwDuration &lt;br /&gt;
| Input &lt;br /&gt;
| The duration of the test in clock ticks. Using “0” allows the STRIDE Runtime (Intercept Module) to set the time automatically.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setStatus(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setStatus)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatusEx ====&lt;br /&gt;
The srTestCaseSetStatusEx() routine is used to set the result of test case and allow specification of an extendedFailureCode.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration, srLONG lExtendedFailureCode)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test. dwDuration Input The duration of the test in clock ticks. Using “0” allows the STRIDE Runtime (Intercept Module) to set the time automatically.&lt;br /&gt;
|-&lt;br /&gt;
| lExtendedFailureCode &lt;br /&gt;
| Input &lt;br /&gt;
| The Stride framework uses the extendedFailureCode to capture the numeric results of test method when the test method fails via a numeric (non-void, nonbool) return type.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setStatusEx(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetStatusEx(srTEST_CASE_DEFAULT, srTEST_FAIL, 0, -5);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setStatusEx)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddAnnotation ====&lt;br /&gt;
The srTestSuiteAddAnnotation() routine is used to add a new annotation to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestAnnotationHandle_t srTestSuiteAddAnnotation(rTestSuiteHandle_t tParent, srTestAnnotationLevel_e eLevel, const srCHAR * szName, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new annotation is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| eLevel&lt;br /&gt;
| Input &lt;br /&gt;
| Annotation level. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of annotation. If null, the default host naming scheme will be used.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of annotation. If null, description will be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestAnnotationHandle_t &lt;br /&gt;
| HHandle of the newly created annotation. srTEST_ANNOTATION_INVALID indicates failure to create annotation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addAnnotation(void) &lt;br /&gt;
{&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    char szName[25];&lt;br /&gt;
    sprintf(szName, &amp;quot;annotation %d&amp;quot;, count);&lt;br /&gt;
    srTestAnnotationHandle_t annot = &lt;br /&gt;
                     srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                              srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                              szName,&lt;br /&gt;
                                              &amp;quot;description of annotation&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addAnnotation)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestAnnotationAddComment ====&lt;br /&gt;
The srTestAnnotationAddComment() routine is used to add a comment (aka a log) to be reported with the specified annotation.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestAnnotationAddComment(srTestAnnotationHandle_t tTestAnnotation, const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestAnnotation&lt;br /&gt;
| Input&lt;br /&gt;
| Handle to an annotation created using srTestSuiteAddAnnotation.&lt;br /&gt;
|-&lt;br /&gt;
| szLabel&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string for the label. If null, the default label will be applied.&lt;br /&gt;
|-&lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string, which can be formatted, representing the comment. Cannot be null.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuiteAnnotation_addComment(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestAnnotationHandle_t annot = &lt;br /&gt;
                           srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                                    srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                                    “annot”,&lt;br /&gt;
                                                    “annot description”);&lt;br /&gt;
  srTestAnnotationAddComment(annot,&lt;br /&gt;
                             srNULL,&lt;br /&gt;
                             &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuiteAnnotation_addComment)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C++ Test Classes ===&lt;br /&gt;
The Runtime Test Services C APIs work equally well from C test functions and C++ test classes. If, however, you are using C++ it might be more convinient for you to derive your C++ test classes from the Runtime Test Services C++ base class, &#039;&#039;srTest&#039;&#039;. That way you will have access to a set of simpler to use C++ classes. &lt;br /&gt;
&lt;br /&gt;
The following C++ classes are provided: &lt;br /&gt;
* &#039;&#039;&#039;[[#class srTest|class srTest]]&#039;&#039;&#039; - base test class&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestSuite|class srTestSuite]]&#039;&#039;&#039; - represents a test suite&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestCase|class srTestCase]]&#039;&#039;&#039; - represents a test case&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestAnnotation|class srTestAnnotation]]&#039;&#039;&#039; - represents a test annotation&lt;br /&gt;
&lt;br /&gt;
==== class srTest ====&lt;br /&gt;
The srTest class provides two Member Objects:&lt;br /&gt;
*&#039;&#039;testSuite&#039;&#039; of class srTestSuite &lt;br /&gt;
*&#039;&#039;testCase&#039;&#039;of class srTestCase&lt;br /&gt;
&lt;br /&gt;
==== class srTestSuite ====&lt;br /&gt;
The srTest class provides the folowing methods:&lt;br /&gt;
&lt;br /&gt;
===== method AddSuite =====&lt;br /&gt;
The AddSuite method is used to add a new test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestSuite AddSuite(const srCHAR * szName = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of test suite. If empty, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestSuite &lt;br /&gt;
| Newly created test suite class.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddSuite(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  stride::srTestSuite suite = testSuite.AddSuite(&amp;quot;tc Sub Suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetName =====&lt;br /&gt;
The SetName method is used to set the name of test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the name of test suite. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteSetName(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteSetName(void)&lt;br /&gt;
{&lt;br /&gt;
  testSuite.SetName(&amp;quot;Setting name for suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetDescription =====&lt;br /&gt;
The SetDescription method is used to set the description of test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the description of test suite. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|- &lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteSetDescription(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteSetDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  testSuite.SetDescription(&amp;quot;Setting description for suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddTest =====&lt;br /&gt;
The AddTest method is used to add a new test case to test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestCase AddTest(const srCHAR * szName = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of test case. If empty, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestCase &lt;br /&gt;
| Newly created test case class.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddSuite(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  const std::string prefix(&amp;quot;dynamic test case &amp;quot;);&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    std::stringstream strm;&lt;br /&gt;
    strm &amp;lt;&amp;lt; prefix &amp;lt;&amp;lt; count;&lt;br /&gt;
    stride::srTestCase tc = testSuite.AddTest(strm.str().c_str());&lt;br /&gt;
    tc.AddComment(&amp;quot;this is a dynamic test case&amp;quot;);&lt;br /&gt;
    tc.SetStatus(srTEST_PASS);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddAnnotation =====&lt;br /&gt;
The AddAnnotation method is used to add a new annotation to test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestAnnoation AddAnnotation(srTestAnnotationLevel_e eLevel, const srCHAR * szName = srNULL, const srCHAR * szDescr = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| eLevel&lt;br /&gt;
| Input&lt;br /&gt;
| Annotation level. Cannot be empty.&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of annotation. If empty, the default host naming scheme will be used.&lt;br /&gt;
|- &lt;br /&gt;
| szDescr&lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the description of annotation. If empty, the description will be blank.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestAnnotation&lt;br /&gt;
| Newly created annotation class.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddAnnotation(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddAnnotation(void) &lt;br /&gt;
{&lt;br /&gt;
  const std::string prefixName(&amp;quot;annotation &amp;quot;);&lt;br /&gt;
  const std::string prefixDescr(&amp;quot;description of annotation &amp;quot;);&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    std::stringstream strmName;&lt;br /&gt;
    std::stringstream strmDescr;&lt;br /&gt;
    strmName &amp;lt;&amp;lt; prefixName &amp;lt;&amp;lt; count;&lt;br /&gt;
    strmDescr &amp;lt;&amp;lt; prefixDescr &amp;lt;&amp;lt; count;&lt;br /&gt;
    stride::srTestAnnotation ta = &lt;br /&gt;
               testSuite.AddAnnotation(srTEST_ANNOTATION_LEVEL_INFO,&lt;br /&gt;
                                       strmName.str().c_str(),&lt;br /&gt;
                                       strmDescr.str().c_str());&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== class srTestCase ====&lt;br /&gt;
The srTestCase class provides the following methods:&lt;br /&gt;
&lt;br /&gt;
===== method SetName =====&lt;br /&gt;
The SetName method is used to set the name of test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the name of test case. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetName(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetName(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetName(&amp;quot;Setting name for case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetDescription =====&lt;br /&gt;
The SetDescription method is used to set the description of test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the description of test case. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetDescription(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetDescription(&amp;quot;Setting description for case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddComment =====&lt;br /&gt;
The AddComment method is used to add a comment to test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD AddComment(const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string, which can be formatted, representing the comment. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseAddComment(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseAddComment(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.AddComment(&amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetStatus =====&lt;br /&gt;
The SetStatus method is used to set the result of the default test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetStatus(srTestStatus_e eStatus, srDWORD dwDuration = 0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test.&lt;br /&gt;
|-&lt;br /&gt;
| dwDuration &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| The duration of the test in clock ticks. The default is 0.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetStatus(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetStatus(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetStatus(srTEST_INPROGRESS, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== class srTestAnnotation ====&lt;br /&gt;
The srTestAnnotation class provides the following methods:&lt;br /&gt;
&lt;br /&gt;
===== method AddComment =====&lt;br /&gt;
The AddComment method is used to add a comment to an annotation created under a test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD AddComment(const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szLabel&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string for the label. If null, the default label will be applied.&lt;br /&gt;
|- &lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string, which can be formatted, representing the comment. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAnnotationAddComment(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAnnotationAddComment(void)&lt;br /&gt;
{&lt;br /&gt;
  stride::srTestAnnotation ta = &lt;br /&gt;
                 testSuite.AddAnnotation(srTEST_ANNOTATION_LEVEL_INFO,&lt;br /&gt;
                                         “annot”,&lt;br /&gt;
                                         “annot description”);&lt;br /&gt;
  ta.AddComment(&amp;quot;this comment on annotation should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer to the [[Media:s2sSCLReferenceGuide.pdf|SCL Reference Guide]] or the [[Media:s2sRuntime.pdf|Runtime Developer&#039;s Guide]] for detailed information about any of these APIs.&lt;br /&gt;
&lt;br /&gt;
== ASSERT/EXPECT Macros ==&lt;br /&gt;
&lt;br /&gt;
The STRIDE Test Unit implementation also provides a set of Test Macros available for use within test methods. The macros are optional - you are not required to use them in your test units. They provide shortcuts for testing assertions and automatic report annotation in the case of failures.  &lt;br /&gt;
&lt;br /&gt;
The macros can currently only be used in C++ test unit code. &lt;br /&gt;
&lt;br /&gt;
=== General guidelines for all macros ===&lt;br /&gt;
&lt;br /&gt;
srEXPECT_xx macros will set the current test case to fail (if it hasn’t already been set) and produce an annotation in the report if the expectation fails. If the expectation succeeds, there is no action. &lt;br /&gt;
&lt;br /&gt;
srASSERT_xx macros will set the current test case to fail (if it hasn’t already been set) and insert an annotation into the report if the assertion fails. In addition, a return from the current function will occur. srASSERT_xx macros can only be used in test functions which return void. If the assertion succeeds there is no action. &lt;br /&gt;
&lt;br /&gt;
The report annotation produced by a failed macro always includes the source file and line along with details about the condition that failed and the failing values. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;All the macros support the adding to the report annotations using the &amp;lt;&amp;lt; operator. For example:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  srEXPECT_TRUE( a != &amp;lt;nowiki&amp;gt;b) &amp;lt;&amp;lt; “My custom message”; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;As delivered, the macros will support stream operator annotations using all the numeric types, char* and s2String. The user may create custom types to be used a report annotation by providing an implementation of the &amp;lt;&amp;lt; operator for their custom type. The details are explained in a section below. &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean Macros ===&lt;br /&gt;
The boolean macros take a single condition expression, &#039;&#039;cond&#039;&#039;, that evaluates to an integral type or bool. The condition will be evaluated once. if &#039;&#039;cond&#039;&#039; evaluates to non-zero the assertion or expectation fails. When a failure occurs the report will be annotated. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_TRUE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_TRUE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| &#039;&#039;cond&#039;&#039; is true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_FALSE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_FALSE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| &#039;&#039;cond&#039;&#039; is false&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Macros ===&lt;br /&gt;
&lt;br /&gt;
Comparison macros take two operands and compare them using the indicated operator. The comparison macros will work for primitive types as well as objects that have the corresponding comparison operator implemented.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_EQ(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_EQ(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; == &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_NE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; != &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039;&amp;lt;nowiki&amp;gt; &amp;lt; &amp;lt;/nowiki&amp;gt;&#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039;&amp;lt;nowiki&amp;gt; &amp;lt;= &amp;lt;/nowiki&amp;gt;&#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; &amp;gt; &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; &amp;gt;= &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== C String Comparison Macros ===&lt;br /&gt;
&lt;br /&gt;
C String Comparison Macros are intended only for use with C-style zero terminated strings. The strings can be char or wchar_t based. In particular, these macros should not be used for object of one or other string class, since such classes have overloaded comparison operators. The standard comparison macros should be used instead. &lt;br /&gt;
&lt;br /&gt;
* The length of a string displayed in the report annotation message is controllable via the following macro: srCFG_TEST_MACROS_MAX_C_STRING_MESSAGE_DISPLAY (found in srtestmacros.h). If a string value is truncated because of the length limit, the text &amp;quot;...(trunc)&amp;quot; will always appear next to it. &lt;br /&gt;
* An empty string will appear in error message output as “”. A null string will appear as NULL with no surrounding quotes. Otherwise all output strings are quoted. &lt;br /&gt;
* The type of str1 and str2 must be compatible with const char* or const wchar_t*. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;C-string comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STREQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STREQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have the same content&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRNE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRNE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have different content&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASEEQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASEEQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have the same content, ignoring case.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASENE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASENE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have different content, ignoring case.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Exception Macros ===&lt;br /&gt;
Exception macros  are used to ensure that expected exceptions are thrown. They require exception support from the target compiler. If the target compiler does not have exception support the macros cannot be used and must be disabled.  The support can be disabled via the macro srCFG_TEST_MACROS_EXCEPTIONS_ON found in srtestmacros.h. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Exceptions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW(statement, ex_type);&lt;br /&gt;
| srASSERT_THROW(statement, ex_type);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; throws an exception of type &#039;&#039;ex_type&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_ANY(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_THROW_ANY(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; throws an exception (type not important)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NO_THROW(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_NO_THROW(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; does not throw an exception&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Predicate Macros ===&lt;br /&gt;
Predicate macros allow user control over the pass/fail decision making in a macro. A predicate is a function returning bool that is implemented by the user but passed to the macro. Other arguments for the predicate are also passed to the macro. The macros allow for predicate functions with up to four parameters. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Predicates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED1(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;)&lt;br /&gt;
| srASSERT_PRED1(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;)&lt;br /&gt;
| &#039;&#039;pred&#039;&#039;(&#039;&#039;val1&#039;&#039;) returns true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED2(&#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;)&lt;br /&gt;
| srASSERT_PRED2(&#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;)&lt;br /&gt;
| &#039;&#039;pred&#039;&#039;(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;) returns true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| …(up to arity of 4)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
All predicate macros require a predicate function function which returns bool. The predicate macros allow functions with one to 4 parameters. Following are the report annotations resulting from expectation or assertion failures.&lt;br /&gt;
&lt;br /&gt;
=== Floating Point Macros ===&lt;br /&gt;
&lt;br /&gt;
Floating point macros are for comparing equivalence (or near equivalence) of floating point numbers. These macros are necessary since because equivalence comparisons for floating point numbers will often fail due to round-off errors. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Floating Point Macros&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NEAR(val1, val2, epsilon);&lt;br /&gt;
| srASSERT_NEAR(val1, val2, epsilon);&lt;br /&gt;
| The absolute value of the difference between val1 and val2 is epsilon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dynamic Test Case Macros ===&lt;br /&gt;
The macros presented so far are not capable of dealing with dynamic test cases. In order to handle dynamic test cases, each of the macros requires another parameter which is the test case to report against. Other than this, these macros provide exactly equivalent functionality to the non-dynamic peer. The dynamic macros are listed below. All require a test case, value of type srTestCaseHandle_t from srtest.h,  to be passed as the first parameter).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;Nonfatal assertion&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;Fatal Assertion&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_TRUE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_TRUE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_FALSE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_FALSE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_EQ_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_EQ_DYN(tc, &#039;&#039;expect&#039;&#039;, &#039;&#039;val&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_NE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;C-string comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STREQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STREQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRNE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRNE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASEEQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASEEQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASENE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASENE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Exceptions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_DYN(statement, ex_type);&lt;br /&gt;
| srASSERT_THROW_DYN(tc, statement, ex_type);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_ANY_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_THROW_ANY_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NO_THROW_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_NO_THROW_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Predicates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED1_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;);&lt;br /&gt;
| srASSERT_PRED1_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED2_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_PRED2_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| …(up to arity of 4)&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Floating Point&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NEAR_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;, &#039;&#039;epsilon&#039;&#039;);&lt;br /&gt;
| srASSERT_NEAR_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;, &#039;&#039;epsilon&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Overloading The &amp;lt;&amp;lt; operator for report annotation ===&lt;br /&gt;
&amp;lt;nowiki&amp;gt;The user of the asserting macros package may overload the &amp;lt;&amp;lt; operator in order to annotate reports using a custom class. An example is below. &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;The following will compile and execute successfully given that the &amp;lt;&amp;lt; operator is overloaded as shown:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyCustomClass custom(34); &lt;br /&gt;
&lt;br /&gt;
srEXPECT_FALSE(true) &amp;lt;&amp;lt; custom;&lt;br /&gt;
&lt;br /&gt;
// MyCustomClass implementation&lt;br /&gt;
class MyCustomClass&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   MyCustomClass(int i) : m_int(i) {}&lt;br /&gt;
&lt;br /&gt;
private: &lt;br /&gt;
   int m_int; &lt;br /&gt;
   friend stride::Message&amp;amp; operator&amp;lt;&amp;lt; &lt;br /&gt;
   ( stride::Message&amp;amp; ss, const MyCustomClass&amp;amp; obj);&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
stride::Message&amp;amp; operator&amp;lt;&amp;lt;(stride::Message&amp;amp; ss, const MyCustomClass&amp;amp; obj)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   // format the internals as a string and send on&lt;br /&gt;
   char buf[20]; &lt;br /&gt;
   sprintf(buf, &amp;quot;%d&amp;quot;, obj.m_int); &lt;br /&gt;
   ss &amp;lt;&amp;lt; buf;&lt;br /&gt;
   return ss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test Macro Configuration ===&lt;br /&gt;
&lt;br /&gt;
The Test Macros are implemented in C++. Because target support for use of the standard libraries and exceptions varies across targets the macro implementation can be configured. &lt;br /&gt;
&lt;br /&gt;
==== Configuring Test Macros When Exceptions Not Available ====&lt;br /&gt;
If the target compiler does not support exceptions (or they are disabled) the Exception Macros must be disabled. This is accomplished by setting srCFG_TEST_MACROS_EXCEPTIONS_ON to 0 in the file srtestmacros.h.&lt;br /&gt;
&lt;br /&gt;
==== Configuring Test Macros When C++ Standard Library is Not Available ====&lt;br /&gt;
If the C++ standard library can be used within the target code, the test macro implementation uses std::string and std::stringstream. If the classes are not available on the target, then an alternate, custom implementation that relies only on C library support can be used. &lt;br /&gt;
&lt;br /&gt;
The choice is configured via srCFG_TEST_MACROS_USE_STANDARD_LIB found within srtestmacros.h&lt;br /&gt;
&lt;br /&gt;
==== Configuring Report Annotation for C-String Comparisons ====&lt;br /&gt;
&lt;br /&gt;
The C-String comparison macros are used to compare strings. When comparisons fail, the values involved in the failed comparison are normally displayed in the report. If the strings are very long, this is probably not desirable. It is possible to constrain the maximum length of the displayed strings using srCFG_TEST_MACROS_MAX_C_STRING_MESSAGE_DISPLAY. String values longer than this value will be truncated in report annotations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scripting a Test Unit ==&lt;br /&gt;
&lt;br /&gt;
To automate the execution and reporting of a Test Unit a script is required. Scripts can be written by hand or automatically generated using the Script Wizard and a corresponding template script. A scripting tool for executing a test unit is the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection. An [[AutoScript#ascript.TestUnits.Item|Ascript TestUnit]] object assembles all of the reporting information for the test unit and its corresponding test methods. &lt;br /&gt;
&lt;br /&gt;
*Require useage of the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection &lt;br /&gt;
*Can be written by hand (refer below) &lt;br /&gt;
*Can leverage [[Templates|Templates]] via the Script Wizard &lt;br /&gt;
*Order of multiple test units dictated by SUID assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== JScript example for a single test unit  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness a test unit that has been captured using #pragma scl_test_class(Simple). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
// Ensure test unit exists&lt;br /&gt;
if (ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;) != null) &lt;br /&gt;
  ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;).Run();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perl example for a single test unit  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness a test unit that has been captured using #pragma scl_test_class(Simple). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE;&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
my $tu = $main::ascript-&amp;gt;TestUnits-&amp;gt;Item(&amp;quot;Simple&amp;quot;);&lt;br /&gt;
if (defined $tu) {&lt;br /&gt;
  $tu-&amp;gt;Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== JScript example for multiple test units  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness two test units that have been captured using #pragma scl_test_class(Simple1) and #pragma scl_test_class(Simple2). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
var Units = [&amp;quot;Simple1&amp;quot;,&amp;quot;Simple2&amp;quot;];&lt;br /&gt;
  &lt;br /&gt;
// iterate through each function&lt;br /&gt;
for (i in Units)&lt;br /&gt;
{&lt;br /&gt;
  var tu = ascript.TestUnits.Item(Units[i]);&lt;br /&gt;
  if ( tu&amp;amp;nbsp;!= null ) &lt;br /&gt;
    tu.Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perl example for multiple test units  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness two test units that have been captured using #pragma scl_test_class(Simple1) and #pragma scl_test_class(Simple2). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE;&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
# initialize an array with all selected function names&lt;br /&gt;
my @UnitNames = (&amp;quot;Simple1&amp;quot;,&amp;quot;Simple2&amp;quot;);&lt;br /&gt;
foreach (@UnitNames) {   &lt;br /&gt;
  my $tu = $main::ascript-&amp;gt;TestUnits-&amp;gt;Item($_-&amp;gt;[1]);&lt;br /&gt;
  die &amp;quot;TestUnit not found: $_-&amp;gt;[1]\n&amp;quot; unless (defined $tu);&lt;br /&gt;
  $tu-&amp;gt;Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Test Units]]&lt;br /&gt;
[[Category:Reference]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=8948</id>
		<title>Test Units Overview</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=8948"/>
		<updated>2009-01-22T20:44:39Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Predicate Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
STRIDE enables testing of C/C++ code through the use of xUnit-style test units. Test units can be written by developers, captured using an SCL pragma, and executed from the host. STRIDE facilitates the execution of some or all of the test units by automatically creating entry points for the execution of test units on the target. &lt;br /&gt;
&lt;br /&gt;
== Using test units  ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites  ===&lt;br /&gt;
&lt;br /&gt;
see [[Desktop Installation#Third Party Components|Perl requirements]]. &lt;br /&gt;
&lt;br /&gt;
===How to get started (Overview)===&lt;br /&gt;
&lt;br /&gt;
The required steps to get started with writing test units are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new Studio workspace (or open an existing one).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Set the workspace to compile in C++ mode (In Studio, choose Tools-&amp;gt;Settings-&amp;gt;Compile as Cpp).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write a test unit. You may create a C++ test class or a C test function as your test unit. Click &#039;&#039;&#039;[[Test_Units#Test_Unit_Requirements|here]]&#039;&#039;&#039; for more information on creating test units.&amp;lt;/li&amp;gt;&lt;br /&gt;
To implement a test unit as a test class:&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class Simple {&lt;br /&gt;
public:&lt;br /&gt;
    int test1(void) { return  0;} // PASS&lt;br /&gt;
    int test2(void) { return 23;} // FAIL &amp;lt;&amp;gt;0&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#pragma scl_test_class(Simple)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Or, as a test function:&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
int test1(void) &lt;br /&gt;
{&lt;br /&gt;
    return 0; // PASS&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int test1(void) &lt;br /&gt;
{&lt;br /&gt;
    return 23; // FAIL &amp;lt;&amp;gt;0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;Simple&amp;quot;, test1, test2)&lt;br /&gt;
&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Compile the workspace &amp;amp; review the &#039;&#039;&#039;Simple&#039;&#039;&#039; interface in the Studio Interface tab&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a script to generate the Intercept Module(IM) &#039;&#039;&#039;after&#039;&#039;&#039; the compilation step.&lt;br /&gt;
:For the simple STUB generation required for test unit execution, you can use the following code&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE qw(in);&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
my $intercept = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;    &lt;br /&gt;
$intercept-&amp;gt;{Path} = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
$intercept-&amp;gt;{Name} = $main::studio-&amp;gt;Workspace-&amp;gt;Name;&lt;br /&gt;
map {$intercept-&amp;gt;Item($_)-&amp;gt;{Stub} = 1} (0..($intercept-&amp;gt;Count - 1));&lt;br /&gt;
$intercept-&amp;gt;Create(); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optionally add custom scripts to automate the building and executing your application.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that the Studio workspace include path contains the location to all of your test unit declaration (header) files.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once you have created one or more test units, ensure the following:&lt;br /&gt;
:* Workspace is compiled and saved&lt;br /&gt;
:* Intercept Module is generated (Stubs for all Test Units)&lt;br /&gt;
:* Target application re-built&lt;br /&gt;
:* Target application downloaded &amp;amp; started&lt;br /&gt;
:* STRIDE Connected to Target&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;If your application is running, you can start executing test units.&lt;br /&gt;
:* You can test-execute individual test units interactively using the &#039;&#039;&#039;Studio interface&#039;&#039;&#039; view. To do this, open the user interface view corresponding to the test unit you would like to execute, then call it. The return values will indicate how many tests produced each of four (4) result types. Furthermore, the input to the entry point will allow you to select all methods for execution (the default) or individual methods via a dropdown list of enumerated values.&lt;br /&gt;
:* Once you are confident that the test units are behaving as expected, you can generate one or more execution scripts using the &#039;&#039;&#039;Script Wizard&#039;&#039;&#039;.  Sample &#039;&#039;&#039;[[templates]]&#039;&#039;&#039; for executing test unit entry points are provided in the %STRIDE_DIR%\templates\Script Wizard directory.&lt;br /&gt;
:* When writing scripts to execute test units, the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection is a powerful tool for test unit execution and reporting, and for obtaining test results.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For integration with larger regression test workspaces, we recommend that developers check in their test unit code and, optionally, the template-generated scripts that can be used to execute their test units.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Pragmas for Test Units===&lt;br /&gt;
STRIDE supports three pragmas for capturing and qualifying test units: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_class ( class-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test class as captured. Once captured, STRIDE will generate the appropriate code for executing the test methods in the class. See the [[scl_test_class|scl_test_class page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_flist ( test-unit-name , test-function-name { , test-function-name } )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test unit as captured, by the specified test-unit-name. One or more functions (test methods) are associated with the test unit. Once captured, STRIDE will generate the appropriate code for executing the associated test methods. See the [[scl_test_flist|scl_test_flist page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_cclass ( struct-name , init-function-name { , deinit-function-name } )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: Declares a test unit as captured. Once captured, STRIDE will generate the appropriate code for executing the associated test methods. See the [[scl_test_cclass|scl_test_cclass page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_setup ( test-unit-name , method-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: [optional] Declares a member method to be a setup fixture for the test unit. If specified, the setup method will be called before the execution of each test method. See the [[scl_test_setup|scl_test_setup page]] for more information.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;scl_test_teardown ( test-unit-name , method-name )&amp;lt;/code&amp;gt;&#039;&#039;&#039;: [optional] Declares a member method to be a teardown fixture for the test unit. If specified, the teardown method will be called after the execution of each test method. See the [[scl_test_teardown|scl_test_teardown page]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Test Unit Requirements  ==&lt;br /&gt;
&lt;br /&gt;
Several variations on typical xUnit-style test units are supported. The additional supported features include: &lt;br /&gt;
&lt;br /&gt;
*Test status can be set using STRIDE Runtime APIs &#039;&#039;or&#039;&#039; by specifying simple return types for test methods. &lt;br /&gt;
*Simple return types: 0 = PASS; &amp;amp;lt;&amp;amp;gt; 0 = FAIL &lt;br /&gt;
*void return type with no explict status setting is assumed PASS &lt;br /&gt;
*Test writers can create additional child suites and tests at runtime by using Runtime APIs. &lt;br /&gt;
*We do not rely on exceptions for reporting of status.&lt;br /&gt;
&lt;br /&gt;
The STRIDE test class framework has the following requirements of each test class: &lt;br /&gt;
&lt;br /&gt;
*The test class must have a suitable default (no-argument) constructor. &lt;br /&gt;
*The test class must have one or more public methods suitable as test methods. Allowable test methods always take no arguments (void) and return either void or simple integer types (int, short, long, char or bool). At this time, we do not allow typedef types or macros for the return values specification. &lt;br /&gt;
*the scl_test_class pragma must be applied to the class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple example using return values for status  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class Simple {&lt;br /&gt;
public:&lt;br /&gt;
    int tc_Int_ExpectPass(void) {return 0;}&lt;br /&gt;
    int tc_Int_ExpectFail(void) {return -1;}&lt;br /&gt;
    bool tc_Bool_ExpectPass(void) {return true;}&lt;br /&gt;
    bool tc_Bool_ExpectFail(void) {return false;}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(Simple)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
  &lt;br /&gt;
int tf_Int_ExpectPass(void) {return 0;}&lt;br /&gt;
int tf_Int_ExpectFail(void) {return -1;}&lt;br /&gt;
bool tf_Bool_ExpectPass(void) {return true;}&lt;br /&gt;
bool tf_Bool_ExpectFail(void) {return false;}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;Simple&amp;quot;, tf_Int_ExpectPass, tf_Int_ExpectFail, tf_Bool_ExpectPass, tf_Bool_ExpectFail)&lt;br /&gt;
#endif&lt;br /&gt;
   &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple example using runtime test service APIs  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class RuntimeServices_basic {&lt;br /&gt;
public: &lt;br /&gt;
  void tc_ExpectPass(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectFail(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_FAIL, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectInProgress(void) &lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(RuntimeServices_basic)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
#endif&lt;br /&gt;
  &lt;br /&gt;
void tf_ExpectPass(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0); &lt;br /&gt;
}&lt;br /&gt;
void tf_ExpectFail(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_FAIL, 0); &lt;br /&gt;
}&lt;br /&gt;
void tf_ExpectInProgress(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT, &amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(&amp;quot;RuntimeServices_basic&amp;quot;, tf_ExpectPass, tf_ExpectFail, tf_ExpectInProgress)&lt;br /&gt;
#endif&lt;br /&gt;
 &lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Simple example using srTest base class  ===&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
class MyTest : public stride::srTest {&lt;br /&gt;
public:&lt;br /&gt;
  void tc_ExpectPass(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should pass&amp;quot;);&lt;br /&gt;
    testCase.SetStatus(srTEST_PASS, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectFail(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should fail&amp;quot;);&lt;br /&gt;
    testCase.SetStatus(srTEST_FAIL, 0); &lt;br /&gt;
  }&lt;br /&gt;
  void tc_ExpectInProgress(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should be in progress&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  int tc_ChangeMyName(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should have name = MyChangedName&amp;quot;);&lt;br /&gt;
    testCase.SetName(&amp;quot;MyChangedName&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  int tc_ChangeMyDescription(void) &lt;br /&gt;
  {&lt;br /&gt;
    testCase.AddComment(&amp;quot;this test should have a description set&amp;quot;);&lt;br /&gt;
    testCase.SetDescription(&amp;quot;this is my new description&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(MyTest)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Runtime Test Services  ==&lt;br /&gt;
&lt;br /&gt;
The Runtime Test Services (declared in srTest.h) are a set of APIs in the STRIDE Runtime that facilitate the writing of target based test code. These APIs make up an optional portion of the STRIDE Runtime and can be used to communicate additional information about tests to the host based reporting mechanism. These APIs also allow target test code to create additional test suites and test cases dynamically at runtime. &lt;br /&gt;
&lt;br /&gt;
There are 2 alternate ways of accessing these APIs: through C-based functions, or through a C++ base class from which you may derive your C++ test class. These are discussed below in C Test Functions, and C++ Test Classes sections below.&lt;br /&gt;
&lt;br /&gt;
=== C Test Functions ===&lt;br /&gt;
&lt;br /&gt;
The following C APIs are provided: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddSuite|srTestSuiteAddSuite]]&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteSetName|srTestSuiteSetName]]&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteSetDescription|srTestSuiteSetDescription]]&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddTest|srTestSuiteAddTest]]&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetName|srTestCaseSetName]]&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetDescription|srTestCaseSetDescription]]&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseAddComment|srTestCaseAddComment]]&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestCaseSetStatus|srTestCaseSetStatus]]&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
*&#039;&#039;&#039;[[#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]]&#039;&#039;&#039;: creates an annotation at runtime. &lt;br /&gt;
*&#039;&#039;&#039;[[#srTestAnnotationAddComment|srTestAnnotationAddComment]]&#039;&#039;&#039;: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddSuite ====&lt;br /&gt;
The srTestSuiteAddSuite() routine is used to add a new test suite to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestSuiteHandle_t srTestSuiteAddSuite(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new test suite is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of test suite. If null, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|srTestSuiteHandle_t &lt;br /&gt;
| Handle of the newly created test suite. srTEST_SUITE_INVALID indicates failure to create test suite.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteHandle_t subSuite =&lt;br /&gt;
  srTestSuiteAddSuite(srTEST_SUITE_DEFAULT, &amp;quot;tf Sub Suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addSuite)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetName ====&lt;br /&gt;
The srTestSuiteSetName() routine is used to set the name of the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestSuiteSetName(srTestSuiteHandle_t tTestSuite, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestSuite &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test suite. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the name of test suite. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_setName(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteSetName(srTEST_SUITE_DEFAULT, &amp;quot;Setting name for default suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_setName)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetDescription ====&lt;br /&gt;
The srTestSuiteSetDescription() routine is used to set the description of the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestSuiteSetDescription(srTestSuiteHandle_t tTestSuite, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestSuite &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test suite. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of test suite. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
void tfsuite_setDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestSuiteSetDescription(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                            &amp;quot;Setting description for default suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_setDescription)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddTest ====&lt;br /&gt;
The srTestSuiteAddTest() routine is used to add a new test case to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestCaseHandle_t srTestSuiteAddTest(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new test case is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of test case. If null, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestCaseHandle_t &lt;br /&gt;
| Handle of the newly created test case. srTEST_CASE_INVALID indicates failure to create test case.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addTest(void)&lt;br /&gt;
{&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    char szName[25];&lt;br /&gt;
    sprintf(szName, &amp;quot;dynamic test case %d&amp;quot;, count);&lt;br /&gt;
    srTestCaseHandle_t test = srTestSuiteAddTest(srTEST_SUITE_DEFAULT, szName);&lt;br /&gt;
    srTEST_ADD_COMMENT_WITH_LOCATION(test, &amp;quot;this is a dynamic test case&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addTest)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetName ====&lt;br /&gt;
The srTestCaseSetName() routine is used to set set the name of the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetName(srTestCaseHandle_t tTestCase, const srCHAR *szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the name of test case. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setName(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetName(srTEST_CASE_DEFAULT, &amp;quot;Setting name for default case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setName)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetDescription ====&lt;br /&gt;
The srTestCaseSetDescription() routine is used to set the description of the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetDescription(srTestCaseHandle_t tTestCase, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of test case. Cannot be null.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetDescription(srTEST_CASE_DEFAULT,&lt;br /&gt;
                           &amp;quot;Setting description for default case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setDescription)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseAddComment ====&lt;br /&gt;
The srTestCaseAddComment() routine is used to add a comment (aka a log) to be reported with the specified test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseAddComment(srTestCaseHandle_t tTestCase, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string, which can be formatted, representing the comment. Cannot be null.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_addComment(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseAddComment(srTEST_CASE_DEFAULT,&lt;br /&gt;
                       &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_addComment)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatus ====&lt;br /&gt;
The srTestCaseSetStatus() routine is used to set the result of test case.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test.&lt;br /&gt;
|-&lt;br /&gt;
| dwDuration &lt;br /&gt;
| Input &lt;br /&gt;
| The duration of the test in clock ticks. Using “0” allows the STRIDE Runtime (Intercept Module) to set the time automatically.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setStatus(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setStatus)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatusEx ====&lt;br /&gt;
The srTestCaseSetStatusEx() routine is used to set the result of test case and allow specification of an extendedFailureCode.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration, srLONG lExtendedFailureCode)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestCase &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to a test case. srTEST_CASE_DEFAULT can be used for the default test case.&lt;br /&gt;
|-&lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test. dwDuration Input The duration of the test in clock ticks. Using “0” allows the STRIDE Runtime (Intercept Module) to set the time automatically.&lt;br /&gt;
|-&lt;br /&gt;
| lExtendedFailureCode &lt;br /&gt;
| Input &lt;br /&gt;
| The Stride framework uses the extendedFailureCode to capture the numeric results of test method when the test method fails via a numeric (non-void, nonbool) return type.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfcase_setStatusEx(void)&lt;br /&gt;
{&lt;br /&gt;
  srTestCaseSetStatusEx(srTEST_CASE_DEFAULT, srTEST_FAIL, 0, -5);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfcase_setStatusEx)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddAnnotation ====&lt;br /&gt;
The srTestSuiteAddAnnotation() routine is used to add a new annotation to the specified test suite.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srTestAnnotationHandle_t srTestSuiteAddAnnotation(rTestSuiteHandle_t tParent, srTestAnnotationLevel_e eLevel, const srCHAR * szName, const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tParent &lt;br /&gt;
| Input&lt;br /&gt;
| Handle to the parent test suite to which new annotation is to be added. srTEST_SUITE_DEFAULT can be used for the default test suite.&lt;br /&gt;
|-&lt;br /&gt;
| eLevel&lt;br /&gt;
| Input &lt;br /&gt;
| Annotation level. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string that represents the name of annotation. If null, the default host naming scheme will be used.&lt;br /&gt;
|-&lt;br /&gt;
| szDescr&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string representing the description of annotation. If null, description will be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestAnnotationHandle_t &lt;br /&gt;
| HHandle of the newly created annotation. srTEST_ANNOTATION_INVALID indicates failure to create annotation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuite_addAnnotation(void) &lt;br /&gt;
{&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    char szName[25];&lt;br /&gt;
    sprintf(szName, &amp;quot;annotation %d&amp;quot;, count);&lt;br /&gt;
    srTestAnnotationHandle_t annot = &lt;br /&gt;
                     srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                              srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                              szName,&lt;br /&gt;
                                              &amp;quot;description of annotation&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuite_addAnnotation)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== srTestAnnotationAddComment ====&lt;br /&gt;
The srTestAnnotationAddComment() routine is used to add a comment (aka a log) to be reported with the specified annotation.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
srWORD srTestAnnotationAddComment(srTestAnnotationHandle_t tTestAnnotation, const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| tTestAnnotation&lt;br /&gt;
| Input&lt;br /&gt;
| Handle to an annotation created using srTestSuiteAddAnnotation.&lt;br /&gt;
|-&lt;br /&gt;
| szLabel&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string for the label. If null, the default label will be applied.&lt;br /&gt;
|-&lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to a null-terminated string, which can be formatted, representing the comment. Cannot be null.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void tfsuiteAnnotation_addComment(void) &lt;br /&gt;
{&lt;br /&gt;
  srTestAnnotationHandle_t annot = &lt;br /&gt;
                           srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                                    srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                                    “annot”,&lt;br /&gt;
                                                    “annot description”);&lt;br /&gt;
  srTestAnnotationAddComment(annot,&lt;br /&gt;
                             srNULL,&lt;br /&gt;
                             &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_flist(“testfunc”, tfsuiteAnnotation_addComment)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C++ Test Classes ===&lt;br /&gt;
The Runtime Test Services C APIs work equally well from C test functions and C++ test classes. If, however, you are using C++ it might be more convinient for you to derive your C++ test classes from the Runtime Test Services C++ base class, &#039;&#039;srTest&#039;&#039;. That way you will have access to a set of simpler to use C++ classes. &lt;br /&gt;
&lt;br /&gt;
The following C++ classes are provided: &lt;br /&gt;
* &#039;&#039;&#039;[[#class srTest|class srTest]]&#039;&#039;&#039; - base test class&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestSuite|class srTestSuite]]&#039;&#039;&#039; - represents a test suite&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestCase|class srTestCase]]&#039;&#039;&#039; - represents a test case&lt;br /&gt;
* &#039;&#039;&#039;[[#class srTestAnnotation|class srTestAnnotation]]&#039;&#039;&#039; - represents a test annotation&lt;br /&gt;
&lt;br /&gt;
==== class srTest ====&lt;br /&gt;
The srTest class provides two Member Objects:&lt;br /&gt;
*&#039;&#039;testSuite&#039;&#039; of class srTestSuite &lt;br /&gt;
*&#039;&#039;testCase&#039;&#039;of class srTestCase&lt;br /&gt;
&lt;br /&gt;
==== class srTestSuite ====&lt;br /&gt;
The srTest class provides the folowing methods:&lt;br /&gt;
&lt;br /&gt;
===== method AddSuite =====&lt;br /&gt;
The AddSuite method is used to add a new test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestSuite AddSuite(const srCHAR * szName = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of test suite. If empty, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestSuite &lt;br /&gt;
| Newly created test suite class.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddSuite(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  stride::srTestSuite suite = testSuite.AddSuite(&amp;quot;tc Sub Suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetName =====&lt;br /&gt;
The SetName method is used to set the name of test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the name of test suite. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteSetName(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteSetName(void)&lt;br /&gt;
{&lt;br /&gt;
  testSuite.SetName(&amp;quot;Setting name for suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetDescription =====&lt;br /&gt;
The SetDescription method is used to set the description of test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the description of test suite. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|- &lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteSetDescription(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteSetDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  testSuite.SetDescription(&amp;quot;Setting description for suite&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddTest =====&lt;br /&gt;
The AddTest method is used to add a new test case to test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestCase AddTest(const srCHAR * szName = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of test case. If empty, the default host naming scheme will be used.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestCase &lt;br /&gt;
| Newly created test case class.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddSuite(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddSuite(void)&lt;br /&gt;
{&lt;br /&gt;
  const std::string prefix(&amp;quot;dynamic test case &amp;quot;);&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    std::stringstream strm;&lt;br /&gt;
    strm &amp;lt;&amp;lt; prefix &amp;lt;&amp;lt; count;&lt;br /&gt;
    stride::srTestCase tc = testSuite.AddTest(strm.str().c_str());&lt;br /&gt;
    tc.AddComment(&amp;quot;this is a dynamic test case&amp;quot;);&lt;br /&gt;
    tc.SetStatus(srTEST_PASS);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddAnnotation =====&lt;br /&gt;
The AddAnnotation method is used to add a new annotation to test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srTestAnnoation AddAnnotation(srTestAnnotationLevel_e eLevel, const srCHAR * szName = srNULL, const srCHAR * szDescr = srNULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| eLevel&lt;br /&gt;
| Input&lt;br /&gt;
| Annotation level. Cannot be empty.&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the name of annotation. If empty, the default host naming scheme will be used.&lt;br /&gt;
|- &lt;br /&gt;
| szDescr&lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Pointer to null-terminated string that represents the description of annotation. If empty, the description will be blank.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srTestAnnotation&lt;br /&gt;
| Newly created annotation class.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAddAnnotation(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAddAnnotation(void) &lt;br /&gt;
{&lt;br /&gt;
  const std::string prefixName(&amp;quot;annotation &amp;quot;);&lt;br /&gt;
  const std::string prefixDescr(&amp;quot;description of annotation &amp;quot;);&lt;br /&gt;
  for (int count = 0; count &amp;lt; 5; ++count)&lt;br /&gt;
  {&lt;br /&gt;
    std::stringstream strmName;&lt;br /&gt;
    std::stringstream strmDescr;&lt;br /&gt;
    strmName &amp;lt;&amp;lt; prefixName &amp;lt;&amp;lt; count;&lt;br /&gt;
    strmDescr &amp;lt;&amp;lt; prefixDescr &amp;lt;&amp;lt; count;&lt;br /&gt;
    stride::srTestAnnotation ta = &lt;br /&gt;
               testSuite.AddAnnotation(srTEST_ANNOTATION_LEVEL_INFO,&lt;br /&gt;
                                       strmName.str().c_str(),&lt;br /&gt;
                                       strmDescr.str().c_str());&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== class srTestCase ====&lt;br /&gt;
The srTestCase class provides the following methods:&lt;br /&gt;
&lt;br /&gt;
===== method SetName =====&lt;br /&gt;
The SetName method is used to set the name of test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szName &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the name of test case. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetName(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetName(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetName(&amp;quot;Setting name for case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetDescription =====&lt;br /&gt;
The SetDescription method is used to set the description of test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szDescr &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string representing the description of test case. Cannot be empty.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetDescription(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetDescription(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetDescription(&amp;quot;Setting description for case&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method AddComment =====&lt;br /&gt;
The AddComment method is used to add a comment to test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD AddComment(const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string, which can be formatted, representing the comment. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseAddComment(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseAddComment(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.AddComment(&amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== method SetStatus =====&lt;br /&gt;
The SetStatus method is used to set the result of the default test case.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD SetStatus(srTestStatus_e eStatus, srDWORD dwDuration = 0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| eStatus &lt;br /&gt;
| Input &lt;br /&gt;
| Result of the test.&lt;br /&gt;
|-&lt;br /&gt;
| dwDuration &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| The duration of the test in clock ticks. The default is 0.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void caseSetStatus(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::caseSetStatus(void)&lt;br /&gt;
{&lt;br /&gt;
  testCase.SetStatus(srTEST_INPROGRESS, 0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== class srTestAnnotation ====&lt;br /&gt;
The srTestAnnotation class provides the following methods:&lt;br /&gt;
&lt;br /&gt;
===== method AddComment =====&lt;br /&gt;
The AddComment method is used to add a comment to an annotation created under a test suite.&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
srWORD AddComment(const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;  &lt;br /&gt;
| &#039;&#039;&#039;Parameters&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Type&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
| szLabel&lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string for the label. If null, the default label will be applied.&lt;br /&gt;
|- &lt;br /&gt;
| szFmtComment &lt;br /&gt;
| Input &lt;br /&gt;
| Pointer to null-terminated string, which can be formatted, representing the comment. Cannot be empty.&lt;br /&gt;
|-&lt;br /&gt;
| ... &lt;br /&gt;
| Input (Optional)&lt;br /&gt;
| Variable argument list to format the comment szFmtComment.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; style=&amp;quot;align:left;&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Return Value&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039; Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| srOK &lt;br /&gt;
| Success&lt;br /&gt;
|-&lt;br /&gt;
| srERR &lt;br /&gt;
| Null string passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_ERR_HANDLE_INVALID &lt;br /&gt;
| Invalid handle passed in.&lt;br /&gt;
|-&lt;br /&gt;
| srTEST_WARN_STR_TRUNCATED &lt;br /&gt;
| String passed in was too large and was truncated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;srtest.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class srtest_class : public stride::srTest&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  void suiteAnnotationAddComment(void);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void srtest_class::suiteAnnotationAddComment(void)&lt;br /&gt;
{&lt;br /&gt;
  stride::srTestAnnotation ta = &lt;br /&gt;
                 testSuite.AddAnnotation(srTEST_ANNOTATION_LEVEL_INFO,&lt;br /&gt;
                                         “annot”,&lt;br /&gt;
                                         “annot description”);&lt;br /&gt;
  ta.AddComment(&amp;quot;this comment on annotation should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#ifdef _SCL&lt;br /&gt;
#pragma scl_test_class(srtest_class)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer to the [[Media:s2sSCLReferenceGuide.pdf|SCL Reference Guide]] or the [[Media:s2sRuntime.pdf|Runtime Developer&#039;s Guide]] for detailed information about any of these APIs.&lt;br /&gt;
&lt;br /&gt;
== ASSERT/EXPECT Macros ==&lt;br /&gt;
&lt;br /&gt;
The STRIDE Test Unit implementation also provides a set of Test Macros available for use within test methods. The macros are optional - you are not required to use them in your test units. They provide shortcuts for testing assertions and automatic report annotation in the case of failures.  &lt;br /&gt;
&lt;br /&gt;
The macros can currently only be used in C++ test unit code. &lt;br /&gt;
&lt;br /&gt;
=== General guidelines for all macros ===&lt;br /&gt;
&lt;br /&gt;
srEXPECT_xx macros will set the current test case to fail (if it hasn’t already been set) and produce an annotation in the report if the expectation fails. If the expectation succeeds, there is no action. &lt;br /&gt;
&lt;br /&gt;
srASSERT_xx macros will set the current test case to fail (if it hasn’t already been set) and insert an annotation into the report if the assertion fails. In addition, a return from the current function will occur. srASSERT_xx macros can only be used in test functions which return void. If the assertion succeeds there is no action. &lt;br /&gt;
&lt;br /&gt;
The report annotation produced by a failed macro always includes the source file and line along with details about the condition that failed and the failing values. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;All the macros support the adding to the report annotations using the &amp;lt;&amp;lt; operator. For example:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  srEXPECT_TRUE( a != &amp;lt;nowiki&amp;gt;b) &amp;lt;&amp;lt; “My custom message”; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;As delivered, the macros will support stream operator annotations using all the numeric types, char* and s2String. The user may create custom types to be used a report annotation by providing an implementation of the &amp;lt;&amp;lt; operator for their custom type. The details are explained in a section below. &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Boolean Macros ===&lt;br /&gt;
The boolean macros take a single condition expression, &#039;&#039;cond&#039;&#039;, that evaluates to an integral type or bool. The condition will be evaluated once. if &#039;&#039;cond&#039;&#039; evaluates to non-zero the assertion or expectation fails. When a failure occurs the report will be annotated. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_TRUE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_TRUE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| &#039;&#039;cond&#039;&#039; is true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_FALSE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_FALSE(&#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| &#039;&#039;cond&#039;&#039; is false&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Macros ===&lt;br /&gt;
&lt;br /&gt;
Comparison macros take two operands and compare them using the indicated operator. The comparison macros will work for primitive types as well as objects that have the corresponding comparison operator implemented.  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_EQ(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_EQ(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; == &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_NE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; != &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039;&amp;lt;nowiki&amp;gt; &amp;lt; &amp;lt;/nowiki&amp;gt;&#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039;&amp;lt;nowiki&amp;gt; &amp;lt;= &amp;lt;/nowiki&amp;gt;&#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GT(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; &amp;gt; &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GE(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;val1&#039;&#039; &amp;gt;= &#039;&#039;val2&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== C String Comparison Macros ===&lt;br /&gt;
&lt;br /&gt;
C String Comparison Macros are intended only for use with C-style zero terminated strings. The strings can be char or wchar_t based. In particular, these macros should not be used for object of one or other string class, since such classes have overloaded comparison operators. The standard comparison macros should be used instead. &lt;br /&gt;
&lt;br /&gt;
* The length of a string displayed in the report annotation message is controllable via the following macro: srCFG_TEST_MACROS_MAX_C_STRING_MESSAGE_DISPLAY (found in srtestmacros.h). If a string value is truncated because of the length limit, the text &amp;quot;...(trunc)&amp;quot; will always appear next to it. &lt;br /&gt;
* An empty string will appear in error message output as “”. A null string will appear as NULL with no surrounding quotes. Otherwise all output strings are quoted. &lt;br /&gt;
* The type of str1 and str2 must be compatible with const char* or const wchar_t*. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;C-string comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STREQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STREQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have the same content&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRNE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRNE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have different content&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASEEQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASEEQ(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have the same content, ignoring case.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASENE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASENE(&#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| &#039;&#039;str1&#039;&#039; and &#039;&#039;str2&#039;&#039; have different content, ignoring case.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Exception Macros ===&lt;br /&gt;
Exception macros  are used to ensure that expected exceptions are thrown. They require exception support from the target compiler. If the target compiler does not have exception support the macros cannot be used and must be disabled.  The support can be disabled via the macro srCFG_TEST_MACROS_EXCEPTIONS_ON found in srtestmacros.h. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Exceptions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW(statement, ex_type);&lt;br /&gt;
| srASSERT_THROW(statement, ex_type);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; throws an exception of type &#039;&#039;ex_type&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_ANY(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_THROW_ANY(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; throws an exception (type not important)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NO_THROW(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_NO_THROW(&#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| &#039;&#039;statement&#039;&#039; does not throw an exception&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Predicate Macros ===&lt;br /&gt;
Predicate macros allow user control over the pass/fail decision making in a macro. A predicate is a function returning bool that is implemented by the user but passed to the macro. Other arguments for the predicate are also passed to the macro. The macros allow for predicate functions with up to four parameters. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Predicates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED1(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;)&lt;br /&gt;
| srASSERT_PRED1(&#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;)&lt;br /&gt;
| &#039;&#039;pred&#039;&#039;(&#039;&#039;val1&#039;&#039;) returns true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED2(&#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;)&lt;br /&gt;
| srASSERT_PRED2(&#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;)&lt;br /&gt;
| &#039;&#039;pred&#039;&#039;(&#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;) returns true&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| …(up to arity of 4)&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
All predicate macros require a predicate function function which returns bool. The predicate macros allow functions with one to 4 parameters. Following are the report annotations resulting from expectation or assertion failures.&lt;br /&gt;
&lt;br /&gt;
=== Floating Point Macros ===&lt;br /&gt;
&lt;br /&gt;
Floating point macros are for comparing equivalence (or near equivalence) of floating point numbers. These macros are necessary since because equivalence comparisons for floating point numbers will often fail due to round-off errors. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &#039;&#039;&#039;Floating Point Macros&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NEAR(val1, val2, epsilon);&lt;br /&gt;
| srASSERT_NEAR(val1, val2, epsilon);&lt;br /&gt;
| The absolute value of the difference between val1 and va2 is epsilon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dynamic Test Case Macros ===&lt;br /&gt;
The macros presented so far are not capable of dealing with dynamic test cases. In order to handle dynamic test cases, each of the macros requires another parameter which is the test case to report against. Other than this, these macros provide exactly equivalent functionality to the non-dynamic peer. The dynamic macros are listed below. All require a test case, value of type srTestCaseHandle_t from srtest.h,  to be passed as the first parameter).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;Nonfatal assertion&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;Fatal Assertion&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_TRUE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_TRUE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_FALSE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
| srASSERT_FALSE_DYN(tc, &#039;&#039;cond&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_EQ_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_EQ_DYN(tc, &#039;&#039;expect&#039;&#039;, &#039;&#039;val&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_NE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_LE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_LE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GT_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_GE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_GE_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;C-string comparison&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STREQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STREQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRNE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRNE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASEEQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASEEQ_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_STRCASENE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
| srASSERT_STRCASENE_DYN(tc, &#039;&#039;str1&#039;&#039;, &#039;&#039;str2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Exceptions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_DYN(statement, ex_type);&lt;br /&gt;
| srASSERT_THROW_DYN(tc, statement, ex_type);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_THROW_ANY_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_THROW_ANY_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NO_THROW_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
| srASSERT_NO_THROW_DYN(tc, &#039;&#039;statement&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Predicates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED1_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;);&lt;br /&gt;
| srASSERT_PRED1_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;val1&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_PRED2_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
| srASSERT_PRED2_DYN(tc, &#039;&#039;pred&#039;&#039;, &#039;&#039;vall&#039;&#039;, &#039;&#039;val2&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| …(up to arity of 4)&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Floating Point&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| srEXPECT_NEAR_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;, &#039;&#039;epsilon&#039;&#039;);&lt;br /&gt;
| srASSERT_NEAR_DYN(tc, &#039;&#039;val1&#039;&#039;, &#039;&#039;val2&#039;&#039;, &#039;&#039;epsilon&#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Overloading The &amp;lt;&amp;lt; operator for report annotation ===&lt;br /&gt;
&amp;lt;nowiki&amp;gt;The user of the asserting macros package may overload the &amp;lt;&amp;lt; operator in order to annotate reports using a custom class. An example is below. &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;The following will compile and execute successfully given that the &amp;lt;&amp;lt; operator is overloaded as shown:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MyCustomClass custom(34); &lt;br /&gt;
&lt;br /&gt;
srEXPECT_FALSE(true) &amp;lt;&amp;lt; custom;&lt;br /&gt;
&lt;br /&gt;
// MyCustomClass implementation&lt;br /&gt;
class MyCustomClass&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   MyCustomClass(int i) : m_int(i) {}&lt;br /&gt;
&lt;br /&gt;
private: &lt;br /&gt;
   int m_int; &lt;br /&gt;
   friend stride::Message&amp;amp; operator&amp;lt;&amp;lt; &lt;br /&gt;
   ( stride::Message&amp;amp; ss, const MyCustomClass&amp;amp; obj);&lt;br /&gt;
}; &lt;br /&gt;
&lt;br /&gt;
stride::Message&amp;amp; operator&amp;lt;&amp;lt;(stride::Message&amp;amp; ss, const MyCustomClass&amp;amp; obj)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
   // format the internals as a string and send on&lt;br /&gt;
   char buf[20]; &lt;br /&gt;
   sprintf(buf, &amp;quot;%d&amp;quot;, obj.m_int); &lt;br /&gt;
   ss &amp;lt;&amp;lt; buf;&lt;br /&gt;
   return ss;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test Macro Configuration ===&lt;br /&gt;
&lt;br /&gt;
The Test Macros are implemented in C++. Because target support for use of the standard libraries and exceptions varies across targets the macro implementation can be configured. &lt;br /&gt;
&lt;br /&gt;
==== Configuring Test Macros When Exceptions Not Available ====&lt;br /&gt;
If the target compiler does not support exceptions (or they are disabled) the Exception Macros must be disabled. This is accomplished by setting srCFG_TEST_MACROS_EXCEPTIONS_ON to 0 in the file srtestmacros.h.&lt;br /&gt;
&lt;br /&gt;
==== Configuring Test Macros When C++ Standard Library is Not Available ====&lt;br /&gt;
If the C++ standard library can be used within the target code, the test macro implementation uses std::string and std::stringstream. If the classes are not available on the target, then an alternate, custom implementation that relies only on C library support can be used. &lt;br /&gt;
&lt;br /&gt;
The choice is configured via srCFG_TEST_MACROS_USE_STANDARD_LIB found within srtestmacros.h&lt;br /&gt;
&lt;br /&gt;
==== Configuring Report Annotation for C-String Comparisons ====&lt;br /&gt;
&lt;br /&gt;
The C-String comparison macros are used to compare strings. When comparisons fail, the values involved in the failed comparison are normally displayed in the report. If the strings are very long, this is probably not desirable. It is possible to constrain the maximum length of the displayed strings using srCFG_TEST_MACROS_MAX_C_STRING_MESSAGE_DISPLAY. String values longer than this value will be truncated in report annotations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scripting a Test Unit ==&lt;br /&gt;
&lt;br /&gt;
To automate the execution and reporting of a Test Unit a script is required. Scripts can be written by hand or automatically generated using the Script Wizard and a corresponding template script. A scripting tool for executing a test unit is the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection. An [[AutoScript#ascript.TestUnits.Item|Ascript TestUnit]] object assembles all of the reporting information for the test unit and its corresponding test methods. &lt;br /&gt;
&lt;br /&gt;
*Require useage of the [[AutoScript#ascript.TestUnits|AutoScript TestUnits]] collection &lt;br /&gt;
*Can be written by hand (refer below) &lt;br /&gt;
*Can leverage [[Templates|Templates]] via the Script Wizard &lt;br /&gt;
*Order of multiple test units dictated by SUID assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== JScript example for a single test unit  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness a test unit that has been captured using #pragma scl_test_class(Simple). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
// Ensure test unit exists&lt;br /&gt;
if (ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;) != null) &lt;br /&gt;
  ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;).Run();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perl example for a single test unit  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness a test unit that has been captured using #pragma scl_test_class(Simple). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE;&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
my $tu = $main::ascript-&amp;gt;TestUnits-&amp;gt;Item(&amp;quot;Simple&amp;quot;);&lt;br /&gt;
if (defined $tu) {&lt;br /&gt;
  $tu-&amp;gt;Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== JScript example for multiple test units  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness two test units that have been captured using #pragma scl_test_class(Simple1) and #pragma scl_test_class(Simple2). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=javascript&amp;gt;&lt;br /&gt;
var Units = [&amp;quot;Simple1&amp;quot;,&amp;quot;Simple2&amp;quot;];&lt;br /&gt;
  &lt;br /&gt;
// iterate through each function&lt;br /&gt;
for (i in Units)&lt;br /&gt;
{&lt;br /&gt;
  var tu = ascript.TestUnits.Item(Units[i]);&lt;br /&gt;
  if ( tu&amp;amp;nbsp;!= null ) &lt;br /&gt;
    tu.Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Perl example for multiple test units  ===&lt;br /&gt;
&lt;br /&gt;
The following example script is used to harness two test units that have been captured using #pragma scl_test_class(Simple1) and #pragma scl_test_class(Simple2). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=perl&amp;gt;&lt;br /&gt;
use strict;&lt;br /&gt;
use Win32::OLE;&lt;br /&gt;
Win32::OLE-&amp;gt;Option(Warn =&amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
# initialize an array with all selected function names&lt;br /&gt;
my @UnitNames = (&amp;quot;Simple1&amp;quot;,&amp;quot;Simple2&amp;quot;);&lt;br /&gt;
foreach (@UnitNames) {   &lt;br /&gt;
  my $tu = $main::ascript-&amp;gt;TestUnits-&amp;gt;Item($_-&amp;gt;[1]);&lt;br /&gt;
  die &amp;quot;TestUnit not found: $_-&amp;gt;[1]\n&amp;quot; unless (defined $tu);&lt;br /&gt;
  $tu-&amp;gt;Run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Test Units]]&lt;br /&gt;
[[Category:Reference]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Main_Page&amp;diff=8759</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Main_Page&amp;diff=8759"/>
		<updated>2009-01-05T19:46:42Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the S2 Technologies™ &#039;&#039;&#039;STRIDE&#039;&#039;&#039;™&#039;&#039;&#039; 3.0 Support Wiki&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
All contributions are welcome and encouraged. Please read &#039;&#039;&#039;[[Help:How to add a topic|How to add a topic]]&#039;&#039;&#039; and &#039;&#039;&#039;[[Help:Contents|Help]]&#039;&#039;&#039; pages for guidelines and instructions on editing. You must &#039;&#039;&#039;[[Special:Userlogin|log in or create an account]]&#039;&#039;&#039; before you can edit a page. &lt;br /&gt;
&lt;br /&gt;
Please select a topic or category heading below, or enter a search string in the Search field to the left. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot; style=&amp;quot;border-right: rgb(187,204,204) 1px solid; border-top: rgb(187,204,204) 1px solid; vertical-align: top; border-left: rgb(187,204,204) 1px solid; border-bottom: rgb(187,204,204) 1px solid&amp;quot; cellspacing=&amp;quot;5&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Installation|Installation]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Reference|Reference]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Samples|Samples]] &amp;lt;!--&lt;br /&gt;
Deploying&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
*[[Desktop_Installation|Desktop Installation]] &lt;br /&gt;
*[[Build_Integration|Build Integration]] &lt;br /&gt;
*[[Target_Integration|Target Integration]] &lt;br /&gt;
*[[Verifying Installation|Verification]]&amp;lt;u&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Reference&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[Reference Overview|Overview]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[Runtime Reference|Runtime]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[Build Tools|Build Tools]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[SCL_Pragmas|SCL Pragmas]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[Intercept Module|Intercept Module]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[AutoScript|AutoScript]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[Reporter|Reporter]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[STRIDE_Studio|Studio]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=pages depth=0&amp;gt;SDKs&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=pages depth=0&amp;gt;Utilities&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Samples&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
*[[Samples Overview]]&lt;br /&gt;
*[[Install_Test_Sample|Install Test]]&lt;br /&gt;
*[[Hello_Stride_Sample|Hello Stride]]&lt;br /&gt;
*[[Test_Unit_Samples|Test Units]]&lt;br /&gt;
*[[Test_Script_Samples|Test Scripts]] &lt;br /&gt;
*[[SCL_Samples|SCL]]&lt;br /&gt;
*[[Intercept_Module_Sample|Intercept Module]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Practice|Practice]] &lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Application Notes|Notes]] &lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Release Notes|Release Notes]]&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=&amp;quot;all&amp;quot; depth=0&amp;gt;Documentation&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=&amp;quot;all&amp;quot; depth=0&amp;gt;Script Writing&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=&amp;quot;all&amp;quot; depth=0&amp;gt;Project Organization&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Notes&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
&amp;lt;categorytree mode=&amp;quot;all&amp;quot; hideroot=&amp;quot;on&amp;quot;&amp;gt;Application Notes&amp;lt;/categorytree&amp;gt; &amp;lt;!--&lt;br /&gt;
Release Notes&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
*[[STRIDE 2.1.00xx|STRIDE 2.1.00xx (D Street)]] &lt;br /&gt;
*[[STRIDE 3.0.01xx|STRIDE 3.0.01xx (StoneSteps)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Intercept_Module_Sample&amp;diff=8638</id>
		<title>Studio:Intercept Module Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Intercept_Module_Sample&amp;diff=8638"/>
		<updated>2008-12-13T01:42:44Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: /* Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
The following content relates to the sample files and workspaces installed in &#039;&#039;%STRIDE_DIR%\Samples\InterceptModule&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample [[Intercept Module|Intercept Module (IM)]] source code, and a STRIDE workspace for doing more advanced test execution.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
The following prerequisites must be satisfied (see [[Desktop Installation]] for more info) before starting:&lt;br /&gt;
* STRIDE must be installed on the Windows PC to be used in the training, and any required licenses must be present.&lt;br /&gt;
* Active State Perl must be installed, and [[Desktop Installation#Perl|additional perl packages]] must be downloaded and installed. &#039;&#039;&#039;Note:&#039;&#039;&#039; when the sample workspace is executed, a script runs that verifies that the required Perl packages have been installed correctly.&lt;br /&gt;
* Microsoft Visual Studio 2005 or a later version must be installed. If you do not currently have any version of Visual Studio, we recommend that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom [[Build_Tools|STRIDE build]] rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the sample source code.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete you can open the STRIDE workspace file and run all scripts using the [[image:Run_all.gif]] button. When run, a simple test report will be produced with a single Passed test and no failures. Although this example produces a report, the focus of it is on the source code instrumentation and intercept module settings, both of which are most easily viewed in the Visual Studio workspace.  The STRIDE workspace provides a means to execute some function call sequences to demonstrate that the call routing via the STRIDE runtime indeed works.&lt;br /&gt;
&lt;br /&gt;
==Sample Tests==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the tests it contains, you can take time to peruse the Visual Studio project source and settings.  This section provides a brief description for the topics covered by this sample workspace. This project is organized in folders, as described in the following sections. The section names match the project folder being described.&lt;br /&gt;
&lt;br /&gt;
===Main===&lt;br /&gt;
&lt;br /&gt;
Contains the application entry point and the generated Intercept Module source file.&lt;br /&gt;
&lt;br /&gt;
===Settings===&lt;br /&gt;
&lt;br /&gt;
Contains a text file with the Intercept options that are used by the project. This file is passed to the [[s2sinstrument]] tool as part of the [[Windows_Off-Target_SDK#Instructions_for_Microsoft_Visual_Studio|STRIDE build rules]]. we have chosen to name this file &#039;&#039;stride.s2sinstrument&#039;&#039; to make clear that it applies the s2sinstrument tool, but the name is not required by the tools (any basename and suffix are allowed).&lt;br /&gt;
&lt;br /&gt;
===Source=== &lt;br /&gt;
&lt;br /&gt;
Contains the application code that we have instrumented so as to illustrate the IM concepts outlined below. The following sub-folders present several IM related concepts. For each of these samples, refer to the &#039;&#039;stride.s2sinstrument&#039;&#039; settings file to see the corresponding tool settings that are required to properly generate the IM code.&lt;br /&gt;
&lt;br /&gt;
====Stub====&lt;br /&gt;
&lt;br /&gt;
Illustrates creation of a [[Intercept Module#Stub|Stub Intercept Module (IM)]], which is required to be included in the target build to call a function on the target platform from the host.&lt;br /&gt;
&lt;br /&gt;
====Proxy====&lt;br /&gt;
&lt;br /&gt;
Demonstrates creation of a [[Intercept Module#Proxy|Proxy Intercept Module (IM)]], which is required to be included in the target build to call a function on the host platform from a function on the target. &lt;br /&gt;
&lt;br /&gt;
====Delegate User Implicit====&lt;br /&gt;
&lt;br /&gt;
Illustrates creation of a [[Intercept Module#Delegate|Delegate User Implicit Intercept Module (IM)]], which is required to be included in the target build to trace on a user (calling) function with implicit [[Name Mangling|name mangling]] that resides wholly on the target.&lt;br /&gt;
&lt;br /&gt;
====Delegate User Explicit====&lt;br /&gt;
&lt;br /&gt;
Illustrates creation of a [[Intercept Module#Delegate|Delegate User Explicit Intercept Module (IM)]], which is required to be included in the target build to trace on a user (calling) function with explicit [[Name Mangling|name mangling]] that resides wholly on the target.&lt;br /&gt;
&lt;br /&gt;
====Delegate Owner Implicit====&lt;br /&gt;
&lt;br /&gt;
Illustrates creation of a [[Intercept Module#Delegate|Delegate Owner Implicit Intercept Module (IM)]], which is required to be included in the target build to trace on a owner (called) function with implicit [[Name Mangling|name mangling]] that resides wholly on the target.&lt;br /&gt;
&lt;br /&gt;
====Delegate Owner Explicit====&lt;br /&gt;
&lt;br /&gt;
Illustrates creation of a [[Intercept Module#Delegate|Delegate Owner Explicit Intercept Module (IM)]], which is required to be included in the target build to trace on a owner (called) function with [[Name Mangling|name mangling]] that resides wholly on the target.&lt;br /&gt;
&lt;br /&gt;
====Delegate Dynamic====&lt;br /&gt;
&lt;br /&gt;
Illustrates creation of a [[Intercept Module#Delegate|Delegate Dynamic Intercept Module (IM)]], which is required to be included in the target build to transparently route calls to either a target-based or host-based implementation of a function.&lt;br /&gt;
&lt;br /&gt;
==Workspace Execution==&lt;br /&gt;
&lt;br /&gt;
The sample STRIDE workspace contains a few basic scripts that drive the execution of the interfaces in the sample application.  The workspace is of little interest other than verifying that the interfaces can be called and invoke the proper proxies and delegates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_CClass_Sample&amp;diff=8634</id>
		<title>Test CClass Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_CClass_Sample&amp;diff=8634"/>
		<updated>2008-12-12T23:01:46Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The Test CClass Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]].  The CClass naming convention implies a C struct that is acting like a class object for the purpose of test unit development.  The Test CClass Samples pertain to implementing test units in the C language that appear to act like test classes.  If you are using C++, you will want to use the [[Test_Class_Sample|Test Class Samples]] for simplicity.  The Test CClass functionality is predominantly for legacy systems that have not switched over to C++.  However, the Test CClass functionality is not restricted from compiling C++ environment as well.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following content relates to the sample files and workspaces installed in &#039;&#039;%STRIDE_DIR%\Samples\TestUnits\TestCClass&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample [[Test Units|scl_test_cclass]] source code, and a STRIDE workspace for doing more advanced test CClass execution.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version installed, you should be able to open this solution (it will be automatically upgraded if necessary).  If you do not have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated. The rebuilding will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test CClasss in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestCClass.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory (%STRIDE_DIR%\Samples\TestUnits\TestCClass).&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestCClass.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
== Sample Test CClass Examples ==&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test CClass it contains, you can take time to peruse the test CClass source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
=== Basic Examples ===&lt;br /&gt;
These examples cover the simplest, easiest way to code a STRIDE test CClass. These examples use simple [http://en.wikipedia.org/wiki/Plain_Old_Data_Structures POD] return types to indicate status and do not annotate the tests with any rich information (such as comments).&lt;br /&gt;
&lt;br /&gt;
==== 01_01_Basic_Simple ====&lt;br /&gt;
This example demonstrates passing and failing tests using the four primary POD types that infer status from (int, short, and char). The bool type is accepted only in C++ mode.&lt;br /&gt;
&lt;br /&gt;
==== 01_02_Basic_Fixtures ====&lt;br /&gt;
This example demonstrates how to use [[Test_Units#Pragmas_for_Test_Units|setup]] and [[Test_Units#Pragmas_for_Test_Units|teardown]] fixtures.  The setup and teardown methods are called immediately before and after the execution of each test method, respectively.&lt;br /&gt;
&lt;br /&gt;
==== 01_03_Basic_Constructors ====&lt;br /&gt;
This example demonstrates how scl_test_cclass may be used with parameterized constructors. These arguments can be passed using our ascript scripting model for test units.&lt;br /&gt;
&lt;br /&gt;
=== Runtime Services Examples ===&lt;br /&gt;
These examples cover basic usage of our Runtime Test Services API (as declared in srtest.h).&lt;br /&gt;
&lt;br /&gt;
==== 02_01_RuntimeServices_Simple ====&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to set status, [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]] to add a comment, and srTEST_ADD_COMMENT_WITH_LOCATION to add a comment that automatically includes line and file information.&lt;br /&gt;
&lt;br /&gt;
==== 02_02_RuntimeServices_Dynamic ====&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestSuiteAddSuite|srTestSuiteAddSuite]], [[Test_Units#srTestSuiteAddTest|srTestSuiteAddTest]], [[Test_Units#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]], and [[Test_Units#srTestAnnotationAddComment|srTestAnnotationAddComment]] for dynamic suite, test case, and annotation creation in the context of a single test method.&lt;br /&gt;
&lt;br /&gt;
==== 02_03_RuntimeServices_Override ====&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to override the status that would otherwise be inferred from the return value.&lt;br /&gt;
&lt;br /&gt;
==== 02_04_RuntimeServices_VarComment ====&lt;br /&gt;
This example demonstrates the use of [http://en.wikipedia.org/wiki/Printf printf] style format strings with [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]].&lt;br /&gt;
&lt;br /&gt;
== Test CClass Execution ==&lt;br /&gt;
This sample demonstrates two different techniques for executing test classes.&lt;br /&gt;
&lt;br /&gt;
=== Commandline Execution ===&lt;br /&gt;
Command line execution for test CClasss is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun]] utility.  Here are several examples with specific syntax to execute scl_test_cclass tests.  All of these commands can be invoked from a standard command shell and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestCClass.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
==== Simple execution of all test units ====&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is included for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestCClass.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test CClass initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see the following:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Constructors...&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              16&lt;br /&gt;
    Failed:               7&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 8 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on an order file ====&lt;br /&gt;
TestUnitRun can optionally base its execution on simple text file input. A simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, is provided which specifies a subset of all the scl_test_cclass tests in this sample. This order file also shows how to create subsuites in the final output by using the special &#039;&#039;&#039;{suitepath}&#039;&#039;&#039; syntax, as described in [[Test_Runners#Usage|the usage section]].&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestCClass.sidb -o RunSimple.txt&lt;br /&gt;
&lt;br /&gt;
...and will produce this output:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               8&lt;br /&gt;
    Failed:               4&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 4 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on file system order ====&lt;br /&gt;
TestUnitRun can also try to infer execution order and suite hierarchy from filesystem organization.  If you have organized your test CClass source files (only the files that contain the scl_test_CClass pragma matter here) in a filesystem hierarchy that you want to mimic in your tests, you can specify a root of a directory tree that contains the relevant test CClass source.  TestUnitRun will walk the directory structure and determine order and hierarchy of tests based on the directory structure.  To see an example of this in action, you can execute this command with the sample:&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestCClass.sidb -f Tests&lt;br /&gt;
&lt;br /&gt;
This will cause the runner to examine the Tests subdirectory structure and build a hierarchy of tests based on that directory tree.  Subdirectories will map to suites in the final report.  Here is the output for this example:&lt;br /&gt;
 &lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test Basic_Constructors...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              16&lt;br /&gt;
    Failed:               7&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 10 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
=== Workspace-based Execution ===&lt;br /&gt;
TestCClass.ssw, a workspace in the TestCClass directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provided basic infrastructure scripts that start/stop the simulator application (TestCClass.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
==== RunAll ====&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alpabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
====CallConstructor====&lt;br /&gt;
&lt;br /&gt;
This folder contains a simple script example that shows how to invoke test classes with constructor arguments.  In this example, the Basic_Constructors test class is executed twice with different initialization (constructor) arguments both times.&lt;br /&gt;
&lt;br /&gt;
==== Run Individual ====&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CClass_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_CClass_NAME&#039;&#039;&#039; is the name of the scl_test_cclass test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_cclass tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_CClass_Sample&amp;diff=8633</id>
		<title>Test CClass Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_CClass_Sample&amp;diff=8633"/>
		<updated>2008-12-12T22:49:46Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The Test CClass Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]].  The CClass naming convention implies a C struct that is acting like a class object for the purpose of test unit development.  The Test CClass Samples pertain to implementing test units in the C language that appear to act like test classes.  If you are using C++, you will want to use the [[Test_Class_Sample|Test Class Samples]] for simplicity.  The Test CClass functionality is predominantly for legacy systems that have not switched over to C++.  However, the Test CClass functionality is not restricted from compiling C++ environment as well.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following content relates to the sample files and workspaces installed in &#039;&#039;%STRIDE_DIR%\Samples\TestUnits\TestCClass&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample [[Test Units|scl_test_cclass]] source code, and a STRIDE workspace for doing more advanced test CClass execution.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version installed, you should be able to open this solution (it will be automatically upgraded if necessary).  If you do not have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated. The rebuilding will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test CClasss in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestCClass.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory (%STRIDE_DIR%\Samples\TestUnits\TestCClass).&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestCClass.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
== Sample Test CClass Examples ==&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test CClass it contains, you can take time to peruse the test CClass source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
=== Basic Examples ===&lt;br /&gt;
These examples cover the simplest, easiest way to code a STRIDE test CClass. These examples use simple [http://en.wikipedia.org/wiki/Plain_Old_Data_Structures POD] return types to indicate status and do not annotate the tests with any rich information (such as comments).&lt;br /&gt;
&lt;br /&gt;
==== 01_01_Basic_Simple ====&lt;br /&gt;
This example demonstrates passing and failing tests using the four primary POD types that infer status from (int, short, and char). The bool type is accepted only in C++ mode.&lt;br /&gt;
&lt;br /&gt;
==== 01_02_Basic_Fixtures ====&lt;br /&gt;
This example demonstrates how to use [[Test_Units#Pragmas_for_Test_Units|setup]] and [[Test_Units#Pragmas_for_Test_Units|teardown]] fixtures.  The setup and teardown methods are called immediately before and after the execution of each test method, respectively.&lt;br /&gt;
&lt;br /&gt;
==== 01_03_Basic_Constructors ====&lt;br /&gt;
This example demonstrates how scl_test_cclass may be used with parameterized constructors. These arguments can be passed using our ascript scripting model for test units.&lt;br /&gt;
&lt;br /&gt;
=== Runtime Services Examples ===&lt;br /&gt;
These examples cover basic usage of our Runtime Test Services API (as declared in srtest.h).&lt;br /&gt;
&lt;br /&gt;
==== 02_01_RuntimeServices_Simple ====&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to set status, [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]] to add a comment, and srTEST_ADD_COMMENT_WITH_LOCATION to add a comment that automatically includes line and file information.&lt;br /&gt;
&lt;br /&gt;
==== 02_02_RuntimeServices_Dynamic ====&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestSuiteAddSuite|srTestSuiteAddSuite]], [[Test_Units#srTestSuiteAddTest|srTestSuiteAddTest]], [[Test_Units#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]], and [[Test_Units#srTestAnnotationAddComment|srTestAnnotationAddComment]] for dynamic suite, test case, and annotation creation in the context of a single test method.&lt;br /&gt;
&lt;br /&gt;
==== 02_03_RuntimeServices_Override ====&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to override the status that would otherwise be inferred from the return value.&lt;br /&gt;
&lt;br /&gt;
==== 02_04_RuntimeServices_VarComment ====&lt;br /&gt;
This example demonstrates the use of [http://en.wikipedia.org/wiki/Printf printf] style format strings with [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]].&lt;br /&gt;
&lt;br /&gt;
== Test CClass Execution ==&lt;br /&gt;
This sample demonstrates two different techniques for executing test classes.&lt;br /&gt;
&lt;br /&gt;
=== Commandline Execution ===&lt;br /&gt;
Command line execution for test CClasss is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun]] utility.  Here are several examples with specific syntax to execute scl_test_cclass tests.  All of these commands can be invoked from a standard command shell and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestCClass.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
==== Simple execution of all test units ====&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is included for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestCClass.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test CClass initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see the following:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Constructors...&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              16&lt;br /&gt;
    Failed:               7&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 8 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on an order file ====&lt;br /&gt;
TestUnitRun can optionally base its execution on simple text file input. A simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, is provided which specifies a subset of all the scl_test_cclass tests in this sample. This order file also shows how to create subsuites in the final output by using the special &#039;&#039;&#039;{suitepath}&#039;&#039;&#039; syntax, as described in [[Test_Runners#Usage|the usage section]].&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestCClass.sidb -o RunSimple.txt&lt;br /&gt;
&lt;br /&gt;
...and will produce this output:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               8&lt;br /&gt;
    Failed:               4&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 4 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on file system order ====&lt;br /&gt;
TestUnitRun can also try to infer execution order and suite hierarchy from filesystem organization.  If you have organized your test CClass source files (only the files that contain the scl_test_CClass pragma matter here) in a filesystem hierarchy that you want to mimic in your tests, you can specify a root of a directory tree that contains the relevant test CClass source.  TestUnitRun will walk the directory structure and determine order and hierarchy of tests based on the directory structure.  To see an example of this in action, you can execute this command with the sample:&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestCClass.sidb -f Tests&lt;br /&gt;
&lt;br /&gt;
This will cause the runner to examine the Tests subdirectory structure and build a hierarchy of tests based on that directory tree.  Subdirectories will map to suites in the final report.  Here is the output for this example:&lt;br /&gt;
 &lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test Basic_Constructors...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestCClass\TestCClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              16&lt;br /&gt;
    Failed:               7&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 10 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
=== Workspace-based Execution ===&lt;br /&gt;
TestCClass.ssw, a workspace in the TestCClass directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provided basic infrastructure scripts that start/stop the simulator application (TestCClass.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
==== RunAll ====&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alpabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
==== Run Individual ====&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CClass_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_CClass_NAME&#039;&#039;&#039; is the name of the scl_test_cclass test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_cclass tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Class_Sample&amp;diff=8630</id>
		<title>Test Class Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Class_Sample&amp;diff=8630"/>
		<updated>2008-12-12T21:05:21Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Class Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;%STRIDE_DIR%\Samples\TestUnits\TestClass&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample [[Test Units|test class]] source code,  and a STRIDE workspace for doing more advanced test class execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestClass.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestClass.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Classes==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test class source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; each of the example test classes is grouped in namespace corresponding to its top-level category (e.g. &#039;&#039;Basic&#039;&#039; or &#039;&#039;Runtime Services&#039;&#039;).  This is something shown for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover the simplest, easiest way to code a STRIDE test class. These examples use simple [http://en.wikipedia.org/wiki/Plain_Old_Data_Structures POD] return types to indicate status and do not annotate the tests with any rich information (such as comments).&lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_Simple====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates passing and failing tests using the four primary POD types that infer status from (int, bool, short, and char).&lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Fixtures====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#Pragmas_for_Test_Units|setup and teardown]] fixtures.  The setup and teardown methods are called immediately before and after the execution of each test method, respectively.&lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how exceptions thrown from a test method are caught by the intercept module and noted in the results.  Any exception that is caught by the harness is assumed to indicate failure.&lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Constructors====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how test classes may have non-trivial constructors.  These arguments can be passed using the [[AutoScript#ascript.TestUnits|ascript]] scripting model for test units.&lt;br /&gt;
&lt;br /&gt;
===Runtime Services Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover basic usage of the Runtime Test Services API (as declared in srtest.h).&lt;br /&gt;
&lt;br /&gt;
====02_01_RuntimeServices_Simple====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to set status, [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]] to add a comment, and srTEST_ADD_COMMENT_WITH_LOCATION to add a comment that automatically includes line and file information. &lt;br /&gt;
&lt;br /&gt;
====02_02_RuntimeServices_Dynamic====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestSuiteAddSuite|srTestSuiteAddSuite]], [[Test_Units#srTestSuiteAddTest|srTestSuiteAddTest]], [[Test_Units#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]], and [[Test_Units#srTestAnnotationAddComment|srTestAnnotationAddComment]] for dynamic suite, test, and annotation creation in the context of a single test method.&lt;br /&gt;
&lt;br /&gt;
====02_03_RuntimeServices_Override====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to override the status that would otherwise be inferred from the return value.&lt;br /&gt;
&lt;br /&gt;
====02_04_RuntimeServices_VarComment====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates the use of [http://en.wikipedia.org/wiki/Printf printf] style format strings with [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]].&lt;br /&gt;
&lt;br /&gt;
===srTest Examples===&lt;br /&gt;
&lt;br /&gt;
These examples show to how to use the [[Test_Units#C.2B.2B_Test_Classes|stride::srTest]] base class for your test classes.  When you publicly inherit from srTest, you get access to default testCase and testSuite members and their associated methods.&lt;br /&gt;
&lt;br /&gt;
====03_01_srTest_Simple====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates the use of [[Test_Units#SetStatus|testCase.setStatus]] to set the status for test cases.&lt;br /&gt;
&lt;br /&gt;
====03_02_srTest_Dynamic====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#AddSuite|testSuite.AddSuite]], [[Test_Units#AddTest|testSuite.AddTest]], [[Test_Units#AddAnnotation|testSuite.AddAnnotation]], and [[Test_Units#AddAnnotation.AddComment|testSuite.AddAnnotation.AddComment]] for dynamic suite, test case, and annotation creation within the context of one test method.&lt;br /&gt;
&lt;br /&gt;
==Test Class Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test classes.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test classes is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test classes.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestClass.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClass.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Class initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Constructors...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::Fixtures...&lt;br /&gt;
  Running Test Basic::Simple...&lt;br /&gt;
  Running Test RuntimeServices::Dynamic...&lt;br /&gt;
  Running Test RuntimeServices::Override... &lt;br /&gt;
  Running Test RuntimeServices::Simple...&lt;br /&gt;
  Running Test RuntimeServices::VarComment...&lt;br /&gt;
  Running Test srTest::Dynamic...&lt;br /&gt;
  Running Test srTest::Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              26&lt;br /&gt;
    Failed:              12&lt;br /&gt;
    In Progress:          2&lt;br /&gt;
    Not Applicable:       2&lt;br /&gt;
    ...in 12 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
====Execution based on an order file====&lt;br /&gt;
&lt;br /&gt;
TestUnitRun can optionally base its execution on simple text file input. A simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, is provided which specifies a subset of all the Test Classes in this sample. This order file also shows how to create subsuites in the final output by using the special &#039;&#039;&#039;{suitepath}&#039;&#039;&#039; syntax, as described in [[Test_Runners#Usage|the usage section]].&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClass.sidb -o RunSimple.txt&lt;br /&gt;
&lt;br /&gt;
...and will produce this output:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Simple...&lt;br /&gt;
  Running Test RuntimeServices::Simple...&lt;br /&gt;
  Running Test srTest::Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              13&lt;br /&gt;
    Failed:               6&lt;br /&gt;
    In Progress:          2&lt;br /&gt;
    Not Applicable:       2&lt;br /&gt;
    ...in 6 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
====Execution based on filesystem order====&lt;br /&gt;
&lt;br /&gt;
TestUnitRun can also try to infer execution order and suite hierarchy from filesystem organization.  If you have organized your test class source files (only the files that contain the scl_test_class pragma matter here) in a filesystem hierarchy that you want to mimic in your tests, you can specify a root of a directory tree that contains the relevant test class source.  TestUnitRun will walk the directory structure and determine order and hierarchy of tests based on the directory structure.  To see an example of this in action, you can execute this command with the sample:&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClass.sidb -f Tests&lt;br /&gt;
&lt;br /&gt;
This will cause the runner to examine the Tests subdirectory structure and build a hierarchy of tests based on that directory tree.  Subdirectories will map to suites in the final report.  Here is the output for this example:&lt;br /&gt;
 &lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Simple...&lt;br /&gt;
  Running Test Basic::Fixtures...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::Constructors...&lt;br /&gt;
  Running Test RuntimeServices::Simple...&lt;br /&gt;
  Running Test RuntimeServices::Dynamic...&lt;br /&gt;
  Running Test RuntimeServices::Override...&lt;br /&gt;
  Running Test RuntimeServices::VarComment...&lt;br /&gt;
  Running Test srTest::Simple...&lt;br /&gt;
  Running Test srTest::Dynamic...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              26&lt;br /&gt;
    Failed:              12&lt;br /&gt;
    In Progress:          2&lt;br /&gt;
    Not Applicable:       2&lt;br /&gt;
    ...in 15 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestClass.ssw, a workspace in the TestClass directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestClass.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alpabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
====CallConstructor====&lt;br /&gt;
&lt;br /&gt;
This folder contains a simple script example that shows how to invoke test classes with constructor arguments.  In this example, the Basic::Constructors test class is executed twice with different initialization (constructor) arguments both times.&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_Class_NAME&#039;&#039;&#039; is the name of the scl_test_class test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_class tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Class_Sample&amp;diff=8629</id>
		<title>Test Class Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Class_Sample&amp;diff=8629"/>
		<updated>2008-12-12T21:02:13Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Test Class Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. The following content relates to the sample files and workspaces installed in &#039;&#039;%STRIDE_DIR%\Samples\TestUnits\TestClass&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample [[Test Units|test class]] source code,  and a STRIDE workspace for doing more advanced test class execution.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary.  If you do not currently have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and a Windows Off-Target App that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test classes in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestClass.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestClass.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
==Sample Test Classes==&lt;br /&gt;
&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test classes it contains, you can take time to peruse the test class source and the corresponding results that each produces.  This section provides a brief description for each.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039; each of the example test classes is grouped in namespace corresponding to its top-level category (e.g. &#039;&#039;Basic&#039;&#039; or &#039;&#039;Runtime Services&#039;&#039;).  This is something shown for organizational purposes only -- it is &#039;&#039;&#039;not&#039;&#039;&#039; a general requirement that test classes be placed into namespaces.   &lt;br /&gt;
&lt;br /&gt;
===Basic Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover the simplest, easiest way to code a STRIDE test class. These examples use simple [http://en.wikipedia.org/wiki/Plain_Old_Data_Structures POD] return types to indicate status and do not annotate the tests with any rich information (such as comments).&lt;br /&gt;
&lt;br /&gt;
====01_01_Basic_Simple====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates passing and failing tests using the four primary POD types that infer status from (int, bool, short, and char).&lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Fixtures====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#Pragmas_for_Test_Units|setup and teardown]] fixtures.  The setup and teardown methods are called immediately before and after the execution of each test method, respectively.&lt;br /&gt;
&lt;br /&gt;
====01_03_Basic_Exceptions====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how exceptions thrown from a test method are caught by the intercept module and noted in the results.  Any exception that is caught by the harness is assumed to indicate failure.&lt;br /&gt;
&lt;br /&gt;
====01_04_Basic_Constructors====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how test classes may have non-trivial constructors.  These arguments can be passed using the [[AutoScript#ascript.TestUnits|ascript]] scripting model for test units.&lt;br /&gt;
&lt;br /&gt;
===Runtime Services Examples===&lt;br /&gt;
&lt;br /&gt;
These examples cover basic usage of the Runtime Test Services API (as declared in srtest.h).&lt;br /&gt;
&lt;br /&gt;
====02_01_RuntimeServices_Simple====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to set status, [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]] to add a comment, and srTEST_ADD_COMMENT_WITH_LOCATION to add a comment that automatically includes line and file information. &lt;br /&gt;
&lt;br /&gt;
====02_02_RuntimeServices_Dynamic====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestSuiteAddSuite|srTestSuiteAddSuite]], [[Test_Units#srTestSuiteAddTest|srTestSuiteAddTest]], [[Test_Units#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]], and [[Test_Units#srTestAnnotationAddComment|srTestAnnotationAddComment]] for dynamic suite, test, and annotation creation in the context of a single test method.&lt;br /&gt;
&lt;br /&gt;
====02_03_RuntimeServices_Override====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to override the status that would otherwise be inferred from the return value.&lt;br /&gt;
&lt;br /&gt;
====02_04_RuntimeServices_VarComment====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates the use of [http://en.wikipedia.org/wiki/Printf printf] style format strings with [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]].&lt;br /&gt;
&lt;br /&gt;
===srTest Examples===&lt;br /&gt;
&lt;br /&gt;
These examples show to how to use the [[Test_Units#C.2B.2B_Test_Classes|stride::srTest]] base class for your test classes.  When you publicly inherit from srTest, you get access to default testCase and testSuite members and their associated methods.&lt;br /&gt;
&lt;br /&gt;
====03_01_srTest_Simple====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates the use of [[Test_Units#SetStatus|testCase.setStatus]] to set the status for test cases.&lt;br /&gt;
&lt;br /&gt;
====03_02_srTest_Dynamic====&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use [[Test_Units#AddSuite|testSuite.AddSuite]], [[Test_Units#AddTest|testSuite.AddTest]], [[Test_Units#AddAnnotation|testSuite.AddAnnotation]], and [[Test_Units#AddAnnotation.AddComment|testSuite.AddAnnotation.AddComment]] for dynamic suite, test case, and annotation creation within the context of one test method.&lt;br /&gt;
&lt;br /&gt;
==Test Class Execution==&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates two different techniques for executing test classes.&lt;br /&gt;
&lt;br /&gt;
===Command Line Execution===&lt;br /&gt;
&lt;br /&gt;
Command line execution for test classes is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun utility]].  Here are several examples of specific syntax to execute test classes.  All of these commands can be invoked from a standard [http://en.wikipedia.org/wiki/Command_Prompt_(Windows) command shell] (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestClass.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
====Simple execution of all test units====&lt;br /&gt;
&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClass.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the database in descending alpha-numeric sort order.  Any Test Class initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see console output like:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Constructors...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::Fixtures...&lt;br /&gt;
  Running Test Basic::Simple...&lt;br /&gt;
  Running Test RuntimeServices::Dynamic...&lt;br /&gt;
  Running Test RuntimeServices::Override... &lt;br /&gt;
  Running Test RuntimeServices::Simple...&lt;br /&gt;
  Running Test RuntimeServices::VarComment...&lt;br /&gt;
  Running Test srTest::Dynamic...&lt;br /&gt;
  Running Test srTest::Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              26&lt;br /&gt;
    Failed:              12&lt;br /&gt;
    In Progress:          2&lt;br /&gt;
    Not Applicable:       2&lt;br /&gt;
    ...in 12 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
====Execution based on an order file====&lt;br /&gt;
&lt;br /&gt;
TestUnitRun can optionally base its execution on simple text file input. A simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, is provided which specifies a subset of all the Test Classes in this sample. This order file also shows how to create subsuites in the final output by using the special &#039;&#039;&#039;{suitepath}&#039;&#039;&#039; syntax, as described in [[Test_Runners#Usage|the usage section]].&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClass.sidb -o RunSimple.txt&lt;br /&gt;
&lt;br /&gt;
...and will produce this output:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Simple...&lt;br /&gt;
  Running Test RuntimeServices::Simple...&lt;br /&gt;
  Running Test srTest::Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              13&lt;br /&gt;
    Failed:               6&lt;br /&gt;
    In Progress:          2&lt;br /&gt;
    Not Applicable:       2&lt;br /&gt;
    ...in 6 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
====Execution based on filesystem order====&lt;br /&gt;
&lt;br /&gt;
TestUnitRun can also try to infer execution order and suite hierarchy from filesystem organization.  If you have organized your test class source files (only the files that contain the scl_test_class pragma matter here) in a filesystem hierarchy that you want to mimic in your tests, you can specify a root of a directory tree that contains the relevant test class source.  TestUnitRun will walk the directory structure and determine order and hierarchy of tests based on the directory structure.  To see an example of this in action, you can execute this command with the sample:&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestClass.sidb -f Tests&lt;br /&gt;
&lt;br /&gt;
This will cause the runner to examine the Tests subdirectory structure and build a hierarchy of tests based on that directory tree.  Subdirectories will map to suites in the final report.  Here is the output for this example:&lt;br /&gt;
 &lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic::Simple...&lt;br /&gt;
  Running Test Basic::Fixtures...&lt;br /&gt;
  Running Test Basic::Exceptions...&lt;br /&gt;
  Running Test Basic::Constructors...&lt;br /&gt;
  Running Test RuntimeServices::Simple...&lt;br /&gt;
  Running Test RuntimeServices::Dynamic...&lt;br /&gt;
  Running Test RuntimeServices::Override...&lt;br /&gt;
  Running Test RuntimeServices::VarComment...&lt;br /&gt;
  Running Test srTest::Simple...&lt;br /&gt;
  Running Test srTest::Dynamic...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestClass\TestClass.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              28&lt;br /&gt;
    Failed:              12&lt;br /&gt;
    In Progress:          2&lt;br /&gt;
    Not Applicable:       2&lt;br /&gt;
    ...in 15 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
===Workspace-based Execution===&lt;br /&gt;
&lt;br /&gt;
TestClass.ssw, a workspace in the TestClass directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (TestClass.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
====RunAll====&lt;br /&gt;
&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alpabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
====CallConstructor====&lt;br /&gt;
&lt;br /&gt;
This folder contains a simple script example that shows how to invoke test classes with constructor arguments.  In this example, the Basic::Constructors test class is executed twice with different initialization (constructor) arguments both times.&lt;br /&gt;
&lt;br /&gt;
====Run Individual====&lt;br /&gt;
&lt;br /&gt;
This folder shows how to use individual scripts to execute test classes. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_Class_NAME&#039;&#039;&#039; is the name of the scl_test_class test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_class tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Function_List_Sample&amp;diff=8626</id>
		<title>Test Function List Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Function_List_Sample&amp;diff=8626"/>
		<updated>2008-12-12T17:57:40Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The Test Function List Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. Function Lists are abbreviated as &#039;FList&#039; in both pragmas (as in scl_test_flist) and documentation. The Test FList Samples pertain to test units that contain lists of functions to be executed. The Test FList functionality is designed to be used for the C language (although it is not restricted from compilation in a C++ environment as well).  &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following content relates to the sample files and workspaces installed in &#039;&#039;%STRIDE_DIR%\Samples\TestUnits\TestFList&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample [[Test Units|scl_test_flist]] source code, and a STRIDE workspace for doing more advanced test function list execution.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version installed, you should be able to open this solution (it will be automatically upgraded if necessary).  If you do not have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated, The rebuilding will produce a STRIDE database, intercept module source files, and a [[Windows_Off-Target_Apps|Windows Off-Target App]] that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test flists in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestFList.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestFList.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
== Sample Test FLists ==&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test flists it contains, you can take time to peruse the test flist source within the STRIDE Studio Project. This section provides a brief description for each. The names of the sections align with the names of the project folders within the STRIDE Studio Project. &lt;br /&gt;
&lt;br /&gt;
=== Basic Examples ===&lt;br /&gt;
These examples cover the simplest, easiest way to code STRIDE scl_test_flist functionality. These examples use simple [http://en.wikipedia.org/wiki/Plain_Old_Data_Structures POD] return types to indicate status and do not annotate the tests with any rich information (such as comments).&lt;br /&gt;
&lt;br /&gt;
==== 01_01_Basic_Simple ====&lt;br /&gt;
This example demonstrates passing and failing tests using the primary POD types that infer status from (int, bool, short, and char). The bool type is only accepted in C++ mode.&lt;br /&gt;
&lt;br /&gt;
==== 01_02_Basic_Fixtures ====&lt;br /&gt;
This example shows how to use [[Test_Units#Pragmas_for_Test_Units|setup]] and [[Test_Units#Pragmas_for_Test_Units|teardown]]  fixtures.  The setup and teardown methods are called immediately before and after the execution of each test method, respectively.&lt;br /&gt;
&lt;br /&gt;
=== Runtime Services Examples ===&lt;br /&gt;
These examples cover basic usage of our Runtime Test Services API (as declared in srtest.h).&lt;br /&gt;
&lt;br /&gt;
==== 02_01_RuntimeServices_Simple ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to set status, [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]] to add a comment, and srTEST_ADD_COMMENT_WITH_LOCATION to add a comment that automatically includes line and file information.&lt;br /&gt;
&lt;br /&gt;
==== 02_02_RuntimeServices_Dynamic ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestSuiteAddSuite|srTestSuiteAddSuite]], [[Test_Units#srTestSuiteAddTest|srTestSuiteAddTest]], [[Test_Units#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]], and [[Test_Units#srTestAnnotationAddComment|srTestAnnotationAddComment]] for dynamic suite, test, and annotation creation in the context of a single test method.&lt;br /&gt;
&lt;br /&gt;
==== 02_03_RuntimeServices_Override ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to override the status that would otherwise be inferred from the return value.&lt;br /&gt;
&lt;br /&gt;
==== 02_04_RuntimeServices_VarComment ====&lt;br /&gt;
This example demonstrates the use of [http://en.wikipedia.org/wiki/Printf printf] style format strings with [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]].&lt;br /&gt;
&lt;br /&gt;
== Test FList Execution ==&lt;br /&gt;
This sample demonstrates two different techniques for executing scl_test_flist code.&lt;br /&gt;
&lt;br /&gt;
=== Commandline Execution ===&lt;br /&gt;
Command line execution for TestFlist is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun]] utility.  Here are several examples of specific syntax to execute function lists.  All of these commands can be invoked from a standard command shell and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestFList.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
==== Simple execution of all test units ====&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the (TestFList.sidb) database in descending alpha-numeric sort order.  Any Test FList initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see the following:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              16&lt;br /&gt;
    Failed:               6&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 7 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on an order file ====&lt;br /&gt;
TestUnitRun can optionally base its execution on simple text file input. A simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, is provided which specifies a subset of all the function list tests in this sample. This order file also shows how to create subsuites in the final output by using the special &#039;&#039;&#039;{suitepath}&#039;&#039;&#039; syntax, as described in [[Test_Runners#Usage|the usage section]].&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb -o RunSimple.txt&lt;br /&gt;
&lt;br /&gt;
...and will produce this output:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)(debug)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               8&lt;br /&gt;
    Failed:               4&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 4 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on file system order ====&lt;br /&gt;
TestUnitRun can also try to infer execution order and suite hierarchy from filesystem organization.  If you have organized your function list test source files (only the files that contain the scl_test_flist pragma matter here) in a filesystem hierarchy that you want to mimic in your tests, you can specify a root of a directory tree that contains the relevant test flist source.  TestUnitRun will walk the directory structure and determine order and hierarchy of tests based on the directory structure.  To see an example of this in action, you can execute this command with the sample:&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb -f Tests&lt;br /&gt;
&lt;br /&gt;
This will cause the runner to examine the Tests subdirectory structure and build a hierarchy of tests based on that directory tree.  Subdirectories will map to suites in the final report.  Here is the output for this example:&lt;br /&gt;
 &lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              16&lt;br /&gt;
    Failed:               6&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 7 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
=== Workspace-based Execution ===&lt;br /&gt;
TestFList.ssw, a workspace in the TestFList directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provided basic infrastructure scripts that start/stop the simulator application (TestFList.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
==== RunAll ====&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alpabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
==== Run Individual ====&lt;br /&gt;
This folder shows how to use individual scripts to execute scl_test_flist tests. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_FList_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_FList_NAME&#039;&#039;&#039; is the name of the scl_test_flist test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_flist tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Function_List_Sample&amp;diff=8625</id>
		<title>Test Function List Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Function_List_Sample&amp;diff=8625"/>
		<updated>2008-12-12T17:56:13Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The Test Function List Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. Function Lists are abbreviated as &#039;FList&#039; in both pragmas (as in scl_test_flist) and documentation. The Test FList Samples pertain to test units that contain lists of functions to be executed. The Test FList functionality is designed to be used for the C language (although it is not restricted from compilation in a C++ environment as well).  &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following content relates to the sample files and workspaces installed in &#039;&#039;%STRIDE_DIR%\Samples\TestUnits\TestFList&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample [[Test Units|scl_test_flist]] source code, and a STRIDE workspace for doing more advanced test function list execution.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version installed, you should be able to open this solution (it will be automatically upgraded if necessary).  If you do not have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated, The rebuilding will produce a STRIDE database, intercept module source files, and a [[Windows_Off-Target_Apps|Windows Off-Target App]] that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test flists in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestFList.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestFList.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
== Sample Test FLists ==&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test flists it contains, you can take time to peruse the test flist source within the STRIDE Studio Project. This section provides a brief description for each. The names of the sections align with the names of the project folders within the STRIDE Studio Project. &lt;br /&gt;
&lt;br /&gt;
=== Basic Examples ===&lt;br /&gt;
These examples cover the simplest, easiest way to code STRIDE scl_test_flist functionality. These examples use simple [http://en.wikipedia.org/wiki/Plain_Old_Data_Structures POD] return types to indicate status and do not annotate the tests with any rich information (such as comments).&lt;br /&gt;
&lt;br /&gt;
==== 01_01_Basic_Simple ====&lt;br /&gt;
This example demonstrates passing and failing tests using the primary POD types that infer status from (int, bool, short, and char). The bool type is only accepted in C++ mode.&lt;br /&gt;
&lt;br /&gt;
==== 01_02_Basic_Fixtures ====&lt;br /&gt;
This example shows how to use [[Test_Units#Pragmas_for_Test_Units|setup]] and [[Test_Units#Pragmas_for_Test_Units|teardown]]  fixtures.  The setup and teardown methods are called immediately before and after the execution of each test method, respectively.&lt;br /&gt;
&lt;br /&gt;
=== Runtime Services Examples ===&lt;br /&gt;
These examples cover basic usage of our Runtime Test Services API (as declared in srtest.h).&lt;br /&gt;
&lt;br /&gt;
==== 02_01_RuntimeServices_Simple ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to set status, [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]] to add a comment, and srTEST_ADD_COMMENT_WITH_LOCATION to add a comment that automatically includes line and file information.&lt;br /&gt;
&lt;br /&gt;
==== 02_02_RuntimeServices_Dynamic ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestSuiteAddSuite|srTestSuiteAddSuite]], [[Test_Units#srTestSuiteAddTest|srTestSuiteAddTest]], [[Test_Units#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]], and [[Test_Units#srTestAnnotationAddComment|srTestAnnotationAddComment]] for dynamic suite, test, and annotation creation in the context of a single test method.&lt;br /&gt;
&lt;br /&gt;
==== 02_03_RuntimeServices_Override ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to override the status that would otherwise be inferred from the return value.&lt;br /&gt;
&lt;br /&gt;
==== 02_04_RuntimeServices_VarComment ====&lt;br /&gt;
This example demonstrates the use of [http://en.wikipedia.org/wiki/Printf printf] style format strings with [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]].&lt;br /&gt;
&lt;br /&gt;
== Test FList Execution ==&lt;br /&gt;
This sample demonstrates two different techniques for executing scl_test_flist code.&lt;br /&gt;
&lt;br /&gt;
=== Commandline Execution ===&lt;br /&gt;
Command line execution for TestFlist is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun]] utility.  Here are several examples of specific syntax to execute function lists.  All of these commands can be invoked from a standard command shell and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestFList.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
==== Simple execution of all test units ====&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the (TestFList.sidb) database in descending alpha-numeric sort order.  Any Test FList initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see the following:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              17&lt;br /&gt;
    Failed:               6&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 7 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on an order file ====&lt;br /&gt;
TestUnitRun can optionally base its execution on simple text file input. A simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, is provided which specifies a subset of all the function list tests in this sample. This order file also shows how to create subsuites in the final output by using the special &#039;&#039;&#039;{suitepath}&#039;&#039;&#039; syntax, as described in [[Test_Runners#Usage|the usage section]].&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb -o RunSimple.txt&lt;br /&gt;
&lt;br /&gt;
...and will produce this output:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)(debug)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               8&lt;br /&gt;
    Failed:               4&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 4 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on file system order ====&lt;br /&gt;
TestUnitRun can also try to infer execution order and suite hierarchy from filesystem organization.  If you have organized your function list test source files (only the files that contain the scl_test_flist pragma matter here) in a filesystem hierarchy that you want to mimic in your tests, you can specify a root of a directory tree that contains the relevant test flist source.  TestUnitRun will walk the directory structure and determine order and hierarchy of tests based on the directory structure.  To see an example of this in action, you can execute this command with the sample:&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb -f Tests&lt;br /&gt;
&lt;br /&gt;
This will cause the runner to examine the Tests subdirectory structure and build a hierarchy of tests based on that directory tree.  Subdirectories will map to suites in the final report.  Here is the output for this example:&lt;br /&gt;
 &lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              17&lt;br /&gt;
    Failed:               6&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 7 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
=== Workspace-based Execution ===&lt;br /&gt;
TestFList.ssw, a workspace in the TestFList directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provided basic infrastructure scripts that start/stop the simulator application (TestFList.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
==== RunAll ====&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alpabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
==== Run Individual ====&lt;br /&gt;
This folder shows how to use individual scripts to execute scl_test_flist tests. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_FList_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_FList_NAME&#039;&#039;&#039; is the name of the scl_test_flist test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_flist tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Function_List_Sample&amp;diff=8624</id>
		<title>Test Function List Sample</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Test_Function_List_Sample&amp;diff=8624"/>
		<updated>2008-12-12T17:48:31Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The Test Function List Samples are part of the [[Test_Unit_Samples|STRIDE Test Unit Samples]]. Function Lists are abbreviated as &#039;FList&#039; in both pragmas (as in scl_test_flist) and documentation. The Test FList Samples pertain to test units that contain lists of functions to be executed. The Test FList functionality is designed to be used for the C language (although it is not restricted from compilation in a C++ environment as well).  &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following content relates to the sample files and workspaces installed in &#039;&#039;%STRIDE_DIR%\Samples\TestUnits\TestFList&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building a [[Windows_Off-Target_Apps|Windows Off-Target App]], sample [[Test Units|scl_test_flist]] source code, and a STRIDE workspace for doing more advanced test function list execution.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
To begin, open the Visual Studio Solution file in the sample directory.  This solution (and corresponding project) were created for Visual Studio 2005.  If you have a later version installed, you should be able to open this solution (it will be automatically upgraded if necessary).  If you do not have any version of Visual Studio, it is recommended that you install the current free version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express].&lt;br /&gt;
&lt;br /&gt;
Once you have successfully opened the solution, rebuild it.  The build process has custom STRIDE build rules integrated, The rebuilding will produce a STRIDE database, intercept module source files, and a [[Windows_Off-Target_Apps|Windows Off-Target App]] that incorporates the test class source.&lt;br /&gt;
&lt;br /&gt;
Once the build is complete, perform the following steps to run the test flists in the workspace:&lt;br /&gt;
&lt;br /&gt;
# launch the Windows Off-Target App, TestFList.exe.  This will run in a standard console window.&lt;br /&gt;
# open a command prompt window and change to this sample&#039;s directory.&lt;br /&gt;
# at the command prompt, run the command &amp;lt;tt&amp;gt;&#039;&#039;&#039;TestUnitRun.pl -v&#039;&#039;&#039;&amp;lt;/tt&amp;gt;.  This will execute all of the test units in the workspace and open a browser to display the results.&lt;br /&gt;
# quit the TestFList.exe application by typing &#039;q&#039; in its console window.&lt;br /&gt;
&lt;br /&gt;
== Sample Test FLists ==&lt;br /&gt;
Now that you have built the Windows Off-Target App and executed the test flists it contains, you can take time to peruse the test flist source within the STRIDE Studio Project. This section provides a brief description for each. The names of the sections align with the names of the project folders within the STRIDE Studio Project. &lt;br /&gt;
&lt;br /&gt;
=== Basic Examples ===&lt;br /&gt;
These examples cover the simplest, easiest way to code STRIDE scl_test_flist functionality. These examples use simple [http://en.wikipedia.org/wiki/Plain_Old_Data_Structures POD] return types to indicate status and do not annotate the tests with any rich information (such as comments).&lt;br /&gt;
&lt;br /&gt;
==== 01_01_Basic_Simple ====&lt;br /&gt;
This example demonstrates passing and failing tests using the primary POD types that infer status from (int, bool, short, and char). The bool type is only accepted in C++ mode.&lt;br /&gt;
&lt;br /&gt;
==== 01_02_Basic_Fixtures ====&lt;br /&gt;
This example shows how to use [[Test_Units#Pragmas_for_Test_Units|setup]] and [[Test_Units#Pragmas_for_Test_Units|teardown]]  fixtures.  The setup and teardown methods are called immediately before and after the execution of each test method, respectively.&lt;br /&gt;
&lt;br /&gt;
=== Runtime Services Examples ===&lt;br /&gt;
These examples cover basic usage of our Runtime Test Services API (as declared in srtest.h).&lt;br /&gt;
&lt;br /&gt;
==== 02_01_RuntimeServices_Simple ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to set status, [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]] to add a comment, and srTEST_ADD_COMMENT_WITH_LOCATION to add a comment that automatically includes line and file information.&lt;br /&gt;
&lt;br /&gt;
==== 02_02_RuntimeServices_Dynamic ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestSuiteAddSuite|srTestSuiteAddSuite]], [[Test_Units#srTestSuiteAddTest|srTestSuiteAddTest]], [[Test_Units#srTestSuiteAddAnnotation|srTestSuiteAddAnnotation]], and [[Test_Units#srTestAnnotationAddComment|srTestAnnotationAddComment]] for dynamic suite, test, and annotation creation in the context of a single test method.&lt;br /&gt;
&lt;br /&gt;
==== 02_03_RuntimeServices_Override ====&lt;br /&gt;
This example shows how to use [[Test_Units#srTestCaseSetStatus|srTestCaseSetStatus]] to override the status that would otherwise be inferred from the return value.&lt;br /&gt;
&lt;br /&gt;
==== 02_04_RuntimeServices_VarComment ====&lt;br /&gt;
This example demonstrates the use of [http://en.wikipedia.org/wiki/Printf printf] style format strings with [[Test_Units#srTestCaseAddComment|srTestCaseAddComment]].&lt;br /&gt;
&lt;br /&gt;
== Test FList Execution ==&lt;br /&gt;
This sample demonstrates two different techniques for executing scl_test_flist code.&lt;br /&gt;
&lt;br /&gt;
=== Commandline Execution ===&lt;br /&gt;
Command line execution for TestFlist is done using the [[Test_Runners#TestUnitRun.pl|TestUnitRun]] utility.  Here are several examples of specific syntax to execute function lists.  All of these commands can be invoked from a standard command shell and the arguments shown assume that the commands are executed with the sample&#039;s directory as the starting directory. You must have your TestFList.exe application running in order for the runner to be able to initiate a connection to the target simulator. In addition, you should verify that your %STRIDE_DIR%\bin\transport.cfg file is using the TCP transport to connect to port 8000 (these are the default settings when the product is installed).&lt;br /&gt;
&lt;br /&gt;
==== Simple execution of all test units ====&lt;br /&gt;
The following command executes all of the test units found in the STRIDE database you have previously generated.  For the purpose of this sample, since there is only one database, the -d parameter is not strictly needed, but it is shown here for completeness.&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb&lt;br /&gt;
&lt;br /&gt;
This command executes all Test Units found in the (TestFList.sidb) database in descending alpha-numeric sort order.  Any Test FList initialization arguments are given default values (typically zero or NULL).&lt;br /&gt;
&lt;br /&gt;
When you run this command, you should see the following:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              17&lt;br /&gt;
    Failed:               6&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 7 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on an order file ====&lt;br /&gt;
TestUnitRun can optionally base its execution on simple text file input. A simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, is provided which specifies a subset of all the function list tests in this sample. This order file also shows how to create subsuites in the final output by using the special &#039;&#039;&#039;{suitepath}&#039;&#039;&#039; syntax, as described in [[Test_Runners#Usage|the usage section]].&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb -o RunSimple.txt&lt;br /&gt;
&lt;br /&gt;
...and will produce this output:&lt;br /&gt;
&lt;br /&gt;
  Attempting connection using [Sockets (S2)(debug)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:               8&lt;br /&gt;
    Failed:               4&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 4 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
==== Execution based on file system order ====&lt;br /&gt;
TestUnitRun can also try to infer execution order and suite hierarchy from filesystem organization.  If you have organized your function list test source files (only the files that contain the scl_test_flist pragma matter here) in a filesystem hierarchy that you want to mimic in your tests, you can specify a root of a directory tree that contains the relevant test flist source.  TestUnitRun will walk the directory structure and determine order and hierarchy of tests based on the directory structure.  To see an example of this in action, you can execute this command with the sample:&lt;br /&gt;
&lt;br /&gt;
  TestUnitRun.pl -d TestFList.sidb -f Tests&lt;br /&gt;
&lt;br /&gt;
This will cause the runner to examine the Tests subdirectory structure and build a hierarchy of tests based on that directory tree.  Subdirectories will map to suites in the final report.  Here is the output for this example:&lt;br /&gt;
 &lt;br /&gt;
  Attempting connection using [Sockets (S2)] transport ...&lt;br /&gt;
  Connected to device.&lt;br /&gt;
  Initializing STRIDE database objects...&lt;br /&gt;
  Done.&lt;br /&gt;
  Running Test Basic_Simple...&lt;br /&gt;
  Running Test Basic_Fixtures...&lt;br /&gt;
  Running Test RuntimeServices_Simple...&lt;br /&gt;
  Running Test RuntimeServices_Dynamic...&lt;br /&gt;
  Running Test RuntimeServices_Override...&lt;br /&gt;
  Running Test RuntimeServices_VarComment...&lt;br /&gt;
  Disconnected from device.&lt;br /&gt;
  Test Results saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.xml&lt;br /&gt;
  Test Report saved to C:\STRIDE\Samples\TestUnits\TestFList\TestFList.html&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
  Results Summary&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
    Passed:              17&lt;br /&gt;
    Failed:               6&lt;br /&gt;
    In Progress:          1&lt;br /&gt;
    Not Applicable:       1&lt;br /&gt;
    ...in 9 suites.&lt;br /&gt;
  ***************************************************************************&lt;br /&gt;
&lt;br /&gt;
=== Workspace-based Execution ===&lt;br /&gt;
TestFList.ssw, a workspace in the TestFList directory, demonstrates the use of script execution with Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]].  The setup and teardown folders provided basic infrastructure scripts that start/stop the simulator application (TestFList.exe) and to manage traceviews used for [[Runtime_Reference#Logging_Services|srPrint]] message collection.  The scripts that drive the testing are in the workspace &#039;&#039;&#039;test&#039;&#039;&#039; folder. What follows is a brief description for each.&lt;br /&gt;
&lt;br /&gt;
==== RunAll ====&lt;br /&gt;
This folder contains a script, All.js, that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in ascending alpabetical order (by name) since the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method was called.&lt;br /&gt;
&lt;br /&gt;
==== Run Individual ====&lt;br /&gt;
This folder shows how to use individual scripts to execute scl_test_flist tests. Each script has the following form:&lt;br /&gt;
&lt;br /&gt;
  ascript.TestUnits.Item(&#039;&#039;&#039;TEST_FList_NAME&#039;&#039;&#039;).Run();&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TEST_FList_NAME&#039;&#039;&#039; is the name of the scl_test_flist test to be run.  The order and hierarchy of each item may be changed via the Studio tree control by moving the item within the scripts and/or folders. The sample contains individual scripts for a few of the sample scl_test_flist tests - you are free to move, add, or delete any items as you experiment with the workspace.&lt;br /&gt;
&lt;br /&gt;
[[Category: Samples]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Main_Page&amp;diff=8419</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Main_Page&amp;diff=8419"/>
		<updated>2008-12-04T21:35:17Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the S2 Technologies™ &#039;&#039;&#039;STRIDE&#039;&#039;&#039;™&#039;&#039;&#039; 3.0 Support Wiki&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
All contributions are welcome and encouraged. Please read &#039;&#039;&#039;[[Help:How to add a topic|How to add a topic]]&#039;&#039;&#039; and &#039;&#039;&#039;[[Help:Contents|Help]]&#039;&#039;&#039; pages for guidelines and instructions on editing. You must &#039;&#039;&#039;[[Special:Userlogin|log in or create an account]]&#039;&#039;&#039; before you can edit a page. &lt;br /&gt;
&lt;br /&gt;
Please select a topic or category heading below, or enter a search string in the Search field to the left. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot; style=&amp;quot;border-right: rgb(187,204,204) 1px solid; border-top: rgb(187,204,204) 1px solid; vertical-align: top; border-left: rgb(187,204,204) 1px solid; border-bottom: rgb(187,204,204) 1px solid&amp;quot; cellspacing=&amp;quot;5&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Installation|Installation]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp; &lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Reference|Reference]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Samples|Samples]] &amp;lt;!--&lt;br /&gt;
Deploying&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
*[[Host_Installation|Host Installation]] &lt;br /&gt;
*[[Build_Integration|Build Integration]] &lt;br /&gt;
*[[Target_Integration|Target Integration]] &lt;br /&gt;
*[[Verifying Installation|Verification]]&amp;lt;u&amp;gt;&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Reference&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[Reference Overview|Overview]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[Runtime Reference|Runtime]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[Build Tools|Build Tools]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[SCL_Pragmas|SCL Pragmas]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[Intercept Module|Intercept Module]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[AutoScript|AutoScript]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[Reporter|Reporter]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;[[STRIDE_Studio|Studio]]&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=pages depth=0&amp;gt;SDKs&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=pages depth=0&amp;gt;Utilities&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Samples&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
*[[Hello_Stride_Sample|Hello Stride]]&lt;br /&gt;
*[[Test_Unit_Samples|Test Units]]&lt;br /&gt;
*[[Test_Script_Samples|Test Scripts]] &lt;br /&gt;
*[[SCL_Samples|SCL]]&lt;br /&gt;
*[[Intercept_Module_Sample|Intercept Module]]&lt;br /&gt;
*[[Install_Test_Sample|Install Test]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Practice|Practice]] &lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Application Notes|Notes]] &lt;br /&gt;
! style=&amp;quot;border-right: rgb(163,176,191) 1px solid; padding-right: 0.4em; border-top: rgb(163,176,191) 1px solid; padding-left: 0.4em; font-weight: bold; font-size: 120%; background: rgb(206,223,242) 0% 50%; padding-bottom: 0.2em; margin: 0pt; border-left: rgb(163,176,191) 1px solid; color: rgb(0,0,0); padding-top: 0.2em; border-bottom: rgb(163,176,191) 1px solid; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial&amp;quot; | [[:Category:Release Notes|Release Notes]]&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=&amp;quot;all&amp;quot; depth=0&amp;gt;Documentation&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=&amp;quot;all&amp;quot; depth=0&amp;gt;Script Writing&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;categorytree mode=&amp;quot;all&amp;quot; depth=0&amp;gt;Project Organization&amp;lt;/categorytree&amp;gt;&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Notes&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
&amp;lt;categorytree mode=&amp;quot;all&amp;quot; hideroot=&amp;quot;on&amp;quot;&amp;gt;Application Notes&amp;lt;/categorytree&amp;gt; &amp;lt;!--&lt;br /&gt;
Release Notes&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
*[[STRIDE 2.1.00xx|STRIDE 2.1.00xx (D Street)]] &lt;br /&gt;
*[[STRIDE 3.0.01xx|STRIDE 3.0.01xx (StoneSteps)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_Build_Tools&amp;diff=8191</id>
		<title>STRIDE Build Tools</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_Build_Tools&amp;diff=8191"/>
		<updated>2008-10-31T22:10:29Z</updated>

		<summary type="html">&lt;p&gt;Jaimeg: fixed minor typo on Partial Intercept Module&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
=Build Tools=&lt;br /&gt;
The STRIDE Build Tools are a set of command line utilities that perform the Stride compile/build process on a supported platform, which may be easily invoked through makefiles or similar build utilities (eg. ANT).&lt;br /&gt;
&lt;br /&gt;
==Command Line Utilities==&lt;br /&gt;
# [[s2scompile|The STRIDE Compiler (s2scompile)]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# [[s2sbind|The STRIDE Database Binder (s2sbind)]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
# [[s2sinstrument|The STRIDE Instrumentation Generator (s2sinstrument)]]&lt;br /&gt;
&#039;&#039;Follow the above links for detailed information on each build tool.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
===Compiling multiple files===&lt;br /&gt;
In this scenario, the &#039;&#039;&#039;s2scompile&#039;&#039;&#039; utility is invoked with a list of header files, containing SCL, each to be compiled a resulting intermediate (.meta) file:&lt;br /&gt;
&lt;br /&gt;
    s2scompile –I&amp;quot;C:\STRIDE\inc&amp;quot; –DN=100 file1.h file2.h&lt;br /&gt;
&lt;br /&gt;
===Database Binding===&lt;br /&gt;
Here, the &#039;&#039;&#039;s2sbind&#039;&#039;&#039; utility is invoked with a list of .meta files to be bound into the specified database (.sidb) file:&lt;br /&gt;
&lt;br /&gt;
    s2sbind –-starting_suid=123 test.sidb file1.h.meta file2.h.meta&lt;br /&gt;
&lt;br /&gt;
===Intercept Module Generation===&lt;br /&gt;
====Single Intercept Module====&lt;br /&gt;
=====Pre-build Instrumentation=====&lt;br /&gt;
In this scenario, the compilation, binding and instrumentation are done before the user’s build. Here, &#039;&#039;&#039;s2scompile&#039;&#039;&#039; is called first, then &#039;&#039;&#039;s2sbind&#039;&#039;&#039;, and finally &#039;&#039;&#039;s2sinstrument&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
    s2scompile –I”C:\STRIDE\inc” –DN=100 file1.h file2.h&lt;br /&gt;
    s2sbind –-starting_suid=123 test.sidb file1.h.meta file2.h.meta&lt;br /&gt;
    s2sinstrument –-im_name=test -–mode=SDud#myGroupID(f1) -–mode=P(f2) test.sidb&lt;br /&gt;
&lt;br /&gt;
=====In-build Prototyping with Post-build Implementation=====&lt;br /&gt;
Here, the compilation, binding and Intercept Module(IM) prototyping (header files only generation) are done incrementally. Note that at the second bind step during prototyping, &#039;&#039;&#039;s2sbind&#039;&#039;&#039; is given an option specifying the existing database to merge with. Also note that &#039;&#039;&#039;s2sinstrument&#039;&#039;&#039; is called the first two times with the &amp;quot;prototype&amp;quot; option specified and then finally is called with the &amp;quot;implement&amp;quot; option for code generation:&lt;br /&gt;
&lt;br /&gt;
    s2scompile –I”C:\STRIDE\inc” –DN=100 file1.h&lt;br /&gt;
    s2sbind –-starting_suid=123 test.sidb file1.h.meta&lt;br /&gt;
    s2sinstrument –-im_name=test –prototype=p1 -–mode=SDud#myGroupID(f10,f11) test.sidb&lt;br /&gt;
&lt;br /&gt;
    s2scompile –I”C:\STRIDE\inc” –DN=100 file2.h&lt;br /&gt;
    s2sbind –-input_database=test.sidb test.sidb file2.h.meta&lt;br /&gt;
    s2sinstrument –-im_name=test –prototype=p2 -–mode=P(f20,f21) test.sidb&lt;br /&gt;
&lt;br /&gt;
    s2sinstrument –-im_name=test –implement -–mode=SDud#myGroupID(f10,f11) -–mode=P(f20,f21) test.sidb&lt;br /&gt;
&lt;br /&gt;
====Multiple Intercept Modules====&lt;br /&gt;
The compilation, binding and Intercept Module(IM) generation (headers and source) are done incrementally. For each component of the user’s build just a subset of SCL files are compiled, bound to a database (merged into the previously created database) and an IM generated for a set of interfaces defined in those SCL files.&lt;br /&gt;
This example shows how this can be accomplished. Notice that a unique name is specified for each IM when s2sinstrument is called:&lt;br /&gt;
&lt;br /&gt;
    s2scompile –I”C:\STRIDE\inc” –DN=100 file1.h&lt;br /&gt;
    s2sbind –-starting_suid=123 test.sidb file1.h.meta&lt;br /&gt;
    s2sinstrument –-im_name=test1 -–mode=SDud#myGroupID(f1) test.sidb&lt;br /&gt;
&lt;br /&gt;
    s2scompile –I”C:\STRIDE\inc” –DN=100 file2.h&lt;br /&gt;
    s2sbind –-input_database=test.sidb test.sidb file2.h.meta&lt;br /&gt;
    s2sinstrument –-im_name=test2 -–mode=P(f2) test.sidb&lt;br /&gt;
&lt;br /&gt;
====Partial Intercept Module====&lt;br /&gt;
&lt;br /&gt;
By default, the instrumentation of a referenced database generates IM code for all functions. If no &#039;&#039;&#039;--mode&#039;&#039;&#039; option is specified the generate IM code would be all Stub.&lt;br /&gt;
&lt;br /&gt;
    s2sinstrument test.sidb&lt;br /&gt;
&lt;br /&gt;
The user can control that default behavior by passing explicitly &#039;&#039;&#039;--default_mode&#039;&#039;&#039; option. For example to generate Proxy for all functions except for function f3:&lt;br /&gt;
&lt;br /&gt;
    s2sinstrument --default_mode=P --mode=(f3) test.sidb&lt;br /&gt;
&lt;br /&gt;
In certain cases it might be desirable to generate partial intercept module - IM code for only specific set of functions. That requires disabling the default behaviour and listing the requested functions with &#039;&#039;&#039;--mode&#039;&#039;&#039; option. For example to generate Stub|Delegate|User|Dynamic IM code for only functions f1 and f2:&lt;br /&gt;
&lt;br /&gt;
    s2sinstrument --default_mode=# --mode=SDud#myGroupID(f1,f2) test.sidb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Reference]]&lt;br /&gt;
[[Category: Build Tools]]&lt;/div&gt;</summary>
		<author><name>Jaimeg</name></author>
	</entry>
</feed>