<?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=Shamr</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=Shamr"/>
	<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Special:Contributions/Shamr"/>
	<updated>2026-04-28T08:05:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Why_don%27t_Perl_scripts_run_even_when_Script_Engine_shows_Perl%3F&amp;diff=8932</id>
		<title>Studio:Why don&#039;t Perl scripts run even when Script Engine shows Perl?</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Why_don%27t_Perl_scripts_run_even_when_Script_Engine_shows_Perl%3F&amp;diff=8932"/>
		<updated>2009-01-16T18:06:25Z</updated>

		<summary type="html">&lt;p&gt;Shamr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Even when ActiveState Perl is installed and STRIDE Studio&#039;s Script Engine (Tools-&amp;gt;Options-&amp;gt;Script Engines) shows Perl file types (PL, PLS, PM, etc), you may not be able to run Perl scripts or not see the &amp;quot;Run&amp;quot; button on opened Perl scripts within STRIDE Studio or get a pop up box with error message &amp;quot;Could not identify a script engine for this file type. Please reinitialize your script engine list.&amp;quot; One reason could be that ActiveState Perl registration is modified by another program.  It is known that &#039;&#039;&#039;iTunes&#039;&#039;&#039; and &#039;&#039;&#039;Real Player&#039;&#039;&#039; take over the ownership of .pls extension used by ActiveState Perl, on which STRIDE Script Engine relies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To verify the problem:&#039;&#039;&#039;&lt;br /&gt;
* Check the value for .pls extension in the registry: HKEY_CLASSES_ROOT\.pls.  If the associated value is not “PerlScriptFile”, there is a registration problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To fix the problem:&#039;&#039;&#039;&lt;br /&gt;
* Run the following on command prompt:&lt;br /&gt;
  CMD&amp;gt; regsvr32 c:\perl\bin\perlSE.dll&lt;br /&gt;
* Remove all Perl file types (PL, PLS, PM, etc) from STRIDE Studio&#039;s Script Engine (Tools-&amp;gt;Options-&amp;gt;Script Engines) and do a &amp;quot;Scan&amp;quot; again.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To verify the solution:&#039;&#039;&#039;&lt;br /&gt;
* Select each Perl files type and look for the text under the buttons that says “ActiveScript compliant”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Perl Info]]&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Why_don%27t_Perl_scripts_run_even_when_Script_Engine_shows_Perl%3F&amp;diff=8905</id>
		<title>Studio:Why don&#039;t Perl scripts run even when Script Engine shows Perl?</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Why_don%27t_Perl_scripts_run_even_when_Script_Engine_shows_Perl%3F&amp;diff=8905"/>
		<updated>2009-01-14T18:25:18Z</updated>

		<summary type="html">&lt;p&gt;Shamr: modified content slightly&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Even when ActiveState Perl is installed and STRIDE Studio&#039;s Script Engine (Tools-&amp;gt;Options-&amp;gt;Script Engines) shows Perl file types (PL, PLS, PM, etc), you may not be able to run Perl scripts or not see the &amp;quot;Run&amp;quot; button on opened Perl scripts within STRIDE Studio or get a pop up box with error message &amp;quot;Could not identify a script engine for this file type. Please reinitialize your script engine list.&amp;quot; One reason could be that ActiveState Perl registration is modified by another program.  It is known that &#039;&#039;&#039;iTunes&#039;&#039;&#039; and &#039;&#039;&#039;Real Player&#039;&#039;&#039; take over the ownership of .pls extension used by ActiveState Perl, on which STRIDE Script Engine relies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To verify the problem:&#039;&#039;&#039;&lt;br /&gt;
* Check the value for .pls extension in the registry: HKEY_CLASSES_ROOT\.pls.  If the associated value is not “PerlScriptFile”, there is a registration problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To fix the problem:&#039;&#039;&#039;&lt;br /&gt;
* Run the following on command prompt:&lt;br /&gt;
  CMD&amp;gt; regsvr32 c:\perl\bin\perlSE.dll&lt;br /&gt;
