ztring.c: A few important extension for <string.h>
 All Classes Files Functions Variables Enumerator Friends Macros
Macros | Functions
uUnit.h File Reference

[u]Micro module for [Unit] program testing. More...

#include <iostream>

Go to the source code of this file.

Macros

#define assertTrue(cond)   testThis(!!(cond), #cond, __FILE__,__LINE__ )
 (cond ? () : cout << "cond" ) More...
 
#define assertFalse(cond)   testThis( !(cond),"!(" #cond ")", __FILE__,__LINE__ )
 (!(cond) ? () : cout << "!" << (cond)" ) More...
 

Functions

static const char * remove_dir_name (const char *str)
 "C:/DIR/SubDir/file_name.ext" ==> "file_name.ext" More...
 
template<class T >
void testThis (bool cond, const T *label, const T *fname, long lineno)
 
template<>
void testThis< char > (bool cond, const char *label, const char *fname, long lineno)
 

Detailed Description

[u]Micro module for [Unit] program testing.

Author
Adolfo Di Mare adolf.nosp@m.o@di.nosp@m.-mare.nosp@m..com
Date
2011
See Also
http://www.di-mare.com/adolfo/p/BUnitXP.htm
#include "uUnit.h" // assertTrue() && assertFalse()
// Example
int main( int argc , const char* argv[] ) {
std::cout << "TestCase [uUnit.h] yesYES" << std::endl;
assertTrue( 1==2 ); // ok?
assertFalse( 1==2 ); // ok!
return test_myImp(argc , argv);
}

Definition in file uUnit.h.

Macro Definition Documentation

#define assertTrue (   cond)    testThis(!!(cond), #cond, __FILE__,__LINE__ )

(cond ? () : cout << "cond" )

Definition at line 79 of file uUnit.h.

#define assertFalse (   cond)    testThis( !(cond),"!(" #cond ")", __FILE__,__LINE__ )

(!(cond) ? () : cout << "!" << (cond)" )

Definition at line 81 of file uUnit.h.

Function Documentation

static const char* remove_dir_name ( const char *  str)
static

"C:/DIR/SubDir/file_name.ext" ==> "file_name.ext"

Definition at line 31 of file uUnit.h.

template<class T >
void testThis ( bool  cond,
const T *  label,
const T *  fname,
long  lineno 
)
inline
template<>
void testThis< char > ( bool  cond,
const char *  label,
const char *  fname,
long  lineno 
)
inline

Definition at line 52 of file uUnit.h.