1 |
// unit.cc -- This is a test case for the Dejagnu.h classes. |
// unit.cc -- This is a test case for the Dejagnu.h classes. |
2 |
|
|
3 |
#include <iostream> |
#include <iostream> |
|
#include <dejagnu.h> |
|
|
|
|
4 |
#include <regex.h> |
#include <regex.h> |
5 |
#include <string> |
#include <string> |
6 |
#include <fstream> |
#include <fstream> |
7 |
#include <set> |
#include <set> |
8 |
#include <sys/types.h> |
#include <sys/types.h> |
9 |
|
#include <dejagnu.h> |
10 |
|
|
11 |
|
using namespace std; |
12 |
|
|
13 |
TestState runtest; |
TestState runtest; |
14 |
TestState test; |
TestState test; |
49 |
// Replace the output buffer for cout, so we can examine it to |
// Replace the output buffer for cout, so we can examine it to |
50 |
// see what was displayed. Otherwise, there is no way we can test |
// see what was displayed. Otherwise, there is no way we can test |
51 |
// the logging functions completely. |
// the logging functions completely. |
|
streambuf *sb = cout.rdbuf(); |
|
52 |
char bbuuff[5120]; |
char bbuuff[5120]; |
53 |
sb->setbuf(bbuuff, 5120); |
#ifdef HAVE_STL3 |
54 |
|
cout.rdbuf()->pubsetbuf(bbuuff, 5120); |
55 |
|
#else |
56 |
|
cout.rdbuf()->setbuf(bbuuff, 5120); |
57 |
|
#endif |
58 |
|
|
59 |
testClass1.tname = "testType1"; |
testClass1.tname = "testType1"; |
60 |
testClass1.tnum = 1; |
testClass1.tnum = 1; |
112 |
} else { |
} else { |
113 |
runtest.fail ("Totals message"); |
runtest.fail ("Totals message"); |
114 |
} |
} |
|
|
|
115 |
} |
} |
116 |
|
|
117 |
|
|