* Remove all Perl file types (PL, PLS, PM, etc) from Tools-&amp;gt;Options-&amp;gt;Script Engines and &amp;quot;Scan&amp;quot; again.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To verify the solution:&#039;&#039;&#039;&lt;br /&gt;
* Select each Perl files type and look for the text under the buttons that says “ActiveScript compliant”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Perl Info]]&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=8150</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=8150"/>
		<updated>2008-10-22T20:42:21Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* 3.0.0102 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.01xx (code name &#039;&#039;StoneSteps&#039;&#039;). &lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: An upgrade to the 3.0.0102 release will require a re-issue of all license files as the underlying licensing scheme has changed. See the  [[STRIDE_3.0.01xx#3.0.0102|3.0.0102 Release Notes]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
Note that if you are upgrading from a previous installation &#039;&#039;&#039;you must uninstall your existing STRIDE&#039;&#039;&#039; before installing version 3.0.01xx. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= What&#039;s New  =&lt;br /&gt;
&lt;br /&gt;
Based on customer feedback, in this release we have made significant performance improvements as well as many key usability improvements and bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Performance Improvements ==&lt;br /&gt;
&lt;br /&gt;
Specific improvements have been made in the following areas: &lt;br /&gt;
&lt;br /&gt;
*Database loading time has been improved &lt;br /&gt;
*Compile times are now shorter &lt;br /&gt;
*Scripting operations involving function and message payloads now perform better, especially when arrays are involved &lt;br /&gt;
*Runtime performance has been improved by optimizing payload serialization and deserialization operations&lt;br /&gt;
&lt;br /&gt;
== Usability Improvements ==&lt;br /&gt;
&lt;br /&gt;
=== SCL Wizard ===&lt;br /&gt;
&lt;br /&gt;
The SCL Wizard functionality in [[STRIDE Studio]] has been extended so that you can now use the tool to qualify message payloads as well as function payloads. &lt;br /&gt;
&lt;br /&gt;
In addition, the following types of qualifications can now be made: &lt;br /&gt;
&lt;br /&gt;
*For payloads that include function pointers, the SCL Wizard now supports qualifying the pointers as such and identifying candidate function values &lt;br /&gt;
*Type casts can now be specified on payload members&lt;br /&gt;
&lt;br /&gt;
=== Connection Management ===&lt;br /&gt;
&lt;br /&gt;
Connection management has been greatly simplified; software managing connection to the target system has been integrated into [[STRIDE Studio]] so that connections can be managed directly from there. (It is still possible to access connection management functionality without using Studio.) &lt;br /&gt;
&lt;br /&gt;
The Panel program is no longer used, and there is no longer a requirement to load the database to communicate with a remote target. &lt;br /&gt;
&lt;br /&gt;
==== Transport Properties ====&lt;br /&gt;
&lt;br /&gt;
All transport properties can now be accessed via scripts. A new transport scripting model makes this possible.&lt;br /&gt;
&lt;br /&gt;
=== STRIDE Studio Test Runner Improvements ===&lt;br /&gt;
&lt;br /&gt;
The test runner in [[STRIDE Studio]] has incorporated several functional and usability improvements. &lt;br /&gt;
&lt;br /&gt;
*Each runnable script and folder (Suite) in a workspace now has additional properties that allow you to optionally specify a handler script that will be executed in the case of an unhandled error (property OnError) or a timeout (property OnTimeout). A timeout value can be set for each folder.&lt;br /&gt;
&lt;br /&gt;
*Each runnable folder (Suite) in a workspace now has a property (OnRunConnect) that can instruct STRIDE Studio to automatically connect to a target system before the folder is executed.&lt;br /&gt;
&lt;br /&gt;
*The workspace now has a dynamic property (ExecutionState) that allows you to alter the order of script execution at runtime.&lt;br /&gt;
&lt;br /&gt;
=== New Frameworks Feature ===&lt;br /&gt;
&lt;br /&gt;
This version introduces [[Using Frameworks|Target Frameworks]], which provide customizable templates for workspace creation. The use of frameworks simplifies the use of STRIDE and ensures consistency across a development team. &lt;br /&gt;
&lt;br /&gt;
Several [[Provided Frameworks|reference frameworks]] are included in this release, supporting the following target environments: &lt;br /&gt;
&lt;br /&gt;
*[[Provided Frameworks#Windows|Windows]] &lt;br /&gt;
*[[Provided Frameworks#Linux|Linux]] &lt;br /&gt;
*[[Provided Frameworks#WinMobile|WinMobile]] &lt;br /&gt;
*[[Provided Frameworks#Generic|Generic]]&lt;br /&gt;
&lt;br /&gt;
[[Using Packages|Packages]] are also introduced. These provide a convenient way to encapsulate SCL-annotated source code and corresponding tests for a set of interfaces. &lt;br /&gt;
&lt;br /&gt;
=== Uploading Results to STRIDE Portal ===&lt;br /&gt;
&lt;br /&gt;
Uploading test results from STRIDE Reporter to STRIDE Portal has been integrated into STRIDE Studio. Portal&#039;s server information can be configured from Studio&#039;s workspace properties while uploading results to Portal can be enabled or disabled via workspace context menu. If enabled, after running the workspace, a script folder or a script file, results in Report file will automatically be uploaded to the configured server. &lt;br /&gt;
&lt;br /&gt;
== Build Tools  ==&lt;br /&gt;
&lt;br /&gt;
A set of new command line [[Build Tools]] has been implemented: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Stride compiler&#039;&#039;&#039; &lt;br /&gt;
*&#039;&#039;&#039;Stride database binder&#039;&#039;&#039; &lt;br /&gt;
*&#039;&#039;&#039;Stride instrumentation generator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with a &amp;quot;make&amp;quot; build environment.&lt;br /&gt;
&lt;br /&gt;
== Target-Based Testing  ==&lt;br /&gt;
&lt;br /&gt;
Target-based (xUnit-style) testing has been simplified. The new set of SCL pragmas [[Test Units]] can now be included in a source file to tell the compiler and IM generator to automatically create test harnessing code.&lt;br /&gt;
&lt;br /&gt;
The automation components STRIDE.testclass, STRIDE.testunit and STRIDE.testfunction are removed.&lt;br /&gt;
&lt;br /&gt;
== Runtime/PAL  ==&lt;br /&gt;
&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Target_Integration#The STRIDE Runtime|STRIDE Runtime]] and [[Target_Integration#The Platform Abstraction Layer (PAL)|PAL]]. &lt;br /&gt;
&lt;br /&gt;
=== Multi-Process Targets  ===&lt;br /&gt;
&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process targets. Changes include: implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
=== Logging (Optional)  ===&lt;br /&gt;
&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL. &lt;br /&gt;
&lt;br /&gt;
== Windows Off-Target SDK  ==&lt;br /&gt;
&lt;br /&gt;
A new [[Windows_Off-Target_SDK|SDK]] for implemention of Off-Target applications on Windows has been packaged. It contains a library (s2srWin.dll/lib) in which the Windows PAL, Runtime, and GRS and a set of utility scripts are prebuilt. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; library, a prebuilt verion of the Host Runtime, has been removed. Building Windows applications using the Host Runtime is not supported anymore. The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; library, a prebuilt version of the Target Runtime, has also been removed. &lt;br /&gt;
&lt;br /&gt;
If an upgrade is performed it is strongly recommended that the above mentioned &#039;&#039;&#039;s2shostapp*&#039;&#039;&#039; libraries and their public API header (hostapp.h) be manually removed.&lt;br /&gt;
&lt;br /&gt;
= Support Wiki =&lt;br /&gt;
&lt;br /&gt;
This support wiki http://support.s2technologies.com is introduced with this version. You can navigate here from your web browser, or directly from STRIDE Studio; a link is provided in the Help menu. &lt;br /&gt;
&lt;br /&gt;
== STRIDE Samples  ==&lt;br /&gt;
&lt;br /&gt;
We have created a set of [[Samples_Overview|sample workspaces]] to aid in the evaluation of STRIDE, or as a tool for learning how to apply STRIDE to different testing scenarios. &lt;br /&gt;
&lt;br /&gt;
If you&#039;re new to STRIDE, or want to learn more about using the product, this is a great place to start.&lt;br /&gt;
&lt;br /&gt;
= Acquiring the Software =&lt;br /&gt;
&lt;br /&gt;
You can download the latest release from the S2 Technologies ftp site: ftp://ftp.s2technologies.com &lt;br /&gt;
&lt;br /&gt;
To run STRIDE you will need a license. 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;
= Installing the Software  =&lt;br /&gt;
&lt;br /&gt;
To install STRIDE for the first time, or as an upgrade to an existing installation, please refer to [[Host Installation]]. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
Note: if you are upgrading from a previous installation &#039;&#039;&#039;you must uninstall your existing STRIDE&#039;&#039;&#039; before installing version 3.0.01xx. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you are new to STRIDE, we recommend that you investigate the [[Samples_Overview|New STRIDE Samples]].&lt;br /&gt;
&lt;br /&gt;
= Change Details  =&lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;ascript&#039;&#039;&#039; API has been changed to be more robust: &lt;br /&gt;
**Certain deprecated methods have been eliminated. &lt;br /&gt;
**Some existing API methods have been modifed. &lt;br /&gt;
**The event model has been improved to allow greater script control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Some scripts must be modified from previous versions of STRIDE to work successfully with 3.0.01xx. The necessary changes are detailed in the [[#Migration_to_3.0.01xx|Migration to 3.0.01xx]] section below. &lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Panel&#039;&#039;&#039; object is no longer available to scripts; its functionality has been moved under the &#039;&#039;&#039;studio&#039;&#039;&#039; object model. You can access this new functionality as &#039;&#039;&#039;studio.Connection&#039;&#039;&#039;, however if you were formerly scripting the &#039;&#039;&#039;Panel&#039;&#039;&#039; object, you may find it is no longer necessary since: &lt;br /&gt;
**You can now configure your connection properties from within STRIDE Studio (from the menu select &#039;&#039;Tools/Target Connectivity&#039;&#039;) &lt;br /&gt;
**You can now set a workspace folder property to autoconnect upon execution&lt;br /&gt;
&lt;br /&gt;
*Zero is now allowed as the maximum size under certain circumstances in &#039;&#039;&#039;scl_string&#039;&#039;&#039; and &#039;&#039;&#039;scl_ptr_sized&#039;&#039;&#039;. Details of these circumstances are contained in the &#039;&#039;&#039;[[Media:s2sSCLReferenceGuide.pdf|SCL Reference Guide]]&#039;&#039;&#039; document.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;studio.Workspace.Compiler.MicrosoftCompatibility&#039;&#039;&#039; has been replaced with &#039;&#039;&#039;studio.Workspace.Compiler.Compatibility&#039;&#039;&#039;. Valid values are &amp;quot;Generic&amp;quot; (generic mode), &amp;quot;Microsoft&amp;quot; (Microsoft compatibility), or &amp;quot;Gnu&amp;quot; (Gnu or Gcc compatibility).&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;studio.Workspace.Compile()&#039;&#039;&#039; has been replaced with &#039;&#039;&#039;studio.Workspace.Build()&#039;&#039;&#039;. Also new methods, &#039;&#039;&#039;studio.Workspace.CleanBuild()&#039;&#039;&#039; and &#039;&#039;&#039;studio.Workspace.ReloadDatabase()&#039;&#039;&#039;, have been added.&lt;br /&gt;
&lt;br /&gt;
*A new property, &#039;&#039;&#039;Output&#039;&#039;&#039;, has been added off the studio object. This property outputs text to the Studio message tab, similar to how &#039;&#039;&#039;ascript.MessageBox()&#039;&#039;&#039; works for certain scripts. This property contains one method, &#039;&#039;&#039;PrintMessage(String msg)&#039;&#039;&#039;. You can see an example of its use [[Debugging Helps|here]].&lt;br /&gt;
&lt;br /&gt;
*A new settings group has been introduced - &#039;&#039;&#039;studio.Workspace.Settings.Build&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;studio.Workspace.Intercept.Path&#039;&#039;&#039; has been replaced with &#039;&#039;&#039;studio.Workspace.Intercept.SourcePath&#039;&#039;&#039; and &#039;&#039;&#039;studio.Workspace.Intercept.HeaderPath&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Fixes  ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This section describes defects which have been corrected in STRIDE and the customer tracking number associated with them, if any, in brackets [].&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
*[1055] Not able to specifiy uppercase include directory &lt;br /&gt;
*[1163] Certain cases of array of pointers to discriminated unions that were not handled correctly in the ascript object have been fixed. &lt;br /&gt;
*[1357] The ascript &#039;&#039;&#039;Call()&#039;&#039;&#039; method, when used with RspTimeoutPeriod, only returns True if a timeout has occurred. &lt;br /&gt;
*[1469] Global casting using &#039;&#039;&#039;scl_cast&#039;&#039;&#039; no longer causes an intercept module compile error. &lt;br /&gt;
*[1539] &#039;&#039;&#039;ascript&#039;&#039;&#039; no longer returns &amp;quot;undefined&amp;quot; when calling &#039;&#039;&#039;function.ReturnValue&#039;&#039;&#039; when the captured function returns an unqualified function pointer. &lt;br /&gt;
*[1543] IM source file locations added to studio UI and automation &lt;br /&gt;
*[1564] The Studio Add files dialog has been increased from 2K bytes to 100K bytes, to allow for more files to be selected at a time. &lt;br /&gt;
*[1586] Support for Variadic Macros &lt;br /&gt;
*[1597] EDGFront crash for scl_ptr_opaque &lt;br /&gt;
*[1600] Pre-processor treats constant 1 always as 8-bit &lt;br /&gt;
*[1605] Generated Perl script generates error when run in debugger &lt;br /&gt;
*The following statement in Runtime files &#039;&#039;&#039;srtest.c&#039;&#039;&#039; and &#039;&#039;&#039;srtest.cpp&#039;&#039;&#039; has been changed:&amp;lt;br&amp;gt;&amp;lt;tt&amp;gt;va_list args = 0;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;is now&amp;lt;br&amp;gt;&amp;lt;tt&amp;gt;va_list args;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; with no initializer. This makes it portable and able to compile under Linux. &lt;br /&gt;
*A macro that determines the existence of &#039;&#039;&#039;vsnprintf()&#039;&#039;&#039; has been updated in &#039;&#039;&#039;srtest.c&#039;&#039;&#039; and &#039;&#039;&#039;srtest.cpp&#039;&#039;&#039; in order to make it able to compile with GCC and other non-Microsoft compilers.&amp;lt;br&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using test functions and C++ test classes, you must be using compilers that support &#039;&#039;&#039;vsnprintf&#039;&#039;&#039; (variable argument lists), which is a standard in C99 and supported in C90. &lt;br /&gt;
*When tracing on a STID it&#039;s possible to display trace information for messages that aren&#039;t captured (i.e. the message&#039;s SMID is not known to STRIDE). A problem could occur when STRIDE attempted to interpret the payload of these messages. This has now been fixed; hex values only are now shown in the trace view for in this situation. &lt;br /&gt;
*Autosense was not working properly in the editor for message payloads. This has been fixed.&lt;br /&gt;
&lt;br /&gt;
== AutoScript  ==&lt;br /&gt;
&lt;br /&gt;
=== TestUnits Collection  ===&lt;br /&gt;
&lt;br /&gt;
A new TestUnits collection has been implemented. All test interfaces (specified with [[SCL_Pragmas#Test_Units | Test Unit pragmas]]) will be listed there.&lt;br /&gt;
&lt;br /&gt;
=== Functions Collection  ===&lt;br /&gt;
&lt;br /&gt;
Interfaces specified with either the [[scl_test_class]] or [[scl_test_flist]] pragmas are not listed in the Functions collection anymore. &lt;br /&gt;
&lt;br /&gt;
== PAL  ==&lt;br /&gt;
&lt;br /&gt;
=== Memory Management  ===&lt;br /&gt;
&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory. &lt;br /&gt;
&lt;br /&gt;
=== Protection using Mutex  ===&lt;br /&gt;
&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects. &lt;br /&gt;
&lt;br /&gt;
=== New Routines  ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments. &lt;br /&gt;
&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is optional. &lt;br /&gt;
&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
=== Updated Routines  ===&lt;br /&gt;
&lt;br /&gt;
*Function signatures and functionalities of palWait() &amp;amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
*Function signatures of palMemAlloc() &amp;amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
=== Removed Routines  ===&lt;br /&gt;
&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
=== Removed Modules  ===&lt;br /&gt;
&lt;br /&gt;
 S2Mem - The memory module provided as part of PAL has been removed. If a native &lt;br /&gt;
         operating system does not support dynamic memory, the Runtime&#039;s memory &lt;br /&gt;
         management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Runtime ==&lt;br /&gt;
&lt;br /&gt;
*STRIDE Host Release &#039;&#039;&#039;3.0.01xx&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;. &lt;br /&gt;
*In order to eliminate redundancy and promote an object-oriented design, &amp;quot;Member Methods&amp;quot; have been removed from srTest; only &amp;quot;Member Objects&amp;quot; exist now in srTest. In addition, accessing the functionality of Member Objects in this way is similar to accessing scripting objects through the STRIDE Reporter object model. For a detailed explanation, refer to [[Test_Units#C.2B.2B_Test_Classes|this article]] on the STRIDE Support Wiki. &lt;br /&gt;
*A new routine, &#039;&#039;&#039;srInit()&#039;&#039;&#039;, replaces deprecated &#039;&#039;&#039;srInitialize()&#039;&#039;&#039;. Now the target will not be able to set an auto-connect with timeout. &lt;br /&gt;
*The &#039;&#039;&#039;scl_tp&#039;&#039;&#039; and &#039;&#039;&#039;scl_tp_format&#039;&#039;&#039; pragmas have been deprecated. The new pragmas are &#039;&#039;&#039;scl_tracepoint&#039;&#039;&#039; and &#039;&#039;&#039;scl_tracepoint_format&#039;&#039;&#039;. &lt;br /&gt;
*The default runtime configuration in srcfg.h now has fragmentation turned on. The srCFG_MAX_TRANSPORT_UNIT is set to 2048. &lt;br /&gt;
*Fixed warnings for parameter name differences in function declarations and definitions for srSubscribe(), srTracePoint(), and srQuerySMID(). &lt;br /&gt;
*Removed unnecessary/extra response to srCONNECT_CLOSE_T_SMID message. &lt;br /&gt;
*The Runtime now checks for the connection before responding with a &amp;quot;Pong&amp;quot; upon receiving a &amp;quot;Ping.&amp;quot; &lt;br /&gt;
*Introduced 40 additional system trace points to better describe internal errors. &lt;br /&gt;
*Reporting of the error srERR_SUB_NONE has been suppressed so that it no longer generates a target trace error. &lt;br /&gt;
*Trace views now always display srTraceStr() with reserved STID (srSTID_RESERVED) regardless of trace filter settings. &lt;br /&gt;
*srPtrSetupChild() now accepts NULL for handle (out pointer - pwHandle). &lt;br /&gt;
*Added a new Runtime Test Services (RTS) API &#039;&#039;&#039;srTestCaseSetStatusEx()&#039;&#039;&#039;, which enables the providing of the actual return value of a numeric test method in the case of failure. &lt;br /&gt;
*Added two new public APIs - &amp;quot;Printing&amp;quot; APIs to display messages on Trace Views without having to specify a STID or a trace level and to set any trace filters on Trace Views. These routines support formatted strings with variable arguments. The &#039;&#039;&#039;srPrintInfo()&#039;&#039;&#039; will show as srTraceStr() with STID=0 and Level=3. The &#039;&#039;&#039;srPrintError()&#039;&#039;&#039; will show as srTraceStr() with STID=0 and the Level=1. &#039;&#039;&#039;Warning:&#039;&#039;&#039; These new APIs use vsnprintf() routine to process variable arguments. The vsnprintf() became a standard in C99 and is supported in C90. &lt;br /&gt;
*To support multi-process target, significant changes have been made to runtime. &lt;br /&gt;
*A new public routine, srUninit(), has been added to sr.h &amp;amp;amp; srapi.c. &lt;br /&gt;
* A new public routine for Runtime Thread exit point, srThreadUninit(), has been added to sr.h &amp;amp;amp; srthread.c. &lt;br /&gt;
*A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp;amp; palMemFree() in case of multi-process target is enabled. &lt;br /&gt;
*Calls to palProtect() &amp;amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines. &lt;br /&gt;
*In target Test Classes and Test Functions, added capability to specify the comment label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
* Fixed a potential data abort issue when executing delegate code in the IM prior to Runtime being initialized.&lt;br /&gt;
* Runtime Test Services APIs are now thread safe. &lt;br /&gt;
* Fixed cancelation of remote boadcast subcribtion goes in an infinite loop.&lt;br /&gt;
* Fixed Runtime resource abuse when sending lots of broadcast messages. &lt;br /&gt;
* Added partial check for message payload corectness.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;The following Runtime files have been modified:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srapi.h&lt;br /&gt;
 srapirgl.c&lt;br /&gt;
 srapirgl.h&lt;br /&gt;
 srcfg.h&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srerr.c&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribctrl.c&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgmar.c&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtest.c&lt;br /&gt;
 srtest.cpp&lt;br /&gt;
 srtest.c&lt;br /&gt;
 srtest.h&lt;br /&gt;
 srtestutil.c&lt;br /&gt;
 srtestutil.h&lt;br /&gt;
 srthread.c&lt;br /&gt;
 srthread.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
 srtp.h&lt;br /&gt;
 srutil.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;The following Runtime files have been added:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
= Migration to 3.0.01xx  =&lt;br /&gt;
&lt;br /&gt;
Recommended steps for migration from a previous version: &lt;br /&gt;
&lt;br /&gt;
== AutoScript  ==&lt;br /&gt;
&lt;br /&gt;
Any use of test classes through the Functions collection, like: &lt;br /&gt;
&lt;br /&gt;
  $main::ascript-&amp;amp;gt;Functions-&amp;amp;gt;Item(&amp;quot;my_test_class&amp;quot;)-&amp;amp;gt;User-&amp;amp;gt;Call(); &lt;br /&gt;
&lt;br /&gt;
should be converted to use the new TestUnits collection: &lt;br /&gt;
&lt;br /&gt;
  $main::ascript-&amp;amp;gt;TestUnits-&amp;amp;gt;Item(&amp;quot;my_test_class&amp;quot;)-&amp;amp;gt;Run(); &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
=== API Changes  ===&lt;br /&gt;
&lt;br /&gt;
*The Support Wiki pages now contain reference help for [[AutoScript#ascript|&#039;&#039;AutoScript&#039;&#039;]]. &lt;br /&gt;
*All synchronous method calls now throw exceptions in order to indicate error conditions rather than have error conditions encoded in return values. &lt;br /&gt;
*Asychronous method calls never throw exceptions to indicate error conditions. Instead, error conditions are delivered as a new Error object that is returned to &#039;&#039;&#039;ascript.WaitForEvent()&#039;&#039;&#039;. (Asynchronous methods are &#039;&#039;&#039;function.Owner.Return()&#039;&#039;&#039;, &#039;&#039;&#039;function.User.CallNonBlocking()&#039;&#039;&#039;, &#039;&#039;&#039;function.User.CallBypassOverrideNonBlocking()&#039;&#039;&#039;, &#039;&#039;&#039;message.Owner.Broadcast()&#039;&#039;&#039;, &#039;&#039;&#039;message.Owner.SendRsp()&#039;&#039;&#039;, &#039;&#039;&#039;message.User.SendCmd()&#039;&#039;&#039;, and &#039;&#039;&#039;message.User.SendCmdBypassOverride()&#039;&#039;&#039;) &lt;br /&gt;
*If &#039;&#039;&#039;ascript.WaitForEvent()&#039;&#039;&#039; times out, an Error object is returned. Previously NULL was returned in this case. &lt;br /&gt;
*All objects returned by &#039;&#039;&#039;ascript.WaitForEvent()&#039;&#039;&#039; have &#039;&#039;&#039;Type&#039;&#039;&#039; and &#039;&#039;&#039;Name&#039;&#039;&#039; properties. When the &#039;&#039;&#039;Type&#039;&#039;&#039; is “Error”, the Error object has additional properties that contain further details about the error. &lt;br /&gt;
*All existing script syntax for designation of message payloads has been deprecated. A new syntax that allows for greater expression has been adopted. Details can be found [[Updated Message Payload Syntax|here]]. There are no syntax changes to function payloads. &lt;br /&gt;
*The signature for &#039;&#039;&#039;ascript.Initialize&#039;&#039;&#039; has been changed. Successful calls to &#039;&#039;&#039;ascript.Initialize&#039;&#039;&#039; now fully initialize the object.&lt;br /&gt;
&lt;br /&gt;
=== End-Of-Life Methods and Properties  ===&lt;br /&gt;
&lt;br /&gt;
This release marks the End-Of-Life (EOL) for the listed methods and properties. A call to any of these methods or an access to any of these properties will now result in a not-implemented exception in the script making the call or access. &lt;br /&gt;
&lt;br /&gt;
*ascript.Quit() &lt;br /&gt;
*ascript.Interfaces &lt;br /&gt;
*ascript.NamedEvents &lt;br /&gt;
*ascript.WaitForEventWithTimeout &lt;br /&gt;
*ascript.RspTimeoutNotifyEnabled &lt;br /&gt;
*ascript.CreateTimer() &lt;br /&gt;
*ascript.DestroyTimer() &lt;br /&gt;
*ascript.WaitTimeoutNotifyEnabled &lt;br /&gt;
*ascript.Compare_As_C_Values() &lt;br /&gt;
*ascript.AsyncErrorNotifyEnabled &lt;br /&gt;
*ascript.Function.Item().User/Owner.SMID&lt;br /&gt;
&lt;br /&gt;
=== Recommended Steps for Migration From a Previous Version  ===&lt;br /&gt;
&lt;br /&gt;
*Search for calls to &#039;&#039;&#039;ascript.WaitForEvent()&#039;&#039;&#039; in all scripts. Previous logic to test for null indicating timeouts must be modified. &#039;&#039;&#039;WaitForEvent()&#039;&#039;&#039; now always returns an object, in the case of a timeout (or other error) an Error object is returned. &lt;br /&gt;
*Search for calls to &#039;&#039;&#039;ascript.Quit&#039;&#039;&#039; in all scripts. Modify the logic as necessary to exit the script by other means in place of the original &#039;&#039;&#039;Quit()&#039;&#039;&#039; call. &lt;br /&gt;
*Search for all asynchronous method calls (Asynchronous calls are limited to &#039;&#039;&#039;function.Owner.Return()&#039;&#039;&#039;, &#039;&#039;&#039;function.User.CallNonBlocking()&#039;&#039;&#039;, &#039;&#039;&#039;function.User.CallBypassOverrideNonBlocking()&#039;&#039;&#039;, &#039;&#039;&#039;message.Owner.Broadcast()&#039;&#039;&#039;, &#039;&#039;&#039;message.Owner.SendRsp()&#039;&#039;&#039;, &#039;&#039;&#039;message.User.SendCmd()&#039;&#039;&#039;, and &#039;&#039;&#039;message.User.SendCmdBypassOverride()&#039;&#039;&#039;). Modify the logic as necessary to call &#039;&#039;&#039;ascript.WaitForEvent()&#039;&#039;&#039; if errors (including timeout error) should be detected. &lt;br /&gt;
*If you have scripts that explicitly instantiate an &#039;&#039;&#039;ascript&#039;&#039;&#039; object (i.e. they create an object using the &#039;&#039;&#039;&amp;quot;STRIDE.ascript&amp;quot;&#039;&#039;&#039; PROGID), search for all occurrences and modify the subsequent call to &#039;&#039;&#039;ascript.Initialize()&#039;&#039;&#039; to pass the new parameter set. &lt;br /&gt;
*Search for all EOL&#039;d methods and properties. Each can be replaced by setting the appropriate timeout property and handling the timeout error object delivered by WaitForEvent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;Section1&amp;quot;&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;width: 100%; border-collapse: collapse;&amp;quot; class=&amp;quot;MsoTableGrid&amp;quot;&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border: 1pt solid windowtext; padding: 0in 5.4pt; background: rgb(204, 255, 204) none repeat scroll 0% 50%; width: 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;EOL’d&#039;&#039;&#039;&amp;lt;/span&amp;gt;&#039;&#039;&#039;Method or Property&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; background: rgb(204, 255, 204) none repeat scroll 0% 50%; width: 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;&amp;quot; | &lt;br /&gt;
&#039;&#039;&#039;Recommended Replacement&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.Quit&#039;&#039;&#039;&amp;lt;/span&amp;gt;&#039;&#039;&#039;()&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;Refactor&amp;lt;/span&amp;gt; script logic to exit the script by other means. &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.Interfaces&#039;&#039;&#039;&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
Use &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.Functions&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.Messages&amp;lt;/span&amp;gt; as appropriate. &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.NamedEvents&#039;&#039;&#039;&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
Contact S2 Technologies &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.WaitForEventWithTimeout&#039;&#039;&#039;&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
Use &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.WaitForEvent&amp;lt;/span&amp;gt;() after setting desired timeout using &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.WaitTimeoutPeriod&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.RspTimeoutNotifyEnabled&#039;&#039;&#039;&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
No longer needed. Timeout notifications are performed by returning an Error object from &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.WaitForEvent&amp;lt;/span&amp;gt;() &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.CreateTimer&#039;&#039;&#039;&amp;lt;/span&amp;gt;&#039;&#039;&#039;()&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
Use &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.Timers.Add&amp;lt;/span&amp;gt;() &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.DestroyTimer&#039;&#039;&#039;&amp;lt;/span&amp;gt;&#039;&#039;&#039;()&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
Use &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.Timers.Remove&amp;lt;/span&amp;gt;() &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.WaitTimeoutNotifyEnabled&#039;&#039;&#039;&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
No longer needed. Timeout notifications are performed by returning an Error object from &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.WaitForEvent&amp;lt;/span&amp;gt;() &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.Compare_As_C_Values&#039;&#039;&#039;&amp;lt;/span&amp;gt;&#039;&#039;&#039;()&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
Contact S2 Technologies &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.AsyncErrorNotifyEnabled&#039;&#039;&#039;&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
No longer needed. Error notification from asynchronous calls is performed by returning an Error object from &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.WaitForEvent&amp;lt;/span&amp;gt;() &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;&#039;&#039;&#039;ascript.Function.Item&#039;&#039;&#039;&amp;lt;/span&amp;gt;&#039;&#039;&#039;().User/&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;Owner.SMID&amp;lt;/span&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; style=&amp;quot;border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 50%;&amp;quot; | &lt;br /&gt;
Use &amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;ascript.Function.Item&amp;lt;/span&amp;gt;().User/&amp;lt;span class=&amp;quot;SpellE&amp;quot;&amp;gt;Owner.SUID&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PAL  ==&lt;br /&gt;
&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines. &lt;br /&gt;
&lt;br /&gt;
*Implement new shared memory routines, palMemSegmentOpen() &amp;amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
*Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
*Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
*Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
*Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
*Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
*Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
*If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
*Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
== Runtime  ==&lt;br /&gt;
&lt;br /&gt;
*Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
*Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
*If target Test Classes and Test Functions are used, change the signature to include test label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
== Windows Applications using Windows Off-Target SDK  ==&lt;br /&gt;
&lt;br /&gt;
Existing Host Apps developed against the old &#039;&#039;&#039;hostapphrt&#039;&#039;&#039; and &#039;&#039;&#039;hostapptrt&#039;&#039;&#039; libraries should be updated to use the new [[Windows_Off-Target_SDK|s2srwin]] library as follows: &lt;br /&gt;
*replace the include of hostapp.h with include of srwin.h &lt;br /&gt;
*replace all calls to HostAppXXX() with srWin_XXX() &lt;br /&gt;
*call srWin_SetMaster() to start the runtime thread, srThread, before calling srWin_Run().&amp;lt;br&amp;gt;Within a multi-process target, only one process (the master) calls this routine.&lt;br /&gt;
*replace srHOST preprocessor definition with srWIN32&lt;br /&gt;
&lt;br /&gt;
= Minor and Patch releases =&lt;br /&gt;
== 3.0.0101 Patch &amp;quot;a&amp;quot; ==&lt;br /&gt;
* Linux version of the STRIDE [[Build Tools]] is officially introduced.&lt;br /&gt;
* Fixed several minor issues in [[STRIDE Studio]].&lt;br /&gt;
&lt;br /&gt;
== 3.0.0101 Patch &amp;quot;b&amp;quot; ==&lt;br /&gt;
* Relaxed [[scl_cast]]() pragma to allow cast from any integral ptr to union of ptrs&lt;br /&gt;
* Fixed compile warnings in Linux PAL.&lt;br /&gt;
* Fixed issue in instrumentation of [[Test Units]].&lt;br /&gt;
* Fixed issue with UNC paths.&lt;br /&gt;
* Fixed several minor issues in [[STRIDE Studio]].&lt;br /&gt;
&lt;br /&gt;
== 3.0.0102 ==&lt;br /&gt;
* Implemented new licensing scheme. Existing licenses will not work anymore and need to be reissued. Old and new licenses could co-exist at the same location.&lt;br /&gt;
* The syntax of [[scl_ptr]] and [[scl_ptr_sized]] pragmas has changed. Now it is required to quote the direction and usage attributes. See this [[Handling_of_pointer_attribute_tokens|page]] for details.&lt;br /&gt;
* [[Test_Units#Runtime_Test_Services|Runtime Test Services]] now support adding annotations per test suite.&lt;br /&gt;
* A complete set of [[Samples]] has been implemented.&lt;br /&gt;
* Fixed several minor issues in STRIDE [[Build Tools]].&lt;br /&gt;
* In [[STRIDE Studio]] the processing of Trace information has been optimized.&lt;br /&gt;
* Fixed several minor issues in [[STRIDE Studio]]. &lt;br /&gt;
* Fixed several minor issues in [[AutoScript]]. &lt;br /&gt;
* Updated [[Linux_PAL|PAL for Linux]] to include a generalized Linux Daemon for Runtime.&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0102&#039;&#039;&#039; is compatible with the Runtime Versions &#039;&#039;&#039;3.00&#039;&#039;&#039; and &#039;&#039;&#039;3.01&#039;&#039;&#039;.&lt;br /&gt;
*&#039;&#039;The following Runtime files have been modified:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srtest.c&lt;br /&gt;
 srtest.cpp&lt;br /&gt;
 srtest.h&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[Category:3.0.01xx]]&lt;br /&gt;
[[Category:Release Notes]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Intercept_Module&amp;diff=8048</id>
		<title>Intercept Module</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Intercept_Module&amp;diff=8048"/>
		<updated>2008-10-13T22:41:34Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* About Intercept Modules&amp;lt;br&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Intercept Modules&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
Intercept Modules allow remote function calls across hardware (e.g., processor or machine) or software (operating system) platform boundaries. Intercept Modules are target-based components that are created as a step in the STRIDE build process (see the [[Build Tools|Build Tools]] page). The Intercept Module, or IM, is created based on selected interfaces or test units that have been &amp;quot;captured&amp;quot;, or identified through a subset of SCL pragmas that tag interfaces as candidates for remote function calls. Once created, the generated code is then compiled, linked and run along with the target application.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The [[s2sinstrument]] executable, or alternatively, the Intercept Module Wizard in Studio generate the code for an intercept module for selected functions or test units. Generation can be tailored to include different instrumentation details for each function. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Three files are created, each prepended with the name of the Intercept Module that you gave it when it was created: &lt;br /&gt;
&lt;br /&gt;
*The Intercept Module source file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.c&#039;&#039;&#039; or &#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.cpp&#039;&#039;&#039;)&amp;lt;br&amp;gt;This file contains the code that allows the &#039;&#039;remoting&#039;&#039; of functions so that they can be accessed by the Target and Host. &lt;br /&gt;
*The Delegate Mangling header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.h&#039;&#039;&#039;)&amp;lt;br&amp;gt;This file must be included in all of your C files that are using Delegates (Dynamic or Tracing). It contains macros that will mangle the appropriate function names so that they can be intercepted and routed through the IM. When used, it must be the last file &amp;lt;tt&amp;gt;#include&amp;lt;/tt&amp;gt;&#039;d in the source. Also, it is only required if the C file uses Delegates. Stubs and Proxy functions do not require this file &lt;br /&gt;
*The IM Entry point header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IMEntry.h&#039;&#039;&#039;)&amp;lt;br&amp;gt;This file contains the prototypes for the external entry points into the IM. It is needed only by the function that starts the IM Stub Read Thread.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The following examples describe integration and testing situations that would require generation of one or more intercept modules: &lt;br /&gt;
&lt;br /&gt;
*To call a function on the target platform from the host, you must generate an intercept module containing a &#039;&#039;&#039;stub&#039;&#039;&#039; and include it in the target build. &lt;br /&gt;
*To call a function on the host platform from a function on the target, you must generate an intercept module containing a &#039;&#039;&#039;proxy&#039;&#039;&#039; and include it in the target build. &lt;br /&gt;
*To trace on that function resides wholly on the target (e.g., both the called and the calling functions are co-located on the target platform), you must generate an intercept module containing a &#039;&#039;&#039;tracing delegate&#039;&#039;&#039; and include it in the target build. &lt;br /&gt;
*To be able to dynamically &amp;quot;move&amp;quot; a function back and forth between host and target platforms during integration and testing without rebuilding the target application, you must generate an intercept module containing a &#039;&#039;&#039;dynamic delegate&#039;&#039;&#039; and include it in the target build.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stubs, Proxies, and Delegates&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
Target instrumentation is handled via stubs, proxies, and delegates, each of which provide distinct functionality.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Image:PROXYSTUB.gif|center]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Stub&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&lt;br /&gt;
A stub is required in order to call a function, f(), on the target from the host. &lt;br /&gt;
&lt;br /&gt;
The stub performs two main tasks: &lt;br /&gt;
&lt;br /&gt;
*Provides a handler for incoming host invocations and transparently converts them into local calls to f(). &lt;br /&gt;
*Captures the return and output values of the local call and transmits them back to the host.&lt;br /&gt;
&lt;br /&gt;
When a proxy and a stub exist for a given function, the stub is never on the same platform as the proxy. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Proxy&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&lt;br /&gt;
A proxy is required in order to transparently intercept a target call to a function, f(), and remote the call to a host implementation of f(). &lt;br /&gt;
&lt;br /&gt;
The proxy performs two main tasks: &lt;br /&gt;
&lt;br /&gt;
*Intercepts local calls to f() and transfers the call, along with parameter data, to the host implementation. &lt;br /&gt;
*Captures the host response containing return values and output data, and transparently returns the information to the local caller.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a proxy and a stub exist for a given function, the stub is never on the same platform as a proxy. When more than one proxy exists for a given function, each proxy must be located on a different platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; A stub and a proxy cannot simultaneously coexist for the same function. Only one can be used for any given test configuration. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Delegate&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&lt;br /&gt;
A delegate is a specialized type of proxy. A delegate can perform the following tasks: &lt;br /&gt;
&lt;br /&gt;
*Transparently trace all calls to a method, f(), whose implementation resides on the target. All calls and parameter data can be captured and recorded. This type of delegate is called a &#039;&#039;&#039;Tracing Delegate&#039;&#039;&#039;. &lt;br /&gt;
*Transparently route calls to either a target- or host-based implementation of f(). This routing is dynamic and controlled by the host. This type of delegate is called a &#039;&#039;&#039;Dynamic Delegate&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A Tracing Delegate intercepts calls to f() and records tracing information such as time, input parameters, etc. before passing control to the local implementation of f(). Upon the return from f(), the delegate again records tracing information before passing control back to the caller. The delegate inserts itself between the caller and the callee in order to capture tracing information. &lt;br /&gt;
&lt;br /&gt;
A Dynamic Delegate inserts itself between the caller and the callee in the same way as a Tracing Delegate, but its logic is different. In addition to recording tracing information, it contains logic to check certain state information to determine whether to route the call to a host implementation (and override the owner) of f(), or to allow the call to proceed to the local implementation (owner) of f(). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; A Dynamic Delegate is always a Tracing Delegate, but depending upon instructions you give the Intercept Module Wizard, a Tracing Delegate may or may not be a Dynamic Delegate.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== Delegate Options&amp;lt;br&amp;gt;  ====&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;Owner/User&#039;&#039;&amp;lt;br&amp;gt;  ====&lt;br /&gt;
&lt;br /&gt;
To insert a delegate between a user (calling) function and owner (called) function, you must choose how function [[Name Mangling|name mangling]] will be handled. Name mangling describes the automatic source transformation required for a delegate to insert itself between caller and callee. There are two options for handling name mangling, one of which must be chosen when using delegates:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#A call to a function f() is transformed to &amp;quot;__imf()” to allow the delegate to intercept the call. This is referred to as &#039;&#039;&#039;user mangling&#039;&#039;&#039;. &lt;br /&gt;
#The implemention of f() can be transformed to &amp;quot;__imf()”. This is referred to as &#039;&#039;&#039;owner mangling&#039;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the [[Name Mangling|Understanding Name Mangling]] page for a detailed explanation of name mangling and how it is used.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;Implicit/Explicit&#039;&#039;&amp;lt;br&amp;gt;  ====&lt;br /&gt;
&lt;br /&gt;
A delegate may have either implicit or explicit mangling incorporated into it. By default, implicit mangling is used; this means that selected routines will be mangled using a [[#Group_ID|Group ID]]. If explicit mangling is used, you must explicitly mangle selected routines using the explicit macro &amp;quot;&#039;&#039;&#039;imDELEGATE(&#039;&#039;&#039;&#039;&#039;&amp;amp;lt;function_name&amp;amp;gt;&#039;&#039;&#039;&#039;&#039;)&#039;&#039;&#039;&amp;quot;. For detailed information about implicit and explicit mangling, including examples, click [[Name Mangling|here]]. &lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;Group ID&#039;&#039;&amp;lt;br&amp;gt;  ====&lt;br /&gt;
&lt;br /&gt;
A Group ID assigns a special symbolic constant, declared in the Intercept Module delegate mangling header file (xxxIM.h), that can be used by the preprocessor to mangle a subset of routines; successful use of Group ID(s) assumes that each source file (e.g., FuncA.c and FuncB.c) has its own header file (e.g., FuncA.h and FuncB.h). A Group ID can be defined within the source file or defined as a compiler input parameter. The default Group ID(s) used by the [[s2sinstrument]] executable or the Intercept Module Wizard in Studio can be overridden with your own Group ID(s). Name mangling conflicts can be resolved using the Group ID(s).&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;See also&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
*[[Name Mangling|Understanding Name Mangling]] &lt;br /&gt;
*&#039;&#039;&#039;[[Integrating the Intercept Module (IM)|Integrating the Intercept Module (IM)]]&#039;&#039;&#039; for directions on how to generate an IM and add it to your target build&lt;br /&gt;
*[[S2sinstrument|Using s2sinstrument to generate an Intercept Module]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Main_Page&amp;diff=8047</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Main_Page&amp;diff=8047"/>
		<updated>2008-10-13T22:39:06Z</updated>

		<summary type="html">&lt;p&gt;Shamr: added IM reference&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;[[Windows Off-Target SDK]]&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;
&amp;lt;!-- old stuff follows&lt;br /&gt;
*[[Training Overview|Overview]] &lt;br /&gt;
*[[STRIDE Quick Start|STRIDE Quick Start]] &lt;br /&gt;
*[[Target Test Code|Target Test Code]] &lt;br /&gt;
*[[Interface Instrumentation|Interface Instrumentation]] &lt;br /&gt;
*[[Intercept Module Settings|Intercept Module Settings]] &lt;br /&gt;
*[[Test Scripts|Test Scripts]] &lt;br /&gt;
*[[Test Units|Test Units]]&lt;br /&gt;
--&amp;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;
 &lt;br /&gt;
*[[:Category:Frameworks|Frameworks]] &lt;br /&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>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Scl_msg&amp;diff=7410</id>
		<title>Studio:Scl msg</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Scl_msg&amp;diff=7410"/>
		<updated>2008-09-30T07:03:40Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Example 1 */ fixed SMID&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The scl_msg pragma =&lt;br /&gt;
&lt;br /&gt;
The scl_msg pragma allows the user to define a messaging interface. Messages are defined by combining a Unique [[#The_STRIDE_Unique_ID_.28SUID.29|STRIDE Identifier (SUID)]] with message attributes to create a STRIDE Message Id (SMID). The SMID is then associated with command and/or response payload type definitions.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
 #pragma scl_msg(SMID)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, cmd-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, rsp-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, cmd-payload, rsp-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, void, rsp-payload)&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;
| &#039;&#039;SMID&#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| SUID + attributes from which the message type and other properties are determined&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;cmd-payload &#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| Optional name of the data type for the command payload. If omitted, then:&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way command or a two-way message, and the User sends an empty payload to the Owner,&amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way response or a broadcast and is sent from Owner to User(s).&amp;lt;br&amp;gt;&lt;br /&gt;
The SMID attributes determine the behavior.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;rsp-payload&#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| Optional name of the data type for the response payload. If omitted then:&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way response or a two-way message, and the Owner is responding with an empty payload to the User, &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way command.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;void&#039;&#039;&lt;br /&gt;
|  &lt;br /&gt;
| This is a special parameter which can only be used if the message is a command/response and there is only a response payload (i.e., no command payload).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The SMID must be a non-parameterized macro name that resolves to an integer constant expression. The macro name will become the name of the message and cannot collide with the name of any other name or function.&lt;br /&gt;
* The SMID, cmd-payload, rsp-payload, and cmd-payload rsp-payload must all be integer constant expressions that evaluate to a number in the range of 0 — 232 - 1 and follow the rules for a SMID.&lt;br /&gt;
* In order to describe a two-way message with only a return payload, the type void is allowed only in the command position in a two-way message:&lt;br /&gt;
&lt;br /&gt;
    #pragma scl_msg (TWO_WAY_CMD_SMID, void, TResponse);&lt;br /&gt;
&lt;br /&gt;
== The STRIDE Message ID (SMID) ==&lt;br /&gt;
The SMID is a 32-bit structure consisting of a unique ID and a set of message attributes. The SCM defines the [[#The_STRIDE_Unique_ID_.28SUID.29|SUID]] portion as the first 24 bits of the SMID (bits 0 — 23), allowing unique identifiers up to 16,777,215. The message attributes use the highest 8 bits of the SMID (bits 24 — 31).  &lt;br /&gt;
&lt;br /&gt;
Each SCL-compliant message within the system must be assigned a unique message ID.&lt;br /&gt;
[[Image: SUID_attributes.gif|center]]&lt;br /&gt;
&lt;br /&gt;
=== SMID Attributes ===&lt;br /&gt;
The attributes are used to declare the message type, describe how to send the option payload and indicate, if applicable, the pointer memory usage attribute for the payload. The attributes, shown below, are the message type (MT), send type for command (STc), send type for response (STr), pointer usage for command (PUc), pointer usage for response (PUr), and Access Class (AC).&lt;br /&gt;
[[Image:SMID_attributes_format.gif|center]]&lt;br /&gt;
&lt;br /&gt;
=== Message Type (MT) Attributes ===&lt;br /&gt;
The Message Type (MT) attribute defines the type of message being used for communication between the owner and user. The following values are used for different message types:&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;
| 00&lt;br /&gt;
| One-way command&lt;br /&gt;
|- &lt;br /&gt;
| 01&lt;br /&gt;
| One-way response&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Two-way command-response&lt;br /&gt;
|- &lt;br /&gt;
| 11&lt;br /&gt;
| Broadcast message&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=== Send Type for Command (STc) Attributes ===&lt;br /&gt;
&lt;br /&gt;
The Send Type (ST) attribute is used to indicate how to transmit the payload. There are two ways to send the payload: by value or by pointer. The STRIDE Runtime is required to use the ST attribute when determining whether to route locally or remotely across platform boundaries. The following tables describe the ST attribute settings:&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;
| 0&lt;br /&gt;
| Pointer&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Value&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Send Type for Response (STr) Attributes ===&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;
| 0&lt;br /&gt;
| Pointer&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Value&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When a command or response does not contain a payload, the ST attribute is set to zero (0).&lt;br /&gt;
&lt;br /&gt;
When a payload is passed by pointer, a Pointer Usage (PU) attribute is required. The PU attribute indicates if the payload is using &#039;&#039;&#039;pool memory&#039;&#039;&#039; or &#039;&#039;&#039;private memory&#039;&#039;&#039;. When the PU attribute indicates &#039;&#039;&#039;pool&#039;&#039;&#039;, the SCM requires that the memory be allocated from the common pool being used by the system. When the PU attribute indicates &#039;&#039;&#039;private&#039;&#039;&#039;, the STRIDE Runtime environment makes no assumptions on how the payload memory is being managed between the Owner and User when they are executing on the same target platform. If the payload crosses platform boundaries, however, the Runtime is required to dynamically allocate memory from the common pool. The temporary memory that is allocated is used to hold the payload, and the address of the memory is passed to the reader. Once the reader returns the message memory to the Runtime, the temporary memory is automatically freed. The original memory from the sender is not affected or synchronized with the other platform. &lt;br /&gt;
&lt;br /&gt;
The PU attributes are listed below:&lt;br /&gt;
&lt;br /&gt;
=== Pointer Usage for Command (PUc) Attribute ===&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;
| 0&lt;br /&gt;
| Pool&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Private&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Pointer Usage for Response (PUr) Attribute ===&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;
| 0&lt;br /&gt;
| Pool&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Private&lt;br /&gt;
|} &lt;br /&gt;
 &lt;br /&gt;
=== Access Class (AC) Attributes ===&lt;br /&gt;
The Access Class (AC) attribute ensures that the intercept module will not register each SUID, and function calls with no registered owner will be routed to the intercept module STID.&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;
| 00&lt;br /&gt;
| Message&lt;br /&gt;
|- &lt;br /&gt;
| 01&lt;br /&gt;
| Function&lt;br /&gt;
|- &lt;br /&gt;
| 10&lt;br /&gt;
| Reserved&lt;br /&gt;
|- &lt;br /&gt;
| 11&lt;br /&gt;
| System/Application&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The following is an excerpt of the installed header file, &#039;&#039;sr.h&#039;&#039;, showing the definitions of the SMID attributes:&lt;br /&gt;
&lt;br /&gt;
    /* Message Types (MT) */ &lt;br /&gt;
    #define srMT_ONE_CMD   0x00000000 &lt;br /&gt;
    #define srMT_ONE_RSP   0x01000000 &lt;br /&gt;
    #define srMT_TWO       0x02000000 &lt;br /&gt;
    #define srMT_BRD       0x03000000&lt;br /&gt;
 &lt;br /&gt;
    /* Abbreviations MT */&lt;br /&gt;
    #define srMT_ONE       srMT_ONE_CMD&lt;br /&gt;
    #define srMT_ONEc      srMT_ONE_CMD&lt;br /&gt;
    #define srMT_ONEr      srMT_ONE_RSP&lt;br /&gt;
 &lt;br /&gt;
    /* Send Type for Command (ST_CMD) */&lt;br /&gt;
    #define srST_CMD_PTR   0x00000000&lt;br /&gt;
    #define srST_CMD_VAL   0x04000000&lt;br /&gt;
 &lt;br /&gt;
    /* Send Type for Response (ST_RSP) */&lt;br /&gt;
    #define srST_RSP_PTR   0x00000000&lt;br /&gt;
    #define srST_RSP_VAL   0x08000000&lt;br /&gt;
 &lt;br /&gt;
    /* Pointer Usage for Command (PU_CMD) */&lt;br /&gt;
    #define srPU_CMD_POL   0x00000000&lt;br /&gt;
    #define srPU_CMD_PRI   0x10000000&lt;br /&gt;
 &lt;br /&gt;
    /* Pointer Usage for Response (PU_RSP) */&lt;br /&gt;
    #define srPU_RSP_POL   0x00000000&lt;br /&gt;
    #define srPU_RSP_PRI   0x20000000&lt;br /&gt;
 &lt;br /&gt;
    /* Access Class (AC) */&lt;br /&gt;
    #define srAC_MSG       0x00000000&lt;br /&gt;
    #define srAC_FUNCTION  0x40000000&lt;br /&gt;
    #define srAC_SYS       0x80000000&lt;br /&gt;
&lt;br /&gt;
Refer to the [[http://www.s2technologies.com/pdf/s2sRuntime.pdf STRIDE Runtime Developer&#039;s Guide]] for additional information and usage of these definitions.&lt;br /&gt;
&lt;br /&gt;
== The STRIDE Unique ID (SUID) ==&lt;br /&gt;
The SUID is a unique 24-bit value used to identify interfaces such as remote function calls and messages. A SUID is required when using a two-way message in order to identify the message user and allow the response payload to be routed correctly. The message user provides this unique ID to the STRIDE Runtime, which in turn sends it to the message owner. The message owner is then required to supply this same unique ID when sending a response back to the STRIDE Runtime, so that the response payload can be routed correctly.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Five examples of the scl_msg pragma are shown below:&lt;br /&gt;
&lt;br /&gt;
# The [[#Example_1|first example]] uses the scl_msg pragma to define a set of messages without payloads.&lt;br /&gt;
# The [[#Example_2|second example]] uses the scl_msg pragma to define a one-way command and a two-way command/response. Both messages are defined with a command payload.&lt;br /&gt;
# The [[#Example_3|third example]] uses the scl_msg pragma to define a one-way-response, a two-way command/response and a broadcast response; all with message payloads. &lt;br /&gt;
# The [[#Example_4|fourth example]] uses the scl_msg pragma to define a two-way command/response with associated payloads.&lt;br /&gt;
# The [[#Example_5|fifth example]] uses the scl_msg pragma and the void parameter to define a two-way command/response with a response payload and an empty command payload.&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages without payloads */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Command */&lt;br /&gt;
    #define OneWayCmd 1 | srMT_ONEc &lt;br /&gt;
    /* SUID = 2, Message Type = One-way Response */&lt;br /&gt;
    #define OneWayRsp 2 | srMT_ONEr&lt;br /&gt;
    /* SUID = 3, Message Type = Two-way Command/Response  */&lt;br /&gt;
    #define TwoWayMsg 3 | srMT_TWO  &lt;br /&gt;
    /* SUID = 4, Message Type = Broadcast Response  */&lt;br /&gt;
    #define BrdCstRsp 4 | srMT_BRD&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to identify the four messages without payloads */&lt;br /&gt;
    #pragma scl_msg(OneWayCmd)&lt;br /&gt;
    #pragma scl_msg(OneWayRsp)&lt;br /&gt;
    #pragma scl_msg(TwoWayMsg)&lt;br /&gt;
    #pragma scl_msg(BrdCstRsp)&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages with command payloads. */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Command,                      */&lt;br /&gt;
    /* Command Send Type = By Pointer, Pointer Memory Usage = Private */&lt;br /&gt;
    #define OneWayCmd 1 | srMT_ONEc | srST_CMD_PTR | srPU_CMD_PRI&lt;br /&gt;
    /* SUID = 2, Message Type = Two-way Command/Response,            */&lt;br /&gt;
    /* Command Send Type = By Value                                  */&lt;br /&gt;
    #define TwoWayMsg 2 | srMT_TWO  | srST_CMD_VAL&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the command payload used with both messages */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } CmdPayload_t;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate the command payload with both SMIDs */&lt;br /&gt;
    #pragma scl_msg(OneWayCmd, CmdPayload_t)&lt;br /&gt;
    #pragma scl_msg(TwoWayMsg, CmdPayload_t)&lt;br /&gt;
&lt;br /&gt;
=== Example 3 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages with response payloads. */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Response,                   */&lt;br /&gt;
    /* Response Send Type = By Pointer, Pointer Memory Usage = Pool */&lt;br /&gt;
    #define OneWayRsp 1 | srMT_ONEr | srST_RSP_PTR | srPU_RSP_POL&lt;br /&gt;
    /* SUID = 2, Message Type = Two-way Command/Response,            */&lt;br /&gt;
    /* Command Send Type = No Payload, Response Send Type = By Value */&lt;br /&gt;
    #define TwoWayMsg 2 | srMT_TWO  | srST_RSP_VAL&lt;br /&gt;
    /* SUID = 3, Message Type = Broadcast Response,                 */&lt;br /&gt;
    /* Response Send Type = By Pointer, Pointer Memory Usage = Pool */&lt;br /&gt;
    #define BrdCstRsp 3 | srMT_BRD  | srST_RSP_PTR | srPU_RSP_POL&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload used with the messages */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } RspPayload_t;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate the payload with each of the SMIDs */&lt;br /&gt;
    #pragma scl_msg( OneWayRsp, RspPayload_t )&lt;br /&gt;
    #pragma scl_msg( TwoWayMsg, RspPayload_t )&lt;br /&gt;
    #pragma scl_msg( BrdCstRsp, RspPayload_t )&lt;br /&gt;
&lt;br /&gt;
=== Example 4 ===&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
    /* STRIDE Message ID (SMID) defining a two-way message with    */&lt;br /&gt;
    /* with a command and a response payload.                      */&lt;br /&gt;
    /* SUID = 1, Message Type = Two-way Command/Response,          */&lt;br /&gt;
    /* Command Send Type = By Value, Response Send Type = By Value */ &lt;br /&gt;
    #define TwoWayMsg 1 | srMT_TWO | srST_CMD_VAL | srST_RSP_VAL&lt;br /&gt;
     &lt;br /&gt;
    /* Structure defining the command payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } CmdPayload_p;&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        short f1;&lt;br /&gt;
        float f2;&lt;br /&gt;
    } RspPayload_r;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate both payloads with the SMID */&lt;br /&gt;
    #pragma scl_msg ( TwoWayMsg, CmdPayload_p, RspPayload_r )&lt;br /&gt;
&lt;br /&gt;
=== Example 5 ===&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
    /* STRIDE Message ID (SMID) defining a two-way message with    */&lt;br /&gt;
    /* with no command payload and a response payload.                      */&lt;br /&gt;
    /* SUID = 1, Message Type = Two-way Command/Response,          */&lt;br /&gt;
    /* Command Send Type = By Value, Response Send Type = By Value */ &lt;br /&gt;
    #define TwoWayMsg 1 | srMT_TWO |  srST_RSP_VAL &lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        short f1;&lt;br /&gt;
        float f2;&lt;br /&gt;
    } RspPayload_r;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate both payloads with the SMID */&lt;br /&gt;
    #pragma scl_msg ( TwoWayMsg, void, RspPayload_r )&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* The [[SCL_Structure|SCL Structure]] page for more information on the format of the STRIDE Unique ID (SUID), and SMIDs.&lt;br /&gt;
&lt;br /&gt;
[[Category: SCL_Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Scl_msg&amp;diff=7409</id>
		<title>Studio:Scl msg</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Scl_msg&amp;diff=7409"/>
		<updated>2008-09-30T07:02:59Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Example 2 */ fixed SMID&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The scl_msg pragma =&lt;br /&gt;
&lt;br /&gt;
The scl_msg pragma allows the user to define a messaging interface. Messages are defined by combining a Unique [[#The_STRIDE_Unique_ID_.28SUID.29|STRIDE Identifier (SUID)]] with message attributes to create a STRIDE Message Id (SMID). The SMID is then associated with command and/or response payload type definitions.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
 #pragma scl_msg(SMID)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, cmd-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, rsp-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, cmd-payload, rsp-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, void, rsp-payload)&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;
| &#039;&#039;SMID&#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| SUID + attributes from which the message type and other properties are determined&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;cmd-payload &#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| Optional name of the data type for the command payload. If omitted, then:&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way command or a two-way message, and the User sends an empty payload to the Owner,&amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way response or a broadcast and is sent from Owner to User(s).&amp;lt;br&amp;gt;&lt;br /&gt;
The SMID attributes determine the behavior.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;rsp-payload&#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| Optional name of the data type for the response payload. If omitted then:&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way response or a two-way message, and the Owner is responding with an empty payload to the User, &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way command.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;void&#039;&#039;&lt;br /&gt;
|  &lt;br /&gt;
| This is a special parameter which can only be used if the message is a command/response and there is only a response payload (i.e., no command payload).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The SMID must be a non-parameterized macro name that resolves to an integer constant expression. The macro name will become the name of the message and cannot collide with the name of any other name or function.&lt;br /&gt;
* The SMID, cmd-payload, rsp-payload, and cmd-payload rsp-payload must all be integer constant expressions that evaluate to a number in the range of 0 — 232 - 1 and follow the rules for a SMID.&lt;br /&gt;
* In order to describe a two-way message with only a return payload, the type void is allowed only in the command position in a two-way message:&lt;br /&gt;
&lt;br /&gt;
    #pragma scl_msg (TWO_WAY_CMD_SMID, void, TResponse);&lt;br /&gt;
&lt;br /&gt;
== The STRIDE Message ID (SMID) ==&lt;br /&gt;
The SMID is a 32-bit structure consisting of a unique ID and a set of message attributes. The SCM defines the [[#The_STRIDE_Unique_ID_.28SUID.29|SUID]] portion as the first 24 bits of the SMID (bits 0 — 23), allowing unique identifiers up to 16,777,215. The message attributes use the highest 8 bits of the SMID (bits 24 — 31).  &lt;br /&gt;
&lt;br /&gt;
Each SCL-compliant message within the system must be assigned a unique message ID.&lt;br /&gt;
[[Image: SUID_attributes.gif|center]]&lt;br /&gt;
&lt;br /&gt;
=== SMID Attributes ===&lt;br /&gt;
The attributes are used to declare the message type, describe how to send the option payload and indicate, if applicable, the pointer memory usage attribute for the payload. The attributes, shown below, are the message type (MT), send type for command (STc), send type for response (STr), pointer usage for command (PUc), pointer usage for response (PUr), and Access Class (AC).&lt;br /&gt;
[[Image:SMID_attributes_format.gif|center]]&lt;br /&gt;
&lt;br /&gt;
=== Message Type (MT) Attributes ===&lt;br /&gt;
The Message Type (MT) attribute defines the type of message being used for communication between the owner and user. The following values are used for different message types:&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;
| 00&lt;br /&gt;
| One-way command&lt;br /&gt;
|- &lt;br /&gt;
| 01&lt;br /&gt;
| One-way response&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Two-way command-response&lt;br /&gt;
|- &lt;br /&gt;
| 11&lt;br /&gt;
| Broadcast message&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=== Send Type for Command (STc) Attributes ===&lt;br /&gt;
&lt;br /&gt;
The Send Type (ST) attribute is used to indicate how to transmit the payload. There are two ways to send the payload: by value or by pointer. The STRIDE Runtime is required to use the ST attribute when determining whether to route locally or remotely across platform boundaries. The following tables describe the ST attribute settings:&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;
| 0&lt;br /&gt;
| Pointer&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Value&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Send Type for Response (STr) Attributes ===&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;
| 0&lt;br /&gt;
| Pointer&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Value&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When a command or response does not contain a payload, the ST attribute is set to zero (0).&lt;br /&gt;
&lt;br /&gt;
When a payload is passed by pointer, a Pointer Usage (PU) attribute is required. The PU attribute indicates if the payload is using &#039;&#039;&#039;pool memory&#039;&#039;&#039; or &#039;&#039;&#039;private memory&#039;&#039;&#039;. When the PU attribute indicates &#039;&#039;&#039;pool&#039;&#039;&#039;, the SCM requires that the memory be allocated from the common pool being used by the system. When the PU attribute indicates &#039;&#039;&#039;private&#039;&#039;&#039;, the STRIDE Runtime environment makes no assumptions on how the payload memory is being managed between the Owner and User when they are executing on the same target platform. If the payload crosses platform boundaries, however, the Runtime is required to dynamically allocate memory from the common pool. The temporary memory that is allocated is used to hold the payload, and the address of the memory is passed to the reader. Once the reader returns the message memory to the Runtime, the temporary memory is automatically freed. The original memory from the sender is not affected or synchronized with the other platform. &lt;br /&gt;
&lt;br /&gt;
The PU attributes are listed below:&lt;br /&gt;
&lt;br /&gt;
=== Pointer Usage for Command (PUc) Attribute ===&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;
| 0&lt;br /&gt;
| Pool&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Private&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Pointer Usage for Response (PUr) Attribute ===&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;
| 0&lt;br /&gt;
| Pool&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Private&lt;br /&gt;
|} &lt;br /&gt;
 &lt;br /&gt;
=== Access Class (AC) Attributes ===&lt;br /&gt;
The Access Class (AC) attribute ensures that the intercept module will not register each SUID, and function calls with no registered owner will be routed to the intercept module STID.&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;
| 00&lt;br /&gt;
| Message&lt;br /&gt;
|- &lt;br /&gt;
| 01&lt;br /&gt;
| Function&lt;br /&gt;
|- &lt;br /&gt;
| 10&lt;br /&gt;
| Reserved&lt;br /&gt;
|- &lt;br /&gt;
| 11&lt;br /&gt;
| System/Application&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The following is an excerpt of the installed header file, &#039;&#039;sr.h&#039;&#039;, showing the definitions of the SMID attributes:&lt;br /&gt;
&lt;br /&gt;
    /* Message Types (MT) */ &lt;br /&gt;
    #define srMT_ONE_CMD   0x00000000 &lt;br /&gt;
    #define srMT_ONE_RSP   0x01000000 &lt;br /&gt;
    #define srMT_TWO       0x02000000 &lt;br /&gt;
    #define srMT_BRD       0x03000000&lt;br /&gt;
 &lt;br /&gt;
    /* Abbreviations MT */&lt;br /&gt;
    #define srMT_ONE       srMT_ONE_CMD&lt;br /&gt;
    #define srMT_ONEc      srMT_ONE_CMD&lt;br /&gt;
    #define srMT_ONEr      srMT_ONE_RSP&lt;br /&gt;
 &lt;br /&gt;
    /* Send Type for Command (ST_CMD) */&lt;br /&gt;
    #define srST_CMD_PTR   0x00000000&lt;br /&gt;
    #define srST_CMD_VAL   0x04000000&lt;br /&gt;
 &lt;br /&gt;
    /* Send Type for Response (ST_RSP) */&lt;br /&gt;
    #define srST_RSP_PTR   0x00000000&lt;br /&gt;
    #define srST_RSP_VAL   0x08000000&lt;br /&gt;
 &lt;br /&gt;
    /* Pointer Usage for Command (PU_CMD) */&lt;br /&gt;
    #define srPU_CMD_POL   0x00000000&lt;br /&gt;
    #define srPU_CMD_PRI   0x10000000&lt;br /&gt;
 &lt;br /&gt;
    /* Pointer Usage for Response (PU_RSP) */&lt;br /&gt;
    #define srPU_RSP_POL   0x00000000&lt;br /&gt;
    #define srPU_RSP_PRI   0x20000000&lt;br /&gt;
 &lt;br /&gt;
    /* Access Class (AC) */&lt;br /&gt;
    #define srAC_MSG       0x00000000&lt;br /&gt;
    #define srAC_FUNCTION  0x40000000&lt;br /&gt;
    #define srAC_SYS       0x80000000&lt;br /&gt;
&lt;br /&gt;
Refer to the [[http://www.s2technologies.com/pdf/s2sRuntime.pdf STRIDE Runtime Developer&#039;s Guide]] for additional information and usage of these definitions.&lt;br /&gt;
&lt;br /&gt;
== The STRIDE Unique ID (SUID) ==&lt;br /&gt;
The SUID is a unique 24-bit value used to identify interfaces such as remote function calls and messages. A SUID is required when using a two-way message in order to identify the message user and allow the response payload to be routed correctly. The message user provides this unique ID to the STRIDE Runtime, which in turn sends it to the message owner. The message owner is then required to supply this same unique ID when sending a response back to the STRIDE Runtime, so that the response payload can be routed correctly.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Five examples of the scl_msg pragma are shown below:&lt;br /&gt;
&lt;br /&gt;
# The [[#Example_1|first example]] uses the scl_msg pragma to define a set of messages without payloads.&lt;br /&gt;
# The [[#Example_2|second example]] uses the scl_msg pragma to define a one-way command and a two-way command/response. Both messages are defined with a command payload.&lt;br /&gt;
# The [[#Example_3|third example]] uses the scl_msg pragma to define a one-way-response, a two-way command/response and a broadcast response; all with message payloads. &lt;br /&gt;
# The [[#Example_4|fourth example]] uses the scl_msg pragma to define a two-way command/response with associated payloads.&lt;br /&gt;
# The [[#Example_5|fifth example]] uses the scl_msg pragma and the void parameter to define a two-way command/response with a response payload and an empty command payload.&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages without payloads */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Command */&lt;br /&gt;
    #define OneWayCmd 1 | srMT_ONEc &lt;br /&gt;
    /* SUID = 2, Message Type = One-way Response */&lt;br /&gt;
    #define OneWayRsp 2 | srMT_ONEr&lt;br /&gt;
    /* SUID = 3, Message Type = Two-way Command/Response  */&lt;br /&gt;
    #define TwoWayMsg 3 | srMT_TWO  &lt;br /&gt;
    /* SUID = 4, Message Type = Broadcast Response  */&lt;br /&gt;
    #define BrdCstRsp 4 | srMT_BRD&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to identify the four messages without payloads */&lt;br /&gt;
    #pragma scl_msg(1)&lt;br /&gt;
    #pragma scl_msg(2)&lt;br /&gt;
    #pragma scl_msg(3)&lt;br /&gt;
    #pragma scl_msg(4)&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages with command payloads. */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Command,                      */&lt;br /&gt;
    /* Command Send Type = By Pointer, Pointer Memory Usage = Private */&lt;br /&gt;
    #define OneWayCmd 1 | srMT_ONEc | srST_CMD_PTR | srPU_CMD_PRI&lt;br /&gt;
    /* SUID = 2, Message Type = Two-way Command/Response,            */&lt;br /&gt;
    /* Command Send Type = By Value                                  */&lt;br /&gt;
    #define TwoWayMsg 2 | srMT_TWO  | srST_CMD_VAL&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the command payload used with both messages */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } CmdPayload_t;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate the command payload with both SMIDs */&lt;br /&gt;
    #pragma scl_msg(OneWayCmd, CmdPayload_t)&lt;br /&gt;
    #pragma scl_msg(TwoWayMsg, CmdPayload_t)&lt;br /&gt;
&lt;br /&gt;
=== Example 3 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages with response payloads. */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Response,                   */&lt;br /&gt;
    /* Response Send Type = By Pointer, Pointer Memory Usage = Pool */&lt;br /&gt;
    #define OneWayRsp 1 | srMT_ONEr | srST_RSP_PTR | srPU_RSP_POL&lt;br /&gt;
    /* SUID = 2, Message Type = Two-way Command/Response,            */&lt;br /&gt;
    /* Command Send Type = No Payload, Response Send Type = By Value */&lt;br /&gt;
    #define TwoWayMsg 2 | srMT_TWO  | srST_RSP_VAL&lt;br /&gt;
    /* SUID = 3, Message Type = Broadcast Response,                 */&lt;br /&gt;
    /* Response Send Type = By Pointer, Pointer Memory Usage = Pool */&lt;br /&gt;
    #define BrdCstRsp 3 | srMT_BRD  | srST_RSP_PTR | srPU_RSP_POL&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload used with the messages */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } RspPayload_t;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate the payload with each of the SMIDs */&lt;br /&gt;
    #pragma scl_msg( OneWayRsp, RspPayload_t )&lt;br /&gt;
    #pragma scl_msg( TwoWayMsg, RspPayload_t )&lt;br /&gt;
    #pragma scl_msg( BrdCstRsp, RspPayload_t )&lt;br /&gt;
&lt;br /&gt;
=== Example 4 ===&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
    /* STRIDE Message ID (SMID) defining a two-way message with    */&lt;br /&gt;
    /* with a command and a response payload.                      */&lt;br /&gt;
    /* SUID = 1, Message Type = Two-way Command/Response,          */&lt;br /&gt;
    /* Command Send Type = By Value, Response Send Type = By Value */ &lt;br /&gt;
    #define TwoWayMsg 1 | srMT_TWO | srST_CMD_VAL | srST_RSP_VAL&lt;br /&gt;
     &lt;br /&gt;
    /* Structure defining the command payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } CmdPayload_p;&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        short f1;&lt;br /&gt;
        float f2;&lt;br /&gt;
    } RspPayload_r;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate both payloads with the SMID */&lt;br /&gt;
    #pragma scl_msg ( TwoWayMsg, CmdPayload_p, RspPayload_r )&lt;br /&gt;
&lt;br /&gt;
=== Example 5 ===&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
    /* STRIDE Message ID (SMID) defining a two-way message with    */&lt;br /&gt;
    /* with no command payload and a response payload.                      */&lt;br /&gt;
    /* SUID = 1, Message Type = Two-way Command/Response,          */&lt;br /&gt;
    /* Command Send Type = By Value, Response Send Type = By Value */ &lt;br /&gt;
    #define TwoWayMsg 1 | srMT_TWO |  srST_RSP_VAL &lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        short f1;&lt;br /&gt;
        float f2;&lt;br /&gt;
    } RspPayload_r;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate both payloads with the SMID */&lt;br /&gt;
    #pragma scl_msg ( TwoWayMsg, void, RspPayload_r )&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* The [[SCL_Structure|SCL Structure]] page for more information on the format of the STRIDE Unique ID (SUID), and SMIDs.&lt;br /&gt;
&lt;br /&gt;
[[Category: SCL_Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Scl_msg&amp;diff=7408</id>
		<title>Studio:Scl msg</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Scl_msg&amp;diff=7408"/>
		<updated>2008-09-30T07:02:23Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Example 3 */ fixed SMID&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The scl_msg pragma =&lt;br /&gt;
&lt;br /&gt;
The scl_msg pragma allows the user to define a messaging interface. Messages are defined by combining a Unique [[#The_STRIDE_Unique_ID_.28SUID.29|STRIDE Identifier (SUID)]] with message attributes to create a STRIDE Message Id (SMID). The SMID is then associated with command and/or response payload type definitions.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
 #pragma scl_msg(SMID)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, cmd-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, rsp-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, cmd-payload, rsp-payload)&lt;br /&gt;
 &lt;br /&gt;
 #pragma scl_msg(SMID, void, rsp-payload)&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;
| &#039;&#039;SMID&#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| SUID + attributes from which the message type and other properties are determined&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;cmd-payload &#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| Optional name of the data type for the command payload. If omitted, then:&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way command or a two-way message, and the User sends an empty payload to the Owner,&amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way response or a broadcast and is sent from Owner to User(s).&amp;lt;br&amp;gt;&lt;br /&gt;
The SMID attributes determine the behavior.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;rsp-payload&#039;&#039;&lt;br /&gt;
| Integer&lt;br /&gt;
| Optional name of the data type for the response payload. If omitted then:&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way response or a two-way message, and the Owner is responding with an empty payload to the User, &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
The message is a one-way command.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;void&#039;&#039;&lt;br /&gt;
|  &lt;br /&gt;
| This is a special parameter which can only be used if the message is a command/response and there is only a response payload (i.e., no command payload).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The SMID must be a non-parameterized macro name that resolves to an integer constant expression. The macro name will become the name of the message and cannot collide with the name of any other name or function.&lt;br /&gt;
* The SMID, cmd-payload, rsp-payload, and cmd-payload rsp-payload must all be integer constant expressions that evaluate to a number in the range of 0 — 232 - 1 and follow the rules for a SMID.&lt;br /&gt;
* In order to describe a two-way message with only a return payload, the type void is allowed only in the command position in a two-way message:&lt;br /&gt;
&lt;br /&gt;
    #pragma scl_msg (TWO_WAY_CMD_SMID, void, TResponse);&lt;br /&gt;
&lt;br /&gt;
== The STRIDE Message ID (SMID) ==&lt;br /&gt;
The SMID is a 32-bit structure consisting of a unique ID and a set of message attributes. The SCM defines the [[#The_STRIDE_Unique_ID_.28SUID.29|SUID]] portion as the first 24 bits of the SMID (bits 0 — 23), allowing unique identifiers up to 16,777,215. The message attributes use the highest 8 bits of the SMID (bits 24 — 31).  &lt;br /&gt;
&lt;br /&gt;
Each SCL-compliant message within the system must be assigned a unique message ID.&lt;br /&gt;
[[Image: SUID_attributes.gif|center]]&lt;br /&gt;
&lt;br /&gt;
=== SMID Attributes ===&lt;br /&gt;
The attributes are used to declare the message type, describe how to send the option payload and indicate, if applicable, the pointer memory usage attribute for the payload. The attributes, shown below, are the message type (MT), send type for command (STc), send type for response (STr), pointer usage for command (PUc), pointer usage for response (PUr), and Access Class (AC).&lt;br /&gt;
[[Image:SMID_attributes_format.gif|center]]&lt;br /&gt;
&lt;br /&gt;
=== Message Type (MT) Attributes ===&lt;br /&gt;
The Message Type (MT) attribute defines the type of message being used for communication between the owner and user. The following values are used for different message types:&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;
| 00&lt;br /&gt;
| One-way command&lt;br /&gt;
|- &lt;br /&gt;
| 01&lt;br /&gt;
| One-way response&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Two-way command-response&lt;br /&gt;
|- &lt;br /&gt;
| 11&lt;br /&gt;
| Broadcast message&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=== Send Type for Command (STc) Attributes ===&lt;br /&gt;
&lt;br /&gt;
The Send Type (ST) attribute is used to indicate how to transmit the payload. There are two ways to send the payload: by value or by pointer. The STRIDE Runtime is required to use the ST attribute when determining whether to route locally or remotely across platform boundaries. The following tables describe the ST attribute settings:&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;
| 0&lt;br /&gt;
| Pointer&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Value&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Send Type for Response (STr) Attributes ===&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;
| 0&lt;br /&gt;
| Pointer&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Value&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When a command or response does not contain a payload, the ST attribute is set to zero (0).&lt;br /&gt;
&lt;br /&gt;
When a payload is passed by pointer, a Pointer Usage (PU) attribute is required. The PU attribute indicates if the payload is using &#039;&#039;&#039;pool memory&#039;&#039;&#039; or &#039;&#039;&#039;private memory&#039;&#039;&#039;. When the PU attribute indicates &#039;&#039;&#039;pool&#039;&#039;&#039;, the SCM requires that the memory be allocated from the common pool being used by the system. When the PU attribute indicates &#039;&#039;&#039;private&#039;&#039;&#039;, the STRIDE Runtime environment makes no assumptions on how the payload memory is being managed between the Owner and User when they are executing on the same target platform. If the payload crosses platform boundaries, however, the Runtime is required to dynamically allocate memory from the common pool. The temporary memory that is allocated is used to hold the payload, and the address of the memory is passed to the reader. Once the reader returns the message memory to the Runtime, the temporary memory is automatically freed. The original memory from the sender is not affected or synchronized with the other platform. &lt;br /&gt;
&lt;br /&gt;
The PU attributes are listed below:&lt;br /&gt;
&lt;br /&gt;
=== Pointer Usage for Command (PUc) Attribute ===&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;
| 0&lt;br /&gt;
| Pool&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Private&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Pointer Usage for Response (PUr) Attribute ===&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;
| 0&lt;br /&gt;
| Pool&lt;br /&gt;
|- &lt;br /&gt;
| 1&lt;br /&gt;
| Private&lt;br /&gt;
|} &lt;br /&gt;
 &lt;br /&gt;
=== Access Class (AC) Attributes ===&lt;br /&gt;
The Access Class (AC) attribute ensures that the intercept module will not register each SUID, and function calls with no registered owner will be routed to the intercept module STID.&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;
| 00&lt;br /&gt;
| Message&lt;br /&gt;
|- &lt;br /&gt;
| 01&lt;br /&gt;
| Function&lt;br /&gt;
|- &lt;br /&gt;
| 10&lt;br /&gt;
| Reserved&lt;br /&gt;
|- &lt;br /&gt;
| 11&lt;br /&gt;
| System/Application&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The following is an excerpt of the installed header file, &#039;&#039;sr.h&#039;&#039;, showing the definitions of the SMID attributes:&lt;br /&gt;
&lt;br /&gt;
    /* Message Types (MT) */ &lt;br /&gt;
    #define srMT_ONE_CMD   0x00000000 &lt;br /&gt;
    #define srMT_ONE_RSP   0x01000000 &lt;br /&gt;
    #define srMT_TWO       0x02000000 &lt;br /&gt;
    #define srMT_BRD       0x03000000&lt;br /&gt;
 &lt;br /&gt;
    /* Abbreviations MT */&lt;br /&gt;
    #define srMT_ONE       srMT_ONE_CMD&lt;br /&gt;
    #define srMT_ONEc      srMT_ONE_CMD&lt;br /&gt;
    #define srMT_ONEr      srMT_ONE_RSP&lt;br /&gt;
 &lt;br /&gt;
    /* Send Type for Command (ST_CMD) */&lt;br /&gt;
    #define srST_CMD_PTR   0x00000000&lt;br /&gt;
    #define srST_CMD_VAL   0x04000000&lt;br /&gt;
 &lt;br /&gt;
    /* Send Type for Response (ST_RSP) */&lt;br /&gt;
    #define srST_RSP_PTR   0x00000000&lt;br /&gt;
    #define srST_RSP_VAL   0x08000000&lt;br /&gt;
 &lt;br /&gt;
    /* Pointer Usage for Command (PU_CMD) */&lt;br /&gt;
    #define srPU_CMD_POL   0x00000000&lt;br /&gt;
    #define srPU_CMD_PRI   0x10000000&lt;br /&gt;
 &lt;br /&gt;
    /* Pointer Usage for Response (PU_RSP) */&lt;br /&gt;
    #define srPU_RSP_POL   0x00000000&lt;br /&gt;
    #define srPU_RSP_PRI   0x20000000&lt;br /&gt;
 &lt;br /&gt;
    /* Access Class (AC) */&lt;br /&gt;
    #define srAC_MSG       0x00000000&lt;br /&gt;
    #define srAC_FUNCTION  0x40000000&lt;br /&gt;
    #define srAC_SYS       0x80000000&lt;br /&gt;
&lt;br /&gt;
Refer to the [[http://www.s2technologies.com/pdf/s2sRuntime.pdf STRIDE Runtime Developer&#039;s Guide]] for additional information and usage of these definitions.&lt;br /&gt;
&lt;br /&gt;
== The STRIDE Unique ID (SUID) ==&lt;br /&gt;
The SUID is a unique 24-bit value used to identify interfaces such as remote function calls and messages. A SUID is required when using a two-way message in order to identify the message user and allow the response payload to be routed correctly. The message user provides this unique ID to the STRIDE Runtime, which in turn sends it to the message owner. The message owner is then required to supply this same unique ID when sending a response back to the STRIDE Runtime, so that the response payload can be routed correctly.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Five examples of the scl_msg pragma are shown below:&lt;br /&gt;
&lt;br /&gt;
# The [[#Example_1|first example]] uses the scl_msg pragma to define a set of messages without payloads.&lt;br /&gt;
# The [[#Example_2|second example]] uses the scl_msg pragma to define a one-way command and a two-way command/response. Both messages are defined with a command payload.&lt;br /&gt;
# The [[#Example_3|third example]] uses the scl_msg pragma to define a one-way-response, a two-way command/response and a broadcast response; all with message payloads. &lt;br /&gt;
# The [[#Example_4|fourth example]] uses the scl_msg pragma to define a two-way command/response with associated payloads.&lt;br /&gt;
# The [[#Example_5|fifth example]] uses the scl_msg pragma and the void parameter to define a two-way command/response with a response payload and an empty command payload.&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages without payloads */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Command */&lt;br /&gt;
    #define OneWayCmd 1 | srMT_ONEc &lt;br /&gt;
    /* SUID = 2, Message Type = One-way Response */&lt;br /&gt;
    #define OneWayRsp 2 | srMT_ONEr&lt;br /&gt;
    /* SUID = 3, Message Type = Two-way Command/Response  */&lt;br /&gt;
    #define TwoWayMsg 3 | srMT_TWO  &lt;br /&gt;
    /* SUID = 4, Message Type = Broadcast Response  */&lt;br /&gt;
    #define BrdCstRsp 4 | srMT_BRD&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to identify the four messages without payloads */&lt;br /&gt;
    #pragma scl_msg(1)&lt;br /&gt;
    #pragma scl_msg(2)&lt;br /&gt;
    #pragma scl_msg(3)&lt;br /&gt;
    #pragma scl_msg(4)&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages with command payloads. */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Command,                      */&lt;br /&gt;
    /* Command Send Type = By Pointer, Pointer Memory Usage = Private */&lt;br /&gt;
    #define OneWayCmd 1 | srMT_ONEc | srST_CMD_PTR | srPU_CMD_PRI&lt;br /&gt;
    /* SUID = 2, Message Type = Two-way Command/Response,            */&lt;br /&gt;
    /* Command Send Type = By Value                                  */&lt;br /&gt;
    #define TwoWayMsg 2 | srMT_TWO  | srST_CMD_VAL&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the command payload used with both messages */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } CmdPayload_t;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate the command payload with both SMIDs */&lt;br /&gt;
    #pragma scl_msg(1, CmdPayload_t)&lt;br /&gt;
    #pragma scl_msg(2, CmdPayload_t)&lt;br /&gt;
&lt;br /&gt;
=== Example 3 ===&lt;br /&gt;
&lt;br /&gt;
    /* STRIDE Message IDs (SMIDs) defining messages with response payloads. */&lt;br /&gt;
    /* SUID = 1, Message Type = One-way Response,                   */&lt;br /&gt;
    /* Response Send Type = By Pointer, Pointer Memory Usage = Pool */&lt;br /&gt;
    #define OneWayRsp 1 | srMT_ONEr | srST_RSP_PTR | srPU_RSP_POL&lt;br /&gt;
    /* SUID = 2, Message Type = Two-way Command/Response,            */&lt;br /&gt;
    /* Command Send Type = No Payload, Response Send Type = By Value */&lt;br /&gt;
    #define TwoWayMsg 2 | srMT_TWO  | srST_RSP_VAL&lt;br /&gt;
    /* SUID = 3, Message Type = Broadcast Response,                 */&lt;br /&gt;
    /* Response Send Type = By Pointer, Pointer Memory Usage = Pool */&lt;br /&gt;
    #define BrdCstRsp 3 | srMT_BRD  | srST_RSP_PTR | srPU_RSP_POL&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload used with the messages */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } RspPayload_t;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate the payload with each of the SMIDs */&lt;br /&gt;
    #pragma scl_msg( OneWayRsp, RspPayload_t )&lt;br /&gt;
    #pragma scl_msg( TwoWayMsg, RspPayload_t )&lt;br /&gt;
    #pragma scl_msg( BrdCstRsp, RspPayload_t )&lt;br /&gt;
&lt;br /&gt;
=== Example 4 ===&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
    /* STRIDE Message ID (SMID) defining a two-way message with    */&lt;br /&gt;
    /* with a command and a response payload.                      */&lt;br /&gt;
    /* SUID = 1, Message Type = Two-way Command/Response,          */&lt;br /&gt;
    /* Command Send Type = By Value, Response Send Type = By Value */ &lt;br /&gt;
    #define TwoWayMsg 1 | srMT_TWO | srST_CMD_VAL | srST_RSP_VAL&lt;br /&gt;
     &lt;br /&gt;
    /* Structure defining the command payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        int f1;&lt;br /&gt;
        char f2;&lt;br /&gt;
    } CmdPayload_p;&lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        short f1;&lt;br /&gt;
        float f2;&lt;br /&gt;
    } RspPayload_r;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate both payloads with the SMID */&lt;br /&gt;
    #pragma scl_msg ( TwoWayMsg, CmdPayload_p, RspPayload_r )&lt;br /&gt;
&lt;br /&gt;
=== Example 5 ===&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
    /* STRIDE Message ID (SMID) defining a two-way message with    */&lt;br /&gt;
    /* with no command payload and a response payload.                      */&lt;br /&gt;
    /* SUID = 1, Message Type = Two-way Command/Response,          */&lt;br /&gt;
    /* Command Send Type = By Value, Response Send Type = By Value */ &lt;br /&gt;
    #define TwoWayMsg 1 | srMT_TWO |  srST_RSP_VAL &lt;br /&gt;
 &lt;br /&gt;
    /* Structure defining the response payload for the message */&lt;br /&gt;
    typedef struct {&lt;br /&gt;
        short f1;&lt;br /&gt;
        float f2;&lt;br /&gt;
    } RspPayload_r;&lt;br /&gt;
 &lt;br /&gt;
    /* Use the scl_msg pragma to associate both payloads with the SMID */&lt;br /&gt;
    #pragma scl_msg ( TwoWayMsg, void, RspPayload_r )&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* The [[SCL_Structure|SCL Structure]] page for more information on the format of the STRIDE Unique ID (SUID), and SMIDs.&lt;br /&gt;
&lt;br /&gt;
[[Category: SCL_Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Why_don%27t_Perl_scripts_run_even_when_Script_Engine_shows_Perl%3F&amp;diff=7373</id>
		<title>Studio:Why don&#039;t Perl scripts run even when Script Engine shows Perl?</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Why_don%27t_Perl_scripts_run_even_when_Script_Engine_shows_Perl%3F&amp;diff=7373"/>
		<updated>2008-09-24T18:50:34Z</updated>

		<summary type="html">&lt;p&gt;Shamr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Even when ActiveState Perl is installed and STRIDE Script Engine (Tools-&amp;gt;Options-&amp;gt;Script Engines) shows Perl file types (PL, PLS, PM, etc), you may not be able to run Perl scripts or see &amp;quot;Run&amp;quot; button on opened Perl scripts within Studio.  One of the reasons could be that ActiveState Perl registration has been modified by another program.  It is known that iTunes and RealPlayer take over the ownership of .pls extension used by ActiveState Perl, on which STRIDE Script Engine relies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To verify the problem:&#039;&#039;&#039;&lt;br /&gt;
* Check the value for .pls extension in the registry: HKEY_CLASSES_ROOT\.pls.  If the associated value is not “PerlScriptFile”, there is a registration problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To fix the problem:&#039;&#039;&#039;&lt;br /&gt;
* Run the following on command prompt:&lt;br /&gt;
  CMD&amp;gt; regsvr32 c:\perl\bin\perlSE.dll&lt;br /&gt;
* Remove all Perl file types (PL, PLS, PM, etc) from Tools-&amp;gt;Options-&amp;gt;Script Engines and &amp;quot;Scan&amp;quot; again.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To verify the solution:&#039;&#039;&#039;&lt;br /&gt;
* Select each Perl files type and look for the text under the buttons that says “ActiveScript compliant”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Perl Info]]&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Why_don%27t_Perl_scripts_run_even_when_Script_Engine_shows_Perl%3F&amp;diff=7372</id>
		<title>Studio:Why don&#039;t Perl scripts run even when Script Engine shows Perl?</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Why_don%27t_Perl_scripts_run_even_when_Script_Engine_shows_Perl%3F&amp;diff=7372"/>
		<updated>2008-09-24T18:49:46Z</updated>

		<summary type="html">&lt;p&gt;Shamr: added new page for Perl registration issue with .pls&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Even when ActiveState Perl is installed and STRIDE Script Engine (Tools-&amp;gt;Options-&amp;gt;Script Engines) shows Perl file types (PL, PLS, PM, etc), you may not be able to run Perl scripts or see &amp;quot;Run&amp;quot; button on opened Perl scripts within Studio.  One of the reasons could be that ActiveState Perl registration has been modified by another program.  It is known that iTunes and RealPlayer take over the ownership of .pls extension used by ActiveState Perl, on which STRIDE Script Engine relies.&lt;br /&gt;
&lt;br /&gt;
To verify the problem:&lt;br /&gt;
* Check the value for .pls extension in the registry: HKEY_CLASSES_ROOT\.pls.  If the associated value is not “PerlScriptFile”, there is a registration problem.&lt;br /&gt;
&lt;br /&gt;
To fix the problem:&lt;br /&gt;
* Run the following on command prompt:&lt;br /&gt;
  CMD&amp;gt; regsvr32 c:\perl\bin\perlSE.dll&lt;br /&gt;
* Remove all Perl file types (PL, PLS, PM, etc) from Tools-&amp;gt;Options-&amp;gt;Script Engines and &amp;quot;Scan&amp;quot; again.&lt;br /&gt;
&lt;br /&gt;
To verify the solution:&lt;br /&gt;
* Select each Perl files type and look for the text under the buttons that says “ActiveScript compliant”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Perl Info]]&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Script_execution_error_messages&amp;diff=7371</id>
		<title>Studio:Script execution error messages</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Script_execution_error_messages&amp;diff=7371"/>
		<updated>2008-09-24T18:14:18Z</updated>

		<summary type="html">&lt;p&gt;Shamr: version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If an error similar to the following occurs when trying to execute a script&lt;br /&gt;
&lt;br /&gt;
...[.\Scripter.cpp:450] ERROR - [TID:604] [PID:2524] Execution of script &amp;quot;[script name].pl&amp;quot; failed - state &amp;lt;1&amp;gt;, error 0x80040154: Class not registered&lt;br /&gt;
&lt;br /&gt;
it is an internal error reported when STRIDE is unable to start the script engine. Generally, it is the result of a problem during the Perl installation or a version of Perl that is not COM-compliant (e.g., Cgywin Perl) or is incompatible with STRIDE. &lt;br /&gt;
&lt;br /&gt;
Verify that you have the required version of [http://www.s2technologies.com/wiki/index.php?title=Host_Installation#Perl ActiveState Perl] installed; it may be  necessary to reinstall it. Once you have done this, from Studio&#039;s &#039;&#039;&#039;Tools-&amp;gt;Options&#039;&#039;&#039; menu, click &#039;&#039;&#039;Scan&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Perl Info]]&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Script_execution_error_messages&amp;diff=7367</id>
		<title>Studio:Script execution error messages</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Script_execution_error_messages&amp;diff=7367"/>
		<updated>2008-09-23T00:01:54Z</updated>

		<summary type="html">&lt;p&gt;Shamr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If an error similar to the following occurs when trying to execute a script&lt;br /&gt;
&lt;br /&gt;
...[.\Scripter.cpp:450] ERROR - [TID:604] [PID:2524] Execution of script &amp;quot;[script name].pl&amp;quot; failed - state &amp;lt;1&amp;gt;, error 0x80040154: Class not registered&lt;br /&gt;
&lt;br /&gt;
it is an internal error reported when STRIDE is unable to start the script engine. Generally, it is the result of a problem during the Perl installation or a version of Perl that is not COM-compliant (e.g., Cgywin Perl) or is incompatible with STRIDE. &lt;br /&gt;
&lt;br /&gt;
Verify that you have an ActiveState version of Perl 5.8 or newer installed; it may be  necessary to reinstall it. Once you have done this, from Studio&#039;s &#039;&#039;&#039;Tools-&amp;gt;Options&#039;&#039;&#039; menu, click &#039;&#039;&#039;Scan&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Perl Info]]&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_CClass_Sample&amp;diff=7328</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=7328"/>
		<updated>2008-09-19T18:54:35Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* 02_02_RuntimeServices_Dynamic */ SCR 8998&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 an [[Windows_Off-Target_Apps|  windows target application]], 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 an off-target simulator application 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 off-target simulator, 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.&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 ==&lt;br /&gt;
Now that you have built the off-target simulator and executed the test CClasss 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;
Demonstrates passing and failing tests using the four primary POD types that we can infer status from (int, short, and char). The bool POD type is allowed, but only in C++ mode.&lt;br /&gt;
&lt;br /&gt;
==== 01_02_Basic_Fixtures ====&lt;br /&gt;
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;
==== 01_03_Basic_Constructors ====&lt;br /&gt;
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;
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;
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 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;
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;
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 we show it here 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)(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 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:              17&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;
==== Execution based on an order file ====&lt;br /&gt;
TestUnitRun can optionally base its execution on simple text file input. We have provided a simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, 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)(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\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)(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 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:              17&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;
We also provide a sample STRIDE workspace that demonstrates the use of script execution with STRIDE Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]] and the [[Provided_Frameworks#WindowsTestApp|WindowsTestApp framework]].  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 single script that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in descending alpabetical order (on name) since we explictly called the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method.&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 takes the very simple 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;
..where &#039;&#039;&#039;TEST_CClass_NAME&#039;&#039;&#039; is the name of the scl_test_cclass test you want to run.  You can then use the Studio tree control to change the order and hierarchy of each item by moving the scripts and creating 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>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Class_Sample&amp;diff=7327</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=7327"/>
		<updated>2008-09-19T18:53:17Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* 03_02_srTest_Dynamic */ SCR 8998&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\TestUnits\TestClass&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building an [[Windows_Off-Target_Apps| windows target application]], 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, we recommend that you install the current free (as in beer) 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 an off-target simulator application 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 off-target simulator, 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 target application 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 we have chosen to do 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;
Demonstrates passing and failing tests using the four primary POD types that we can infer status from (int, bool, short, and char).&lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Fixtures====&lt;br /&gt;
&lt;br /&gt;
Shows 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;
Demonstrates how exceptions thrown from a test method are caught by our 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;
Demonstrates how test classes may have non-trivial constructors.  These arguments can be passed using our [[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 our 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;
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;
&lt;br /&gt;
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;
&lt;br /&gt;
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;
&lt;br /&gt;
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;
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;
Shows 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 we show it 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:              28&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. We have provided a simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, 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;
We also provide a sample STRIDE workspace that demonstrates the use of script execution with STRIDE Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]] and the [[Provided_Frameworks#WindowsTestApp|WindowsTestApp framework]].  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 single script that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in descending alpabetical order (on name) since we explictly called the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method.&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 takes the very simple 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;
..where &#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039; is the name of the test class you want to run.  You can then use the Studio tree control to change the order and hierarchy of each item by moving the scripts and creating folders. The sample contains individual scripts for a few of the sample test classes - 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>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Class_Sample&amp;diff=7326</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=7326"/>
		<updated>2008-09-19T18:47:26Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* 02_02_RuntimeServices_Dynamic */  SCR 8998&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\TestUnits\TestClass&#039;&#039;.  This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building an [[Windows_Off-Target_Apps| windows target application]], 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, we recommend that you install the current free (as in beer) 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 an off-target simulator application 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 off-target simulator, 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 target application 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 we have chosen to do 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;
Demonstrates passing and failing tests using the four primary POD types that we can infer status from (int, bool, short, and char).&lt;br /&gt;
&lt;br /&gt;
====01_02_Basic_Fixtures====&lt;br /&gt;
&lt;br /&gt;
Shows 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;
Demonstrates how exceptions thrown from a test method are caught by our 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;
Demonstrates how test classes may have non-trivial constructors.  These arguments can be passed using our [[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 our 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;
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;
&lt;br /&gt;
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;
&lt;br /&gt;
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;
&lt;br /&gt;
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;
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;
Shows how to use [[Test_Units#AddSuite|testSuite.AddSuite]] and [[Test_Units#AddTest|testSuite.AddTest]] for dynamic suite and test case 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 we show it 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:              28&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. We have provided a simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, 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;
We also provide a sample STRIDE workspace that demonstrates the use of script execution with STRIDE Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]] and the [[Provided_Frameworks#WindowsTestApp|WindowsTestApp framework]].  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 single script that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in descending alpabetical order (on name) since we explictly called the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method.&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 takes the very simple 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;
..where &#039;&#039;&#039;TEST_CLASS_NAME&#039;&#039;&#039; is the name of the test class you want to run.  You can then use the Studio tree control to change the order and hierarchy of each item by moving the scripts and creating folders. The sample contains individual scripts for a few of the sample test classes - 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>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Function_List_Sample&amp;diff=7325</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=7325"/>
		<updated>2008-09-19T18:43:04Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* 02_02_RuntimeServices_Dynamic */  SCR 8998&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 an [[Windows_Off-Target_Apps| windows target application]], 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, we recommend 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 an [[Windows_Off-Target_Apps| windows target application]] 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 target application, 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 off-target simulator and executed the test flists it contains, you can take time to peruse the test flist 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 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;
Demonstrates passing and failing tests using the primary POD types that we can infer status from (int, bool, short, and char). The bool POD type is only accepted in C++ mode.&lt;br /&gt;
&lt;br /&gt;
==== 01_02_Basic_Fixtures ====&lt;br /&gt;
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;
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;
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;
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;
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 test flists 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 we show it 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 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. We have provided a simple order file, &#039;&#039;RunSimple.txt&#039;&#039;, 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)] 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;
==== 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;
We also provide a sample STRIDE workspace that demonstrates the use of script execution with STRIDE Studio to manage test order and hierarchy.  This workspace was created using [[WorkspaceSetup.pl]] and the [[Provided_Frameworks#WindowsTestApp|WindowsTestApp framework]].  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 single script that iterates through the entire collection of test units and executes them one at a time. The order of execution will be in descending alpabetical order (on name) since we explictly called the [[AutoScript#ascript.TestUnits|ArrangeBy]] collection method.&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 takes the very simple 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;
..where &#039;&#039;&#039;TEST_FLIST_NAME&#039;&#039;&#039; is the name of the scl_test_flist test you want to run.  You can then use the Studio tree control to change the order and hierarchy of each item by moving the scripts and creating 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>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=7324</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=7324"/>
		<updated>2008-09-19T16:35:02Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* srTestAnnotationAddComment */&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 [[Host_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;pre&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;/pre&amp;gt;&lt;br /&gt;
Or, as a test function:&lt;br /&gt;
&amp;lt;pre&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;/pre&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 (perl syntax)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&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;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optionally add custom scripts to automate the building and executing your application. Refer to [[Using Frameworks]] for more information regarding building and executing tests with a target device.&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 )&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_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;
  #include &amp;amp;lt;srtest.h&amp;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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(Simple)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #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;
&lt;br /&gt;
=== Simple example using runtime test service APIs  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(RuntimeServices_basic)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #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;
&lt;br /&gt;
=== Simple example using srTest base class  ===&lt;br /&gt;
&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  class MyTest&amp;amp;nbsp;: 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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(MyTest)&lt;br /&gt;
  #endif&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;&amp;lt;code&amp;gt;srTestSuiteAddSuite&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteSetName&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteSetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteAddTest&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetName&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseAddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetStatus&amp;lt;/code&amp;gt;&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteAddAnnotation&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an annotation at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestAnnotationAddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039;: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddSuite ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestSuiteHandle_t srTestSuiteAddSuite(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddSuite() routine is used to add a new test suite to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addSuite)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestSuiteSetName(srTestSuiteHandle_t tTestSuite, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteSetName() routine is used to set the name of the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_setName)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestSuiteSetDescription(srTestSuiteHandle_t tTestSuite, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteSetDescription() routine is used to set the description of the specified test&lt;br /&gt;
suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_setDescription)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddTest ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestCaseHandle_t srTestSuiteAddTest(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddTest() routine is used to add a new test case to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
  void tfsuite_addTest(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;
      srTestCaseHandle_t test = srTestSuiteAddTest(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                                   strm.str().c_str());&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addTest)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetName(srTestCaseHandle_t tTestCase, const srCHAR *szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetName() routine is used to set set the name of the specified test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setName)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetDescription(srTestCaseHandle_t tTestCase, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetDescription() routine is used to set the description of the specified test&lt;br /&gt;
case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setDescription)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseAddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseAddComment(srTestCaseHandle_t tTestCase, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseAddComment() routine is used to add a comment (aka a log) to be&lt;br /&gt;
reported with the specified test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_addComment)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatus ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetStatus() routine is used to set the result of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  void tfcase_setStatus(void)&lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setStatus)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatusEx ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration, srLONG lExtendedFailureCode)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetStatusEx() routine is used to set the result of test case and allow&lt;br /&gt;
specification of an extendedFailureCode.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  void tfcase_setStatusEx(void)&lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseSetStatusEx(srTEST_CASE_DEFAULT, srTEST_FAIL, 0, -5);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setStatusEx)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddAnnotation ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestAnnotationHandle_t srTestSuiteAddAnnotation(rTestSuiteHandle_t tParent, srTestAnnotationLevel_e eLevel, const srCHAR * szName, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddAnnotation() routine is used to add a new annotation to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
  void tfsuite_addAnnotation(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;
      srTestAnnotationHandle_t annot = &lt;br /&gt;
                     srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                              srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                              strmName.str().c_str(),&lt;br /&gt;
                                              strmDescr.str().c_str());&lt;br /&gt;
    }&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addAnnotation)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestAnnotationAddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestAnnotationAddComment(srTestAnnotationHandle_t tTestAnnotation, const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&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;
&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuiteAnnotation_addComment)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
=== C++ Test Classes ===&lt;br /&gt;
The Runtime Test Services APIs work equally well from C test functions and C++ test classes. If, however, you choose to derive your C++ test classes from the STRIDE Runtime base class, &#039;&#039;srTest&#039;&#039;, then you will have access to member objects in srTest and their methods that provide the same functionality as the C API. The srTest base class provides two Member Objects, via which you can access functionality: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Member Objects&#039;&#039;&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;testSuite&#039;&#039;, which has methods: &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddSuite&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetName&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddTest&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddAnnotation&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddAnnotation.AddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
*&#039;&#039;testCase&#039;&#039;, which has methods: &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetName&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetStatus&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Methods of Member Object testSuite &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
==== AddSuite ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestSuite AddSuite(const srCHAR * szName = srNULL)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddSuite method is used to add a new test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetName method is used to set the name of test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetDescription method is used to set the description of test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddTest ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestCase AddTest(const srCHAR * szName = srNULL)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddTest method is used to add a new test case to test suite.&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;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;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddAnnotation ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestAnnoation AddAnnotation(srTestAnnotationLevel_e eLevel, const srCHAR * szName = srNULL, const srCHAR * szDescr = srNULL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddAnnotation method is used to add a new annotation to test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddAnnotation.AddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD AddComment(const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&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;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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Methods of Member Object testCase &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== SetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetName method is used to set the name of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetDescription method is used to set the description of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD AddComment(const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddComment method is used to add a comment to test case.&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;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;
|}&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetStatus ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetStatus(srTestStatus_e eStatus, srDWORD dwDuration = 0)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetStatus method is used to set the result of the default test case.&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;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;
|}&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;gt;&lt;br /&gt;
  void srtest_class::caseSetStatus(void)&lt;br /&gt;
  {&lt;br /&gt;
    testCase.SetStatus(srTEST_INPROGRESS, 0);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Refer to the Reference Guide or the Runtime Developers Guide, both available in the STRIDE Online Help, for detailed information about any of these functions.&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;
   // Ensure test unit exists&lt;br /&gt;
   if (ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;)&amp;amp;nbsp;!= null ) &lt;br /&gt;
     ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;).Run();&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;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
   use strict;&lt;br /&gt;
   use Win32::OLE;&lt;br /&gt;
   Win32::OLE-&amp;amp;gt;Option(Warn =&amp;amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
   my $tu = $main::ascript-&amp;amp;gt;TestUnits-&amp;amp;gt;Item(&amp;quot;Simple&amp;quot;);&lt;br /&gt;
   if (defined $tu) {&lt;br /&gt;
     $tu-&amp;amp;gt;Run();&lt;br /&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;br&amp;gt; &lt;br /&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;
&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;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
   use strict;&lt;br /&gt;
   use Win32::OLE;&lt;br /&gt;
   Win32::OLE-&amp;amp;gt;Option(Warn =&amp;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;amp;gt;TestUnits-&amp;amp;gt;Item($_-&amp;amp;gt;[1]);&lt;br /&gt;
     die &amp;quot;TestUnit not found: $_-&amp;amp;gt;[1]\n&amp;quot; unless (defined $tu);&lt;br /&gt;
     $tu-&amp;amp;gt;Run();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
[[Category:Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_Runtime&amp;diff=7323</id>
		<title>STRIDE Runtime</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_Runtime&amp;diff=7323"/>
		<updated>2008-09-19T01:32:50Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* C++ Test Classes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview  ==&lt;br /&gt;
&lt;br /&gt;
The STRIDE Runtime routes messages both within and between platform boundaries and manages the conversion of interface data as it crosses from one platform to another. This &amp;quot;transparent messaging&amp;quot; model means that your test cases can be located on one platform (e.g., as a script running off-target) and your code on another (on-target). &lt;br /&gt;
&lt;br /&gt;
The STRIDE Runtime is a combination of processes and libraries that provide services for messaging, remote function calls, and tracing while providing seamless connectivity between the target application and the host operating system. The STRIDE Runtime standardizes how threads and applications communicate with each other, independent of the platform on which they are executing, which eliminates the need to integrate new software on the target hardware. Developers can then incrementally integrate embedded software on a combination of the desktop environment and the target hardware, providing more control over integration and testing. New software functionality under development can be simulated on the desktop environment while the software using this new functionality can run on the target hardware. The tremendous flexibility gained by allowing developers to choose how to integrate different software components and target platforms allows developers to detect integration and testing issues and correct defects much earlier in the development process. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Image:Runtime Overview.jpg|600px|center|Overview of the STRIDE Runtime]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The Runtime components consist of: &lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;PAL (Platform Abstraction Layer)&#039;&#039;&#039; - provides a consistent interface for the STRIDE Runtime regardless of the operating system or data transport used. It consists of a small set of functions that provide a virtual link between the target operating system and the STRIDE Runtime. The PAL functionality, defined in the &#039;&#039;pal.h&#039;&#039; header file, allows the STRIDE Runtime to transmit and receive packets of data (called I-blocks) using the platform’s transport mechanism.&lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Host Transport Layer and Object Model&#039;&#039;&#039; - a server process and set of APIs that connects the Transport DLL to the STRIDE Runtime, providing indirect access to the target from host-side scripts and STRIDE applications. The Host Transport Services are defined in the &#039;&#039;transport.h&#039;&#039; header file. The Transport Server process is is accessed through the set of interfaces defined for the &#039;&#039;STRIDE.transport&#039;&#039; COM server.&lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Runtime APIs&#039;&#039;&#039; - a public API set, defined in the &#039;&#039;sr.h&#039;&#039; header file,&amp;amp;nbsp;available for programmers to integrate into their target application code. These APIs support messaging, remote function calls, and tracing between the target application and host operating system.&lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Intercept Module&#039;&#039;&#039; - generated code that facilitates remote function calls between the host and target. The IM code links to the target application; it implements &#039;&#039;&#039;stubs &#039;&#039;&#039;to allow remote function calls from the host to target-resident functions, and &#039;&#039;&#039;proxies &#039;&#039;&#039;that&amp;amp;nbsp;intercept target function calls and remotes them to a host implementation of the function. The IM can contain logic to dynamically switch target-based function calls to either host-resident or target-resident implementations, and capture tracing information, through &#039;&#039;&#039;delegates&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Additionally, groups of Runtime APIs provide test unit logging and services, and a software development kit is available for creating windows-based target applications. Each is briefly described here, with links provided for more detail. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Platform Abstraction Layer&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The&amp;amp;nbsp;Platform Abstraction Layer, or PAL, defines the set of OS functionality required by the platform to support the STRIDE Runtime. The “pal.h” header file provided with the STRIDE installation defines the PAL functionality. The PAL also defines functionality required by the STRIDE Runtime to transmit and receive packets of data (called I-blocks) using the platform’s transport mechanism. These PAL routines enable the STRIDE Runtime to be installed on diverse environments without changing its internal design.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Refer to the [[Platform Abstraction Layer|Platform Abstraction Layer]] page and the [[http://www.s2technologies.com/pdf/s2sPAL.pdf PAL Specification]] document for a more detailed description of the PAL and its interfaces. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== The Host Transport Services  ==&lt;br /&gt;
&lt;br /&gt;
The Host Transport Services define an interface that enables the STRIDE Runtime on your target to send data to and receive data from the target. The STRIDE Transport Server connects the Transport DLL to the STRIDE Runtime running on the host platform, thus providing indirect access to the target from STRIDE Studio, Autoscript, and other STRIDE applications. Several common transports are already supported within the STRIDE Transport Server, including serial and TCP/IP. &lt;br /&gt;
&lt;br /&gt;
[[Image:Transport diagram.gif|center|Host Transport Services Diagram]] &lt;br /&gt;
&lt;br /&gt;
The Host Transport Services are defined in &amp;quot;transport.h&amp;quot; and each Transport DLL must implement the interfaces derived from the IStrideTransport class. &lt;br /&gt;
&lt;br /&gt;
Refer to the [[http://www.s2technologies.com/pdf/s2sTransport.pdf Host Runtime Transport Specification]] document for a more detailed description of the Host Transport Services. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== The Intercept Module  ==&lt;br /&gt;
&lt;br /&gt;
The [[Intercept Module]] page provides details of the Intercept Module concept.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The [[Name Mangling]] page provides more background on the use of name mangling when implementing delegates within an Intercept Module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Runtime Developer&#039;s Guide  ==&lt;br /&gt;
&lt;br /&gt;
Click [[http://www.s2technologies.com/pdf/s2sRuntime.pdf here]] to view the STRIDE Runtime Developer&#039;s Guide PDF document. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Public Services&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Runtime Test Services (RTS)&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The Runtime Test Services (RTS) are a set of C-based 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.&amp;lt;br&amp;gt;These C-based APIs work equally well from &#039;&#039;&#039;C Test Functions&#039;&#039;&#039; and &#039;&#039;&#039;C++ Test Classes&#039;&#039;&#039;. If, however, you choose to derive your C++ test classes from the &#039;&#039;&#039;STRIDE Runtime Base Class (srTest)&#039;&#039;&#039;, then you will have access to member objects in the srTest class and its methods that provide the same functionality as the C APIs.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== C Test Functions  ====&lt;br /&gt;
&lt;br /&gt;
C test functions enable testing of C code similarily to xUnit-style testing. Test functions can be written by users, captured using the scl_function pragma, and executed from the host. C-based Runtime Test Services APIs are available for use in test functions.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;C-based Runtime Test Services APIs provided:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteAddSuite&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteSetName&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteSetDescription&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteAddTest&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseSetName&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseSetDescription&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseAddComment&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseSetStatus&#039;&#039;&#039;: explicitly sets the status for the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseSetStatusEx&#039;&#039;&#039;: explicitly sets the status for the specified test case and allows specification of an extended failure code.&lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteAddAnnotation: creates an annotation at runtime.&lt;br /&gt;
*&#039;&#039;&#039;srTestAnnotationAddComment: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== C++ Test Classes  ====&lt;br /&gt;
&lt;br /&gt;
C++ test classes enable testing of C++ code similarily to xUnit-style testing. Test classes can be written by users, captured using scl_test_class, scl_test_setup and scl_test_teardown pragmas, and executed from the host. C-based Runtime Test Services APIs as well as C++ Runtime Base Class are available for use in test classes.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Member objects of srTest base class:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;testSuite &#039;&#039;&#039;member object provides following methods: &lt;br /&gt;
**&#039;&#039;&#039;AddSuite&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
**&#039;&#039;&#039;SetName&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
**&#039;&#039;&#039;SetDescription&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
**&#039;&#039;&#039;AddTest&#039;&#039;&#039;: creates an additional test case at runtime.&lt;br /&gt;
**&#039;&#039;&#039;AddAnnotation&lt;br /&gt;
**&#039;&#039;&#039;AddAnnotation.AddComment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;testCase &#039;&#039;&#039;member object provides following methods: &lt;br /&gt;
**&#039;&#039;&#039;SetName&#039;&#039;&#039;&amp;lt;span style=&amp;quot;font-weight: bold;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;: sets the name of the specified test case. &lt;br /&gt;
**&#039;&#039;&#039;SetDescription&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
**&#039;&#039;&#039;AddComment&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
**&#039;&#039;&#039;SetStatus&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; These services use the &#039;&#039;&#039;&#039;&#039;srtest.h&#039;&#039;&#039;&#039;&#039; header file. Please refer to the &#039;&#039;&#039;[[Test_Units#Runtime_Test_Services|Test Units page]]&#039;&#039;&#039;, or Chapter 4 of the [[http://www.s2technologies.com/pdf/s2sRuntime.pdf Runtime Developer&#039;s Guide]] for more information on these APIs.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Logging Services  ===&lt;br /&gt;
&lt;br /&gt;
The following are the categories available in the Runtime API for logging, that is, collecting and/or displaying, information at the host runtime environment: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Setup and Shutdown&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;srCreateSTID()&#039;&#039;&#039;: used to allocate resources required to send and receive trace and print messages that implement the following APIs. &lt;br /&gt;
**&#039;&#039;&#039;srDeleteSTID()&#039;&#039;&#039;: used to free STRIDE Runtime resources previously allocated for an STID.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Tracing&#039;&#039;&#039; - Tracing routines are used by target applications for information collection and display by the host runtime environment. &lt;br /&gt;
**&#039;&#039;&#039;srTracePoint()&#039;&#039;&#039;: used to output a data structure to the tracing window on the host. &lt;br /&gt;
**&#039;&#039;&#039;srTraceStr()&#039;&#039;&#039;: used to output a string to the tracing window.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Printing&#039;&#039;&#039; - These routines are used by applications to log or display messages on Trace Views on the host. &lt;br /&gt;
**&#039;&#039;&#039;srPrintInfo()&#039;&#039;&#039;: used to output a formatted string with variable arguments to be displayed at information level filtering. &lt;br /&gt;
**&#039;&#039;&#039;srPrintError()&#039;&#039;&#039;: used to output a formatted string with variable arguments to be displayed at error level filtering.&lt;br /&gt;
&lt;br /&gt;
These services use the &#039;&#039;&#039;&#039;&#039;sr.h&#039;&#039;&#039;&#039;&#039; header file. Please refer to Chapter 3 of the [[http://www.s2technologies.com/pdf/s2sRuntime.pdf Runtime Developer&#039;s Guide]] for more information on these APIs.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Windows Off-Target SDK  ==&lt;br /&gt;
&lt;br /&gt;
The STRIDE development environment provides a way for you to build and execute your application and test code off-target, on a Windows host platform. This provides a faster way to test and validate your code since it does not require you to build your target application and re-image the device. &lt;br /&gt;
&lt;br /&gt;
The Windows Off-Target SDK consists of:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The Target Runtime, PAL and [[GRS|GRS]] packaged in the s2srwin.lib and s2srwin.dll files, installed in the STRIDE\lib and STRIDE\bin directories.&lt;br /&gt;
&lt;br /&gt;
*The public APIs for these components, available through header files installed in the STRIDE\inc directory. These include: &lt;br /&gt;
**sr.h &lt;br /&gt;
**srwin.h &lt;br /&gt;
**grs.h &lt;br /&gt;
**pal.h&lt;br /&gt;
&lt;br /&gt;
*Utility script components that facilitate building and executing off-target applications on Windows hosts: &lt;br /&gt;
**[[STRIDE.vsbuild|STRIDE.vsbuild]] &lt;br /&gt;
**[[STRIDE.windowsprocess|STRIDE.windowsprocess]]&lt;br /&gt;
&lt;br /&gt;
These components are written in the Perl scripting language and therefore require that Perl be installed. See [[Host_Installation#Third Party Requirements|Perl requirements]] for more information.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Development of off-target applications using the SDK resources is discussed in more detail in the [[Windows Off-Target Apps|Windows Off-Target Apps]] page.&lt;br /&gt;
&lt;br /&gt;
== The Transport Server Object Model  ==&lt;br /&gt;
&lt;br /&gt;
The Transport Server is an out-of-process COM server that provides connection management, loopback and diagnostic features. It can be accessed by clients through the STRIDE.transport Program ID. The Transport Server API is defined in the [[Transport Server Component|Transport Server Object Model]] page.&lt;br /&gt;
&lt;br /&gt;
[[Category: Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=7322</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=7322"/>
		<updated>2008-09-19T01:01:34Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* AddAnnotation.AddComment */&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 [[Host_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;pre&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;/pre&amp;gt;&lt;br /&gt;
Or, as a test function:&lt;br /&gt;
&amp;lt;pre&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;/pre&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 (perl syntax)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&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;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optionally add custom scripts to automate the building and executing your application. Refer to [[Using Frameworks]] for more information regarding building and executing tests with a target device.&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 )&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_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;
  #include &amp;amp;lt;srtest.h&amp;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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(Simple)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #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;
&lt;br /&gt;
=== Simple example using runtime test service APIs  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(RuntimeServices_basic)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #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;
&lt;br /&gt;
=== Simple example using srTest base class  ===&lt;br /&gt;
&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  class MyTest&amp;amp;nbsp;: 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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(MyTest)&lt;br /&gt;
  #endif&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;&amp;lt;code&amp;gt;srTestSuiteAddSuite&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteSetName&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteSetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteAddTest&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetName&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseAddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetStatus&amp;lt;/code&amp;gt;&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteAddAnnotation&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an annotation at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestAnnotationAddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039;: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddSuite ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestSuiteHandle_t srTestSuiteAddSuite(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddSuite() routine is used to add a new test suite to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addSuite)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestSuiteSetName(srTestSuiteHandle_t tTestSuite, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteSetName() routine is used to set the name of the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_setName)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestSuiteSetDescription(srTestSuiteHandle_t tTestSuite, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteSetDescription() routine is used to set the description of the specified test&lt;br /&gt;
suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_setDescription)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddTest ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestCaseHandle_t srTestSuiteAddTest(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddTest() routine is used to add a new test case to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
  void tfsuite_addTest(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;
      srTestCaseHandle_t test = srTestSuiteAddTest(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                                   strm.str().c_str());&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addTest)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetName(srTestCaseHandle_t tTestCase, const srCHAR *szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetName() routine is used to set set the name of the specified test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setName)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetDescription(srTestCaseHandle_t tTestCase, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetDescription() routine is used to set the description of the specified test&lt;br /&gt;
case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setDescription)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseAddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseAddComment(srTestCaseHandle_t tTestCase, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseAddComment() routine is used to add a comment (aka a log) to be&lt;br /&gt;
reported with the specified test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_addComment)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatus ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetStatus() routine is used to set the result of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  void tfcase_setStatus(void)&lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setStatus)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatusEx ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration, srLONG lExtendedFailureCode)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetStatusEx() routine is used to set the result of test case and allow&lt;br /&gt;
specification of an extendedFailureCode.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  void tfcase_setStatusEx(void)&lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseSetStatusEx(srTEST_CASE_DEFAULT, srTEST_FAIL, 0, -5);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setStatusEx)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddAnnotation ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestAnnotationHandle_t srTestSuiteAddAnnotation(rTestSuiteHandle_t tParent, srTestAnnotationLevel_e eLevel, const srCHAR * szName, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddAnnotation() routine is used to add a new annotation to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
  void tfsuite_addAnnotation(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;
      srTestAnnotationHandle_t annot = &lt;br /&gt;
                     srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                              srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                              strmName.str().c_str(),&lt;br /&gt;
                                              strmDescr.str().c_str());&lt;br /&gt;
    }&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addAnnotation)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestAnnotationAddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestAnnotationAddComment(srTestAnnotationHandle_t tTestAnnotation, const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&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;
&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
                                 &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuiteAnnotation_addComment)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== C++ Test Classes ===&lt;br /&gt;
The Runtime Test Services APIs work equally well from C test functions and C++ test classes. If, however, you choose to derive your C++ test classes from the STRIDE Runtime base class, &#039;&#039;srTest&#039;&#039;, then you will have access to member objects in srTest and their methods that provide the same functionality as the C API. The srTest base class provides two Member Objects, via which you can access functionality: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Member Objects&#039;&#039;&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;testSuite&#039;&#039;, which has methods: &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddSuite&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetName&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddTest&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddAnnotation&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddAnnotation.AddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
*&#039;&#039;testCase&#039;&#039;, which has methods: &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetName&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetStatus&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Methods of Member Object testSuite &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
==== AddSuite ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestSuite AddSuite(const srCHAR * szName = srNULL)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddSuite method is used to add a new test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetName method is used to set the name of test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetDescription method is used to set the description of test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddTest ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestCase AddTest(const srCHAR * szName = srNULL)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddTest method is used to add a new test case to test suite.&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;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;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddAnnotation ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestAnnoation AddAnnotation(srTestAnnotationLevel_e eLevel, const srCHAR * szName = srNULL, const srCHAR * szDescr = srNULL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddAnnotation method is used to add a new annotation to test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddAnnotation.AddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD AddComment(const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&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;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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Methods of Member Object testCase &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== SetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetName method is used to set the name of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetDescription method is used to set the description of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD AddComment(const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddComment method is used to add a comment to test case.&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;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;
|}&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetStatus ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetStatus(srTestStatus_e eStatus, srDWORD dwDuration = 0)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetStatus method is used to set the result of the default test case.&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;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;
|}&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;gt;&lt;br /&gt;
  void srtest_class::caseSetStatus(void)&lt;br /&gt;
  {&lt;br /&gt;
    testCase.SetStatus(srTEST_INPROGRESS, 0);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Refer to the Reference Guide or the Runtime Developers Guide, both available in the STRIDE Online Help, for detailed information about any of these functions.&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;
   // Ensure test unit exists&lt;br /&gt;
   if (ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;)&amp;amp;nbsp;!= null ) &lt;br /&gt;
     ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;).Run();&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;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
   use strict;&lt;br /&gt;
   use Win32::OLE;&lt;br /&gt;
   Win32::OLE-&amp;amp;gt;Option(Warn =&amp;amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
   my $tu = $main::ascript-&amp;amp;gt;TestUnits-&amp;amp;gt;Item(&amp;quot;Simple&amp;quot;);&lt;br /&gt;
   if (defined $tu) {&lt;br /&gt;
     $tu-&amp;amp;gt;Run();&lt;br /&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;br&amp;gt; &lt;br /&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;
&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;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
   use strict;&lt;br /&gt;
   use Win32::OLE;&lt;br /&gt;
   Win32::OLE-&amp;amp;gt;Option(Warn =&amp;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;amp;gt;TestUnits-&amp;amp;gt;Item($_-&amp;amp;gt;[1]);&lt;br /&gt;
     die &amp;quot;TestUnit not found: $_-&amp;amp;gt;[1]\n&amp;quot; unless (defined $tu);&lt;br /&gt;
     $tu-&amp;amp;gt;Run();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
[[Category:Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Test_Units_Overview&amp;diff=7321</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=7321"/>
		<updated>2008-09-19T01:00:14Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime Test Services */  SCR 8998&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 [[Host_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;pre&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;/pre&amp;gt;&lt;br /&gt;
Or, as a test function:&lt;br /&gt;
&amp;lt;pre&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;/pre&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 (perl syntax)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&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;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optionally add custom scripts to automate the building and executing your application. Refer to [[Using Frameworks]] for more information regarding building and executing tests with a target device.&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 )&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_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;
  #include &amp;amp;lt;srtest.h&amp;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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(Simple)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #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;
&lt;br /&gt;
=== Simple example using runtime test service APIs  ===&lt;br /&gt;
==== Using a Test Class ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(RuntimeServices_basic)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== Using a Test Function ====&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;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;
  #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;
&lt;br /&gt;
=== Simple example using srTest base class  ===&lt;br /&gt;
&lt;br /&gt;
  #include &amp;amp;lt;srtest.h&amp;amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  class MyTest&amp;amp;nbsp;: 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;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(MyTest)&lt;br /&gt;
  #endif&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;&amp;lt;code&amp;gt;srTestSuiteAddSuite&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteSetName&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteSetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteAddTest&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetName&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseAddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestCaseSetStatus&amp;lt;/code&amp;gt;&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestSuiteAddAnnotation&amp;lt;/code&amp;gt;&#039;&#039;&#039;: creates an annotation at runtime. &lt;br /&gt;
*&#039;&#039;&#039;&amp;lt;code&amp;gt;srTestAnnotationAddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039;: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddSuite ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestSuiteHandle_t srTestSuiteAddSuite(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddSuite() routine is used to add a new test suite to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addSuite)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestSuiteSetName(srTestSuiteHandle_t tTestSuite, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteSetName() routine is used to set the name of the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_setName)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteSetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestSuiteSetDescription(srTestSuiteHandle_t tTestSuite, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteSetDescription() routine is used to set the description of the specified test&lt;br /&gt;
suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_setDescription)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddTest ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestCaseHandle_t srTestSuiteAddTest(srTestSuiteHandle_t tParent, const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddTest() routine is used to add a new test case to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
  void tfsuite_addTest(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;
      srTestCaseHandle_t test = srTestSuiteAddTest(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                                   strm.str().c_str());&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addTest)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetName(srTestCaseHandle_t tTestCase, const srCHAR *szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetName() routine is used to set set the name of the specified test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setName)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetDescription(srTestCaseHandle_t tTestCase, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetDescription() routine is used to set the description of the specified test&lt;br /&gt;
case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setDescription)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseAddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseAddComment(srTestCaseHandle_t tTestCase, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseAddComment() routine is used to add a comment (aka a log) to be&lt;br /&gt;
reported with the specified test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_addComment)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatus ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetStatus() routine is used to set the result of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  void tfcase_setStatus(void)&lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseSetStatus(srTEST_CASE_DEFAULT, srTEST_PASS, 0);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setStatus)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestCaseSetStatusEx ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestCaseSetStatus(srTestCaseHandle_t tTestCase, srTestStatus_e eStatus, srDWORD dwDuration, srLONG lExtendedFailureCode)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestCaseSetStatusEx() routine is used to set the result of test case and allow&lt;br /&gt;
specification of an extendedFailureCode.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  void tfcase_setStatusEx(void)&lt;br /&gt;
  {&lt;br /&gt;
    srTestCaseSetStatusEx(srTEST_CASE_DEFAULT, srTEST_FAIL, 0, -5);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfcase_setStatusEx)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestSuiteAddAnnotation ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestAnnotationHandle_t srTestSuiteAddAnnotation(rTestSuiteHandle_t tParent, srTestAnnotationLevel_e eLevel, const srCHAR * szName, const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The srTestSuiteAddAnnotation() routine is used to add a new annotation to the specified test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
  void tfsuite_addAnnotation(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;
      srTestAnnotationHandle_t annot = &lt;br /&gt;
                     srTestSuiteAddAnnotation(srTEST_SUITE_DEFAULT,&lt;br /&gt;
                                              srTEST_ANNOTATION_LEVEL_ERROR,&lt;br /&gt;
                                              strmName.str().c_str(),&lt;br /&gt;
                                              strmDescr.str().c_str());&lt;br /&gt;
    }&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuite_addAnnotation)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== srTestAnnotationAddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD srTestAnnotationAddComment(srTestAnnotationHandle_t tTestAnnotation, const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&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;
&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
                                 &amp;quot;this comment should print %s&amp;quot;, &amp;quot;A STRING&amp;quot;);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_flist(“testfunc”, tfsuiteAnnotation_addComment)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== C++ Test Classes ===&lt;br /&gt;
The Runtime Test Services APIs work equally well from C test functions and C++ test classes. If, however, you choose to derive your C++ test classes from the STRIDE Runtime base class, &#039;&#039;srTest&#039;&#039;, then you will have access to member objects in srTest and their methods that provide the same functionality as the C API. The srTest base class provides two Member Objects, via which you can access functionality: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Member Objects&#039;&#039;&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;testSuite&#039;&#039;, which has methods: &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddSuite&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetName&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddTest&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddAnnotation&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddAnnotation.AddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
*&#039;&#039;testCase&#039;&#039;, which has methods: &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetName&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetDescription&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;AddComment&amp;lt;/code&amp;gt;&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;&amp;lt;code&amp;gt;SetStatus&amp;lt;/code&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Methods of Member Object testSuite &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
==== AddSuite ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestSuite AddSuite(const srCHAR * szName = srNULL)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddSuite method is used to add a new test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  } &amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetName method is used to set the name of test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetDescription method is used to set the description of test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddTest ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestCase AddTest(const srCHAR * szName = srNULL)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddTest method is used to add a new test case to test suite.&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;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;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddAnnotation ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srTestAnnoation AddAnnotation(srTestAnnotationLevel_e eLevel, const srCHAR * szName = srNULL, const srCHAR * szDescr = srNULL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddAnnotation method is used to add a new annotation to test suite.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&lt;br /&gt;
  #include &amp;lt;sstream&amp;gt;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddAnnotation.AddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD AddComment(const srCHAR * szLabel, const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&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;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;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;
|}&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039; Methods of Member Object testCase &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
==== SetName ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetName(const srCHAR * szName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetName method is used to set the name of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetDescription ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetDescription(const srCHAR * szDescr)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetDescription method is used to set the description of test case.&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;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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== AddComment ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD AddComment(const srCHAR * szFmtComment, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The AddComment method is used to add a comment to test case.&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;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;
|}&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;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;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
==== SetStatus ====&lt;br /&gt;
&#039;&#039;&#039;Prototype&#039;&#039;&#039;&lt;br /&gt;
  srWORD SetStatus(srTestStatus_e eStatus, srDWORD dwDuration = 0)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
The SetStatus method is used to set the result of the default test case.&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;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;
|}&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;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
  #include &amp;quot;srtest.h&amp;quot;&amp;lt;br&amp;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;
  };&amp;lt;br&amp;gt;&lt;br /&gt;
  void srtest_class::caseSetStatus(void)&lt;br /&gt;
  {&lt;br /&gt;
    testCase.SetStatus(srTEST_INPROGRESS, 0);&lt;br /&gt;
  }&amp;lt;br&amp;gt;&lt;br /&gt;
  #ifdef _SCL&lt;br /&gt;
  #pragma scl_test_class(srtest_class)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Refer to the Reference Guide or the Runtime Developers Guide, both available in the STRIDE Online Help, for detailed information about any of these functions.&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;
   // Ensure test unit exists&lt;br /&gt;
   if (ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;)&amp;amp;nbsp;!= null ) &lt;br /&gt;
     ascript.TestUnits.Item(&amp;quot;Simple&amp;quot;).Run();&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;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
   use strict;&lt;br /&gt;
   use Win32::OLE;&lt;br /&gt;
   Win32::OLE-&amp;amp;gt;Option(Warn =&amp;amp;gt; 3);&lt;br /&gt;
   &lt;br /&gt;
   my $tu = $main::ascript-&amp;amp;gt;TestUnits-&amp;amp;gt;Item(&amp;quot;Simple&amp;quot;);&lt;br /&gt;
   if (defined $tu) {&lt;br /&gt;
     $tu-&amp;amp;gt;Run();&lt;br /&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;br&amp;gt; &lt;br /&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;
&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;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
   use strict;&lt;br /&gt;
   use Win32::OLE;&lt;br /&gt;
   Win32::OLE-&amp;amp;gt;Option(Warn =&amp;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;amp;gt;TestUnits-&amp;amp;gt;Item($_-&amp;amp;gt;[1]);&lt;br /&gt;
     die &amp;quot;TestUnit not found: $_-&amp;amp;gt;[1]\n&amp;quot; unless (defined $tu);&lt;br /&gt;
     $tu-&amp;amp;gt;Run();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
[[Category:Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_Runtime&amp;diff=7320</id>
		<title>STRIDE Runtime</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_Runtime&amp;diff=7320"/>
		<updated>2008-09-19T00:21:10Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime Test Services (RTS)&amp;lt;br&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview  ==&lt;br /&gt;
&lt;br /&gt;
The STRIDE Runtime routes messages both within and between platform boundaries and manages the conversion of interface data as it crosses from one platform to another. This &amp;quot;transparent messaging&amp;quot; model means that your test cases can be located on one platform (e.g., as a script running off-target) and your code on another (on-target). &lt;br /&gt;
&lt;br /&gt;
The STRIDE Runtime is a combination of processes and libraries that provide services for messaging, remote function calls, and tracing while providing seamless connectivity between the target application and the host operating system. The STRIDE Runtime standardizes how threads and applications communicate with each other, independent of the platform on which they are executing, which eliminates the need to integrate new software on the target hardware. Developers can then incrementally integrate embedded software on a combination of the desktop environment and the target hardware, providing more control over integration and testing. New software functionality under development can be simulated on the desktop environment while the software using this new functionality can run on the target hardware. The tremendous flexibility gained by allowing developers to choose how to integrate different software components and target platforms allows developers to detect integration and testing issues and correct defects much earlier in the development process. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Image:Runtime Overview.jpg|600px|center|Overview of the STRIDE Runtime]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The Runtime components consist of: &lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;PAL (Platform Abstraction Layer)&#039;&#039;&#039; - provides a consistent interface for the STRIDE Runtime regardless of the operating system or data transport used. It consists of a small set of functions that provide a virtual link between the target operating system and the STRIDE Runtime. The PAL functionality, defined in the &#039;&#039;pal.h&#039;&#039; header file, allows the STRIDE Runtime to transmit and receive packets of data (called I-blocks) using the platform’s transport mechanism.&lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Host Transport Layer and Object Model&#039;&#039;&#039; - a server process and set of APIs that connects the Transport DLL to the STRIDE Runtime, providing indirect access to the target from host-side scripts and STRIDE applications. The Host Transport Services are defined in the &#039;&#039;transport.h&#039;&#039; header file. The Transport Server process is is accessed through the set of interfaces defined for the &#039;&#039;STRIDE.transport&#039;&#039; COM server.&lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Runtime APIs&#039;&#039;&#039; - a public API set, defined in the &#039;&#039;sr.h&#039;&#039; header file,&amp;amp;nbsp;available for programmers to integrate into their target application code. These APIs support messaging, remote function calls, and tracing between the target application and host operating system.&lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Intercept Module&#039;&#039;&#039; - generated code that facilitates remote function calls between the host and target. The IM code links to the target application; it implements &#039;&#039;&#039;stubs &#039;&#039;&#039;to allow remote function calls from the host to target-resident functions, and &#039;&#039;&#039;proxies &#039;&#039;&#039;that&amp;amp;nbsp;intercept target function calls and remotes them to a host implementation of the function. The IM can contain logic to dynamically switch target-based function calls to either host-resident or target-resident implementations, and capture tracing information, through &#039;&#039;&#039;delegates&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Additionally, groups of Runtime APIs provide test unit logging and services, and a software development kit is available for creating windows-based target applications. Each is briefly described here, with links provided for more detail. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Platform Abstraction Layer&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The&amp;amp;nbsp;Platform Abstraction Layer, or PAL, defines the set of OS functionality required by the platform to support the STRIDE Runtime. The “pal.h” header file provided with the STRIDE installation defines the PAL functionality. The PAL also defines functionality required by the STRIDE Runtime to transmit and receive packets of data (called I-blocks) using the platform’s transport mechanism. These PAL routines enable the STRIDE Runtime to be installed on diverse environments without changing its internal design.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Refer to the [[Platform Abstraction Layer|Platform Abstraction Layer]] page and the [[http://www.s2technologies.com/pdf/s2sPAL.pdf PAL Specification]] document for a more detailed description of the PAL and its interfaces. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== The Host Transport Services  ==&lt;br /&gt;
&lt;br /&gt;
The Host Transport Services define an interface that enables the STRIDE Runtime on your target to send data to and receive data from the target. The STRIDE Transport Server connects the Transport DLL to the STRIDE Runtime running on the host platform, thus providing indirect access to the target from STRIDE Studio, Autoscript, and other STRIDE applications. Several common transports are already supported within the STRIDE Transport Server, including serial and TCP/IP. &lt;br /&gt;
&lt;br /&gt;
[[Image:Transport diagram.gif|center|Host Transport Services Diagram]] &lt;br /&gt;
&lt;br /&gt;
The Host Transport Services are defined in &amp;quot;transport.h&amp;quot; and each Transport DLL must implement the interfaces derived from the IStrideTransport class. &lt;br /&gt;
&lt;br /&gt;
Refer to the [[http://www.s2technologies.com/pdf/s2sTransport.pdf Host Runtime Transport Specification]] document for a more detailed description of the Host Transport Services. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== The Intercept Module  ==&lt;br /&gt;
&lt;br /&gt;
The [[Intercept Module]] page provides details of the Intercept Module concept.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The [[Name Mangling]] page provides more background on the use of name mangling when implementing delegates within an Intercept Module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Runtime Developer&#039;s Guide  ==&lt;br /&gt;
&lt;br /&gt;
Click [[http://www.s2technologies.com/pdf/s2sRuntime.pdf here]] to view the STRIDE Runtime Developer&#039;s Guide PDF document. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Public Services&amp;lt;br&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Runtime Test Services (RTS)&amp;lt;br&amp;gt;  ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;The Runtime Test Services (RTS) are a set of C-based 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.&amp;lt;br&amp;gt;These C-based APIs work equally well from &#039;&#039;&#039;C Test Functions&#039;&#039;&#039; and &#039;&#039;&#039;C++ Test Classes&#039;&#039;&#039;. If, however, you choose to derive your C++ test classes from the &#039;&#039;&#039;STRIDE Runtime Base Class (srTest)&#039;&#039;&#039;, then you will have access to member objects in the srTest class and its methods that provide the same functionality as the C APIs.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== C Test Functions  ====&lt;br /&gt;
&lt;br /&gt;
C test functions enable testing of C code similarily to xUnit-style testing. Test functions can be written by users, captured using the scl_function pragma, and executed from the host. C-based Runtime Test Services APIs are available for use in test functions.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;C-based Runtime Test Services APIs provided:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteAddSuite&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteSetName&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteSetDescription&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteAddTest&#039;&#039;&#039;: creates an additional test case at runtime. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseSetName&#039;&#039;&#039;: sets the name of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseSetDescription&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseAddComment&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseSetStatus&#039;&#039;&#039;: explicitly sets the status for the specified test case. &lt;br /&gt;
*&#039;&#039;&#039;srTestCaseSetStatusEx&#039;&#039;&#039;: explicitly sets the status for the specified test case and allows specification of an extended failure code.&lt;br /&gt;
*&#039;&#039;&#039;srTestSuiteAddAnnotation: creates an annotation at runtime.&lt;br /&gt;
*&#039;&#039;&#039;srTestAnnotationAddComment: adds a comment to the specified annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== C++ Test Classes  ====&lt;br /&gt;
&lt;br /&gt;
C++ test classes enable testing of C++ code similarily to xUnit-style testing. Test classes can be written by users, captured using scl_test_class, scl_test_setup and scl_test_teardown pragmas, and executed from the host. C-based Runtime Test Services APIs as well as C++ Runtime Base Class are available for use in test classes.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Member objects of srTest base class:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;testSuite &#039;&#039;&#039;member object provides following methods: &lt;br /&gt;
**&#039;&#039;&#039;AddSuite&#039;&#039;&#039;: creates an additional sub-suite at runtime. &lt;br /&gt;
**&#039;&#039;&#039;SetName&#039;&#039;&#039;: sets the name of the specified suite. &lt;br /&gt;
**&#039;&#039;&#039;SetDescription&#039;&#039;&#039;: sets the description of the specified suite. &lt;br /&gt;
**&#039;&#039;&#039;AddTest&#039;&#039;&#039;: creates an additional test case at runtime.&lt;br /&gt;
**&#039;&#039;&#039;AddAnnotation&lt;br /&gt;
**&#039;&#039;&#039;AddAnnotation.AddComment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;testCase &#039;&#039;&#039;member object provides following methods: &lt;br /&gt;
**&#039;&#039;&#039;SetName&#039;&#039;&#039;&amp;lt;span style=&amp;quot;font-weight: bold;&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;: sets the name of the specified test case. &lt;br /&gt;
**&#039;&#039;&#039;SetDescription&#039;&#039;&#039;: sets the description of the specified test case. &lt;br /&gt;
**&#039;&#039;&#039;AddComment&#039;&#039;&#039;: adds a comment to the specified test case. &lt;br /&gt;
**&#039;&#039;&#039;SetStatus&#039;&#039;&#039;: explicitly sets the status for the specified test case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; These services use the &#039;&#039;&#039;&#039;&#039;srtest.h&#039;&#039;&#039;&#039;&#039; header file. Please refer to the [[Test_Units#Runtime_Test_Services|Test Units page]], or Chapter 4 of the [[http://www.s2technologies.com/pdf/s2sRuntime.pdf Runtime Developer&#039;s Guide]] for more information on these APIs.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Logging Services  ===&lt;br /&gt;
&lt;br /&gt;
The following are the categories available in the Runtime API for logging, that is, collecting and/or displaying, information at the host runtime environment: &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Setup and Shutdown&#039;&#039;&#039; &lt;br /&gt;
**&#039;&#039;&#039;srCreateSTID()&#039;&#039;&#039;: used to allocate resources required to send and receive trace and print messages that implement the following APIs. &lt;br /&gt;
**&#039;&#039;&#039;srDeleteSTID()&#039;&#039;&#039;: used to free STRIDE Runtime resources previously allocated for an STID.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Tracing&#039;&#039;&#039; - Tracing routines are used by target applications for information collection and display by the host runtime environment. &lt;br /&gt;
**&#039;&#039;&#039;srTracePoint()&#039;&#039;&#039;: used to output a data structure to the tracing window on the host. &lt;br /&gt;
**&#039;&#039;&#039;srTraceStr()&#039;&#039;&#039;: used to output a string to the tracing window.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Printing&#039;&#039;&#039; - These routines are used by applications to log or display messages on Trace Views on the host. &lt;br /&gt;
**&#039;&#039;&#039;srPrintInfo()&#039;&#039;&#039;: used to output a formatted string with variable arguments to be displayed at information level filtering. &lt;br /&gt;
**&#039;&#039;&#039;srPrintError()&#039;&#039;&#039;: used to output a formatted string with variable arguments to be displayed at error level filtering.&lt;br /&gt;
&lt;br /&gt;
These services use the &#039;&#039;&#039;&#039;&#039;sr.h&#039;&#039;&#039;&#039;&#039; header file. Please refer to Chapter 3 of the [[http://www.s2technologies.com/pdf/s2sRuntime.pdf Runtime Developer&#039;s Guide]] for more information on these APIs.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Windows Off-Target SDK  ==&lt;br /&gt;
&lt;br /&gt;
The STRIDE development environment provides a way for you to build and execute your application and test code off-target, on a Windows host platform. This provides a faster way to test and validate your code since it does not require you to build your target application and re-image the device. &lt;br /&gt;
&lt;br /&gt;
The Windows Off-Target SDK consists of:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*The Target Runtime, PAL and [[GRS|GRS]] packaged in the s2srwin.lib and s2srwin.dll files, installed in the STRIDE\lib and STRIDE\bin directories.&lt;br /&gt;
&lt;br /&gt;
*The public APIs for these components, available through header files installed in the STRIDE\inc directory. These include: &lt;br /&gt;
**sr.h &lt;br /&gt;
**srwin.h &lt;br /&gt;
**grs.h &lt;br /&gt;
**pal.h&lt;br /&gt;
&lt;br /&gt;
*Utility script components that facilitate building and executing off-target applications on Windows hosts: &lt;br /&gt;
**[[STRIDE.vsbuild|STRIDE.vsbuild]] &lt;br /&gt;
**[[STRIDE.windowsprocess|STRIDE.windowsprocess]]&lt;br /&gt;
&lt;br /&gt;
These components are written in the Perl scripting language and therefore require that Perl be installed. See [[Host_Installation#Third Party Requirements|Perl requirements]] for more information.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Development of off-target applications using the SDK resources is discussed in more detail in the [[Windows Off-Target Apps|Windows Off-Target Apps]] page.&lt;br /&gt;
&lt;br /&gt;
== The Transport Server Object Model  ==&lt;br /&gt;
&lt;br /&gt;
The Transport Server is an out-of-process COM server that provides connection management, loopback and diagnostic features. It can be accessed by clients through the STRIDE.transport Program ID. The Transport Server API is defined in the [[Transport Server Component|Transport Server Object Model]] page.&lt;br /&gt;
&lt;br /&gt;
[[Category: Reference]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=7311</id>
		<title>Studio:Integrating the Intercept Module (IM)</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=7311"/>
		<updated>2008-09-17T19:32:50Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Linux Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Intercept Modules ==&lt;br /&gt;
Intercept Modules allow remote function calls across hardware (e.g., processor or machine) or software (operating system) platform boundaries. Intercept Modules are target-based components that are created as a step in the STRIDE build process. The [[Intercept Module|Intercept Module]], or IM, is created based on selected interfaces or test units that have been &amp;quot;captured&amp;quot;, or identified through a subset of SCL pragmas that tag interfaces as candidates for remote function calls. Once created, the generated code is then compiled, linked and run along with the target application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Activating the Intercept Module ==&lt;br /&gt;
=== Compiling the IM ===&lt;br /&gt;
To compile the IM, you must define the macro &#039;&#039;&#039;srIMON&#039;&#039;&#039; when you compile the IM.c file or any file that includes one of the headers.  This &amp;quot;turns on&amp;quot; the intercept feature. For example:&lt;br /&gt;
  cc -c -IC:\STRIDE\inc -DsrIMON MyProjectIM.c&lt;br /&gt;
&lt;br /&gt;
Notice that the IM.c and IMEntry.h files reference header files in the STRIDE installation directory.  The build must include this directory when compiling either of these files.  The Delegate (IM.h) header file does not have any dependencies on this directory.&lt;br /&gt;
&lt;br /&gt;
=== IM Resource Requirements ===&lt;br /&gt;
The Intercept Module is usually run as a separate task, and therefore has some&lt;br /&gt;
resource requirements that are in addition to those of the [[Target Integration#The STRIDE Runtime |Runtime]] and the [[Target Integration#The Platform Abstraction Layer (PAL)| PAL]]. One of these is the task resource itself.  Another is space for the task stack.&lt;br /&gt;
&lt;br /&gt;
The required task stack size if difficult to predict since it is dependent on the underlying system and on the data that is passed through function arguments.  A stack size between 2-4K would be a good starting point.&lt;br /&gt;
&lt;br /&gt;
=== Starting the srThread and IMStubRead threads ===&lt;br /&gt;
The IM must be started &#039;&#039;after&#039;&#039; the Runtime and Transport have been initialized, but before any intercepted calls can be made.  Failure to do this before making an intercepted call can crash or hang the target.&lt;br /&gt;
&lt;br /&gt;
This code snippet for Linux, based on using the POSIX call pthread_create() to start a task (your OS may use a different call), demonstrates how to initialize the PAL and the Runtime, start the IM, then becomes the Runtime message processing loop.  Note that this code assumes that it will become the Runtime thread&#039;s message processing loop (because srThread() will never return unless thread is stopped or killed).  The comments note that this could instead create a second task for the Runtime and return.&lt;br /&gt;
&lt;br /&gt;
=== Linux Implementation ===&lt;br /&gt;
This code snippet for Linux also handles termination signals based on POSIX APIs in signal.h in order to cleanly shut down the target and clean up resources.  This is required if multi-process target is enabled in the Runtime, especially for Linux OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;pthread.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* STRIDE runtime includes */&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
/* The OS PAL configuration file */&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* Intercept Module includes */&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extern palBOOL palInit();&lt;br /&gt;
extern palBOOL palUninit();&lt;br /&gt;
&lt;br /&gt;
/* The IM message handler (&amp;quot;MyProject&amp;quot; is the IM name) */&lt;br /&gt;
extern void MyProjectIMStubThread();&lt;br /&gt;
&lt;br /&gt;
/* Thread handling */&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
void* _threadFunc(void* param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static pthread_t _threads[15] = {0};&lt;br /&gt;
&lt;br /&gt;
/* Termination signals handling */&lt;br /&gt;
void _cleanup(void)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
    fprintf(stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(_threads)/sizeof(_threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (_threads[i-1] != 0)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(_threads[i-1], palSTOP_EVENT);&lt;br /&gt;
            pthread_join(_threads[i-1], NULL);&lt;br /&gt;
            pthread_detach(_threads[i-1]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palUninit();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
volatile sig_atomic_t termination_in_progress = 0;&lt;br /&gt;
&lt;br /&gt;
void _terminate(int sig)&lt;br /&gt;
{&lt;br /&gt;
    /* Since this handler is established for more than one kind of signal, &lt;br /&gt;
       it might still get invoked recursively by delivery of some other kind&lt;br /&gt;
       of signal.  Use a static variable to keep track of that. */&lt;br /&gt;
    if (termination_in_progress)&lt;br /&gt;
        raise (sig);&lt;br /&gt;
    termination_in_progress = 1;&lt;br /&gt;
&lt;br /&gt;
    /* cleanup */&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    /* Now reraise the signal.  We reactivate the signal&#039;s&lt;br /&gt;
       default handling, which is to terminate the process.&lt;br /&gt;
       We could just call exit or abort,&lt;br /&gt;
       but reraising the signal sets the return status&lt;br /&gt;
       from the process correctly. */&lt;br /&gt;
    signal (sig, SIG_DFL);&lt;br /&gt;
    raise (sig);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************************&lt;br /&gt;
 * Main entry point&lt;br /&gt;
 ***************************************************************************/&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
    pthread_t *ioThread = NULL;&lt;br /&gt;
&lt;br /&gt;
    // Set termination signals handling&lt;br /&gt;
    (void) signal(SIGABRT, _terminate);&lt;br /&gt;
    (void) signal(SIGTERM, _terminate);&lt;br /&gt;
    (void) signal(SIGINT, _terminate);&lt;br /&gt;
    (void) signal(SIGQUIT, _terminate);&lt;br /&gt;
&lt;br /&gt;
    // Initialize PAL. It will return palFALSE if it fails&lt;br /&gt;
    if (palInit(&amp;amp;ioThread) == palFALSE)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;PAL Initialization failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Initialize Runtime &lt;br /&gt;
    if (srInit() != srOK)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Initialize GRS &lt;br /&gt;
    if (grsInit() != grsTRUE) {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;grsInit FAILED&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Start the Runtime thread first&lt;br /&gt;
    pthread_create(&amp;amp;_threads[i++], NULL, _threadFunc, (void*)srThread);&lt;br /&gt;
&lt;br /&gt;
    // Start the IM stub read thread&lt;br /&gt;
    // The name of the stub read function is defined by the makefile&lt;br /&gt;
    pthread_create(&amp;amp;_threads[i++], NULL, _threadFunc, (void*)strideIMStubThread);&lt;br /&gt;
    // __STRIDE_FRAMEWORK_CUSTOM_INIT_BODY__&lt;br /&gt;
&lt;br /&gt;
    pthread_join(*ioThread, NULL);&lt;br /&gt;
&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows Implementation ===&lt;br /&gt;
This code snippet for Windows is based on using the Win32 API calls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;stdafx.h&amp;quot;&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#include &amp;lt;commctrl.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static bool bUseSerial = false;&lt;br /&gt;
&lt;br /&gt;
struct ThreadInfo&lt;br /&gt;
{&lt;br /&gt;
    HANDLE handle;&lt;br /&gt;
    DWORD id;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
static DWORD WINAPI _threadFunc(LPVOID param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
    ThreadInfo threads[15] = {{NULL, 0}};&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
	// Initialize the PAL&lt;br /&gt;
	if (palOSInit() != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palOSInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	pal_io_config_t cfg;&lt;br /&gt;
	pal_prot_t protocol;&lt;br /&gt;
	if (bUseSerial) {&lt;br /&gt;
		protocol = PAL_PROT_SERIAL;&lt;br /&gt;
		cfg.u.serial.BaudRate = PAL_SERIAL_BAUDRATE;&lt;br /&gt;
		cfg.u.serial.ByteSize = PAL_SERIAL_BYTESIZE;&lt;br /&gt;
		cfg.u.serial.ComPort = PAL_SERIAL_PORT;&lt;br /&gt;
		cfg.u.serial.Parity = PAL_SERIAL_PARITY;&lt;br /&gt;
		cfg.u.serial.StopBits = PAL_SERIAL_STOPBITS;&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		protocol = PAL_PROT_TCP;&lt;br /&gt;
		cfg.u.tcp.Port = PAL_DEFAULT_TCP_PORT;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize tcp transport &lt;br /&gt;
	if (palIOInit(protocol, &amp;amp;cfg) != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palIOInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize Runtime &lt;br /&gt;
	if (srInit() != srOK) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the Runtime thread first&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, srThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for Runtime Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the IM stub read thread&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, MyProjectIMStubThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for IM Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Wait for Runtime thread&lt;br /&gt;
    WaitForSingleObject(threads[0].handle, INFINITE);&lt;br /&gt;
&lt;br /&gt;
    fprintf (stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(threads)/sizeof(threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (threads[i-1].handle != NULL)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(threads[i-1].id, palSTOP_EVENT);&lt;br /&gt;
            WaitForSingleObject(threads[i-1].handle, INFINITE);&lt;br /&gt;
            CloseHandle(threads[i-1].handle);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palOSUninit();&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=7259</id>
		<title>Studio:Integrating the Intercept Module (IM)</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=7259"/>
		<updated>2008-09-04T19:03:30Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Linux Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Intercept Modules ==&lt;br /&gt;
Intercept Modules allow remote function calls across hardware (e.g., processor or machine) or software (operating system) platform boundaries. Intercept Modules are target-based components that are created as a step in the STRIDE build process. The [[Intercept Module|Intercept Module]], or IM, is created based on selected interfaces or test units that have been &amp;quot;captured&amp;quot;, or identified through a subset of SCL pragmas that tag interfaces as candidates for remote function calls. Once created, the generated code is then compiled, linked and run along with the target application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Activating the Intercept Module ==&lt;br /&gt;
=== Compiling the IM ===&lt;br /&gt;
To compile the IM, you must define the macro &#039;&#039;&#039;srIMON&#039;&#039;&#039; when you compile the IM.c file or any file that includes one of the headers.  This &amp;quot;turns on&amp;quot; the intercept feature. For example:&lt;br /&gt;
  cc -c -IC:\STRIDE\inc -DsrIMON MyProjectIM.c&lt;br /&gt;
&lt;br /&gt;
Notice that the IM.c and IMEntry.h files reference header files in the STRIDE installation directory.  The build must include this directory when compiling either of these files.  The Delegate (IM.h) header file does not have any dependencies on this directory.&lt;br /&gt;
&lt;br /&gt;
=== IM Resource Requirements ===&lt;br /&gt;
The Intercept Module is usually run as a separate task, and therefore has some&lt;br /&gt;
resource requirements that are in addition to those of the [[Target Integration#The STRIDE Runtime |Runtime]] and the [[Target Integration#The Platform Abstraction Layer (PAL)| PAL]]. One of these is the task resource itself.  Another is space for the task stack.&lt;br /&gt;
&lt;br /&gt;
The required task stack size if difficult to predict since it is dependent on the underlying system and on the data that is passed through function arguments.  A stack size between 2-4K would be a good starting point.&lt;br /&gt;
&lt;br /&gt;
=== Starting the srThread and IMStubRead threads ===&lt;br /&gt;
The IM must be started &#039;&#039;after&#039;&#039; the Runtime and Transport have been initialized, but before any intercepted calls can be made.  Failure to do this before making an intercepted call can crash or hang the target.&lt;br /&gt;
&lt;br /&gt;
This code snippet for Linux, based on using the POSIX call pthread_create() to start a task (your OS may use a different call), demonstrates how to initialize the PAL and the Runtime, start the IM, then becomes the Runtime message processing loop.  Note that this code assumes that it will become the Runtime thread&#039;s message processing loop (because srThread() will never return unless thread is stopped or killed).  The comments note that this could instead create a second task for the Runtime and return.&lt;br /&gt;
&lt;br /&gt;
=== Linux Implementation ===&lt;br /&gt;
This code snippet for Linux also handles termination signals based on POSIX APIs in signal.h in order to cleanly shut down the target and clean up resources.  This is required if multi-process target is enabled in the Runtime, especially for Linux OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;pthread.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* STRIDE runtime includes */&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
/* The OS PAL configuration file */&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* Intercept Module includes */&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extern palBOOL palInit();&lt;br /&gt;
extern palBOOL palUninit();&lt;br /&gt;
&lt;br /&gt;
/* The IM message handler (&amp;quot;MyProject&amp;quot; is the IM name) */&lt;br /&gt;
extern void MyProjectIMStubThread();&lt;br /&gt;
&lt;br /&gt;
/* Thread handling */&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
void* _threadFunc(void* param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static pthread_t _threads[15] = {0};&lt;br /&gt;
&lt;br /&gt;
/* Termination signals handling */&lt;br /&gt;
void _cleanup(void)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
    fprintf(stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(_threads)/sizeof(_threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (_threads[i-1] != 0)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(_threads[i-1], palSTOP_EVENT);&lt;br /&gt;
            pthread_join(_threads[i-1], NULL);&lt;br /&gt;
            pthread_detach(_threads[i-1]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palUninit();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
volatile sig_atomic_t termination_in_progress = 0;&lt;br /&gt;
&lt;br /&gt;
void _terminate(int sig)&lt;br /&gt;
{&lt;br /&gt;
    /* Since this handler is established for more than one kind of signal, &lt;br /&gt;
       it might still get invoked recursively by delivery of some other kind&lt;br /&gt;
       of signal.  Use a static variable to keep track of that. */&lt;br /&gt;
    if (termination_in_progress)&lt;br /&gt;
        raise (sig);&lt;br /&gt;
    termination_in_progress = 1;&lt;br /&gt;
&lt;br /&gt;
    /* cleanup */&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    /* Now reraise the signal.  We reactivate the signal&#039;s&lt;br /&gt;
       default handling, which is to terminate the process.&lt;br /&gt;
       We could just call exit or abort,&lt;br /&gt;
       but reraising the signal sets the return status&lt;br /&gt;
       from the process correctly. */&lt;br /&gt;
    signal (sig, SIG_DFL);&lt;br /&gt;
    raise (sig);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************************&lt;br /&gt;
 * Main entry point&lt;br /&gt;
 ***************************************************************************/&lt;br /&gt;
#ifdef __cplusplus&lt;br /&gt;
extern &amp;quot;C&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
    pthread_t *ioThread = NULL;&lt;br /&gt;
&lt;br /&gt;
    // Set termination signals handling&lt;br /&gt;
    (void) signal(SIGABRT, _terminate);&lt;br /&gt;
    (void) signal(SIGTERM, _terminate);&lt;br /&gt;
    (void) signal(SIGINT, _terminate);&lt;br /&gt;
    (void) signal(SIGQUIT, _terminate);&lt;br /&gt;
&lt;br /&gt;
    // Initialize PAL. It will return palFALSE if it fails&lt;br /&gt;
    if (palInit(&amp;amp;ioThread) == palFALSE)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;PAL Initialization failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Initialize Runtime &lt;br /&gt;
    if (srInit() != srOK)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Initialize GRS &lt;br /&gt;
    if (grsInit() != grsTRUE) {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;grsInit FAILED&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Start the Runtime thread first&lt;br /&gt;
    pthread_create(&amp;amp;_threads[i++], NULL, _threadFunc, (void*)srThread);&lt;br /&gt;
&lt;br /&gt;
    // Start the IM stub read thread&lt;br /&gt;
    // The name of the stub read function is defined by the makefile&lt;br /&gt;
    pthread_create(&amp;amp;_threads[i++], NULL, _threadFunc, (void*)strideIMStubThread);&lt;br /&gt;
    // __STRIDE_FRAMEWORK_CUSTOM_INIT_BODY__&lt;br /&gt;
&lt;br /&gt;
    int joinStatus = pthread_join(*ioThread, NULL);&lt;br /&gt;
&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows Implementation ===&lt;br /&gt;
This code snippet for Windows is based on using the Win32 API calls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;stdafx.h&amp;quot;&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#include &amp;lt;commctrl.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static bool bUseSerial = false;&lt;br /&gt;
&lt;br /&gt;
struct ThreadInfo&lt;br /&gt;
{&lt;br /&gt;
    HANDLE handle;&lt;br /&gt;
    DWORD id;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
static DWORD WINAPI _threadFunc(LPVOID param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
    ThreadInfo threads[15] = {{NULL, 0}};&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
	// Initialize the PAL&lt;br /&gt;
	if (palOSInit() != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palOSInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	pal_io_config_t cfg;&lt;br /&gt;
	pal_prot_t protocol;&lt;br /&gt;
	if (bUseSerial) {&lt;br /&gt;
		protocol = PAL_PROT_SERIAL;&lt;br /&gt;
		cfg.u.serial.BaudRate = PAL_SERIAL_BAUDRATE;&lt;br /&gt;
		cfg.u.serial.ByteSize = PAL_SERIAL_BYTESIZE;&lt;br /&gt;
		cfg.u.serial.ComPort = PAL_SERIAL_PORT;&lt;br /&gt;
		cfg.u.serial.Parity = PAL_SERIAL_PARITY;&lt;br /&gt;
		cfg.u.serial.StopBits = PAL_SERIAL_STOPBITS;&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		protocol = PAL_PROT_TCP;&lt;br /&gt;
		cfg.u.tcp.Port = PAL_DEFAULT_TCP_PORT;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize tcp transport &lt;br /&gt;
	if (palIOInit(protocol, &amp;amp;cfg) != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palIOInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize Runtime &lt;br /&gt;
	if (srInit() != srOK) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the Runtime thread first&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, srThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for Runtime Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the IM stub read thread&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, MyProjectIMStubThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for IM Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Wait for Runtime thread&lt;br /&gt;
    WaitForSingleObject(threads[0].handle, INFINITE);&lt;br /&gt;
&lt;br /&gt;
    fprintf (stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(threads)/sizeof(threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (threads[i-1].handle != NULL)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(threads[i-1].id, palSTOP_EVENT);&lt;br /&gt;
            WaitForSingleObject(threads[i-1].handle, INFINITE);&lt;br /&gt;
            CloseHandle(threads[i-1].handle);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palOSUninit();&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Platform_Abstraction_Layer&amp;diff=5177</id>
		<title>Platform Abstraction Layer</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Platform_Abstraction_Layer&amp;diff=5177"/>
		<updated>2008-06-24T22:39:00Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* PAL Operating System (OS) Services */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The PAL, or Platform Abstraction Layer, enables the STRIDE Runtime to be platform-independent by providing a consistent interface for the STRIDE Runtime regardless of the operating system or data transport used. This interface layer is necessary given the broad variety of operating systems and data transports that exist within embedded systems today.&lt;br /&gt;
&lt;br /&gt;
== PAL Concepts ==&lt;br /&gt;
This section describes the basic concepts of the PAL and the system services it must provide.&lt;br /&gt;
&lt;br /&gt;
=== Function Registration ===&lt;br /&gt;
Typically, the STRIDE Runtime calls PAL functions; however, there are some functions in the STRIDE Runtime that need to be called by the PAL. To eliminate PAL dependencies on the STRIDE Runtime, these functions are accessed through a function registration process initiated by the STRIDE Runtime at startup. You write the registration routine called by the Runtime. This registration routine passes in the address of the STRIDE Runtime function to be registered as the input parameter, and stores the address of the STRIDE Runtime function in your own function variable, which is actually a pointer to a function. You can then call the registered function using your function pointer variable.&lt;br /&gt;
&lt;br /&gt;
The registered STRIDE Runtime functions allow you to complete such tasks as delivering a received I block to the Runtime, checking the number of I-blocks the Runtime has ready to send out, or signalling the Runtime that your transport is ready for the next I-block. It is not necessary for the PAL to know the details of these Runtime functions.&lt;br /&gt;
&lt;br /&gt;
=== Task Synchronization / Event Notification ===&lt;br /&gt;
Unique information is required by an operating system to notify a thread of a pending event. This information can be a simple index into a table, an address to a thread control block, the address of a semaphore or one of a number of other implementations. Although each implementation may be different, a unique notifier is necessary for each thread. The STRIDE Runtime calls this unique information a Notification Identifier (NID). A thread uses a NID when waiting for a STRIDE event, and the STRIDE Runtime uses the same NID to notify the thread of a pending STRIDE event.&lt;br /&gt;
&lt;br /&gt;
An additional piece of information included with the notify routine is a box ID, which is the ID of the mailbox where the message is delivered.&lt;br /&gt;
&lt;br /&gt;
Support for sharing of the synchronization object among multiple applications should be ensured in case of multi-process target is enabled. &lt;br /&gt;
&lt;br /&gt;
=== Protection using Mutex ===&lt;br /&gt;
The STRIDE Runtime needs to protect critical and shared data structures from multiple, simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. The PAL requires implementing protection using Mutexes that can be created and, in case of multi-process target is enabled, used with a unique name by any STRIDE Runtime module or PAL itself. The STRIDE Runtime guarantees that calls to palMutexLock() will not be nested.&lt;br /&gt;
&lt;br /&gt;
=== Timer Administration ===&lt;br /&gt;
The STRIDE Runtime requires that at least one timer be available. When a timer is created, a callback is registered so that the STRIDE Runtime can be notified of timer expirations.  A user parameter, provided when the timer is created, is passed to the callback when it gets called. If several timers share a callback routine, this user parameter can be used to identify which timer expired. The STRIDE Runtime can also stop, start and delete timers.&lt;br /&gt;
&lt;br /&gt;
Because the STRIDE Runtime also has the need to timestamp trace log data, a routine that returns the system time, palGetTime(), is also part of the PAL. This routine is not associated with timers. &lt;br /&gt;
&lt;br /&gt;
=== Memory Allocation ===&lt;br /&gt;
The STRIDE Runtime dynamically allocates memory for messages and trace log storage. The Runtime uses palMemAlloc() and palMemFree() to allocate memory dynamically and then return it to the system.&lt;br /&gt;
&lt;br /&gt;
The Runtime uses palMemSegmentOpen() and palMemSegmentClose() to create, open and close memory segments. In case of single process target, these routines can simply allocate dynamic memory as in normal memory allocation routines.&lt;br /&gt;
&lt;br /&gt;
To support multi-process target, the STRIDE Runtime requires dynamic and configurable memory allocated through palMemAlloc() and static internal memory allocated directly through palMemSegmentOpen()  to be shared memory.&lt;br /&gt;
&lt;br /&gt;
In case of multi-process target, palMemAlloc() and palMemFree() routines can simply call the STRIDE Runtime’s Memory Management module srMem, which is in turn dependent on palMemSegmentOpen() and palMemSegmentClose() routines.&lt;br /&gt;
&lt;br /&gt;
=== Transport Services ===&lt;br /&gt;
The PAL transport routines are needed to transfer I-blocks (STRIDE data packets) into and out of the STRIDE Runtime on your target platform. These routines handle the buffering and transferring of data to and from your transport mechanism. The PAL also contains registration routines that allow for STRIDE Runtime routines to be called by the PAL.&lt;br /&gt;
&lt;br /&gt;
The palOut() routine enables the STRIDE Runtime to transfer I-blocks to your transport. The STRIDE Runtime calls the palOut() routine whenever it needs to send out an I-block.&lt;br /&gt;
&lt;br /&gt;
Your transport calls the routine registered with the palOutRdyReg() routine when the transport is ready for the next I-block to be transmitted. The STRIDE Runtime will not call the palOut() routine until you call the registered function. In this way, you can control the flow of transmitted I-blocks.&lt;br /&gt;
When a complete I-block has been received by your transport, the routine registered with the palInReg() routine should be called to put the received I-block into the STRIDE Runtime.&lt;br /&gt;
&lt;br /&gt;
In some cases it is useful to know when the transmit path is not being requested. Your transport mechanism can check the number of I-blocks the STRIDE Runtime has ready for transmission by calling the routine registered with the palOutPndReg() routine. &lt;br /&gt;
&lt;br /&gt;
=== Host Services ===&lt;br /&gt;
The PAL also provides a way for the STRIDE Runtime to support your transport protocol&lt;br /&gt;
on the desktop. A Windows® DLL linked to STRIDE Studio enables these host&lt;br /&gt;
services. The DLL allows your data to be received and transmitted using your transport&lt;br /&gt;
&lt;br /&gt;
== PAL Organization ==&lt;br /&gt;
&lt;br /&gt;
This section explains the two categories of PAL services that support the STRIDE Runtime, as&lt;br /&gt;
well as the files used to implement these services on your target.&lt;br /&gt;
&lt;br /&gt;
=== PAL Services ===&lt;br /&gt;
The PAL services include the following:&lt;br /&gt;
* Operating System (OS) Services&lt;br /&gt;
* Input/Output (IO) Services&lt;br /&gt;
&lt;br /&gt;
=== PAL Operating System Services ===&lt;br /&gt;
The PAL Operating System (OS) Services are the routines that enable the STRIDE Runtime to work with the operating system on your target platform. In order to write your PAL OS services you must have detailed knowledge of how your operating system handles thread synchronization, timers, mutexes, dynamic memory, shared memory, and notification. The PAL OS services make the features of your operating system available to the STRIDE Runtime.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot; style=&amp;quot;margin:1em auto 1em&amp;quot; &lt;br /&gt;
! Function Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Synchronization&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palCreateNID || Create a Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palDeleteNID || Delete a Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palCreateRFCProxyNID || Create the RFC Proxy Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palDeleteRFCProxyNID || Delete the RFC Proxy Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palWait || Wait for an event &lt;br /&gt;
|-&lt;br /&gt;
| palNotify || Signal a thread that an event is pending &lt;br /&gt;
|-&lt;br /&gt;
| palGetThreadId || Return current thread Id &lt;br /&gt;
|-&lt;br /&gt;
| palGetProcessId || Return current process Id &lt;br /&gt;
|-&lt;br /&gt;
| palSleep || Suspend the execution of the current thread&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Timers&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palTimerCreate || Create a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerDelete || Delete a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerStart || Start a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerStop || Stop a timer &lt;br /&gt;
|-&lt;br /&gt;
| palGetTime || Return system time (e.g., tick count) &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Mutex&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palMutexInit || Initialize a mutex object&lt;br /&gt;
|-&lt;br /&gt;
| palMutexDestroy || Destroy a mutex object&lt;br /&gt;
|-&lt;br /&gt;
| palMutexLock || Lock a mutex object&lt;br /&gt;
|-&lt;br /&gt;
| palMutexUnlock || Unlock a mutex object&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palMemAlloc || Allocate a block of dynamic memory&lt;br /&gt;
|-&lt;br /&gt;
| palMemFree || Free a block of dynamic memory&lt;br /&gt;
|-&lt;br /&gt;
| palMemSegmentOpen || Create/open memory segments&lt;br /&gt;
|-&lt;br /&gt;
| palMemSegmentClose || Close memory segments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PAL Input/Output Services ===&lt;br /&gt;
The PAL Input/Output (IO) Services are the routines that enable the STRIDE Runtime to&lt;br /&gt;
work with different data transport mechanisms. These routines enable your transport to&lt;br /&gt;
send and receive data between the host and the target.&lt;br /&gt;
&lt;br /&gt;
The IO services have also been defined to allow the target platform to control how&lt;br /&gt;
memory is managed and the rate of data exchange. See Appendix A beginning on page&lt;br /&gt;
121 for definitions of the header file functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot; style=&amp;quot;margin:1em auto 1em&amp;quot; &lt;br /&gt;
! Function Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Transmit&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| PalOutPndReg || Query the current output queue of the Runtime&lt;br /&gt;
|-&lt;br /&gt;
| PalOutRdyReg || Identify the transport as ready to receive data &lt;br /&gt;
|-&lt;br /&gt;
| PalOut || Send data to the host platform&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Receive&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| PalInReg || Data extracted from the transport and identified for the STRIDE Runtime&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Integrating the PAL ==&lt;br /&gt;
&lt;br /&gt;
=== PAL Operating System (OS) Services ===&lt;br /&gt;
The &#039;&#039;&#039;[[Platform Abstraction Layer|PAL]]&#039;&#039;&#039; OS Services provide the glue between the STRIDE Runtime and the Target Operating System. The services it must provide are:&lt;br /&gt;
* Task protection and synchronization (e.g. mutexes)&lt;br /&gt;
* Periodic Timers&lt;br /&gt;
* Get Time Stamp&lt;br /&gt;
* Memory Management&lt;br /&gt;
By convention, these services are implemented in a file called palOS.c.&lt;br /&gt;
&lt;br /&gt;
=== PAL Transport (I/O) Services ===&lt;br /&gt;
The [[Integrating STRIDE#The_Host_Transport|Host Transport]] implement the host peer of the I/O services between the Host and Target. Most of the pre-packaged PALs below provide both a serial and a TCP/IP transport.&lt;br /&gt;
&lt;br /&gt;
On the Target side, the Transport is usually implemented in file palIO.c.&lt;br /&gt;
&lt;br /&gt;
On the Host side, STRIDE Studio provides menus and automation methods to manage your target connection.&lt;br /&gt;
&lt;br /&gt;
;What about USB?: S2 does not yet provide a native USB transport. If you wish to use one of our pre-packaged transports, then the  USB can either be used to emulate a serial (COM) port, or can be used with TCP/IP by installing and using USBNet. USBNet is open software for Linux and Windows that permits TCP/IP connections over USB.  Google &amp;quot;USBNet&amp;quot; to locate a driver for your systems.&lt;br /&gt;
;What if I need a custom transport?: A custom transport can be readily written to your specific needs. Please refer to the &#039;&#039;STRIDE Host Transport Specification&#039;&#039; document that is installed with STRIDE for information on creating custom Transport DLLs for the host.  Your PAL implementation will need to implement the target side of the custom communication.  More information on the Transport Wizard can be found in the &#039;&#039;STRIDE Developer&#039;s Guide&#039;&#039; in Online Help.&lt;br /&gt;
&lt;br /&gt;
=== Using a Pre-Packaged PAL ===&lt;br /&gt;
S2 can provide a ready made PAL for many common operating systems. Most contain support for both a serial and a TCP/IP transport. Select the optional &#039;&#039;&#039;runtime&#039;&#039;&#039; section when installing STRIDE to get the currently supported PALs installed on your machine, or [http://www.s2technologies.com/contact.html contact us] for help in obtaining a PAL for other platforms.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own PAL ===&lt;br /&gt;
The PAL enables STRIDE to be completely agnostic to the underlying operating system and hardware.  In fact, an operating system is not really required, so long as the PAL can provide the needed services.&lt;br /&gt;
&lt;br /&gt;
If there is no pre-packaged PAL for your system, you can use an existing one as a starting point, or even write a new one from scratch. Past experience has shown that a PAL can usually be implemented in about two days.&lt;br /&gt;
&lt;br /&gt;
More information on creating a custom PAL, including a custom Transport can be found in the Online Help and in the &#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039; which can be found in C:\STRIDE\doc\s2sPAL.pdf.  S2&#039;s System&#039;s Engineers are also available to assist you with this task.&lt;br /&gt;
&lt;br /&gt;
=== PAL Resource Requirements ===&lt;br /&gt;
Most PALs require a reader task to monitor the Transport input data stream.&lt;br /&gt;
&lt;br /&gt;
PAL memory usage is limited to a few dozen bytes for table and control block storage.  The size of I/O buffers used by the reader task are Transport dependent but are usually in the 8KB range.&lt;br /&gt;
&lt;br /&gt;
=== PAL Initialization ===&lt;br /&gt;
There is no &amp;quot;formal&amp;quot; mechanism required for initializing the PAL. That is, an initialization function is not required by the STRIDE Runtime or IM.  However, over time the convention of providing a &#039;&#039;palInit()&#039;&#039; function has developed. All of the Pre-Packaged PAL use this convention and their &#039;&#039;palInit()&#039;&#039; function must be called before any other STRIDE Runtime function.&lt;br /&gt;
&lt;br /&gt;
If you roll your own PAL, it is recommended that you maintain this convention.&lt;br /&gt;
&lt;br /&gt;
[[Category: Deploying STRIDE]]&lt;br /&gt;
[[Category:STRIDE Runtime]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Platform_Abstraction_Layer&amp;diff=5176</id>
		<title>Platform Abstraction Layer</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Platform_Abstraction_Layer&amp;diff=5176"/>
		<updated>2008-06-24T22:38:25Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* PAL Organization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The PAL, or Platform Abstraction Layer, enables the STRIDE Runtime to be platform-independent by providing a consistent interface for the STRIDE Runtime regardless of the operating system or data transport used. This interface layer is necessary given the broad variety of operating systems and data transports that exist within embedded systems today.&lt;br /&gt;
&lt;br /&gt;
== PAL Concepts ==&lt;br /&gt;
This section describes the basic concepts of the PAL and the system services it must provide.&lt;br /&gt;
&lt;br /&gt;
=== Function Registration ===&lt;br /&gt;
Typically, the STRIDE Runtime calls PAL functions; however, there are some functions in the STRIDE Runtime that need to be called by the PAL. To eliminate PAL dependencies on the STRIDE Runtime, these functions are accessed through a function registration process initiated by the STRIDE Runtime at startup. You write the registration routine called by the Runtime. This registration routine passes in the address of the STRIDE Runtime function to be registered as the input parameter, and stores the address of the STRIDE Runtime function in your own function variable, which is actually a pointer to a function. You can then call the registered function using your function pointer variable.&lt;br /&gt;
&lt;br /&gt;
The registered STRIDE Runtime functions allow you to complete such tasks as delivering a received I block to the Runtime, checking the number of I-blocks the Runtime has ready to send out, or signalling the Runtime that your transport is ready for the next I-block. It is not necessary for the PAL to know the details of these Runtime functions.&lt;br /&gt;
&lt;br /&gt;
=== Task Synchronization / Event Notification ===&lt;br /&gt;
Unique information is required by an operating system to notify a thread of a pending event. This information can be a simple index into a table, an address to a thread control block, the address of a semaphore or one of a number of other implementations. Although each implementation may be different, a unique notifier is necessary for each thread. The STRIDE Runtime calls this unique information a Notification Identifier (NID). A thread uses a NID when waiting for a STRIDE event, and the STRIDE Runtime uses the same NID to notify the thread of a pending STRIDE event.&lt;br /&gt;
&lt;br /&gt;
An additional piece of information included with the notify routine is a box ID, which is the ID of the mailbox where the message is delivered.&lt;br /&gt;
&lt;br /&gt;
Support for sharing of the synchronization object among multiple applications should be ensured in case of multi-process target is enabled. &lt;br /&gt;
&lt;br /&gt;
=== Protection using Mutex ===&lt;br /&gt;
The STRIDE Runtime needs to protect critical and shared data structures from multiple, simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. The PAL requires implementing protection using Mutexes that can be created and, in case of multi-process target is enabled, used with a unique name by any STRIDE Runtime module or PAL itself. The STRIDE Runtime guarantees that calls to palMutexLock() will not be nested.&lt;br /&gt;
&lt;br /&gt;
=== Timer Administration ===&lt;br /&gt;
The STRIDE Runtime requires that at least one timer be available. When a timer is created, a callback is registered so that the STRIDE Runtime can be notified of timer expirations.  A user parameter, provided when the timer is created, is passed to the callback when it gets called. If several timers share a callback routine, this user parameter can be used to identify which timer expired. The STRIDE Runtime can also stop, start and delete timers.&lt;br /&gt;
&lt;br /&gt;
Because the STRIDE Runtime also has the need to timestamp trace log data, a routine that returns the system time, palGetTime(), is also part of the PAL. This routine is not associated with timers. &lt;br /&gt;
&lt;br /&gt;
=== Memory Allocation ===&lt;br /&gt;
The STRIDE Runtime dynamically allocates memory for messages and trace log storage. The Runtime uses palMemAlloc() and palMemFree() to allocate memory dynamically and then return it to the system.&lt;br /&gt;
&lt;br /&gt;
The Runtime uses palMemSegmentOpen() and palMemSegmentClose() to create, open and close memory segments. In case of single process target, these routines can simply allocate dynamic memory as in normal memory allocation routines.&lt;br /&gt;
&lt;br /&gt;
To support multi-process target, the STRIDE Runtime requires dynamic and configurable memory allocated through palMemAlloc() and static internal memory allocated directly through palMemSegmentOpen()  to be shared memory.&lt;br /&gt;
&lt;br /&gt;
In case of multi-process target, palMemAlloc() and palMemFree() routines can simply call the STRIDE Runtime’s Memory Management module srMem, which is in turn dependent on palMemSegmentOpen() and palMemSegmentClose() routines.&lt;br /&gt;
&lt;br /&gt;
=== Transport Services ===&lt;br /&gt;
The PAL transport routines are needed to transfer I-blocks (STRIDE data packets) into and out of the STRIDE Runtime on your target platform. These routines handle the buffering and transferring of data to and from your transport mechanism. The PAL also contains registration routines that allow for STRIDE Runtime routines to be called by the PAL.&lt;br /&gt;
&lt;br /&gt;
The palOut() routine enables the STRIDE Runtime to transfer I-blocks to your transport. The STRIDE Runtime calls the palOut() routine whenever it needs to send out an I-block.&lt;br /&gt;
&lt;br /&gt;
Your transport calls the routine registered with the palOutRdyReg() routine when the transport is ready for the next I-block to be transmitted. The STRIDE Runtime will not call the palOut() routine until you call the registered function. In this way, you can control the flow of transmitted I-blocks.&lt;br /&gt;
When a complete I-block has been received by your transport, the routine registered with the palInReg() routine should be called to put the received I-block into the STRIDE Runtime.&lt;br /&gt;
&lt;br /&gt;
In some cases it is useful to know when the transmit path is not being requested. Your transport mechanism can check the number of I-blocks the STRIDE Runtime has ready for transmission by calling the routine registered with the palOutPndReg() routine. &lt;br /&gt;
&lt;br /&gt;
=== Host Services ===&lt;br /&gt;
The PAL also provides a way for the STRIDE Runtime to support your transport protocol&lt;br /&gt;
on the desktop. A Windows® DLL linked to STRIDE Studio enables these host&lt;br /&gt;
services. The DLL allows your data to be received and transmitted using your transport&lt;br /&gt;
&lt;br /&gt;
== PAL Organization ==&lt;br /&gt;
&lt;br /&gt;
This section explains the two categories of PAL services that support the STRIDE Runtime, as&lt;br /&gt;
well as the files used to implement these services on your target.&lt;br /&gt;
&lt;br /&gt;
=== PAL Services ===&lt;br /&gt;
The PAL services include the following:&lt;br /&gt;
* Operating System (OS) Services&lt;br /&gt;
* Input/Output (IO) Services&lt;br /&gt;
&lt;br /&gt;
=== PAL Operating System Services ===&lt;br /&gt;
The PAL Operating System (OS) Services are the routines that enable the STRIDE Runtime to work with the operating system on your target platform. In order to write your PAL OS services you must have detailed knowledge of how your operating system handles thread synchronization, timers, mutexes, dynamic memory, shared memory, and notification. The PAL OS services make the features of your operating system available to the STRIDE Runtime.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot; style=&amp;quot;margin:1em auto 1em&amp;quot; &lt;br /&gt;
! Function Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Synchronization&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palCreateNID || Create a Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palDeleteNID || Delete a Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palCreateRFCProxyNID || Create the RFC Proxy Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palDeleteRFCProxyNID || Delete the RFC Proxy Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palWait || Wait for an event &lt;br /&gt;
|-&lt;br /&gt;
| palNotify || Signal a thread that an event is pending &lt;br /&gt;
|-&lt;br /&gt;
| palGetThreadId || Return current thread Id &lt;br /&gt;
|-&lt;br /&gt;
| palGetProcessId || Return current process Id &lt;br /&gt;
|-&lt;br /&gt;
| palSleep || Suspend the execution of the current thread&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Timers&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palTimerCreate || Create a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerDelete || Delete a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerStart || Start a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerStop || Stop a timer &lt;br /&gt;
|-&lt;br /&gt;
| palGetTime || Return system time (e.g., tick count) &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Mutex&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palMutexInit || Initialize a mutex object&lt;br /&gt;
|-&lt;br /&gt;
| palMutexDestroy || Destroy a mutex object&lt;br /&gt;
|-&lt;br /&gt;
| palMutexLock || Lock a mutex object&lt;br /&gt;
|-&lt;br /&gt;
| palMutexUnlock || Unlock a mutex object&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palMemAlloc || Allocate a block of dynamic memory&lt;br /&gt;
|-&lt;br /&gt;
| palMemFree || Free a block of dynamic memory&lt;br /&gt;
|-&lt;br /&gt;
| palMemSegmentOpen || Create/open memory segments&lt;br /&gt;
|-&lt;br /&gt;
| palMemSegmentClose || Close memory segments&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PAL Input/Output Services ===&lt;br /&gt;
The PAL Input/Output (IO) Services are the routines that enable the STRIDE Runtime to&lt;br /&gt;
work with different data transport mechanisms. These routines enable your transport to&lt;br /&gt;
send and receive data between the host and the target.&lt;br /&gt;
&lt;br /&gt;
The IO services have also been defined to allow the target platform to control how&lt;br /&gt;
memory is managed and the rate of data exchange. See Appendix A beginning on page&lt;br /&gt;
121 for definitions of the header file functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot; style=&amp;quot;margin:1em auto 1em&amp;quot; &lt;br /&gt;
! Function Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Transmit&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| PalOutPndReg || Query the current output queue of the Runtime&lt;br /&gt;
|-&lt;br /&gt;
| PalOutRdyReg || Identify the transport as ready to receive data &lt;br /&gt;
|-&lt;br /&gt;
| PalOut || Send data to the host platform&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Receive&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| PalInReg || Data extracted from the transport and identified for the STRIDE Runtime&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Integrating the PAL ==&lt;br /&gt;
&lt;br /&gt;
=== PAL Operating System (OS) Services ===&lt;br /&gt;
The &#039;&#039;&#039;[[Platform Abstraction Layer|PAL]]&#039;&#039;&#039; OS Services provide the glue between the STRIDE Runtime and the Target Operating System. The services it must provide are:&lt;br /&gt;
* Task protection and synchronization (e.g. semaphores)&lt;br /&gt;
* Periodic Timers&lt;br /&gt;
* Get Time Stamp&lt;br /&gt;
* Memory Management&lt;br /&gt;
By convention, these services are implemented in a file called palOS.c.&lt;br /&gt;
&lt;br /&gt;
=== PAL Transport (I/O) Services ===&lt;br /&gt;
The [[Integrating STRIDE#The_Host_Transport|Host Transport]] implement the host peer of the I/O services between the Host and Target. Most of the pre-packaged PALs below provide both a serial and a TCP/IP transport.&lt;br /&gt;
&lt;br /&gt;
On the Target side, the Transport is usually implemented in file palIO.c.&lt;br /&gt;
&lt;br /&gt;
On the Host side, STRIDE Studio provides menus and automation methods to manage your target connection.&lt;br /&gt;
&lt;br /&gt;
;What about USB?: S2 does not yet provide a native USB transport. If you wish to use one of our pre-packaged transports, then the  USB can either be used to emulate a serial (COM) port, or can be used with TCP/IP by installing and using USBNet. USBNet is open software for Linux and Windows that permits TCP/IP connections over USB.  Google &amp;quot;USBNet&amp;quot; to locate a driver for your systems.&lt;br /&gt;
;What if I need a custom transport?: A custom transport can be readily written to your specific needs. Please refer to the &#039;&#039;STRIDE Host Transport Specification&#039;&#039; document that is installed with STRIDE for information on creating custom Transport DLLs for the host.  Your PAL implementation will need to implement the target side of the custom communication.  More information on the Transport Wizard can be found in the &#039;&#039;STRIDE Developer&#039;s Guide&#039;&#039; in Online Help.&lt;br /&gt;
&lt;br /&gt;
=== Using a Pre-Packaged PAL ===&lt;br /&gt;
S2 can provide a ready made PAL for many common operating systems. Most contain support for both a serial and a TCP/IP transport. Select the optional &#039;&#039;&#039;runtime&#039;&#039;&#039; section when installing STRIDE to get the currently supported PALs installed on your machine, or [http://www.s2technologies.com/contact.html contact us] for help in obtaining a PAL for other platforms.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own PAL ===&lt;br /&gt;
The PAL enables STRIDE to be completely agnostic to the underlying operating system and hardware.  In fact, an operating system is not really required, so long as the PAL can provide the needed services.&lt;br /&gt;
&lt;br /&gt;
If there is no pre-packaged PAL for your system, you can use an existing one as a starting point, or even write a new one from scratch. Past experience has shown that a PAL can usually be implemented in about two days.&lt;br /&gt;
&lt;br /&gt;
More information on creating a custom PAL, including a custom Transport can be found in the Online Help and in the &#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039; which can be found in C:\STRIDE\doc\s2sPAL.pdf.  S2&#039;s System&#039;s Engineers are also available to assist you with this task.&lt;br /&gt;
&lt;br /&gt;
=== PAL Resource Requirements ===&lt;br /&gt;
Most PALs require a reader task to monitor the Transport input data stream.&lt;br /&gt;
&lt;br /&gt;
PAL memory usage is limited to a few dozen bytes for table and control block storage.  The size of I/O buffers used by the reader task are Transport dependent but are usually in the 8KB range.&lt;br /&gt;
&lt;br /&gt;
=== PAL Initialization ===&lt;br /&gt;
There is no &amp;quot;formal&amp;quot; mechanism required for initializing the PAL. That is, an initialization function is not required by the STRIDE Runtime or IM.  However, over time the convention of providing a &#039;&#039;palInit()&#039;&#039; function has developed. All of the Pre-Packaged PAL use this convention and their &#039;&#039;palInit()&#039;&#039; function must be called before any other STRIDE Runtime function.&lt;br /&gt;
&lt;br /&gt;
If you roll your own PAL, it is recommended that you maintain this convention.&lt;br /&gt;
&lt;br /&gt;
[[Category: Deploying STRIDE]]&lt;br /&gt;
[[Category:STRIDE Runtime]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Platform_Abstraction_Layer&amp;diff=5175</id>
		<title>Platform Abstraction Layer</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Platform_Abstraction_Layer&amp;diff=5175"/>
		<updated>2008-06-24T22:33:53Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* PAL Concepts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The PAL, or Platform Abstraction Layer, enables the STRIDE Runtime to be platform-independent by providing a consistent interface for the STRIDE Runtime regardless of the operating system or data transport used. This interface layer is necessary given the broad variety of operating systems and data transports that exist within embedded systems today.&lt;br /&gt;
&lt;br /&gt;
== PAL Concepts ==&lt;br /&gt;
This section describes the basic concepts of the PAL and the system services it must provide.&lt;br /&gt;
&lt;br /&gt;
=== Function Registration ===&lt;br /&gt;
Typically, the STRIDE Runtime calls PAL functions; however, there are some functions in the STRIDE Runtime that need to be called by the PAL. To eliminate PAL dependencies on the STRIDE Runtime, these functions are accessed through a function registration process initiated by the STRIDE Runtime at startup. You write the registration routine called by the Runtime. This registration routine passes in the address of the STRIDE Runtime function to be registered as the input parameter, and stores the address of the STRIDE Runtime function in your own function variable, which is actually a pointer to a function. You can then call the registered function using your function pointer variable.&lt;br /&gt;
&lt;br /&gt;
The registered STRIDE Runtime functions allow you to complete such tasks as delivering a received I block to the Runtime, checking the number of I-blocks the Runtime has ready to send out, or signalling the Runtime that your transport is ready for the next I-block. It is not necessary for the PAL to know the details of these Runtime functions.&lt;br /&gt;
&lt;br /&gt;
=== Task Synchronization / Event Notification ===&lt;br /&gt;
Unique information is required by an operating system to notify a thread of a pending event. This information can be a simple index into a table, an address to a thread control block, the address of a semaphore or one of a number of other implementations. Although each implementation may be different, a unique notifier is necessary for each thread. The STRIDE Runtime calls this unique information a Notification Identifier (NID). A thread uses a NID when waiting for a STRIDE event, and the STRIDE Runtime uses the same NID to notify the thread of a pending STRIDE event.&lt;br /&gt;
&lt;br /&gt;
An additional piece of information included with the notify routine is a box ID, which is the ID of the mailbox where the message is delivered.&lt;br /&gt;
&lt;br /&gt;
Support for sharing of the synchronization object among multiple applications should be ensured in case of multi-process target is enabled. &lt;br /&gt;
&lt;br /&gt;
=== Protection using Mutex ===&lt;br /&gt;
The STRIDE Runtime needs to protect critical and shared data structures from multiple, simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. The PAL requires implementing protection using Mutexes that can be created and, in case of multi-process target is enabled, used with a unique name by any STRIDE Runtime module or PAL itself. The STRIDE Runtime guarantees that calls to palMutexLock() will not be nested.&lt;br /&gt;
&lt;br /&gt;
=== Timer Administration ===&lt;br /&gt;
The STRIDE Runtime requires that at least one timer be available. When a timer is created, a callback is registered so that the STRIDE Runtime can be notified of timer expirations.  A user parameter, provided when the timer is created, is passed to the callback when it gets called. If several timers share a callback routine, this user parameter can be used to identify which timer expired. The STRIDE Runtime can also stop, start and delete timers.&lt;br /&gt;
&lt;br /&gt;
Because the STRIDE Runtime also has the need to timestamp trace log data, a routine that returns the system time, palGetTime(), is also part of the PAL. This routine is not associated with timers. &lt;br /&gt;
&lt;br /&gt;
=== Memory Allocation ===&lt;br /&gt;
The STRIDE Runtime dynamically allocates memory for messages and trace log storage. The Runtime uses palMemAlloc() and palMemFree() to allocate memory dynamically and then return it to the system.&lt;br /&gt;
&lt;br /&gt;
The Runtime uses palMemSegmentOpen() and palMemSegmentClose() to create, open and close memory segments. In case of single process target, these routines can simply allocate dynamic memory as in normal memory allocation routines.&lt;br /&gt;
&lt;br /&gt;
To support multi-process target, the STRIDE Runtime requires dynamic and configurable memory allocated through palMemAlloc() and static internal memory allocated directly through palMemSegmentOpen()  to be shared memory.&lt;br /&gt;
&lt;br /&gt;
In case of multi-process target, palMemAlloc() and palMemFree() routines can simply call the STRIDE Runtime’s Memory Management module srMem, which is in turn dependent on palMemSegmentOpen() and palMemSegmentClose() routines.&lt;br /&gt;
&lt;br /&gt;
=== Transport Services ===&lt;br /&gt;
The PAL transport routines are needed to transfer I-blocks (STRIDE data packets) into and out of the STRIDE Runtime on your target platform. These routines handle the buffering and transferring of data to and from your transport mechanism. The PAL also contains registration routines that allow for STRIDE Runtime routines to be called by the PAL.&lt;br /&gt;
&lt;br /&gt;
The palOut() routine enables the STRIDE Runtime to transfer I-blocks to your transport. The STRIDE Runtime calls the palOut() routine whenever it needs to send out an I-block.&lt;br /&gt;
&lt;br /&gt;
Your transport calls the routine registered with the palOutRdyReg() routine when the transport is ready for the next I-block to be transmitted. The STRIDE Runtime will not call the palOut() routine until you call the registered function. In this way, you can control the flow of transmitted I-blocks.&lt;br /&gt;
When a complete I-block has been received by your transport, the routine registered with the palInReg() routine should be called to put the received I-block into the STRIDE Runtime.&lt;br /&gt;
&lt;br /&gt;
In some cases it is useful to know when the transmit path is not being requested. Your transport mechanism can check the number of I-blocks the STRIDE Runtime has ready for transmission by calling the routine registered with the palOutPndReg() routine. &lt;br /&gt;
&lt;br /&gt;
=== Host Services ===&lt;br /&gt;
The PAL also provides a way for the STRIDE Runtime to support your transport protocol&lt;br /&gt;
on the desktop. A Windows® DLL linked to STRIDE Studio enables these host&lt;br /&gt;
services. The DLL allows your data to be received and transmitted using your transport&lt;br /&gt;
&lt;br /&gt;
== PAL Organization ==&lt;br /&gt;
&lt;br /&gt;
This section explains the two categories of PAL services that support the STRIDE Runtime, as&lt;br /&gt;
well as the files used to implement these services on your target.&lt;br /&gt;
&lt;br /&gt;
=== PAL Services ===&lt;br /&gt;
The PAL services include the following:&lt;br /&gt;
* Operating System (OS) Services&lt;br /&gt;
* Input/Output (IO) Services&lt;br /&gt;
&lt;br /&gt;
=== PAL Operating System Services ===&lt;br /&gt;
The PAL Operating System (OS) Services are the routines that enable the STRIDE&lt;br /&gt;
Runtime to work with the operating system on your target platform. In order to write your&lt;br /&gt;
PAL OS services you must have detailed knowledge of how your operating system&lt;br /&gt;
handles thread synchronization, timers, critical sections, dynamic memory, and&lt;br /&gt;
notification. The PAL OS services make the features of your operating system available&lt;br /&gt;
to the STRIDE Runtime.  All of the functions described here must be fully implemented in your PAL.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot; style=&amp;quot;margin:1em auto 1em&amp;quot; &lt;br /&gt;
! Function Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Synchronization&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palCreateNID || Create a Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palDeleteNID || Delete a Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palCreateRFCProxyNID || Create the RFC Proxy Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palDeleteRFCProxyNID || Delete the RFC Proxy Notification Identifier (NID) &lt;br /&gt;
|-&lt;br /&gt;
| palWait || Wait for an event &lt;br /&gt;
|-&lt;br /&gt;
| palNotify || Signal a thread that an event is pending &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Timers&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palTimerCreate || Create a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerDelete || Delete a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerStart || Start a timer &lt;br /&gt;
|-&lt;br /&gt;
| palTimerStop || Stop a timer &lt;br /&gt;
|-&lt;br /&gt;
| palGetTime || Return system time (e.g., tick count) &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Critical Section&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palProtect || Begin critical section &lt;br /&gt;
|-&lt;br /&gt;
| palUnprotect || End critical section &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Memory&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| palMemAlloc || Allocate a block of dynamic memory &lt;br /&gt;
|-&lt;br /&gt;
| palMemFree || Free a block of dynamic memory &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PAL Input/Output Services ===&lt;br /&gt;
The PAL Input/Output (IO) Services are the routines that enable the STRIDE Runtime to&lt;br /&gt;
work with different data transport mechanisms. These routines enable your transport to&lt;br /&gt;
send and receive data between the host and the target.&lt;br /&gt;
&lt;br /&gt;
The IO services have also been defined to allow the target platform to control how&lt;br /&gt;
memory is managed and the rate of data exchange. See Appendix A beginning on page&lt;br /&gt;
121 for definitions of the header file functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot; style=&amp;quot;margin:1em auto 1em&amp;quot; &lt;br /&gt;
! Function Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Transmit&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| PalOutPndReg || Query the current output queue of the Runtime&lt;br /&gt;
|-&lt;br /&gt;
| PalOutRdyReg || Identify the transport as ready to receive data &lt;br /&gt;
|-&lt;br /&gt;
| PalOut || Send data to the host platform&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | &#039;&#039;&#039;Receive&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| PalInReg || Data extracted from the transport and identified for the STRIDE Runtime&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Integrating the PAL ==&lt;br /&gt;
&lt;br /&gt;
=== PAL Operating System (OS) Services ===&lt;br /&gt;
The &#039;&#039;&#039;[[Platform Abstraction Layer|PAL]]&#039;&#039;&#039; OS Services provide the glue between the STRIDE Runtime and the Target Operating System. The services it must provide are:&lt;br /&gt;
* Task protection and synchronization (e.g. semaphores)&lt;br /&gt;
* Periodic Timers&lt;br /&gt;
* Get Time Stamp&lt;br /&gt;
* Memory Management&lt;br /&gt;
By convention, these services are implemented in a file called palOS.c.&lt;br /&gt;
&lt;br /&gt;
=== PAL Transport (I/O) Services ===&lt;br /&gt;
The [[Integrating STRIDE#The_Host_Transport|Host Transport]] implement the host peer of the I/O services between the Host and Target. Most of the pre-packaged PALs below provide both a serial and a TCP/IP transport.&lt;br /&gt;
&lt;br /&gt;
On the Target side, the Transport is usually implemented in file palIO.c.&lt;br /&gt;
&lt;br /&gt;
On the Host side, STRIDE Studio provides menus and automation methods to manage your target connection.&lt;br /&gt;
&lt;br /&gt;
;What about USB?: S2 does not yet provide a native USB transport. If you wish to use one of our pre-packaged transports, then the  USB can either be used to emulate a serial (COM) port, or can be used with TCP/IP by installing and using USBNet. USBNet is open software for Linux and Windows that permits TCP/IP connections over USB.  Google &amp;quot;USBNet&amp;quot; to locate a driver for your systems.&lt;br /&gt;
;What if I need a custom transport?: A custom transport can be readily written to your specific needs. Please refer to the &#039;&#039;STRIDE Host Transport Specification&#039;&#039; document that is installed with STRIDE for information on creating custom Transport DLLs for the host.  Your PAL implementation will need to implement the target side of the custom communication.  More information on the Transport Wizard can be found in the &#039;&#039;STRIDE Developer&#039;s Guide&#039;&#039; in Online Help.&lt;br /&gt;
&lt;br /&gt;
=== Using a Pre-Packaged PAL ===&lt;br /&gt;
S2 can provide a ready made PAL for many common operating systems. Most contain support for both a serial and a TCP/IP transport. Select the optional &#039;&#039;&#039;runtime&#039;&#039;&#039; section when installing STRIDE to get the currently supported PALs installed on your machine, or [http://www.s2technologies.com/contact.html contact us] for help in obtaining a PAL for other platforms.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own PAL ===&lt;br /&gt;
The PAL enables STRIDE to be completely agnostic to the underlying operating system and hardware.  In fact, an operating system is not really required, so long as the PAL can provide the needed services.&lt;br /&gt;
&lt;br /&gt;
If there is no pre-packaged PAL for your system, you can use an existing one as a starting point, or even write a new one from scratch. Past experience has shown that a PAL can usually be implemented in about two days.&lt;br /&gt;
&lt;br /&gt;
More information on creating a custom PAL, including a custom Transport can be found in the Online Help and in the &#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039; which can be found in C:\STRIDE\doc\s2sPAL.pdf.  S2&#039;s System&#039;s Engineers are also available to assist you with this task.&lt;br /&gt;
&lt;br /&gt;
=== PAL Resource Requirements ===&lt;br /&gt;
Most PALs require a reader task to monitor the Transport input data stream.&lt;br /&gt;
&lt;br /&gt;
PAL memory usage is limited to a few dozen bytes for table and control block storage.  The size of I/O buffers used by the reader task are Transport dependent but are usually in the 8KB range.&lt;br /&gt;
&lt;br /&gt;
=== PAL Initialization ===&lt;br /&gt;
There is no &amp;quot;formal&amp;quot; mechanism required for initializing the PAL. That is, an initialization function is not required by the STRIDE Runtime or IM.  However, over time the convention of providing a &#039;&#039;palInit()&#039;&#039; function has developed. All of the Pre-Packaged PAL use this convention and their &#039;&#039;palInit()&#039;&#039; function must be called before any other STRIDE Runtime function.&lt;br /&gt;
&lt;br /&gt;
If you roll your own PAL, it is recommended that you maintain this convention.&lt;br /&gt;
&lt;br /&gt;
[[Category: Deploying STRIDE]]&lt;br /&gt;
[[Category:STRIDE Runtime]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5172</id>
		<title>Studio:Integrating the Intercept Module (IM)</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5172"/>
		<updated>2008-06-24T22:09:25Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Starting the IMStubRead thread */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intercept Module Files and their purpose ==&lt;br /&gt;
The Intercept Module is generated by STRIDE Studio for the specific set of function interfaces you select.  Three files are created, each prepended with the name of the Intercept Module that you gave it when it was created:&lt;br /&gt;
* The Intercept Module source file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.c&#039;&#039;&#039; or &#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.cpp&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the code that allows the &#039;&#039;remoting&#039;&#039; of functions so that they can be accessed by the Target and Host.&lt;br /&gt;
* The Delegate Mangling header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file must be included in all of your C files that are using Delegates (Dynamic or Tracing). It contains macros that will mangle the appropriate function names so that they can be intercepted and routed through the IM.  When used, it must be the last file &amp;lt;tt&amp;gt;#include&amp;lt;/tt&amp;gt;&#039;d in the source.  Also, it is only required if the C file uses Delegates.  Stubs and Proxy functions do not require this file&lt;br /&gt;
* The IM Entry point header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IMEntry.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the prototypes for the external entry points into the IM.  It is needed only by the function that starts the IM Stub Read Thread.&lt;br /&gt;
&lt;br /&gt;
These filenames are all prepended by the name you give the IM when it is generated.  For example, if you call the IM &amp;quot;MyProject&amp;quot;, then the resulting filenames will be &amp;quot;MyProjectIM.c&amp;quot;, &amp;quot;MyProjectIM.h&amp;quot;, and &amp;quot;MyProjectIMEntry.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring and generating an Intercept Module ==&lt;br /&gt;
You can either generate the IM via STRIDE Studio&#039;s Intercept Module Wizard, or you can utilize scripts to automatically configure and generate the IM files. These files will contain Studio-based configuration definitions. In addition, the script used for configuration will denote in which context the IM runtime functions are to be executed.&lt;br /&gt;
&lt;br /&gt;
The script can execute automatically so that the Intercept Module is built as part of the test automation framework, as shown in the following example. The IM generation script should open a Studio workspace, optionally compile the workspace and save the database (if needed), then configure and create the IM as shown in the following Perl example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Build the workspace database&lt;br /&gt;
$main::studio-&amp;gt;Workspace-&amp;gt;Build();&lt;br /&gt;
  &lt;br /&gt;
# Intercept Module (IM) name and path constants&lt;br /&gt;
my $IM_FILE_NAME = &amp;quot;MyProject&amp;quot;;&lt;br /&gt;
my $IM_LOCATION_PATH = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
  &lt;br /&gt;
# Create a reference to the workspace IM object&lt;br /&gt;
my $IM = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;&lt;br /&gt;
  &lt;br /&gt;
# Local variables&lt;br /&gt;
my ($i, $fx);&lt;br /&gt;
  &lt;br /&gt;
# Reset all of the IM configuration settings to off and&lt;br /&gt;
# reset the delegate group Id&#039;s to their default name.&lt;br /&gt;
$IM-&amp;gt;Reset();&lt;br /&gt;
   &lt;br /&gt;
# Setup the IM name and path&lt;br /&gt;
$IM-&amp;gt;{Name} = $IM_FILE_NAME;&lt;br /&gt;
$IM-&amp;gt;{SourcePath} = $IM_LOCATION_PATH;&lt;br /&gt;
$IM-&amp;gt;{HeaderPath} = $IM_LOCATION_PATH;&lt;br /&gt;
   &lt;br /&gt;
# For each interface in the IM collection&lt;br /&gt;
for ($i=0; $i &amp;lt; $IM-&amp;gt;Count(); $i++)&lt;br /&gt;
{&lt;br /&gt;
    # reference the ith interface;&lt;br /&gt;
    $fx = $IM-&amp;gt;Item($i);&lt;br /&gt;
   &lt;br /&gt;
    $fx-&amp;gt;{Stub} = 1;               # configure as stub&lt;br /&gt;
                                     # and delegate&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Owner} = 1;    # mangle from owner&#039;s perspective&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Explicit} = 1; # implicit name mangling&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Dynamic} = 1;  # enable dynamic interception&lt;br /&gt;
}                                 &lt;br /&gt;
   &lt;br /&gt;
# Create IM files.&lt;br /&gt;
$IM-&amp;gt;Create();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in the above script how the IM name and output directory were defined. In this case, all three files are created in the same directory as the STRIDE workspace.  The resulting Intercept Module file must then be compiled and built with the rest of your target code.&lt;br /&gt;
&lt;br /&gt;
== Activating the Intercept Module ==&lt;br /&gt;
=== Compiling the IM ===&lt;br /&gt;
To compile the IM, you must define the macro &#039;&#039;&#039;srIMON&#039;&#039;&#039; when you compile the IM.c file or any file that includes one of the headers.  This &amp;quot;turns on&amp;quot; the intercept feature. For example:&lt;br /&gt;
  cc -c -IC:\STRIDE\inc -DsrIMON MyProjectIM.c&lt;br /&gt;
&lt;br /&gt;
Notice that the IM.c and IMEntry.h files reference header files in the STRIDE installation directory.  The build must include this directory when compiling either of these files.  The Delegate (IM.h) header file does not have any dependencies on this directory.&lt;br /&gt;
&lt;br /&gt;
=== IM Resource Requirements ===&lt;br /&gt;
The Intercept Module is usually run as a separate task, and therefore has some&lt;br /&gt;
resource requirements that are in addition to those of the [[Integrating the STRIDE Runtime into a Target|Runtime]] and the [[Integrating the Platform Abstract Layer (PAL)|PAL]]. One of these is the task resource itself.  Another is space for the task stack.&lt;br /&gt;
&lt;br /&gt;
The required task stack size if difficult to predict since it is dependent on the underlying system and on the data that is passed through function arguments.  A stack size between 2-4K would be a good starting point.&lt;br /&gt;
&lt;br /&gt;
=== Starting the srThread and IMStubRead threads ===&lt;br /&gt;
The IM must be started &#039;&#039;after&#039;&#039; the Runtime and Transport have been initialized, but before any intercepted calls can be made.  Failure to do this before making an intercepted call can crash or hang the target.&lt;br /&gt;
&lt;br /&gt;
This code snippet for Linux, based on using the POSIX call pthread_create() to start a task (your OS may use a different call), demonstrates how to initialize the PAL and the Runtime, start the IM, then becomes the Runtime message processing loop.  Note that this code assumes that it will become the Runtime thread&#039;s message processing loop (because srThread() will never return unless thread is stopped or killed).  The comments note that this could instead create a second task for the Runtime and return.&lt;br /&gt;
&lt;br /&gt;
This code snippet for Linux also handles termination signals based on POSIX APIs in signal.h in order to cleanly shut down the target and clean up resources.  This is required if multi-process target is enabled in the Runtime, especially for Linux OS.&lt;br /&gt;
&lt;br /&gt;
== Linux Implementation ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;pthread.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* STRIDE runtime includes */&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
/* The OS PAL configuration file */&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* Intercept Module includes */&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extern palBOOL palInit();&lt;br /&gt;
extern palBOOL palUninit();&lt;br /&gt;
&lt;br /&gt;
/* The IM message handler (&amp;quot;MyProject&amp;quot; is the IM name) */&lt;br /&gt;
extern void MyProjectIMStubThread();&lt;br /&gt;
&lt;br /&gt;
/* Thread handling */&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
void* _threadFunc(void* param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static pthread_t _threads[15] = {0};&lt;br /&gt;
&lt;br /&gt;
/* Termination signals handling */&lt;br /&gt;
void _cleanup(void)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
    fprintf(stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(_threads)/sizeof(_threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (_threads[i-1] != 0)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(_threads[i-1], palSTOP_EVENT);&lt;br /&gt;
            pthread_join(_threads[i-1], NULL);&lt;br /&gt;
            pthread_detach(_threads[i-1]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palUninit();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
volatile sig_atomic_t termination_in_progress = 0;&lt;br /&gt;
&lt;br /&gt;
void _terminate(int sig)&lt;br /&gt;
{&lt;br /&gt;
    /* Since this handler is established for more than one kind of signal, &lt;br /&gt;
       it might still get invoked recursively by delivery of some other kind&lt;br /&gt;
       of signal.  Use a static variable to keep track of that. */&lt;br /&gt;
    if (termination_in_progress)&lt;br /&gt;
        raise (sig);&lt;br /&gt;
    termination_in_progress = 1;&lt;br /&gt;
&lt;br /&gt;
    /* cleanup */&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    /* Now reraise the signal.  We reactivate the signal&#039;s&lt;br /&gt;
       default handling, which is to terminate the process.&lt;br /&gt;
       We could just call exit or abort,&lt;br /&gt;
       but reraising the signal sets the return status&lt;br /&gt;
       from the process correctly. */&lt;br /&gt;
    signal (sig, SIG_DFL);&lt;br /&gt;
    raise (sig);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* A function to start the STRIDE threads */&lt;br /&gt;
void STRIDEstartup()&lt;br /&gt;
{&lt;br /&gt;
    /* Set termination signals handling */&lt;br /&gt;
    (void) signal(SIGABRT, _terminate);&lt;br /&gt;
    (void) signal(SIGTERM, _terminate);&lt;br /&gt;
    (void) signal(SIGINT, _terminate);&lt;br /&gt;
    (void) signal(SIGQUIT, _terminate);&lt;br /&gt;
    (void) signal(SIGHUP, _terminate);&lt;br /&gt;
&lt;br /&gt;
    /* Initialize PAL. It will return palFALSE if it fails&lt;br /&gt;
       (This will open the transport to the host) */&lt;br /&gt;
    if (palInit() == palFALSE) {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;PAL Initialization failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Initialize Runtime */&lt;br /&gt;
    if (srInit() != srOK)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit failed.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Start the Runtime thread first */&lt;br /&gt;
    pthread_create(&amp;amp;_threads[0], NULL, _threadFunc, (void*)srThread);&lt;br /&gt;
&lt;br /&gt;
    /* Start the IM stub read thread */&lt;br /&gt;
    pthread_create(&amp;amp;_threads[1], NULL, _threadFunc, (void*)MyProjectIMStubThread);&lt;br /&gt;
&lt;br /&gt;
    /* Wait for Runtime thread */&lt;br /&gt;
    pthread_join(_threads[0], NULL);&lt;br /&gt;
&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code snippet for Windows is based on using the Win32 API calls.&lt;br /&gt;
&lt;br /&gt;
== Windows Implementation ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;stdafx.h&amp;quot;&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#include &amp;lt;commctrl.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static bool bUseSerial = false;&lt;br /&gt;
&lt;br /&gt;
struct ThreadInfo&lt;br /&gt;
{&lt;br /&gt;
    HANDLE handle;&lt;br /&gt;
    DWORD id;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
static DWORD WINAPI _threadFunc(LPVOID param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
    ThreadInfo threads[15] = {{NULL, 0}};&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
	// Initialize the PAL&lt;br /&gt;
	if (palOSInit() != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palOSInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	pal_io_config_t cfg;&lt;br /&gt;
	pal_prot_t protocol;&lt;br /&gt;
	if (bUseSerial) {&lt;br /&gt;
		protocol = PAL_PROT_SERIAL;&lt;br /&gt;
		cfg.u.serial.BaudRate = PAL_SERIAL_BAUDRATE;&lt;br /&gt;
		cfg.u.serial.ByteSize = PAL_SERIAL_BYTESIZE;&lt;br /&gt;
		cfg.u.serial.ComPort = PAL_SERIAL_PORT;&lt;br /&gt;
		cfg.u.serial.Parity = PAL_SERIAL_PARITY;&lt;br /&gt;
		cfg.u.serial.StopBits = PAL_SERIAL_STOPBITS;&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		protocol = PAL_PROT_TCP;&lt;br /&gt;
		cfg.u.tcp.Port = PAL_DEFAULT_TCP_PORT;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize tcp transport &lt;br /&gt;
	if (palIOInit(protocol, &amp;amp;cfg) != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palIOInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize Runtime &lt;br /&gt;
	if (srInit() != srOK) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the Runtime thread first&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, srThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for Runtime Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the IM stub read thread&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, MyProjectIMStubThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for IM Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Wait for Runtime thread&lt;br /&gt;
    WaitForSingleObject(threads[0].handle, INFINITE);&lt;br /&gt;
&lt;br /&gt;
    fprintf (stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(threads)/sizeof(threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (threads[i-1].handle != NULL)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(threads[i-1].id, palSTOP_EVENT);&lt;br /&gt;
            WaitForSingleObject(threads[i-1].handle, INFINITE);&lt;br /&gt;
            CloseHandle(threads[i-1].handle);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palOSUninit();&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Intercept Modules]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5118</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5118"/>
		<updated>2008-06-24T00:17:07Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Change Details */  SCR 8880&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Target-Based Testing==&lt;br /&gt;
The Target-based testing has been expanded with a new pragma scl_test_flist(). When included in the source code the compiler and the IM generator will automatically create test harnessing code. &lt;br /&gt;
&lt;br /&gt;
On a higher level the test pragmas (scl_test_class and scl_test_flist) has been grouped in [[Test Units]] category. A new TestUnits collection has been added to AutoScript.&lt;br /&gt;
&lt;br /&gt;
The automation components STRIDE.testclass, STRIDE.testunit and STRIDE.testfunction are removed.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary, a prebuild verion of the Host Runtime, has been removed. Building Windows applications using the Host Runtime is not supported anymore. The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary, a prebuild version of the Target Runtime, has been removed. &lt;br /&gt;
&lt;br /&gt;
If an upgrade is performed it is srongly recommented that the above mentioned &#039;&#039;&#039;s2shostapp*&#039;&#039;&#039; libraries and the their public API header (hostapp.h) be manually removed.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==Fixes==&lt;br /&gt;
&#039;&#039;This section describes defects which have been corrected in STRIDE and the customer tracking number associated with them, if any, in brackets [].&#039;&#039;&lt;br /&gt;
* [1055] Not able to specifiy uppercase include directory&lt;br /&gt;
* [1543] IM source file locations added to studio UI and automation&lt;br /&gt;
* [1586] Support for Variadic Macros&lt;br /&gt;
* [1597] EDGFront crash for scl_ptr_opaque &lt;br /&gt;
* [1600] Pre-processor treats constant 1 always as 8-bit &lt;br /&gt;
&lt;br /&gt;
==AutoScript==&lt;br /&gt;
&lt;br /&gt;
===TestUnits Collection===&lt;br /&gt;
A new TestUnits collection has been implemented. All test interfaces (specified with scl_test_class and scl_test_flist) will be listed there.&lt;br /&gt;
&lt;br /&gt;
===Functions Collection===&lt;br /&gt;
Interfaces specified with scl_test_class pragma are not listed in the Functions collection anymore.&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime (Beta 1)==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0101&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
* In target Test Classes and Test Functions, added capability to specify the comment label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtest.c&lt;br /&gt;
 srtest.cpp&lt;br /&gt;
 srtest.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
==Runtime (Beta 2)==&lt;br /&gt;
* A new public routine for Runtime Thread exit point, srThreadUninit(), has been added to sr.h &amp;amp; srthread.c.&lt;br /&gt;
* Fixed a compiler warning in srmem.c.&lt;br /&gt;
* Fixed a potential data abort issue when executing delegate code in the IM prior to Runtime being initialized.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srcfg.h&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srthread.c&lt;br /&gt;
&lt;br /&gt;
==Runtime (Beta 3)==&lt;br /&gt;
* Runtime Test Services APIs are now thread safe.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srapi.h&lt;br /&gt;
 srtest.c&lt;br /&gt;
&lt;br /&gt;
=Migration to 3.0.0101=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==AutoScript==&lt;br /&gt;
Any use of test classes through the Functions collection, like:&lt;br /&gt;
&lt;br /&gt;
$main::ascript-&amp;gt;Functions-&amp;gt;Item(&amp;quot;my_test_class&amp;quot;)-&amp;gt;User-&amp;gt;Call();&lt;br /&gt;
&lt;br /&gt;
should be converted to use the new TestUnits collection:&lt;br /&gt;
&lt;br /&gt;
$main::ascript-&amp;gt;TestUnits-&amp;gt;Item(&amp;quot;my_test_class&amp;quot;)-&amp;gt;Run();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
* If target Test Classes and Test Functions are used, change the signature to include test label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5108</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5108"/>
		<updated>2008-06-20T22:47:49Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime (Beta 2) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Target-Based Testing==&lt;br /&gt;
The Target-based testing has been expanded with a new pragma scl_test_flist(). When included in the source code the compiler and the IM generator will automatically create test harnessing code. &lt;br /&gt;
&lt;br /&gt;
On a higher level the test pragmas (scl_test_class and scl_test_flist) has been grouped in [[Test Units]] category. A new TestUnits collection has been added to AutoScript.&lt;br /&gt;
&lt;br /&gt;
The automation components STRIDE.testclass, STRIDE.testunit and STRIDE.testfunction are removed.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary, a prebuild verion of the Host Runtime, has been removed. Building Windows applications using the Host Runtime is not supported anymore. The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary, a prebuild version of the Target Runtime, has been removed. &lt;br /&gt;
&lt;br /&gt;
If an upgrade is performed it is srongly recommented that the above mentioned &#039;&#039;&#039;s2shostapp*&#039;&#039;&#039; libraries and the their public API header (hostapp.h) be manually removed.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==Fixes==&lt;br /&gt;
&#039;&#039;This section describes defects which have been corrected in STRIDE and the customer tracking number associated with them, if any, in brackets [].&#039;&#039;&lt;br /&gt;
* [1055] Not able to specifiy uppercase include directory&lt;br /&gt;
* [1543] IM source file locations added to studio UI and automation&lt;br /&gt;
* [1586] Support for Variadic Macros&lt;br /&gt;
* [1597] EDGFront crash for scl_ptr_opaque &lt;br /&gt;
* [1600] Pre-processor treats constant 1 always as 8-bit &lt;br /&gt;
&lt;br /&gt;
==AutoScript==&lt;br /&gt;
&lt;br /&gt;
===TestUnits Collection===&lt;br /&gt;
A new TestUnits collection has been implemented. All test interfaces (specified with scl_test_class and scl_test_flist) will be listed there.&lt;br /&gt;
&lt;br /&gt;
===Functions Collection===&lt;br /&gt;
Interfaces specified with scl_test_class pragma are not listed in the Functions collection anymore.&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime (Beta 1)==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0101&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
* In target Test Classes and Test Functions, added capability to specify the comment label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtest.c&lt;br /&gt;
 srtest.cpp&lt;br /&gt;
 srtest.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
==Runtime (Beta 2)==&lt;br /&gt;
* A new public routine for Runtime Thread exit point, srThreadUninit(), has been added to sr.h &amp;amp; srthread.c.&lt;br /&gt;
* Fixed a compiler warning in srmem.c.&lt;br /&gt;
* Fixed a potential data abort issue when executing delegate code in the IM prior to Runtime being initialized.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srcfg.h&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srthread.c&lt;br /&gt;
&lt;br /&gt;
=Migration to 3.0.0101=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==AutoScript==&lt;br /&gt;
Any use of test classes through the Functions collection, like:&lt;br /&gt;
&lt;br /&gt;
$main::ascript-&amp;gt;Functions-&amp;gt;Item(&amp;quot;my_test_class&amp;quot;)-&amp;gt;User-&amp;gt;Call();&lt;br /&gt;
&lt;br /&gt;
should be converted to use the new TestUnits collection:&lt;br /&gt;
&lt;br /&gt;
$main::ascript-&amp;gt;TestUnits-&amp;gt;Item(&amp;quot;my_test_class&amp;quot;)-&amp;gt;Run();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
* If target Test Classes and Test Functions are used, change the signature to include test label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5107</id>
		<title>Studio:Integrating the Intercept Module (IM)</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5107"/>
		<updated>2008-06-20T22:29:49Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Windows Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intercept Module Files and their purpose ==&lt;br /&gt;
The Intercept Module is generated by STRIDE Studio for the specific set of function interfaces you select.  Three files are created, each prepended with the name of the Intercept Module that you gave it when it was created:&lt;br /&gt;
* The Intercept Module source file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.c&#039;&#039;&#039; or &#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.cpp&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the code that allows the &#039;&#039;remoting&#039;&#039; of functions so that they can be accessed by the Target and Host.&lt;br /&gt;
* The Delegate Mangling header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file must be included in all of your C files that are using Delegates (Dynamic or Tracing). It contains macros that will mangle the appropriate function names so that they can be intercepted and routed through the IM.  When used, it must be the last file &amp;lt;tt&amp;gt;#include&amp;lt;/tt&amp;gt;&#039;d in the source.  Also, it is only required if the C file uses Delegates.  Stubs and Proxy functions do not require this file&lt;br /&gt;
* The IM Entry point header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IMEntry.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the prototypes for the external entry points into the IM.  It is needed only by the function that starts the IM Stub Read Thread.&lt;br /&gt;
&lt;br /&gt;
These filenames are all prepended by the name you give the IM when it is generated.  For example, if you call the IM &amp;quot;MyProject&amp;quot;, then the resulting filenames will be &amp;quot;MyProjectIM.c&amp;quot;, &amp;quot;MyProjectIM.h&amp;quot;, and &amp;quot;MyProjectIMEntry.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring and generating an Intercept Module ==&lt;br /&gt;
You can either generate the IM via STRIDE Studio&#039;s Intercept Module Wizard, or you can utilize scripts to automatically configure and generate the IM files. These files will contain Studio-based configuration definitions. In addition, the script used for configuration will denote in which context the IM runtime functions are to be executed.&lt;br /&gt;
&lt;br /&gt;
The script can execute automatically so that the Intercept Module is built as part of the test automation framework, as shown in the following example. The IM generation script should open a Studio workspace, optionally compile the workspace and save the database (if needed), then configure and create the IM as shown in the following Perl example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Build the workspace database&lt;br /&gt;
$main::studio-&amp;gt;Workspace-&amp;gt;Build();&lt;br /&gt;
  &lt;br /&gt;
# Intercept Module (IM) name and path constants&lt;br /&gt;
my $IM_FILE_NAME = &amp;quot;MyProject&amp;quot;;&lt;br /&gt;
my $IM_LOCATION_PATH = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
  &lt;br /&gt;
# Create a reference to the workspace IM object&lt;br /&gt;
my $IM = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;&lt;br /&gt;
  &lt;br /&gt;
# Local variables&lt;br /&gt;
my ($i, $fx);&lt;br /&gt;
  &lt;br /&gt;
# Reset all of the IM configuration settings to off and&lt;br /&gt;
# reset the delegate group Id&#039;s to their default name.&lt;br /&gt;
$IM-&amp;gt;Reset();&lt;br /&gt;
   &lt;br /&gt;
# Setup the IM name and path&lt;br /&gt;
$IM-&amp;gt;{Name} = $IM_FILE_NAME;&lt;br /&gt;
$IM-&amp;gt;{SourcePath} = $IM_LOCATION_PATH;&lt;br /&gt;
$IM-&amp;gt;{HeaderPath} = $IM_LOCATION_PATH;&lt;br /&gt;
   &lt;br /&gt;
# For each interface in the IM collection&lt;br /&gt;
for ($i=0; $i &amp;lt; $IM-&amp;gt;Count(); $i++)&lt;br /&gt;
{&lt;br /&gt;
    # reference the ith interface;&lt;br /&gt;
    $fx = $IM-&amp;gt;Item($i);&lt;br /&gt;
   &lt;br /&gt;
    $fx-&amp;gt;{Stub} = 1;               # configure as stub&lt;br /&gt;
                                     # and delegate&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Owner} = 1;    # mangle from owner&#039;s perspective&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Explicit} = 1; # implicit name mangling&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Dynamic} = 1;  # enable dynamic interception&lt;br /&gt;
}                                 &lt;br /&gt;
   &lt;br /&gt;
# Create IM files.&lt;br /&gt;
$IM-&amp;gt;Create();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in the above script how the IM name and output directory were defined. In this case, all three files are created in the same directory as the STRIDE workspace.  The resulting Intercept Module file must then be compiled and built with the rest of your target code.&lt;br /&gt;
&lt;br /&gt;
== Activating the Intercept Module ==&lt;br /&gt;
=== Compiling the IM ===&lt;br /&gt;
To compile the IM, you must define the macro &#039;&#039;&#039;srIMON&#039;&#039;&#039; when you compile the IM.c file or any file that includes one of the headers.  This &amp;quot;turns on&amp;quot; the intercept feature. For example:&lt;br /&gt;
  cc -c -IC:\STRIDE\inc -DsrIMON MyProjectIM.c&lt;br /&gt;
&lt;br /&gt;
Notice that the IM.c and IMEntry.h files reference header files in the STRIDE installation directory.  The build must include this directory when compiling either of these files.  The Delegate (IM.h) header file does not have any dependencies on this directory.&lt;br /&gt;
&lt;br /&gt;
=== IM Resource Requirements ===&lt;br /&gt;
The Intercept Module is usually run as a separate task, and therefore has some&lt;br /&gt;
resource requirements that are in addition to those of the [[Integrating the STRIDE Runtime into a Target|Runtime]] and the [[Integrating the Platform Abstract Layer (PAL)|PAL]]. One of these is the task resource itself.  Another is space for the task stack.&lt;br /&gt;
&lt;br /&gt;
The required task stack size if difficult to predict since it is dependent on the underlying system and on the data that is passed through function arguments.  A stack size between 2-4K would be a good starting point.&lt;br /&gt;
&lt;br /&gt;
=== Starting the IMStubRead thread ===&lt;br /&gt;
The IM must be started &#039;&#039;after&#039;&#039; the Runtime and Transport have been initialized, but before any intercepted calls can be made.  Failure to do this before making an intercepted call can crash or hang the target.&lt;br /&gt;
&lt;br /&gt;
This code snippet for Linux, based on using the POSIX call pthread_create() to start a task (your OS may use a different call), demonstrates how to initialize the PAL and the Runtime, start the IM, then becomes the Runtime message processing loop.  Note that this code assumes that it will become the Runtime thread&#039;s message processing loop (because srThread() will never return unless thread is stopped or killed).  The comments note that this could instead create a second task for the Runtime and return.&lt;br /&gt;
&lt;br /&gt;
This code snippet for Linux also handles termination signals based on POSIX APIs in signal.h in order to cleanly shut down the target and clean up resources.  This is required if multi-process target is enabled in the Runtime, especially for Linux OS.&lt;br /&gt;
&lt;br /&gt;
== Linux Implementation ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;pthread.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* STRIDE runtime includes */&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
/* The OS PAL configuration file */&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* Intercept Module includes */&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extern palBOOL palInit();&lt;br /&gt;
extern palBOOL palUninit();&lt;br /&gt;
&lt;br /&gt;
/* The IM message handler (&amp;quot;MyProject&amp;quot; is the IM name) */&lt;br /&gt;
extern void MyProjectIMStubThread();&lt;br /&gt;
&lt;br /&gt;
/* Thread handling */&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
void* _threadFunc(void* param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static pthread_t _threads[15] = {0};&lt;br /&gt;
&lt;br /&gt;
/* Termination signals handling */&lt;br /&gt;
void _cleanup(void)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
    fprintf(stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(_threads)/sizeof(_threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (_threads[i-1] != 0)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(_threads[i-1], palSTOP_EVENT);&lt;br /&gt;
            pthread_join(_threads[i-1], NULL);&lt;br /&gt;
            pthread_detach(_threads[i-1]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palUninit();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
volatile sig_atomic_t termination_in_progress = 0;&lt;br /&gt;
&lt;br /&gt;
void _terminate(int sig)&lt;br /&gt;
{&lt;br /&gt;
    /* Since this handler is established for more than one kind of signal, &lt;br /&gt;
       it might still get invoked recursively by delivery of some other kind&lt;br /&gt;
       of signal.  Use a static variable to keep track of that. */&lt;br /&gt;
    if (termination_in_progress)&lt;br /&gt;
        raise (sig);&lt;br /&gt;
    termination_in_progress = 1;&lt;br /&gt;
&lt;br /&gt;
    /* cleanup */&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    /* Now reraise the signal.  We reactivate the signal&#039;s&lt;br /&gt;
       default handling, which is to terminate the process.&lt;br /&gt;
       We could just call exit or abort,&lt;br /&gt;
       but reraising the signal sets the return status&lt;br /&gt;
       from the process correctly. */&lt;br /&gt;
    signal (sig, SIG_DFL);&lt;br /&gt;
    raise (sig);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* A function to start the STRIDE threads */&lt;br /&gt;
void STRIDEstartup()&lt;br /&gt;
{&lt;br /&gt;
    /* Set termination signals handling */&lt;br /&gt;
    (void) signal(SIGABRT, _terminate);&lt;br /&gt;
    (void) signal(SIGTERM, _terminate);&lt;br /&gt;
    (void) signal(SIGINT, _terminate);&lt;br /&gt;
    (void) signal(SIGQUIT, _terminate);&lt;br /&gt;
    (void) signal(SIGHUP, _terminate);&lt;br /&gt;
&lt;br /&gt;
    /* Initialize PAL. It will return palFALSE if it fails&lt;br /&gt;
       (This will open the transport to the host) */&lt;br /&gt;
    if (palInit() == palFALSE) {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;PAL Initialization failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Initialize Runtime */&lt;br /&gt;
    if (srInit() != srOK)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit failed.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Start the Runtime thread first */&lt;br /&gt;
    pthread_create(&amp;amp;_threads[0], NULL, _threadFunc, (void*)srThread);&lt;br /&gt;
&lt;br /&gt;
    /* Start the IM stub read thread */&lt;br /&gt;
    pthread_create(&amp;amp;_threads[1], NULL, _threadFunc, (void*)MyProjectIMStubThread);&lt;br /&gt;
&lt;br /&gt;
    /* Wait for Runtime thread */&lt;br /&gt;
    pthread_join(_threads[0], NULL);&lt;br /&gt;
&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code snippet for Windows is based on using the Win32 API calls.&lt;br /&gt;
&lt;br /&gt;
== Windows Implementation ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;stdafx.h&amp;quot;&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#include &amp;lt;commctrl.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static bool bUseSerial = false;&lt;br /&gt;
&lt;br /&gt;
struct ThreadInfo&lt;br /&gt;
{&lt;br /&gt;
    HANDLE handle;&lt;br /&gt;
    DWORD id;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
static DWORD WINAPI _threadFunc(LPVOID param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
    ThreadInfo threads[15] = {{NULL, 0}};&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
	// Initialize the PAL&lt;br /&gt;
	if (palOSInit() != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palOSInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	pal_io_config_t cfg;&lt;br /&gt;
	pal_prot_t protocol;&lt;br /&gt;
	if (bUseSerial) {&lt;br /&gt;
		protocol = PAL_PROT_SERIAL;&lt;br /&gt;
		cfg.u.serial.BaudRate = PAL_SERIAL_BAUDRATE;&lt;br /&gt;
		cfg.u.serial.ByteSize = PAL_SERIAL_BYTESIZE;&lt;br /&gt;
		cfg.u.serial.ComPort = PAL_SERIAL_PORT;&lt;br /&gt;
		cfg.u.serial.Parity = PAL_SERIAL_PARITY;&lt;br /&gt;
		cfg.u.serial.StopBits = PAL_SERIAL_STOPBITS;&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		protocol = PAL_PROT_TCP;&lt;br /&gt;
		cfg.u.tcp.Port = PAL_DEFAULT_TCP_PORT;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize tcp transport &lt;br /&gt;
	if (palIOInit(protocol, &amp;amp;cfg) != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palIOInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize Runtime &lt;br /&gt;
	if (srInit() != srOK) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the Runtime thread first&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, srThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for Runtime Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the IM stub read thread&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, MyProjectIMStubThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for IM Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Wait for Runtime thread&lt;br /&gt;
    WaitForSingleObject(threads[0].handle, INFINITE);&lt;br /&gt;
&lt;br /&gt;
    fprintf (stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(threads)/sizeof(threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (threads[i-1].handle != NULL)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(threads[i-1].id, palSTOP_EVENT);&lt;br /&gt;
            WaitForSingleObject(threads[i-1].handle, INFINITE);&lt;br /&gt;
            CloseHandle(threads[i-1].handle);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palOSUninit();&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Intercept Modules]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5106</id>
		<title>Studio:Integrating the Intercept Module (IM)</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5106"/>
		<updated>2008-06-20T22:28:36Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Starting the IMStubRead thread */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intercept Module Files and their purpose ==&lt;br /&gt;
The Intercept Module is generated by STRIDE Studio for the specific set of function interfaces you select.  Three files are created, each prepended with the name of the Intercept Module that you gave it when it was created:&lt;br /&gt;
* The Intercept Module source file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.c&#039;&#039;&#039; or &#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.cpp&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the code that allows the &#039;&#039;remoting&#039;&#039; of functions so that they can be accessed by the Target and Host.&lt;br /&gt;
* The Delegate Mangling header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file must be included in all of your C files that are using Delegates (Dynamic or Tracing). It contains macros that will mangle the appropriate function names so that they can be intercepted and routed through the IM.  When used, it must be the last file &amp;lt;tt&amp;gt;#include&amp;lt;/tt&amp;gt;&#039;d in the source.  Also, it is only required if the C file uses Delegates.  Stubs and Proxy functions do not require this file&lt;br /&gt;
* The IM Entry point header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IMEntry.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the prototypes for the external entry points into the IM.  It is needed only by the function that starts the IM Stub Read Thread.&lt;br /&gt;
&lt;br /&gt;
These filenames are all prepended by the name you give the IM when it is generated.  For example, if you call the IM &amp;quot;MyProject&amp;quot;, then the resulting filenames will be &amp;quot;MyProjectIM.c&amp;quot;, &amp;quot;MyProjectIM.h&amp;quot;, and &amp;quot;MyProjectIMEntry.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring and generating an Intercept Module ==&lt;br /&gt;
You can either generate the IM via STRIDE Studio&#039;s Intercept Module Wizard, or you can utilize scripts to automatically configure and generate the IM files. These files will contain Studio-based configuration definitions. In addition, the script used for configuration will denote in which context the IM runtime functions are to be executed.&lt;br /&gt;
&lt;br /&gt;
The script can execute automatically so that the Intercept Module is built as part of the test automation framework, as shown in the following example. The IM generation script should open a Studio workspace, optionally compile the workspace and save the database (if needed), then configure and create the IM as shown in the following Perl example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Build the workspace database&lt;br /&gt;
$main::studio-&amp;gt;Workspace-&amp;gt;Build();&lt;br /&gt;
  &lt;br /&gt;
# Intercept Module (IM) name and path constants&lt;br /&gt;
my $IM_FILE_NAME = &amp;quot;MyProject&amp;quot;;&lt;br /&gt;
my $IM_LOCATION_PATH = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
  &lt;br /&gt;
# Create a reference to the workspace IM object&lt;br /&gt;
my $IM = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;&lt;br /&gt;
  &lt;br /&gt;
# Local variables&lt;br /&gt;
my ($i, $fx);&lt;br /&gt;
  &lt;br /&gt;
# Reset all of the IM configuration settings to off and&lt;br /&gt;
# reset the delegate group Id&#039;s to their default name.&lt;br /&gt;
$IM-&amp;gt;Reset();&lt;br /&gt;
   &lt;br /&gt;
# Setup the IM name and path&lt;br /&gt;
$IM-&amp;gt;{Name} = $IM_FILE_NAME;&lt;br /&gt;
$IM-&amp;gt;{SourcePath} = $IM_LOCATION_PATH;&lt;br /&gt;
$IM-&amp;gt;{HeaderPath} = $IM_LOCATION_PATH;&lt;br /&gt;
   &lt;br /&gt;
# For each interface in the IM collection&lt;br /&gt;
for ($i=0; $i &amp;lt; $IM-&amp;gt;Count(); $i++)&lt;br /&gt;
{&lt;br /&gt;
    # reference the ith interface;&lt;br /&gt;
    $fx = $IM-&amp;gt;Item($i);&lt;br /&gt;
   &lt;br /&gt;
    $fx-&amp;gt;{Stub} = 1;               # configure as stub&lt;br /&gt;
                                     # and delegate&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Owner} = 1;    # mangle from owner&#039;s perspective&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Explicit} = 1; # implicit name mangling&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Dynamic} = 1;  # enable dynamic interception&lt;br /&gt;
}                                 &lt;br /&gt;
   &lt;br /&gt;
# Create IM files.&lt;br /&gt;
$IM-&amp;gt;Create();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in the above script how the IM name and output directory were defined. In this case, all three files are created in the same directory as the STRIDE workspace.  The resulting Intercept Module file must then be compiled and built with the rest of your target code.&lt;br /&gt;
&lt;br /&gt;
== Activating the Intercept Module ==&lt;br /&gt;
=== Compiling the IM ===&lt;br /&gt;
To compile the IM, you must define the macro &#039;&#039;&#039;srIMON&#039;&#039;&#039; when you compile the IM.c file or any file that includes one of the headers.  This &amp;quot;turns on&amp;quot; the intercept feature. For example:&lt;br /&gt;
  cc -c -IC:\STRIDE\inc -DsrIMON MyProjectIM.c&lt;br /&gt;
&lt;br /&gt;
Notice that the IM.c and IMEntry.h files reference header files in the STRIDE installation directory.  The build must include this directory when compiling either of these files.  The Delegate (IM.h) header file does not have any dependencies on this directory.&lt;br /&gt;
&lt;br /&gt;
=== IM Resource Requirements ===&lt;br /&gt;
The Intercept Module is usually run as a separate task, and therefore has some&lt;br /&gt;
resource requirements that are in addition to those of the [[Integrating the STRIDE Runtime into a Target|Runtime]] and the [[Integrating the Platform Abstract Layer (PAL)|PAL]]. One of these is the task resource itself.  Another is space for the task stack.&lt;br /&gt;
&lt;br /&gt;
The required task stack size if difficult to predict since it is dependent on the underlying system and on the data that is passed through function arguments.  A stack size between 2-4K would be a good starting point.&lt;br /&gt;
&lt;br /&gt;
=== Starting the IMStubRead thread ===&lt;br /&gt;
The IM must be started &#039;&#039;after&#039;&#039; the Runtime and Transport have been initialized, but before any intercepted calls can be made.  Failure to do this before making an intercepted call can crash or hang the target.&lt;br /&gt;
&lt;br /&gt;
This code snippet for Linux, based on using the POSIX call pthread_create() to start a task (your OS may use a different call), demonstrates how to initialize the PAL and the Runtime, start the IM, then becomes the Runtime message processing loop.  Note that this code assumes that it will become the Runtime thread&#039;s message processing loop (because srThread() will never return unless thread is stopped or killed).  The comments note that this could instead create a second task for the Runtime and return.&lt;br /&gt;
&lt;br /&gt;
This code snippet for Linux also handles termination signals based on POSIX APIs in signal.h in order to cleanly shut down the target and clean up resources.  This is required if multi-process target is enabled in the Runtime, especially for Linux OS.&lt;br /&gt;
&lt;br /&gt;
== Linux Implementation ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;pthread.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* STRIDE runtime includes */&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
/* The OS PAL configuration file */&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* Intercept Module includes */&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extern palBOOL palInit();&lt;br /&gt;
extern palBOOL palUninit();&lt;br /&gt;
&lt;br /&gt;
/* The IM message handler (&amp;quot;MyProject&amp;quot; is the IM name) */&lt;br /&gt;
extern void MyProjectIMStubThread();&lt;br /&gt;
&lt;br /&gt;
/* Thread handling */&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
void* _threadFunc(void* param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static pthread_t _threads[15] = {0};&lt;br /&gt;
&lt;br /&gt;
/* Termination signals handling */&lt;br /&gt;
void _cleanup(void)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
    fprintf(stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(_threads)/sizeof(_threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (_threads[i-1] != 0)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(_threads[i-1], palSTOP_EVENT);&lt;br /&gt;
            pthread_join(_threads[i-1], NULL);&lt;br /&gt;
            pthread_detach(_threads[i-1]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palUninit();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
volatile sig_atomic_t termination_in_progress = 0;&lt;br /&gt;
&lt;br /&gt;
void _terminate(int sig)&lt;br /&gt;
{&lt;br /&gt;
    /* Since this handler is established for more than one kind of signal, &lt;br /&gt;
       it might still get invoked recursively by delivery of some other kind&lt;br /&gt;
       of signal.  Use a static variable to keep track of that. */&lt;br /&gt;
    if (termination_in_progress)&lt;br /&gt;
        raise (sig);&lt;br /&gt;
    termination_in_progress = 1;&lt;br /&gt;
&lt;br /&gt;
    /* cleanup */&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    /* Now reraise the signal.  We reactivate the signal&#039;s&lt;br /&gt;
       default handling, which is to terminate the process.&lt;br /&gt;
       We could just call exit or abort,&lt;br /&gt;
       but reraising the signal sets the return status&lt;br /&gt;
       from the process correctly. */&lt;br /&gt;
    signal (sig, SIG_DFL);&lt;br /&gt;
    raise (sig);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* A function to start the STRIDE threads */&lt;br /&gt;
void STRIDEstartup()&lt;br /&gt;
{&lt;br /&gt;
    /* Set termination signals handling */&lt;br /&gt;
    (void) signal(SIGABRT, _terminate);&lt;br /&gt;
    (void) signal(SIGTERM, _terminate);&lt;br /&gt;
    (void) signal(SIGINT, _terminate);&lt;br /&gt;
    (void) signal(SIGQUIT, _terminate);&lt;br /&gt;
    (void) signal(SIGHUP, _terminate);&lt;br /&gt;
&lt;br /&gt;
    /* Initialize PAL. It will return palFALSE if it fails&lt;br /&gt;
       (This will open the transport to the host) */&lt;br /&gt;
    if (palInit() == palFALSE) {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;PAL Initialization failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Initialize Runtime */&lt;br /&gt;
    if (srInit() != srOK)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit failed.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Start the Runtime thread first */&lt;br /&gt;
    pthread_create(&amp;amp;_threads[0], NULL, _threadFunc, (void*)srThread);&lt;br /&gt;
&lt;br /&gt;
    /* Start the IM stub read thread */&lt;br /&gt;
    pthread_create(&amp;amp;_threads[1], NULL, _threadFunc, (void*)MyProjectIMStubThread);&lt;br /&gt;
&lt;br /&gt;
    /* Wait for Runtime thread */&lt;br /&gt;
    pthread_join(_threads[0], NULL);&lt;br /&gt;
&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code snippet for Windows is based on using the Win32 API calls.&lt;br /&gt;
&lt;br /&gt;
== Windows Implementation ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
// TestAgent.cpp : Defines the entry point for the console application.&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;stdafx.h&amp;quot;&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#include &amp;lt;commctrl.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static bool bUseSerial = false;&lt;br /&gt;
&lt;br /&gt;
struct ThreadInfo&lt;br /&gt;
{&lt;br /&gt;
    HANDLE handle;&lt;br /&gt;
    DWORD id;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
static DWORD WINAPI _threadFunc(LPVOID param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
    ThreadInfo threads[15] = {{NULL, 0}};&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
	// Initialize the PAL&lt;br /&gt;
	if (palOSInit() != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palOSInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	pal_io_config_t cfg;&lt;br /&gt;
	pal_prot_t protocol;&lt;br /&gt;
	if (bUseSerial) {&lt;br /&gt;
		protocol = PAL_PROT_SERIAL;&lt;br /&gt;
		cfg.u.serial.BaudRate = PAL_SERIAL_BAUDRATE;&lt;br /&gt;
		cfg.u.serial.ByteSize = PAL_SERIAL_BYTESIZE;&lt;br /&gt;
		cfg.u.serial.ComPort = PAL_SERIAL_PORT;&lt;br /&gt;
		cfg.u.serial.Parity = PAL_SERIAL_PARITY;&lt;br /&gt;
		cfg.u.serial.StopBits = PAL_SERIAL_STOPBITS;&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		protocol = PAL_PROT_TCP;&lt;br /&gt;
		cfg.u.tcp.Port = PAL_DEFAULT_TCP_PORT;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize tcp transport &lt;br /&gt;
	if (palIOInit(protocol, &amp;amp;cfg) != palTRUE) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;palIOInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Initialize Runtime &lt;br /&gt;
	if (srInit() != srOK) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit FAILED.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the Runtime thread first&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, srThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for Runtime Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Start the IM stub read thread&lt;br /&gt;
	threads[i].handle = CreateThread(NULL, 0, _threadFunc, MyProjectIMStubThread, 0, &amp;amp;threads[i].id);&lt;br /&gt;
	if (!threads[i++].handle) {&lt;br /&gt;
		palLog(palLOG_LEVEL_ERROR, &amp;quot;CreateThread FAILED for IM Thread.&amp;quot;);&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
    // Wait for Runtime thread&lt;br /&gt;
    WaitForSingleObject(threads[0].handle, INFINITE);&lt;br /&gt;
&lt;br /&gt;
    fprintf (stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = sizeof(threads)/sizeof(threads[0]); i &amp;gt; 0; i--)&lt;br /&gt;
    {&lt;br /&gt;
        if (threads[i-1].handle != NULL)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(threads[i-1].id, palSTOP_EVENT);&lt;br /&gt;
            WaitForSingleObject(threads[i-1].handle, INFINITE);&lt;br /&gt;
            CloseHandle(threads[i-1].handle);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palOSUninit();&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Intercept Modules]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5090</id>
		<title>Studio:Integrating the Intercept Module (IM)</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5090"/>
		<updated>2008-06-19T17:43:00Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Starting the IMStubRead thread */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intercept Module Files and their purpose ==&lt;br /&gt;
The Intercept Module is generated by STRIDE Studio for the specific set of function interfaces you select.  Three files are created, each prepended with the name of the Intercept Module that you gave it when it was created:&lt;br /&gt;
* The Intercept Module source file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.c&#039;&#039;&#039; or &#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.cpp&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the code that allows the &#039;&#039;remoting&#039;&#039; of functions so that they can be accessed by the Target and Host.&lt;br /&gt;
* The Delegate Mangling header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file must be included in all of your C files that are using Delegates (Dynamic or Tracing). It contains macros that will mangle the appropriate function names so that they can be intercepted and routed through the IM.  When used, it must be the last file &amp;lt;tt&amp;gt;#include&amp;lt;/tt&amp;gt;&#039;d in the source.  Also, it is only required if the C file uses Delegates.  Stubs and Proxy functions do not require this file&lt;br /&gt;
* The IM Entry point header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IMEntry.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the prototypes for the external entry points into the IM.  It is needed only by the function that starts the IM Stub Read Thread.&lt;br /&gt;
&lt;br /&gt;
These filenames are all prepended by the name you give the IM when it is generated.  For example, if you call the IM &amp;quot;MyProject&amp;quot;, then the resulting filenames will be &amp;quot;MyProjectIM.c&amp;quot;, &amp;quot;MyProjectIM.h&amp;quot;, and &amp;quot;MyProjectIMEntry.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring and generating an Intercept Module ==&lt;br /&gt;
You can either generate the IM via STRIDE Studio&#039;s Intercept Module Wizard, or you can utilize scripts to automatically configure and generate the IM files. These files will contain Studio-based configuration definitions. In addition, the script used for configuration will denote in which context the IM runtime functions are to be executed.&lt;br /&gt;
&lt;br /&gt;
The script can execute automatically so that the Intercept Module is built as part of the test automation framework, as shown in the following example. The IM generation script should open a Studio workspace, optionally compile the workspace and save the database (if needed), then configure and create the IM as shown in the following Perl example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Build the workspace database&lt;br /&gt;
$main::studio-&amp;gt;Workspace-&amp;gt;Build();&lt;br /&gt;
  &lt;br /&gt;
# Intercept Module (IM) name and path constants&lt;br /&gt;
my $IM_FILE_NAME = &amp;quot;MyProject&amp;quot;;&lt;br /&gt;
my $IM_LOCATION_PATH = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
  &lt;br /&gt;
# Create a reference to the workspace IM object&lt;br /&gt;
my $IM = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;&lt;br /&gt;
  &lt;br /&gt;
# Local variables&lt;br /&gt;
my ($i, $fx);&lt;br /&gt;
  &lt;br /&gt;
# Reset all of the IM configuration settings to off and&lt;br /&gt;
# reset the delegate group Id&#039;s to their default name.&lt;br /&gt;
$IM-&amp;gt;Reset();&lt;br /&gt;
   &lt;br /&gt;
# Setup the IM name and path&lt;br /&gt;
$IM-&amp;gt;{Name} = $IM_FILE_NAME;&lt;br /&gt;
$IM-&amp;gt;{SourcePath} = $IM_LOCATION_PATH;&lt;br /&gt;
$IM-&amp;gt;{HeaderPath} = $IM_LOCATION_PATH;&lt;br /&gt;
   &lt;br /&gt;
# For each interface in the IM collection&lt;br /&gt;
for ($i=0; $i &amp;lt; $IM-&amp;gt;Count(); $i++)&lt;br /&gt;
{&lt;br /&gt;
    # reference the ith interface;&lt;br /&gt;
    $fx = $IM-&amp;gt;Item($i);&lt;br /&gt;
   &lt;br /&gt;
    $fx-&amp;gt;{Stub} = 1;               # configure as stub&lt;br /&gt;
                                     # and delegate&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Owner} = 1;    # mangle from owner&#039;s perspective&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Explicit} = 1; # implicit name mangling&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Dynamic} = 1;  # enable dynamic interception&lt;br /&gt;
}                                 &lt;br /&gt;
   &lt;br /&gt;
# Create IM files.&lt;br /&gt;
$IM-&amp;gt;Create();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in the above script how the IM name and output directory were defined. In this case, all three files are created in the same directory as the STRIDE workspace.  The resulting Intercept Module file must then be compiled and built with the rest of your target code.&lt;br /&gt;
&lt;br /&gt;
== Activating the Intercept Module ==&lt;br /&gt;
=== Compiling the IM ===&lt;br /&gt;
To compile the IM, you must define the macro &#039;&#039;&#039;srIMON&#039;&#039;&#039; when you compile the IM.c file or any file that includes one of the headers.  This &amp;quot;turns on&amp;quot; the intercept feature. For example:&lt;br /&gt;
  cc -c -IC:\STRIDE\inc -DsrIMON MyProjectIM.c&lt;br /&gt;
&lt;br /&gt;
Notice that the IM.c and IMEntry.h files reference header files in the STRIDE installation directory.  The build must include this directory when compiling either of these files.  The Delegate (IM.h) header file does not have any dependencies on this directory.&lt;br /&gt;
&lt;br /&gt;
=== IM Resource Requirements ===&lt;br /&gt;
The Intercept Module is usually run as a separate task, and therefore has some&lt;br /&gt;
resource requirements that are in addition to those of the [[Integrating the STRIDE Runtime into a Target|Runtime]] and the [[Integrating the Platform Abstract Layer (PAL)|PAL]]. One of these is the task resource itself.  Another is space for the task stack.&lt;br /&gt;
&lt;br /&gt;
The required task stack size if difficult to predict since it is dependent on the underlying system and on the data that is passed through function arguments.  A stack size between 2-4K would be a good starting point.&lt;br /&gt;
&lt;br /&gt;
=== Starting the IMStubRead thread ===&lt;br /&gt;
The IM must be started &#039;&#039;after&#039;&#039; the Runtime and Transport have been initialized, but before any intercepted calls can be made.  Failure to do this before making an intercepted call can crash or hang the target.&lt;br /&gt;
&lt;br /&gt;
This code snippet, based on using the POSIX call pthread_create() to start a task (your OS may use a different call), demonstrates how to initialize the PAL and the Runtime, start the IM, then becomes the Runtime message processing loop.  Note that this code assumes that it will become the Runtime thread&#039;s message processing loop (because srThread() will never return unless thread is stopped or killed).  The comments note that this could instead create a second task for the Runtime and return.&lt;br /&gt;
&lt;br /&gt;
This code snippet also handles termination signals based on POSIX APIs in signal.h in order to cleanly shut down the target and clean up resources.  This is required if multi-process target is enabled in the Runtime, especially for Linux OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;pthread.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* STRIDE runtime includes */&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
/* The OS PAL configuration file */&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* Intercept Module includes */&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extern palBOOL palInit();&lt;br /&gt;
extern palBOOL palUninit();&lt;br /&gt;
&lt;br /&gt;
/* The IM message handler (&amp;quot;MyProject&amp;quot; is the IM name) */&lt;br /&gt;
extern void MyProjectIMStubThread();&lt;br /&gt;
&lt;br /&gt;
/* Thread handling */&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
void* _threadFunc(void* param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static pthread_t _threads[15] = {0};&lt;br /&gt;
&lt;br /&gt;
/* Termination signals handling */&lt;br /&gt;
void _cleanup(void)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
    fprintf (stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = 0; i &amp;lt; sizeof(_threads)/sizeof(_threads[0]); i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (_threads[i] != 0)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(_threads[i], palSTOP_EVENT);&lt;br /&gt;
            pthread_join(_threads[i], NULL);&lt;br /&gt;
            pthread_detach(_threads[i]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palUninit();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
volatile sig_atomic_t termination_in_progress = 0;&lt;br /&gt;
&lt;br /&gt;
void _terminate(int sig)&lt;br /&gt;
{&lt;br /&gt;
    /* Since this handler is established for more than one kind of signal, &lt;br /&gt;
       it might still get invoked recursively by delivery of some other kind&lt;br /&gt;
       of signal.  Use a static variable to keep track of that. */&lt;br /&gt;
    if (termination_in_progress)&lt;br /&gt;
        raise (sig);&lt;br /&gt;
    termination_in_progress = 1;&lt;br /&gt;
&lt;br /&gt;
    /* cleanup */&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    /* Now reraise the signal.  We reactivate the signal&#039;s&lt;br /&gt;
       default handling, which is to terminate the process.&lt;br /&gt;
       We could just call exit or abort,&lt;br /&gt;
       but reraising the signal sets the return status&lt;br /&gt;
       from the process correctly. */&lt;br /&gt;
    signal (sig, SIG_DFL);&lt;br /&gt;
    raise (sig);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* A function to start the STRIDE threads */&lt;br /&gt;
void STRIDEstartup()&lt;br /&gt;
{&lt;br /&gt;
    /* Set termination signals handling */&lt;br /&gt;
    (void) signal(SIGABRT, _terminate);&lt;br /&gt;
    (void) signal(SIGTERM, _terminate);&lt;br /&gt;
    (void) signal(SIGINT, _terminate);&lt;br /&gt;
    (void) signal(SIGQUIT, _terminate);&lt;br /&gt;
    (void) signal(SIGHUP, _terminate);&lt;br /&gt;
&lt;br /&gt;
    /* Initialize PAL. It will return palFALSE if it fails&lt;br /&gt;
       (This will open the transport to the host) */&lt;br /&gt;
    if (palInit() == palFALSE) {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;PAL Initialization failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Initialize Runtime */&lt;br /&gt;
    if (srInit() != srOK)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit failed.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Start the Runtime thread */&lt;br /&gt;
    pthread_create (&amp;amp;_threads[0], NULL, _threadFunc, (void*)srThread);&lt;br /&gt;
&lt;br /&gt;
    /* Start the IM stub read thread */&lt;br /&gt;
    pthread_create (&amp;amp;_threads[1], NULL, _threadFunc, (void*)MyProjectIMStubThread);&lt;br /&gt;
&lt;br /&gt;
    pthread_join(_threads[0], NULL);&lt;br /&gt;
    &lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Intercept Modules]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5080</id>
		<title>Studio:Integrating the Intercept Module (IM)</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:Integrating_the_Intercept_Module_(IM)&amp;diff=5080"/>
		<updated>2008-06-19T00:19:22Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Starting the IMStubRead thread */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intercept Module Files and their purpose ==&lt;br /&gt;
The Intercept Module is generated by STRIDE Studio for the specific set of function interfaces you select.  Three files are created, each prepended with the name of the Intercept Module that you gave it when it was created:&lt;br /&gt;
* The Intercept Module source file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.c&#039;&#039;&#039; or &#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.cpp&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the code that allows the &#039;&#039;remoting&#039;&#039; of functions so that they can be accessed by the Target and Host.&lt;br /&gt;
* The Delegate Mangling header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IM.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file must be included in all of your C files that are using Delegates (Dynamic or Tracing). It contains macros that will mangle the appropriate function names so that they can be intercepted and routed through the IM.  When used, it must be the last file &amp;lt;tt&amp;gt;#include&amp;lt;/tt&amp;gt;&#039;d in the source.  Also, it is only required if the C file uses Delegates.  Stubs and Proxy functions do not require this file&lt;br /&gt;
* The IM Entry point header file (&#039;&#039;imname&#039;&#039;&#039;&#039;&#039;IMEntry.h&#039;&#039;&#039;)&amp;lt;br/&amp;gt;This file contains the prototypes for the external entry points into the IM.  It is needed only by the function that starts the IM Stub Read Thread.&lt;br /&gt;
&lt;br /&gt;
These filenames are all prepended by the name you give the IM when it is generated.  For example, if you call the IM &amp;quot;MyProject&amp;quot;, then the resulting filenames will be &amp;quot;MyProjectIM.c&amp;quot;, &amp;quot;MyProjectIM.h&amp;quot;, and &amp;quot;MyProjectIMEntry.h&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring and generating an Intercept Module ==&lt;br /&gt;
You can either generate the IM via STRIDE Studio&#039;s Intercept Module Wizard, or you can utilize scripts to automatically configure and generate the IM files. These files will contain Studio-based configuration definitions. In addition, the script used for configuration will denote in which context the IM runtime functions are to be executed.&lt;br /&gt;
&lt;br /&gt;
The script can execute automatically so that the Intercept Module is built as part of the test automation framework, as shown in the following example. The IM generation script should open a Studio workspace, optionally compile the workspace and save the database (if needed), then configure and create the IM as shown in the following Perl example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Compile and save the workspace database&lt;br /&gt;
$main::studio-&amp;gt;Workspace-&amp;gt;CompileAll();&lt;br /&gt;
$main::studio-&amp;gt;Workspace-&amp;gt;Save();&lt;br /&gt;
  &lt;br /&gt;
# Intercept Module (IM) name and path constants&lt;br /&gt;
my $IM_FILE_NAME = &amp;quot;MyProject&amp;quot;;&lt;br /&gt;
my $IM_LOCATION_PATH = $main::studio-&amp;gt;Workspace-&amp;gt;Path;&lt;br /&gt;
  &lt;br /&gt;
# Create a reference to the workspace IM object&lt;br /&gt;
my $IM = $main::studio-&amp;gt;Workspace-&amp;gt;Intercept;&lt;br /&gt;
  &lt;br /&gt;
# Local variables&lt;br /&gt;
my ($i, $fx);&lt;br /&gt;
  &lt;br /&gt;
# Reset all of the IM configuration settings to off and&lt;br /&gt;
# reset the delegate group Id&#039;s to their default name.&lt;br /&gt;
$IM-&amp;gt;Reset();&lt;br /&gt;
   &lt;br /&gt;
# Setup the IM name and path&lt;br /&gt;
$IM-&amp;gt;{Name} = $IM_FILE_NAME;&lt;br /&gt;
$IM-&amp;gt;{Path} = $IM_LOCATION_PATH;&lt;br /&gt;
   &lt;br /&gt;
# For each interface in the IM collection&lt;br /&gt;
for ($i=0; $i &amp;lt; $IM-&amp;gt;Count(); $i++)&lt;br /&gt;
{&lt;br /&gt;
    # reference the ith interface;&lt;br /&gt;
    $fx = $IM-&amp;gt;Item($i);&lt;br /&gt;
   &lt;br /&gt;
    $fx-&amp;gt;{Stub} = 1;               # configure as stub&lt;br /&gt;
                                     # and delegate&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Owner} = 1;    # mangle from owner&#039;s perspective&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Explicit} = 1; # implicit name mangling&lt;br /&gt;
    $fx-&amp;gt;Delegate-&amp;gt;{Dynamic} = 1;  # enable dynamic interception&lt;br /&gt;
}                                 &lt;br /&gt;
   &lt;br /&gt;
# Create IM files.&lt;br /&gt;
$IM-&amp;gt;Create();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in the above script how the IM name and output directory were defined. In this case, all three files are created in the same directory as the STRIDE workspace.  The resulting Intercept Module file must then be compiled and built with the rest of your target code.&lt;br /&gt;
&lt;br /&gt;
== Activating the Intercept Module ==&lt;br /&gt;
=== Compiling the IM ===&lt;br /&gt;
To compile the IM, you must define the macro &#039;&#039;&#039;srIMON&#039;&#039;&#039; when you compile the IM.c file or any file that includes one of the headers.  This &amp;quot;turns on&amp;quot; the intercept feature. For example:&lt;br /&gt;
  cc -c -IC:\STRIDE\inc -DsrIMON MyProjectIM.c&lt;br /&gt;
&lt;br /&gt;
Notice that the IM.c and IMEntry.h files reference header files in the STRIDE installation directory.  The build must include this directory when compiling either of these files.  The Delegate (IM.h) header file does not have any dependencies on this directory.&lt;br /&gt;
&lt;br /&gt;
=== IM Resource Requirements ===&lt;br /&gt;
The Intercept Module is usually run as a separate task, and therefore has some&lt;br /&gt;
resource requirements that are in addition to those of the [[Integrating the STRIDE Runtime into a Target|Runtime]] and the [[Integrating the Platform Abstract Layer (PAL)|PAL]]. One of these is the task resource itself.  Another is space for the task stack.&lt;br /&gt;
&lt;br /&gt;
The required task stack size if difficult to predict since it is dependent on the underlying system and on the data that is passed through function arguments.  A stack size between 2-4K would be a good starting point.&lt;br /&gt;
&lt;br /&gt;
=== Starting the IMStubRead thread ===&lt;br /&gt;
The IM must be started &#039;&#039;after&#039;&#039; the Runtime and Transport have been initialized, but before any intercepted calls can be made.  Failure to do this before making an intercepted call can crash or hang the target.&lt;br /&gt;
&lt;br /&gt;
This code snippet, based on using the POSIX call pthread_create() to start a task (your OS may use a different call), demonstrates how to initialize the PAL and the Runtime, start the IM, then become the Runtime message processing loop.  Note that this code assumes that it will become the Runtime thread&#039;s message processing loop (because srThread() will never return unless thread is stopped or killed).  The comments note that this could instead create a second task for the Runtime and return.&lt;br /&gt;
&lt;br /&gt;
This code snippet also handles termination signals based on POSIX APIs in signal.h in order to cleanly shut down the target and clean up resources.  This is required if multi-process target is enabled in the Runtime, especially for Linux OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;pthread.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* STRIDE runtime includes */&lt;br /&gt;
#include &amp;lt;sr.h&amp;gt;&lt;br /&gt;
/* The OS PAL configuration file */&lt;br /&gt;
#include &amp;lt;palcfg.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* Intercept Module includes */&lt;br /&gt;
#include &amp;quot;MyProjectIMEntry.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
extern palBOOL palInit();&lt;br /&gt;
extern palBOOL palUninit();&lt;br /&gt;
&lt;br /&gt;
/* The IM message handler (&amp;quot;MyProject&amp;quot; is the IM name) */&lt;br /&gt;
extern void MyProjectIMStubThread();&lt;br /&gt;
&lt;br /&gt;
/* Thread handling */&lt;br /&gt;
typedef void (*_ThreadFunc_t)( void );&lt;br /&gt;
&lt;br /&gt;
void* _threadFunc(void* param)&lt;br /&gt;
{&lt;br /&gt;
    if (param)&lt;br /&gt;
    {&lt;br /&gt;
        _ThreadFunc_t proc = (_ThreadFunc_t)param;&lt;br /&gt;
        proc();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static pthread_t _threads[15] = {0};&lt;br /&gt;
&lt;br /&gt;
/* Termination signals handling */&lt;br /&gt;
void _cleanup(void)&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
    fprintf (stdout, &amp;quot;TestAgent exiting.\n&amp;quot;);&lt;br /&gt;
    for (i = 0; i &amp;lt; sizeof(_threads)/sizeof(_threads[0]); i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (_threads[i] != 0)&lt;br /&gt;
        {&lt;br /&gt;
            palNotify(_threads[i], palSTOP_EVENT);&lt;br /&gt;
            pthread_join(_threads[i], NULL);&lt;br /&gt;
            pthread_detach(_threads[i]);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    srUninit();&lt;br /&gt;
    palUninit();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
volatile sig_atomic_t termination_in_progress = 0;&lt;br /&gt;
&lt;br /&gt;
void _terminate(int sig)&lt;br /&gt;
{&lt;br /&gt;
    /* Since this handler is established for more than one kind of signal, &lt;br /&gt;
       it might still get invoked recursively by delivery of some other kind&lt;br /&gt;
       of signal.  Use a static variable to keep track of that. */&lt;br /&gt;
    if (termination_in_progress)&lt;br /&gt;
        raise (sig);&lt;br /&gt;
    termination_in_progress = 1;&lt;br /&gt;
&lt;br /&gt;
    /* cleanup */&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    /* Now reraise the signal.  We reactivate the signal&#039;s&lt;br /&gt;
       default handling, which is to terminate the process.&lt;br /&gt;
       We could just call exit or abort,&lt;br /&gt;
       but reraising the signal sets the return status&lt;br /&gt;
       from the process correctly. */&lt;br /&gt;
    signal (sig, SIG_DFL);&lt;br /&gt;
    raise (sig);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* A function to start the STRIDE threads */&lt;br /&gt;
void STRIDEstartup()&lt;br /&gt;
{&lt;br /&gt;
    int i = 0;&lt;br /&gt;
&lt;br /&gt;
    /* Set termination signals handling */&lt;br /&gt;
    (void) signal(SIGABRT, _terminate);&lt;br /&gt;
    (void) signal(SIGTERM, _terminate);&lt;br /&gt;
    (void) signal(SIGINT, _terminate);&lt;br /&gt;
    (void) signal(SIGQUIT, _terminate);&lt;br /&gt;
    (void) signal(SIGHUP, _terminate);&lt;br /&gt;
&lt;br /&gt;
    /* Initialize PAL. It will return palFALSE if it fails&lt;br /&gt;
       (This will open the transport to the host) */&lt;br /&gt;
    if (palInit() == palFALSE) {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;PAL Initialization failed.&amp;quot;);&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;Quitting.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Initialize Runtime */&lt;br /&gt;
    if (srInit() != srOK)&lt;br /&gt;
    {&lt;br /&gt;
        palLog(palLOG_LEVEL_ERROR, &amp;quot;srInit failed.&amp;quot;);&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /* Start the Runtime thread */&lt;br /&gt;
    pthread_create (&amp;amp;_threads[i++], NULL, _threadFunc, (void*)srThread);&lt;br /&gt;
&lt;br /&gt;
    /* Start the IM stub read thread */&lt;br /&gt;
    pthread_create (&amp;amp;_threads[i++], NULL, _threadFunc, (void*)MyProjectIMStubThread);&lt;br /&gt;
&lt;br /&gt;
    _cleanup();&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Intercept Modules]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5051</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5051"/>
		<updated>2008-06-18T20:04:47Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime */  SCR 8636&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary that previously packaged the Host Runtime has been removed. Building Windows applications using the Host Runtime is not supported anymore. &lt;br /&gt;
The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary that previously packaged the Target Runtime has been removed. &lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime (Beta 1)==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0101&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
* In target Test Classes and Test Functions, added capability to specify the comment label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtest.c&lt;br /&gt;
 srtest.cpp&lt;br /&gt;
 srtest.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
==Runtime (Beta 2)==&lt;br /&gt;
* A new public routine for Runtime Thread exit point, srThreadUninit(), has been added to sr.h &amp;amp; srthread.c.&lt;br /&gt;
* Fixed a compiler warning in srmem.c.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srcfg.h&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srthread.c&lt;br /&gt;
&lt;br /&gt;
=Migration to 3.0.0101=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
* If target Test Classes and Test Functions are used, change the signature to include test label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5050</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5050"/>
		<updated>2008-06-18T19:56:38Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime */  SCR 8891&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary that previously packaged the Host Runtime has been removed. Building Windows applications using the Host Runtime is not supported anymore. &lt;br /&gt;
The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary that previously packaged the Target Runtime has been removed. &lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0101&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
* In target Test Classes and Test Functions, added capability to specify the comment label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtest.c&lt;br /&gt;
 srtest.cpp&lt;br /&gt;
 srtest.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 3.0.0101=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
* If target Test Classes and Test Functions are used, change the signature to include test label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5049</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5049"/>
		<updated>2008-06-18T19:53:01Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary that previously packaged the Host Runtime has been removed. Building Windows applications using the Host Runtime is not supported anymore. &lt;br /&gt;
The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary that previously packaged the Target Runtime has been removed. &lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0101&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
* In target Test Classes and Test Functions, added capability to specify the comment label in srTestCaseAddComment() and AddComment() APIs.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtest.c&lt;br /&gt;
 srtest.cpp&lt;br /&gt;
 srtest.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 3.0.0101=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Studio:After_installing_the_STRIDE_Runtime,_what_are_my_configuration_settings%3F&amp;diff=5030</id>
		<title>Studio:After installing the STRIDE Runtime, what are my configuration settings?</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Studio:After_installing_the_STRIDE_Runtime,_what_are_my_configuration_settings%3F&amp;diff=5030"/>
		<updated>2008-06-17T22:44:28Z</updated>

		<summary type="html">&lt;p&gt;Shamr: updated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Runtime configuration settings are described in the &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file, located in &#039;&#039;&#039;C:\STRIDE\runtime&#039;&#039;&#039;. (This file is installed only when the runtime files are requested as part of the STRIDE install.)&lt;br /&gt;
&lt;br /&gt;
If you have made changes to the default settings, you should avoid overwriting the file.&lt;br /&gt;
&lt;br /&gt;
The default configuration settings are as follows:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;Source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/* Messaging */&lt;br /&gt;
#define srCFG_TOTAL_STIDS              16   /* number of STRIDE Transact IDs in system   */&lt;br /&gt;
#define srCFG_TOTAL_SUBCS              20   /* total number of subscribers at one time   */&lt;br /&gt;
#define srCFG_TOTAL_PTRS               30   /* total number of pointer entries           */&lt;br /&gt;
#define srCFG_SUID_TABLE_TYPE          1    /* 1 = Search based, 0 = Index based         */&lt;br /&gt;
#define srCFG_SUID_TABLE_SIZE          225  /* number of SUID Table entries              */&lt;br /&gt;
#define srCFG_TOTAL_SUIDS_QUED         50   /* total number of SUIDS queued at one time  */&lt;br /&gt;
#define srCFG_STID_NAME_SIZE           15   /* max size of a STRIDE Transact ID name     */&lt;br /&gt;
#define srCFG_SUID_OVERRIDE            1    /* override (1 = enabled, 0 = disabled)      */&lt;br /&gt;
#define srCFG_SUID_OVERRIDE_STORAGE    0    /* override registration storage allocation  */&lt;br /&gt;
&lt;br /&gt;
/* Tracing */&lt;br /&gt;
#define srCFG_TRACING_ENABLED          1    /* tracing enabled  (1=enabled, 0=disabled)  */&lt;br /&gt;
#define srCFG_TOTAL_TRACING_MEMORY     4096 /* number of bytes allocated for tracing     */&lt;br /&gt;
#define srCFG_TRACEBUFFER_MAX_SIZE     1000 /* max size of a single trace buffer         */&lt;br /&gt;
#define srCFG_TRACEBUFFER_WAKEUP_TIME  100  /* number of milliseconds between sending    */&lt;br /&gt;
&lt;br /&gt;
/* Time Stamp */&lt;br /&gt;
#define srCFG_TIMESTAMP_UNITS          1    /* 0 = microsecs, 1 = Millisecs, 2 = secs    */&lt;br /&gt;
#define srCFG_TIMESTAMP_DURATION       1    /* number of TimeStamp Units per Tick        */&lt;br /&gt;
&lt;br /&gt;
/* Auxiliary Data */&lt;br /&gt;
#define srCFG_AUXDATA                  0    /* Use Auxiliary Data (1=Yes, 0=No)          */&lt;br /&gt;
&lt;br /&gt;
/* Transport Settings */&lt;br /&gt;
#define srCFG_MAX_TRANSPORT_UNIT       2048 /* 0=No Fragmentation, Number=Fragment Size  */&lt;br /&gt;
#define srCFG_DEFAULT_TRANSPORT_STATE  1    /* 1=Transport Ready, 0=Transport Not Ready  */&lt;br /&gt;
&lt;br /&gt;
/* Connection Settings */&lt;br /&gt;
#define srCFG_CONNECTION_TIMEOUT       5000 /* connection timeout (1=enabled, 0=disabled)*/&lt;br /&gt;
&lt;br /&gt;
/* RFC (Remote Function Call) Settings */&lt;br /&gt;
#define srCFG_RFC_ENABLED              1    /* RFC enabled  (1=Yes, 0=No)                */&lt;br /&gt;
#define srCFG_RFC_PMM                  1    /* RFC pool memory management                */&lt;br /&gt;
                                            /*    - (0=None, 1=Recovery, 2=Reallocation) */&lt;br /&gt;
#define srCFG_RFC_PAL_PMM              0    /* PAL pool memory management (1=Yes, 0=No)  */&lt;br /&gt;
&lt;br /&gt;
/* Memory Management Settings */&lt;br /&gt;
#define srCFG_MEMORY_MANAGEMENT        0    /* memory management (1=enabled, 0=disabled) */&lt;br /&gt;
&lt;br /&gt;
#if srCFG_MEMORY_MANAGEMENT&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_SIZE_SMALL  30     /* size of a small memory block            */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_SIZE_MEDIUM 100    /* size of a medium memory block           */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_SIZE_LARGE  500    /* size of a large memory block            */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_SIZE_LARGE2 1000   /* size of a large2 memory block           */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_SIZE_LARGE3 10000  /* size of a large3 memory block           */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_SIZE_HUGE   0xFFFF /* size of a huge memory block             */&lt;br /&gt;
&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_MAX_SMALL   5000   /* max number of small memory blocks       */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_MAX_MEDIUM  250    /* max number of medium memory blocks      */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_MAX_LARGE   250    /* max number of large memory blocks       */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_MAX_LARGE2  100    /* max number of large2 memory blocks      */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_MAX_LARGE3  50     /* max number of large3 memory blocks      */&lt;br /&gt;
#define srCFG_MEMORY_BLOCK_MAX_HUGE    50     /* max number of huge memory blocks        */&lt;br /&gt;
#endif /* srCFG_MEMORY_MANAGEMENT */&lt;br /&gt;
&lt;br /&gt;
/* Multi-Process Settings */&lt;br /&gt;
#define srCFG_MULTI_PROC_TARGET        0  /* multi-process target (1=enabled, 0=disabled)*/&lt;br /&gt;
&lt;br /&gt;
/* Variable Arguments */&lt;br /&gt;
#define srCFG_VAR_ARGS_ENABLED         1    /* variable arguments (1=enabled, 0=disabled)*/&lt;br /&gt;
&lt;br /&gt;
/* Debug Settings */&lt;br /&gt;
#define srCFG_ERROR_CHECK_LEVEL        2    /* levels(0,1,2), none(0)                    */&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:STRIDE Runtime]]&lt;br /&gt;
[[Category:STRIDE Runtime Configuration]]&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5025</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5025"/>
		<updated>2008-06-17T17:53:56Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Migration to 2.1.0301 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary that previously packaged the Host Runtime has been removed. Building Windows applications using the Host Runtime is not supported anymore. &lt;br /&gt;
The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary that previously packaged the Target Runtime has been removed. &lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0101&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 3.0.0101=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=Main_Page&amp;diff=5024</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=Main_Page&amp;diff=5024"/>
		<updated>2008-06-17T17:52:14Z</updated>

		<summary type="html">&lt;p&gt;Shamr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the S2 Technologies&amp;amp;trade; &#039;&#039;&#039;STRIDE&#039;&#039;&#039;&amp;amp;trade;&#039;&#039;&#039; 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;
&lt;br /&gt;
{|&lt;br /&gt;
{|&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{|cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top;border:1px solid #bcc&amp;quot;&lt;br /&gt;
! style=&amp;quot;margin:0;background:#cedff2;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot; | [[:Category:Deploying STRIDE|Deploying STRIDE]]&lt;br /&gt;
! style=&amp;quot;margin:0;background:#cedff2;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot; | [[:Category:Test Utilities|Test Utilities]]&lt;br /&gt;
! style=&amp;quot;margin:0;background:#cedff2;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot; | [[:Category:Frameworks|Frameworks]]&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
* [[Installing STRIDE]]&lt;br /&gt;
* [[Integrating STRIDE]]&lt;br /&gt;
* [[Verifying Installation]]&lt;br /&gt;
* [[Proof of Concept]]&lt;br /&gt;
* [[Framework| Framework]]&lt;br /&gt;
* [[Training]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
* [[Host Apps]]&lt;br /&gt;
* [[Test Classes]]&lt;br /&gt;
* [[Test Functions]]&lt;br /&gt;
* [[Test Runners]]&lt;br /&gt;
* [[:Category:Components|Components]]&lt;br /&gt;
* [[Templates]]&lt;br /&gt;
* [[Other Utilities]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
* [[Using Frameworks]]&lt;br /&gt;
* [[Creating Frameworks]]&lt;br /&gt;
* [[Provided Frameworks]]&lt;br /&gt;
* [[Using Packages]]&lt;br /&gt;
* [[Creating Packages]]&lt;br /&gt;
* [[Provided Packages]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;margin:0;background:#cedff2;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot; | [[:Category:Training|Training]]&lt;br /&gt;
! style=&amp;quot;margin:0;background:#cedff2;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot; | [[:Category:Application Notes|Application Notes]]&lt;br /&gt;
! style=&amp;quot;margin:0;background:#cedff2;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot; | [[:Category:Release Notes|Release Notes]]&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
*[[Overview]]&lt;br /&gt;
*[[STRIDE Quick Start]]&lt;br /&gt;
*[[Target Test Code]]&lt;br /&gt;
*[[Interface Instrumentation]]&lt;br /&gt;
*[[Intercept Module Settings]]&lt;br /&gt;
*[[Test Scripts]]&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;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Category tree is drawn here&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 2.1.0201 | STRIDE 2.1.02xx (Moonlight)]]&lt;br /&gt;
* [[STRIDE 3.0.0101 | STRIDE 3.0.01xx (StoneSteps)]]&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5022</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5022"/>
		<updated>2008-06-17T17:51:26Z</updated>

		<summary type="html">&lt;p&gt;Shamr: STRIDE 2.1.0301 moved to STRIDE 3.0.0101&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary that previously packaged the Host Runtime has been removed. Building Windows applications using the Host Runtime is not supported anymore. &lt;br /&gt;
The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary that previously packaged the Target Runtime has been removed. &lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0101&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5021</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5021"/>
		<updated>2008-06-17T17:48:49Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary that previously packaged the Host Runtime has been removed. Building Windows applications using the Host Runtime is not supported anymore. &lt;br /&gt;
The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary that previously packaged the Target Runtime has been removed. &lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;3.0.0101&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5020</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5020"/>
		<updated>2008-06-17T17:44:30Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Removed / Old Routines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 3.0.0101 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
==Windows Off-Target SDK==&lt;br /&gt;
A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.&lt;br /&gt;
The &#039;&#039;&#039;s2shostapphrt&#039;&#039;&#039; libriary that previously packaged the Host Runtime has been removed. Building Windows applications using the Host Runtime is not supported anymore. &lt;br /&gt;
The &#039;&#039;&#039;s2shostapptrt&#039;&#039;&#039; libriary that previously packaged the Target Runtime has been removed. &lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
==Windows Applications using Windows Off-Target SDK==&lt;br /&gt;
* The new &#039;&#039;&#039;s2srwin.lib&#039;&#039;&#039; has public API, pulished in a header srwin.h, containing the following set of routines:&lt;br /&gt;
 srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.&lt;br /&gt;
 srWin_AddThread() - Adds additional message processing threads to the application.&lt;br /&gt;
 srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.&lt;br /&gt;
 srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
 srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.&lt;br /&gt;
* Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:&lt;br /&gt;
** replace the include of hostapp.h with include of srwin.h&lt;br /&gt;
** replace all calls to HostAppXXX() with srWin_XXX()&lt;br /&gt;
** call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5008</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5008"/>
		<updated>2008-06-12T23:38:53Z</updated>

		<summary type="html">&lt;p&gt;Shamr: SCR 8891 initial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 2.1.0301 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen() - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose() - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit() - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy() - Destroy a mutex object&lt;br /&gt;
 palMutexLock() - Lock a mutex object&lt;br /&gt;
 palMutexUnlock() - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId() - Get current thread Id&lt;br /&gt;
 palGetProcessId() - Get current process Id&lt;br /&gt;
 palSleep() - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog() - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
* Function signatures and functionalities of palWait() &amp;amp; palNotify() have been updated.&lt;br /&gt;
&lt;br /&gt;
 palWait() - now takes in an in/out pointer for events notification&lt;br /&gt;
 palNotify() - mail box Id has been updated to notify any event including mail box Ids.&lt;br /&gt;
&lt;br /&gt;
* Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
&lt;br /&gt;
===Removed / Old Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Modules===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.&lt;br /&gt;
&lt;br /&gt;
* If your PAL uses &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).&lt;br /&gt;
&lt;br /&gt;
==Host Apps using Target Runtime lib s2shostapptrt==&lt;br /&gt;
* A new routine, &#039;&#039;&#039;HostAppSetMaster()&#039;&#039;&#039;, has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the &#039;&#039;master&#039;&#039; process or the &#039;&#039;daemon&#039;&#039; calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5006</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=5006"/>
		<updated>2008-06-05T23:04:38Z</updated>

		<summary type="html">&lt;p&gt;Shamr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 2.1.0301 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
&lt;br /&gt;
==Build Tools==&lt;br /&gt;
A set of new command line build tools has been implemented:&lt;br /&gt;
* &#039;&#039;&#039;Stride compiler&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride database binder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Stride instrumantation generator&#039;&#039;&#039;&lt;br /&gt;
These utilities has been ported for Windows and Linux. Using them would allow seamless integration with &amp;quot;make&amp;quot; like build environment.&lt;br /&gt;
&lt;br /&gt;
==Runtime/PAL==&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===Memory Management===&lt;br /&gt;
To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Memory Management&#039;&#039;&#039;&lt;br /&gt;
In case of multi-process target, recommended approach is to use &amp;lt;u&amp;gt;Memory-Mapped Files&amp;lt;/u&amp;gt; to implement memory segments.&lt;br /&gt;
 palMemSegmentOpen - Open/create memory segment &lt;br /&gt;
 palMemSegmentClose - Close memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy - Destroy a mutex object&lt;br /&gt;
 palMutexLock - Lock a mutex object&lt;br /&gt;
 palMutexUnlock - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId - Get current thread Id&lt;br /&gt;
 palGetProcessId - Get current process Id&lt;br /&gt;
 palSleep - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
 palMemAlloc - now returns a void pointer&lt;br /&gt;
 palMemFree - now takes in a void pointer as input&lt;br /&gt;
&lt;br /&gt;
===Removed / Old Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
===Removed Module===&lt;br /&gt;
 S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime&#039;s memory management module &#039;&#039;srMem&#039;&#039; can be used instead of &#039;&#039;S2Mem&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), will be used in PAL&#039;s palMemAlloc() &amp;amp; palMemFree() in case of multi-process target is enabled.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palMemSegmentOpen() &amp;amp; palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support sharing of the synchronization objects among multiple processors if shared memory management is enabled.&lt;br /&gt;
&lt;br /&gt;
* If your PAL was using &#039;&#039;S2Mem&#039;&#039; routines for dynamic memory, you should use new Runtime module &#039;&#039;srMem&#039;&#039;. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module &#039;&#039;srMem&#039;&#039; uses these configurations to allocate and manage memory segments.&lt;br /&gt;
&lt;br /&gt;
==Host Apps using Target Runtime lib s2shostapptrt==&lt;br /&gt;
* A new routine, &#039;&#039;&#039;HostAppSetMaster()&#039;&#039;&#039;, has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the &#039;&#039;master&#039;&#039; process or the &#039;&#039;daemon&#039;&#039; calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4994</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4994"/>
		<updated>2008-05-29T19:25:54Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 2.1.0301 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets / Shared Memory===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of shared memory, protecting using named Mutex objects, synchronization of multiple processors ands multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Runtime Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
===Shared Memory===&lt;br /&gt;
To support multi-process target, shared memory support for dynamic and static pool memory has been implemented in Runtime. Runtime makes PAL calls to acquire shared memory and manages the memory according to runtime configurations set by user.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect shared resources between multiple processors and multiple threads. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Shared Memory Management&#039;&#039;&#039;&lt;br /&gt;
Recommended approach is to use Memory-Mapped Files to implement shared memory.&lt;br /&gt;
 palOpenSharedMem - Open/Create shared memory segment &lt;br /&gt;
 palCloseSharedMem - Close shared memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy - Destroy a mutex object&lt;br /&gt;
 palMutexLock - Lock a mutex object&lt;br /&gt;
 palMutexUnlock - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId - Get current thread Id&lt;br /&gt;
 palGetProcessId - Get current process Id&lt;br /&gt;
 palSleep - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
 palMemAlloc - now returns a void pointer&lt;br /&gt;
 palMemFree - now takes in a void pointer as input&lt;br /&gt;
&lt;br /&gt;
===Removed / Old Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime Version &#039;&#039;&#039;3.00&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* To use in PAL for shared dynamic pool memory, new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), have been added as part of new runtime files srmem.h &amp;amp; srmem.c.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palOpenSharedMem() &amp;amp; palCloseSharedMem(), using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now manages shared dynamic pool memory. Update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free() for the shared memory case. For the non-shared case, you can leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support sharing of the synchronization objects among multiple processors if shared memory management is enabled.&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the shared memory management. By default, shared memory is disabled. If you enable shared memory, you also need to configure the sizes and maximum number of shared memory blocks. New Runtime module &#039;&#039;srmem&#039;&#039; uses these configurations to allocate and manage shared dynamic pool memory.&lt;br /&gt;
&lt;br /&gt;
==Host Apps using Target Runtime lib s2shostapptrt==&lt;br /&gt;
* A new routine, &#039;&#039;&#039;HostAppSetMaster()&#039;&#039;&#039;, has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the &#039;&#039;master&#039;&#039; process or the &#039;&#039;daemon&#039;&#039; calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4993</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4993"/>
		<updated>2008-05-29T19:21:24Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Host Apps using Target Runtime lib s2shostapptrt */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 2.1.0301 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets / Shared Memory===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of shared memory, protecting using named Mutex objects, synchronization of multiple processors ands multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Runtime Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
===Shared Memory===&lt;br /&gt;
To support multi-process target, shared memory support for dynamic and static pool memory has been implemented in Runtime. Runtime makes PAL calls to acquire shared memory and manages the memory according to runtime configurations set by user.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect shared resources between multiple processors and multiple threads. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Shared Memory Management&#039;&#039;&#039;&lt;br /&gt;
Recommended approach is to use Memory-Mapped Files to implement shared memory.&lt;br /&gt;
 palOpenSharedMem - Open/Create shared memory segment &lt;br /&gt;
 palCloseSharedMem - Close shared memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy - Destroy a mutex object&lt;br /&gt;
 palMutexLock - Lock a mutex object&lt;br /&gt;
 palMutexUnlock - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId - Get current thread Id&lt;br /&gt;
 palGetProcessId - Get current process Id&lt;br /&gt;
 palSleep - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
 palMemAlloc - now returns a void pointer&lt;br /&gt;
 palMemFree - now takes in a void pointer as input&lt;br /&gt;
&lt;br /&gt;
===Removed / Old Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime versions &#039;&#039;&#039;3.0&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* To use in PAL for shared dynamic pool memory, new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), have been added as part of new runtime files srmem.h &amp;amp; srmem.c.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palOpenSharedMem() &amp;amp; palCloseSharedMem(), using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now manages shared dynamic pool memory. Update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free() for the shared memory case. For the non-shared case, you can leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support sharing of the synchronization objects among multiple processors if shared memory management is enabled.&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the shared memory management. By default, shared memory is disabled. If you enable shared memory, you also need to configure the sizes and maximum number of shared memory blocks. New Runtime module &#039;&#039;srmem&#039;&#039; uses these configurations to allocate and manage shared dynamic pool memory.&lt;br /&gt;
&lt;br /&gt;
==Host Apps using Target Runtime lib s2shostapptrt==&lt;br /&gt;
* A new routine, &#039;&#039;&#039;HostAppSetMaster()&#039;&#039;&#039;, has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the &#039;&#039;master&#039;&#039; process or the &#039;&#039;daemon&#039;&#039; calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4992</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4992"/>
		<updated>2008-05-29T19:20:51Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 2.1.0301 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets / Shared Memory===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of shared memory, protecting using named Mutex objects, synchronization of multiple processors ands multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Runtime Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
===Shared Memory===&lt;br /&gt;
To support multi-process target, shared memory support for dynamic and static pool memory has been implemented in Runtime. Runtime makes PAL calls to acquire shared memory and manages the memory according to runtime configurations set by user.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect shared resources between multiple processors and multiple threads. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Shared Memory Management&#039;&#039;&#039;&lt;br /&gt;
Recommended approach is to use Memory-Mapped Files to implement shared memory.&lt;br /&gt;
 palOpenSharedMem - Open/Create shared memory segment &lt;br /&gt;
 palCloseSharedMem - Close shared memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy - Destroy a mutex object&lt;br /&gt;
 palMutexLock - Lock a mutex object&lt;br /&gt;
 palMutexUnlock - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId - Get current thread Id&lt;br /&gt;
 palGetProcessId - Get current process Id&lt;br /&gt;
 palSleep - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
 palMemAlloc - now returns a void pointer&lt;br /&gt;
 palMemFree - now takes in a void pointer as input&lt;br /&gt;
&lt;br /&gt;
===Removed / Old Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime versions &#039;&#039;&#039;3.0&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* To use in PAL for shared dynamic pool memory, new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), have been added as part of new runtime files srmem.h &amp;amp; srmem.c.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palOpenSharedMem() &amp;amp; palCloseSharedMem(), using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now manages shared dynamic pool memory. Update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free() for the shared memory case. For the non-shared case, you can leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support sharing of the synchronization objects among multiple processors if shared memory management is enabled.&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit &#039;&#039;&#039;srcfg.h&#039;&#039;&#039; file to configure the shared memory management. By default, shared memory is disabled. If you enable shared memory, you also need to configure the sizes and maximum number of shared memory blocks. New Runtime module &#039;&#039;srmem&#039;&#039; uses these configurations to allocate and manage shared dynamic pool memory.&lt;br /&gt;
&lt;br /&gt;
==Host Apps using Target Runtime lib s2shostapptrt==&lt;br /&gt;
* A new routine, HostAppSetMaster(), has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the &#039;&#039;master&#039;&#039; process or the &#039;&#039;daemon&#039;&#039; calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4991</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4991"/>
		<updated>2008-05-29T19:19:47Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* Runtime */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 2.1.0301 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets / Shared Memory===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of shared memory, protecting using named Mutex objects, synchronization of multiple processors ands multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Runtime Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
===Shared Memory===&lt;br /&gt;
To support multi-process target, shared memory support for dynamic and static pool memory has been implemented in Runtime. Runtime makes PAL calls to acquire shared memory and manages the memory according to runtime configurations set by user.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect shared resources between multiple processors and multiple threads. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Shared Memory Management&#039;&#039;&#039;&lt;br /&gt;
Recommended approach is to use Memory-Mapped Files to implement shared memory.&lt;br /&gt;
 palOpenSharedMem - Open/Create shared memory segment &lt;br /&gt;
 palCloseSharedMem - Close shared memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy - Destroy a mutex object&lt;br /&gt;
 palMutexLock - Lock a mutex object&lt;br /&gt;
 palMutexUnlock - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId - Get current thread Id&lt;br /&gt;
 palGetProcessId - Get current process Id&lt;br /&gt;
 palSleep - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
 palMemAlloc - now returns a void pointer&lt;br /&gt;
 palMemFree - now takes in a void pointer as input&lt;br /&gt;
&lt;br /&gt;
===Removed / Old Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime versions &#039;&#039;&#039;3.0&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* To use in PAL for shared dynamic pool memory, new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), have been added as part of new runtime files srmem.h &amp;amp; srmem.c.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palOpenSharedMem() &amp;amp; palCloseSharedMem(), using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now manages shared dynamic pool memory. Update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free() for the shared memory case. For the non-shared case, you can leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support sharing of the synchronization objects among multiple processors if shared memory management is enabled.&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit srcfg.h file to configure the shared memory management. By default, shared memory is disabled. If you enable shared memory, you also need to configure the sizes and maximum number of shared memory blocks. New Runtime module &#039;&#039;srmem&#039;&#039; uses these configurations to allocate and manage shared dynamic pool memory.&lt;br /&gt;
&lt;br /&gt;
==Host Apps using Target Runtime lib s2shostapptrt==&lt;br /&gt;
* A new routine, HostAppSetMaster(), has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the &#039;&#039;master&#039;&#039; process or the &#039;&#039;daemon&#039;&#039; calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4990</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4990"/>
		<updated>2008-05-28T23:45:22Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* PAL */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 2.1.0301 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets / Shared Memory===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of shared memory, protecting using named Mutex objects, synchronization of multiple processors ands multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Runtime Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
===Shared Memory===&lt;br /&gt;
To support multi-process target, shared memory support for dynamic and static pool memory has been implemented in Runtime. Runtime makes PAL calls to acquire shared memory and manages the memory according to runtime configurations set by user.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect shared resources between multiple processors and multiple threads. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Shared Memory Management&#039;&#039;&#039;&lt;br /&gt;
Recommended approach is to use Memory-Mapped Files to implement shared memory.&lt;br /&gt;
 palOpenSharedMem - Open/Create shared memory segment &lt;br /&gt;
 palCloseSharedMem - Close shared memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy - Destroy a mutex object&lt;br /&gt;
 palMutexLock - Lock a mutex object&lt;br /&gt;
 palMutexUnlock - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId - Get current thread Id&lt;br /&gt;
 palGetProcessId - Get current process Id&lt;br /&gt;
 palSleep - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
 palMemAlloc - now returns a void pointer&lt;br /&gt;
 palMemFree - now takes in a void pointer as input&lt;br /&gt;
&lt;br /&gt;
===Removed / Old Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime versions &#039;&#039;&#039;3.0&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* To use in PAL for shared dynamic pool memory, new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), have been added as part of new runtime files srmem.h &amp;amp; srmem.c.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to &#039;&#039;&#039;&#039;&#039;Platform Abstraction Layer (PAL) Specification&#039;&#039;&#039;&#039;&#039; for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palOpenSharedMem() &amp;amp; palCloseSharedMem(), using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now manages shared dynamic pool memory. Update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free() for the shared memory case. For the non-shared case, you can leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support sharing of the synchronization objects among multiple processors if shared memory management is enabled.&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit srcfg.h file to configure the shared memory management. By default, shared memory is disabled. If you decide to enable shared memory, you also need to configure the sizes and max number of memory blocks. New runtime module srmem uses these configurations to allocate and manage shared dynamic pool memory.&lt;br /&gt;
&lt;br /&gt;
==Host Apps using Target Runtime lib s2shostapptrt==&lt;br /&gt;
* A new routine, HostAppSetMaster(), has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the &#039;&#039;master&#039;&#039; process or the &#039;&#039;daemon&#039;&#039; calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
	<entry>
		<id>https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4989</id>
		<title>STRIDE 3.0.01xx</title>
		<link rel="alternate" type="text/html" href="https://www.stridewiki.com/index.php?title=STRIDE_3.0.01xx&amp;diff=4989"/>
		<updated>2008-05-28T23:44:26Z</updated>

		<summary type="html">&lt;p&gt;Shamr: /* PAL */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Release Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This page documents the changes in STRIDE version 2.1.0301 (code name &#039;&#039;StoneSteps&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Please review this information before upgrading from an earlier version.&lt;br /&gt;
&lt;br /&gt;
=What&#039;s New=&lt;br /&gt;
Based on customer requirements, in this release we have made significant changes to [[Integrating STRIDE#The STRIDE Runtime|STRIDE Runtime]] and [[Integrating STRIDE#The Platform Abstraction Layer (PAL)|PAL]].&lt;br /&gt;
&lt;br /&gt;
===Multi-Process Targets / Shared Memory===&lt;br /&gt;
New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of shared memory, protecting using named Mutex objects, synchronization of multiple processors ands multiple threads, and usage of current process and thread IDs.&lt;br /&gt;
&lt;br /&gt;
===Runtime Logging (Optional)===&lt;br /&gt;
Runtime and PAL use a logging routine that can optionally be implemented in PAL.&lt;br /&gt;
&lt;br /&gt;
=Change Details=&lt;br /&gt;
===Shared Memory===&lt;br /&gt;
To support multi-process target, shared memory support for dynamic and static pool memory has been implemented in Runtime. Runtime makes PAL calls to acquire shared memory and manages the memory according to runtime configurations set by user.&lt;br /&gt;
&lt;br /&gt;
===Protection using Mutex===&lt;br /&gt;
Runtime now uses named mutex objects to protect shared resources between multiple processors and multiple threads. Runtime makes PAL calls to obtain and control mutex objects.&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
&lt;br /&gt;
===New Routines===&lt;br /&gt;
* &#039;&#039;&#039;Shared Memory Management&#039;&#039;&#039;&lt;br /&gt;
Recommended approach is to use Memory-Mapped Files to implement shared memory.&lt;br /&gt;
 palOpenSharedMem - Open/Create shared memory segment &lt;br /&gt;
 palCloseSharedMem - Close shared memory segment&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Named Mutexes&#039;&#039;&#039;&lt;br /&gt;
 palMutexInit - Initialize a mutex object&lt;br /&gt;
 palMutexDestroy - Destroy a mutex object&lt;br /&gt;
 palMutexLock - Lock a mutex object&lt;br /&gt;
 palMutexUnlock - Unlock a mutex object&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Task Synchronization&#039;&#039;&#039;&lt;br /&gt;
 palGetThreadId - Get current thread Id&lt;br /&gt;
 palGetProcessId - Get current process Id&lt;br /&gt;
 palSleep - Suspend the execution of the current thread&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Logging&#039;&#039;&#039;&lt;br /&gt;
This is optional.&lt;br /&gt;
 palLog - Logging utility&lt;br /&gt;
&lt;br /&gt;
===Updated Routines===&lt;br /&gt;
Function signatures of palMemAlloc() &amp;amp; palMemFree() have been updated.&lt;br /&gt;
 palMemAlloc - now returns a void pointer&lt;br /&gt;
 palMemFree - now takes in a void pointer as input&lt;br /&gt;
&lt;br /&gt;
===Removed / Old Routines===&lt;br /&gt;
 palProtect&lt;br /&gt;
 palUnprotect&lt;br /&gt;
 palCriticalErr&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
&lt;br /&gt;
* STRIDE Host Release &#039;&#039;&#039;2.1.0301&#039;&#039;&#039; is compatible with the Runtime versions &#039;&#039;&#039;3.0&#039;&#039;&#039;.&lt;br /&gt;
* To support multi-process target, significant changes have been made to runtime.&lt;br /&gt;
* A new public routine, srUninit(), has been added to sr.h &amp;amp; srapi.c.&lt;br /&gt;
* To use in PAL for shared dynamic pool memory, new routines, _srMem_Allocate() &amp;amp; _srMem_Free(), have been added as part of new runtime files srmem.h &amp;amp; srmem.c.&lt;br /&gt;
* Calls to palProtect() &amp;amp; palUnprotect() have been replaced by new routines _srProtect() &amp;amp; _srUnprotect(), in which the implementation uses its own mutex object that calls PAL&#039;s mutex routines.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been modified:&lt;br /&gt;
 sr.h&lt;br /&gt;
 srapi.c&lt;br /&gt;
 srconn.c&lt;br /&gt;
 srconn.h&lt;br /&gt;
 srib.c&lt;br /&gt;
 srib.h&lt;br /&gt;
 sribtr.c&lt;br /&gt;
 sribtr.h&lt;br /&gt;
 srmsgptr.c&lt;br /&gt;
 srmsgptr.h&lt;br /&gt;
 srmsgque.c&lt;br /&gt;
 srmsgque.h&lt;br /&gt;
 srmsgrt.c&lt;br /&gt;
 srmsgrt.h&lt;br /&gt;
 srmsgsub.c&lt;br /&gt;
 srmsgsub.h&lt;br /&gt;
 srstid.c&lt;br /&gt;
 srstid.h&lt;br /&gt;
 srsuid.c&lt;br /&gt;
 srsuid.h&lt;br /&gt;
 srtime.c&lt;br /&gt;
 srtime.h&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039; The following Runtime files have been added:&lt;br /&gt;
 srmem.c&lt;br /&gt;
 srmem.h&lt;br /&gt;
&lt;br /&gt;
=Migration to 2.1.0301=&lt;br /&gt;
Recommended steps for migration from a previous version:&lt;br /&gt;
&lt;br /&gt;
==PAL==&lt;br /&gt;
Please refer to Platform Abstraction Layer (PAL) Specification for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.&lt;br /&gt;
&lt;br /&gt;
* Implement new shared memory routines, palOpenSharedMem() &amp;amp; palCloseSharedMem(), using memory-mapped files.&lt;br /&gt;
&lt;br /&gt;
* Runtime now manages shared dynamic pool memory. Update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free() for the shared memory case. For the non-shared case, you can leave the current implementation as it is.&lt;br /&gt;
&lt;br /&gt;
* Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() &amp;amp; palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.&lt;br /&gt;
&lt;br /&gt;
* Remove old routines palProtect(), palUnprotect() and palCriticalErr().&lt;br /&gt;
&lt;br /&gt;
* Implement new routines palGetThreadId() and palGetProcessId().&lt;br /&gt;
&lt;br /&gt;
* Implement new routine palSleep().&lt;br /&gt;
&lt;br /&gt;
* Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() &amp;amp; palNotify(), to support sharing of the synchronization objects among multiple processors if shared memory management is enabled.&lt;br /&gt;
&lt;br /&gt;
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.&lt;br /&gt;
&lt;br /&gt;
==Runtime==&lt;br /&gt;
* Edit srcfg.h file to configure the shared memory management. By default, shared memory is disabled. If you decide to enable shared memory, you also need to configure the sizes and max number of memory blocks. New runtime module srmem uses these configurations to allocate and manage shared dynamic pool memory.&lt;br /&gt;
&lt;br /&gt;
==Host Apps using Target Runtime lib s2shostapptrt==&lt;br /&gt;
* A new routine, HostAppSetMaster(), has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the &#039;&#039;master&#039;&#039; process or the &#039;&#039;daemon&#039;&#039; calls this routine.&lt;/div&gt;</summary>
		<author><name>Shamr</name></author>
	</entry>
</feed>