AUnit  1.1
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
Macros
AssertVerboseMacros.h File Reference

Verbose versions of the macros in AssertMacros.h. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define assertEqual(arg1, arg2)   assertOpVerboseInternal(arg1,aunit::internal::compareEqual,"==",arg2)
 Assert that arg1 is equal to arg2. More...
 
#define assertNotEqual(arg1, arg2)   assertOpVerboseInternal(arg1,aunit::internal::compareNotEqual,"!=",arg2)
 Assert that arg1 is not equal to arg2. More...
 
#define assertLess(arg1, arg2)   assertOpVerboseInternal(arg1,aunit::internal::compareLess,"<",arg2)
 Assert that arg1 is less than arg2. More...
 
#define assertMore(arg1, arg2)   assertOpVerboseInternal(arg1,aunit::internal::compareMore,">",arg2)
 Assert that arg1 is more than arg2. More...
 
#define assertLessOrEqual(arg1, arg2)   assertOpVerboseInternal(arg1,aunit::internal::compareLessOrEqual,"<=",arg2)
 Assert that arg1 is less than or equal to arg2. More...
 
#define assertMoreOrEqual(arg1, arg2)   assertOpVerboseInternal(arg1,aunit::internal::compareMoreOrEqual,">=",arg2)
 Assert that arg1 is more than or equal to arg2. More...
 
#define assertStringCaseEqual(arg1, arg2)
 Assert that string arg1 is equal to string arg2, case-insensitive. More...
 
#define assertStringCaseNotEqual(arg1, arg2)
 Assert that string arg1 is not equal to string arg2, case-insensitive. More...
 
#define assertTrue(arg)   assertBoolVerboseInternal(arg,true)
 Assert that arg is true. More...
 
#define assertFalse(arg)   assertBoolVerboseInternal(arg,false)
 Assert that arg is false. More...
 
#define assertOpVerboseInternal(arg1, op, opName, arg2)
 Internal helper macro, shouldn't be called directly by users. More...
 
#define assertBoolVerboseInternal(arg, value)
 Internal helper macro, shouldn't be called directly by users. More...
 
#define assertNear(arg1, arg2, error)
 Assert that arg1 and arg2 are within error of each other. More...
 
#define assertNotNear(arg1, arg2, error)
 Assert that arg1 and arg2 are NOT within error of each other. More...
 

Detailed Description

Verbose versions of the macros in AssertMacros.h.

These capture the string of the actual arguments and pass them to the respective assertionVerbose() methods so that verbose messages can be printed.

Definition in file AssertVerboseMacros.h.

Macro Definition Documentation

◆ assertBoolVerboseInternal

#define assertBoolVerboseInternal (   arg,
  value 
)
Value:
do {\
if (!assertionBoolVerbose(__FILE__,__LINE__,(arg),AUNIT_F(#arg),(value)))\
return;\
} while (false)

Internal helper macro, shouldn't be called directly by users.

Definition at line 87 of file AssertVerboseMacros.h.

◆ assertEqual

#define assertEqual (   arg1,
  arg2 
)    assertOpVerboseInternal(arg1,aunit::internal::compareEqual,"==",arg2)

Assert that arg1 is equal to arg2.

Definition at line 40 of file AssertVerboseMacros.h.

◆ assertFalse

#define assertFalse (   arg)    assertBoolVerboseInternal(arg,false)

Assert that arg is false.

Definition at line 77 of file AssertVerboseMacros.h.

◆ assertLess

#define assertLess (   arg1,
  arg2 
)    assertOpVerboseInternal(arg1,aunit::internal::compareLess,"<",arg2)

Assert that arg1 is less than arg2.

Definition at line 48 of file AssertVerboseMacros.h.

◆ assertLessOrEqual

#define assertLessOrEqual (   arg1,
  arg2 
)    assertOpVerboseInternal(arg1,aunit::internal::compareLessOrEqual,"<=",arg2)

Assert that arg1 is less than or equal to arg2.

Definition at line 56 of file AssertVerboseMacros.h.

◆ assertMore

#define assertMore (   arg1,
  arg2 
)    assertOpVerboseInternal(arg1,aunit::internal::compareMore,">",arg2)

Assert that arg1 is more than arg2.

Definition at line 52 of file AssertVerboseMacros.h.

◆ assertMoreOrEqual

#define assertMoreOrEqual (   arg1,
  arg2 
)    assertOpVerboseInternal(arg1,aunit::internal::compareMoreOrEqual,">=",arg2)

Assert that arg1 is more than or equal to arg2.

Definition at line 60 of file AssertVerboseMacros.h.

◆ assertNear

#define assertNear (   arg1,
  arg2,
  error 
)
Value:
do { \
if (!assertionNearVerbose(__FILE__, __LINE__, \
arg1, AUNIT_F(#arg1), arg2, AUNIT_F(#arg2), error, AUNIT_F(#error), \
"<=", aunit::internal::compareNear)) \
return;\
} while (false)

Assert that arg1 and arg2 are within error of each other.

Definition at line 93 of file AssertVerboseMacros.h.

◆ assertNotEqual

#define assertNotEqual (   arg1,
  arg2 
)    assertOpVerboseInternal(arg1,aunit::internal::compareNotEqual,"!=",arg2)

Assert that arg1 is not equal to arg2.

Definition at line 44 of file AssertVerboseMacros.h.

◆ assertNotNear

#define assertNotNear (   arg1,
  arg2,
  error 
)
Value:
do { \
if (!assertionNearVerbose(__FILE__, __LINE__, \
arg1, AUNIT_F(#arg1), arg2, AUNIT_F(#arg2), error, AUNIT_F(#error), \
">", aunit::internal::compareNotNear)) \
return;\
} while (false)

Assert that arg1 and arg2 are NOT within error of each other.

Definition at line 101 of file AssertVerboseMacros.h.

◆ assertOpVerboseInternal

#define assertOpVerboseInternal (   arg1,
  op,
  opName,
  arg2 
)
Value:
do {\
if (!assertionVerbose(__FILE__,__LINE__,\
(arg1),AUNIT_F(#arg1),opName,op,(arg2),AUNIT_F(#arg2)))\
return;\
} while (false)

Internal helper macro, shouldn't be called directly by users.

Definition at line 80 of file AssertVerboseMacros.h.

◆ assertStringCaseEqual

#define assertStringCaseEqual (   arg1,
  arg2 
)
Value:
assertOpVerboseInternal(arg1,aunit::internal::compareStringCaseEqual,\
"==",arg2)
#define assertOpVerboseInternal(arg1, op, opName, arg2)
Internal helper macro, shouldn&#39;t be called directly by users.

Assert that string arg1 is equal to string arg2, case-insensitive.

Definition at line 64 of file AssertVerboseMacros.h.

◆ assertStringCaseNotEqual

#define assertStringCaseNotEqual (   arg1,
  arg2 
)
Value:
assertOpVerboseInternal(arg1,aunit::internal::compareStringCaseNotEqual,\
"!=",arg2)
#define assertOpVerboseInternal(arg1, op, opName, arg2)
Internal helper macro, shouldn&#39;t be called directly by users.

Assert that string arg1 is not equal to string arg2, case-insensitive.

Definition at line 69 of file AssertVerboseMacros.h.

◆ assertTrue

#define assertTrue (   arg)    assertBoolVerboseInternal(arg,true)

Assert that arg is true.

Definition at line 74 of file AssertVerboseMacros.h.