35 #ifndef __UNITTEST_UNITTEST_HH__ 
   36 #define __UNITTEST_UNITTEST_HH__ 
   48 void checkVal(
const char *file, 
const unsigned line,
 
   49               const char *test, 
const bool result);
 
  100 void setCase(
const char *newCase);
 
  105 #define EXPECT_TRUE(expr) \ 
  106     UnitTest::checkVal(__FILE__, __LINE__, "EXPECT_TRUE(" #expr ")", (expr)) 
  107 #define EXPECT_FALSE(expr) \ 
  109     UnitTest::checkVal(__FILE__, __LINE__, \ 
  110             "EXPECT_FALSE(" #expr ")", (expr) == false) 
  111 #define EXPECT_EQ(lhs, rhs) \ 
  113     UnitTest::checkVal(__FILE__, __LINE__, \ 
  114             "EXPECT_EQ(" #lhs ", " #rhs ")", (lhs) == (rhs)); 
void checkVal(const char *file, const unsigned line, const char *test, const bool result)
Function that actually handles checking whether an EXPECT_* passed. 
 
unsigned failures()
Function that returns the current number of failed checks. 
 
void reset()
Zero the number of passes and failures so far. 
 
bool printOnPass()
Print on pass is a switch that specifies whether to print a message even when a check passes...
 
void setCase(const char *newCase)
Sets the current test case. 
 
unsigned passes()
Function that returns the current number of passed checks. 
 
unsigned printResults()
Function to call at the end of a test that prints an overall result and a summary of how many checks ...