/[dejagnu]/dejagnu/dejagnu.h
ViewVC logotype

Diff of /dejagnu/dejagnu.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by rsavoye, Sat May 26 05:55:28 2001 UTC revision 1.4 by rsavoye, Wed May 30 15:35:50 2001 UTC
# Line 68  totals (void) { Line 68  totals (void) {
68  #include <iomanip>  #include <iomanip>
69  #include <fstream>  #include <fstream>
70  #include <string>  #include <string>
71    #if HAVE_STL3
72    #include <sstream>
73    #else
74  #include <strstream>  #include <strstream>
75    #endif
76    
77  char *outstate[] = {  char *outstate[] = {
78      "FAILED: ",      "FAILED: ",
# Line 110  OMANIP<int> testout(int i) { Line 114  OMANIP<int> testout(int i) {
114  }  }
115  #endif  #endif
116    
 char *testout (int x) {  
   using namespace std;  
   const int len = 128;  
   static char buf[len];  
   static ostrstream oss(buf, len, ios::out);  
   oss.seekp(ios::beg);  
   oss << outstate[x] << ends;  
   return buf;  
 }  
   
117  enum teststate {FAILED, PASSED,UNTESTED,UNRESOLVED} laststate;  enum teststate {FAILED, PASSED,UNTESTED,UNRESOLVED} laststate;
118    
119  class TestState {  class TestState {
# Line 137  class TestState { Line 131  class TestState {
131          totals();          totals();
132      };      };
133    
   
134      void testrun (bool b, std::string s) {      void testrun (bool b, std::string s) {
135          if (b)          if (b)
136              pass (s);              pass (s);
# Line 149  class TestState { Line 142  class TestState {
142          passed++;          passed++;
143          laststate = PASSED;          laststate = PASSED;
144          lastmsg = s;          lastmsg = s;
145          std::cout << "\t" << testout(PASSED) << s << std::endl;          std::cout << "\t" << outstate[PASSED] << s << std::endl;
146      }      }
147      void pass (const char *c) {      void pass (const char *c) {
148          std::string s = c;          std::string s = c;
# Line 160  class TestState { Line 153  class TestState {
153          failed++;          failed++;
154          laststate = FAILED;          laststate = FAILED;
155          lastmsg = s;          lastmsg = s;
156          std::cout << "\t" << testout(FAILED) << s << std::endl;          std::cout << "\t" << outstate[FAILED] << s << std::endl;
157      }      }
158      void fail (const char *c) {      void fail (const char *c) {
159          std::string s = c;          std::string s = c;
# Line 171  class TestState { Line 164  class TestState {
164          untest++;          untest++;
165          laststate = UNTESTED;          laststate = UNTESTED;
166          lastmsg = s;          lastmsg = s;
167          std::cout << "\t" << testout(UNTESTED) << s << std::endl;          std::cout << "\t" << outstate[UNTESTED] << s << std::endl;
168      }      }
169      void untested (const char *c) {      void untested (const char *c) {
170          std::string s = c;          std::string s = c;
# Line 182  class TestState { Line 175  class TestState {
175          unresolve++;          unresolve++;
176          laststate = UNRESOLVED;          laststate = UNRESOLVED;
177          lastmsg = s;          lastmsg = s;
178          std::cout << "\t" << testout(UNRESOLVED) << s << std::endl;          std::cout << "\t" << outstate[UNRESOLVED] << s << std::endl;
179      }      }
180      void unresolved (const char *c) {      void unresolved (const char *c) {
181          std::string s = c;          std::string s = c;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26