Difference between revisions of "Notes"

From STRIDE Wiki
Jump to: navigation, search
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
Note macros provide a simple means to add annotations attached to the currently executing test case. These annotations are added to the test report info with a level of either ''Error'', ''Warning'', or ''Info'' according to the macro that is used. The message also includes the file and line number.
  
'''srNOTE('''''message''''')'''
+
'''Example usage of Notes'''
* Unconditionally adds an annotation to the current test case's results report which includes the message as well as file and line number
+
<source lang='c'>
 +
srNOTE_INFO("This is an info message with format string %s and %s.", "this", "that");
 +
srNOTE_WARN("This is a warning message with format string %d.", 123);
 +
srNOTE_ERROR("This is an error message.");
 +
</source>
  
== Notes ==
+
== Syntax ==
Note macros provide a simple means to add annotations attached to the currently executing test case. These annotations are added to the test report info with a level of either ''Error'', ''Warning'', or ''Info'' according to the macro that is used.
+
The ''message'' is a pointer to a null-terminated format string
  
{| class="prettytable"
+
  srNOTE_INFO(''message'', ...)
| colspan="2" | '''Error Annotation'''
+
  srNOTE_WARN(''message'', ...)
|-
+
  srNOTE_ERRO(''message'', ...)
| srNOTE_ERROR(''message'', ...)
 
| ''message'' is a pointer to a null-terminated format string<br/>
 
''...'' variable list matching the format string
 
|}
 
 
 
{| class="prettytable"
 
| colspan="2" | '''Warning Annotation'''
 
|-
 
| srNOTE_WARN(''message'', ...)
 
| ''message'' is a pointer to a null-terminated format string<br/>
 
''...'' variable list matching the format string
 
|}
 
 
 
{| class="prettytable"
 
| colspan="2" | '''Info Annotation'''
 
|-
 
| srNOTE_INFO(''message'', ...)
 
| ''message'' is a pointer to a null-terminated format string<br/>
 
''...'' variable list matching the format string
 
|}
 
  
 
* versions of these log macros also exist for use with dynamically generated test cases. To use these macros, just append '''_DYN''' to the macro names shown above and then pass the explicit ''testCaseHandle_t'' item as the first argument to the macros.
 
* versions of these log macros also exist for use with dynamically generated test cases. To use these macros, just append '''_DYN''' to the macro names shown above and then pass the explicit ''testCaseHandle_t'' item as the first argument to the macros.
 
* The maximum length of the message string approximately 1000 characters. If the maximum length is exceeded, the message string is truncated.
 
* The maximum length of the message string approximately 1000 characters. If the maximum length is exceeded, the message string is truncated.
 
=== Example ===
 
<source lang='c'>
 
srNOTE_ERROR("This is an error message.");
 
srNOTE_WARN("This is a warning message with format string %d.", 123);
 
srNOTE_INFO("This is an info message with format string %s and %s.", "this", "that");
 
</source>
 

Revision as of 09:37, 1 July 2015

Note macros provide a simple means to add annotations attached to the currently executing test case. These annotations are added to the test report info with a level of either Error, Warning, or Info according to the macro that is used. The message also includes the file and line number.

Example usage of Notes

srNOTE_INFO("This is an info message with format string %s and %s.", "this", "that");
srNOTE_WARN("This is a warning message with format string %d.", 123);
srNOTE_ERROR("This is an error message.");

Syntax

The message is a pointer to a null-terminated format string

 srNOTE_INFO(message, ...)
 srNOTE_WARN(message, ...)
 srNOTE_ERRO(message, ...)
  • versions of these log macros also exist for use with dynamically generated test cases. To use these macros, just append _DYN to the macro names shown above and then pass the explicit testCaseHandle_t item as the first argument to the macros.
  • The maximum length of the message string approximately 1000 characters. If the maximum length is exceeded, the message string is truncated.