AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
ntv2bft.h File Reference

Handy macros for Basic Functionality Tests. More...

#include <iostream>
#include <assert.h>
Include dependency graph for ntv2bft.h:

Go to the source code of this file.

Macros

#define STDOUT   std::cout
 
#define STDERR   std::cerr
 
#define ENDL   std::endl
 
#define DEBUG_BREAK()   do {} while (false)
 
#define SHOW_PASSED   (false)
 
#define STOP_AFTER_FAILURE   (true)
 
#define DEBUG_BREAK_AFTER_FAILURE   (false)
 
#define SHOULD_BE_TRUE(_x_)
 
#define SHOULD_BE_FALSE(_x_)
 
#define SHOULD_BE_NULL(_x_)
 
#define SHOULD_BE_NON_NULL(_x_)
 
#define SHOULD_BE_EQUAL(_x_, _y_)
 
#define SHOULD_BE_UNEQUAL(_x_, _y_)
 

Detailed Description

Handy macros for Basic Functionality Tests.

Deprecated:
This module was deprecated in SDK 17.0 — use DocTest instead.
Warning
This module will be removed in a future SDK.

Definition in file ntv2bft.h.

Macro Definition Documentation

◆ DEBUG_BREAK

#define DEBUG_BREAK ( )    do {} while (false)

Definition at line 44 of file ntv2bft.h.

◆ DEBUG_BREAK_AFTER_FAILURE

#define DEBUG_BREAK_AFTER_FAILURE   (false)

Definition at line 82 of file ntv2bft.h.

◆ ENDL

#define ENDL   std::endl

Definition at line 23 of file ntv2bft.h.

◆ SHOULD_BE_EQUAL

#define SHOULD_BE_EQUAL (   _x_,
  _y_ 
)
Value:
do \
{ \
if ((_x_) != (_y_)) \
{ \
STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \
<< " '" << (_x_) << "' is not equal to '" << (_y_) << "'" << ENDL \
<< " Expected '" << #_x_ << "' to equal '" << #_y_ << "'" << ENDL; \
{ \
DEBUG_BREAK (); \
return false; \
} \
} \
else if (SHOW_PASSED) \
STDOUT << "## NOTE: '" << #_x_ << "' is equal to '" << #_y_ << "' in '" << __FUNCTION__ << "'" << ENDL; \
} while (false)

Definition at line 162 of file ntv2bft.h.

◆ SHOULD_BE_FALSE

#define SHOULD_BE_FALSE (   _x_)
Value:
do \
{ \
if (_x_) \
{ \
STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \
<< " Expected 'False' result from '" << #_x_ << "'" << ENDL \
<< " Instead got 'True'" << ENDL; \
{ \
DEBUG_BREAK (); \
return false; \
} \
} \
else if (SHOW_PASSED) \
STDOUT << "## NOTE: '" << #_x_ << "' in '" << __FUNCTION__ << "' returned 'False'" << ENDL; \
} while (false)

Definition at line 105 of file ntv2bft.h.

◆ SHOULD_BE_NON_NULL

#define SHOULD_BE_NON_NULL (   _x_)
Value:
do \
{ \
if ((_x_) == NULL) \
{ \
STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \
<< " '" << (_x_) << "' is NULL" << ENDL \
<< " Expected '" << #_x_ << "' to be non-NULL" << ENDL; \
{ \
DEBUG_BREAK (); \
return false; \
} \
} \
else if (SHOW_PASSED) \
STDOUT << "## NOTE: '" << #_x_ << "' is non-NULL in '" << __FUNCTION__ << "'" << ENDL; \
} while (false)

Definition at line 143 of file ntv2bft.h.

◆ SHOULD_BE_NULL

#define SHOULD_BE_NULL (   _x_)
Value:
do \
{ \
if ((_x_) != NULL) \
{ \
STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \
<< " '" << (_x_) << "' is non-NULL" << ENDL \
<< " Expected '" << #_x_ << "' to be NULL" << ENDL; \
{ \
DEBUG_BREAK (); \
return false; \
} \
} \
else if (SHOW_PASSED) \
STDOUT << "## NOTE: '" << #_x_ << "' is NULL in '" << __FUNCTION__ << "'" << ENDL; \
} while (false)

Definition at line 124 of file ntv2bft.h.

◆ SHOULD_BE_TRUE

#define SHOULD_BE_TRUE (   _x_)
Value:
do \
{ \
if (!(_x_)) \
{ \
STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \
<< " Expected 'True' result from '" << #_x_ << "'" << ENDL \
<< " Instead got 'False'" << ENDL; \
{ \
DEBUG_BREAK (); \
return false; \
} \
} \
else if (SHOW_PASSED) \
STDOUT << "## NOTE: '" << #_x_ << "' in '" << __FUNCTION__ << "' returned 'True'" << ENDL; \
} while (false)

Definition at line 86 of file ntv2bft.h.

◆ SHOULD_BE_UNEQUAL

#define SHOULD_BE_UNEQUAL (   _x_,
  _y_ 
)
Value:
do \
{ \
if ((_x_) == (_y_)) \
{ \
STDERR << "## ERROR: '" << __FUNCTION__ << "' failed at line " << __LINE__ << " of " << __FILE__ << ":" << ENDL \
<< " '" << (_x_) << "' is equal to '" << (_y_) << "'" << ENDL \
<< " Expected '" << #_x_ << "' to not equal '" << #_y_ << "'" << ENDL; \
{ \
DEBUG_BREAK (); \
return false; \
} \
} \
else if (SHOW_PASSED) \
STDOUT << "## NOTE: '" << #_x_ << "' is not equal to '" << #_y_ << "' in '" << __FUNCTION__ << "'" << ENDL; \
} while (false)

Definition at line 181 of file ntv2bft.h.

◆ SHOW_PASSED

#define SHOW_PASSED   (false)

Definition at line 76 of file ntv2bft.h.

◆ STDERR

#define STDERR   std::cerr

Definition at line 22 of file ntv2bft.h.

◆ STDOUT

#define STDOUT   std::cout

Definition at line 21 of file ntv2bft.h.

◆ STOP_AFTER_FAILURE

#define STOP_AFTER_FAILURE   (true)

Definition at line 79 of file ntv2bft.h.

NULL
#define NULL
Definition: ntv2caption608types.h:19
ENDL
#define ENDL
Definition: ntv2bft.h:23
SHOW_PASSED
#define SHOW_PASSED
Definition: ntv2bft.h:76
STOP_AFTER_FAILURE
#define STOP_AFTER_FAILURE
Definition: ntv2bft.h:79
DEBUG_BREAK_AFTER_FAILURE
#define DEBUG_BREAK_AFTER_FAILURE
Definition: ntv2bft.h:82