Difference between revisions of "Notes"

From STRIDE Wiki
Jump to: navigation, search
(Created page with "__NOTOC__ == Notes == 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...")
 
 
(2 intermediate revisions by one other user not shown)
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 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.
  
== Notes ==
+
'''Example usage of Notes'''
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.  
+
<source lang='c'>
 
+
srNOTE_INFO("This is an info message with format string %s and %s.", "this", "that");
{| class="prettytable"
+
srNOTE_WARN("This is a warning message with format string %d.", 123);
| colspan="2" | '''Error Annotation'''
+
srNOTE_ERROR("This is an error message.");
|-
+
</source>
| srNOTE_ERROR(''message'', ...)
 
| ''message'' is a pointer to a null-terminated format string<br/>
 
''...'' variable list matching the format string
 
|}
 
  
{| class="prettytable"
+
== Syntax ==
| colspan="2" | '''Warning Annotation'''
+
The ''message'' is a pointer to a null-terminated format string
|-
 
| srNOTE_WARN(''message'', ...)
 
| ''message'' is a pointer to a null-terminated format string<br/>
 
''...'' variable list matching the format string
 
|}
 
  
{| class="prettytable"
+
  srNOTE_INFO(''message'', ...)
| colspan="2" | '''Info Annotation'''
+
  srNOTE_WARN(''message'', ...)
|-
+
  srNOTE_ERRO(''message'', ...)
| 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>
 

Latest revision as of 10:37, 7 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 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.