forked from mandliya/algorithms_and_data_structures
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpUnitTest.h
More file actions
37 lines (28 loc) · 1.06 KB
/
Copy pathpUnitTest.h
File metadata and controls
37 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// pUnitTest.h
// A simple unit test class
#ifndef __PSTRING_UTEST__
#define __PSTRING_UTEST__
#include <cstdio>
#define _UTest_VERSION "1.0.0"
const static char * __ut_pstr = "pass";
const static char * __ut_fstr = "fail";
class UTest {
unsigned long int _pass_count = 0;
unsigned long int _fail_count = 0;
bool _summary_flag = false;
const char * _test_str = nullptr;
UTest( UTest & ); // no copy constructor
UTest operator = ( UTest & ); // no assignment operator
UTest(){} // no default constructor
public:
static const char * version() { return _UTest_VERSION; }
UTest( const char * );
void init ( const char * );
bool summary ( bool flag ) { return _summary_flag = flag; }
bool summary ( ) { return _summary_flag; }
unsigned long int pass_count() const { return _pass_count; }
unsigned long int fail_count() const { return _fail_count; }
void test ( const char * description, const int flag );
void report() const;
};
#endif /* defined(__PSTRING_UTEST__) */