This is Unofficial EPICS BASE Doxygen Site
detail::testPassx Class Reference

#include "pvUnitTest.h"

Public Member Functions

 testPassx ()
 
 testPassx (bool r)
 
 ~testPassx ()
 
template<typename T >
testPassxoperator<< (const T &v)
 
 testPassx (testPassx &o)
 

Detailed Description

Definition at line 32 of file pvUnitTest.h.

Constructor & Destructor Documentation

detail::testPassx::testPassx ( )
inline

Definition at line 38 of file pvUnitTest.h.

38 :dotest(false), pass(false), alive(true) {}
detail::testPassx::testPassx ( bool  r)
inlineexplicit

Definition at line 39 of file pvUnitTest.h.

39 :dotest(true), pass(r), alive(true) {}
detail::testPassx::~testPassx ( )

Definition at line 16 of file pvUnitTest.cpp.

16  {
17  if(!alive) return;
18  std::string msg(strm.str());
19  size_t nl = msg.find_first_of('\n');
20  if(nl==msg.npos) {
21  // single-line output
22  if(dotest)
23  testOk(pass, "%s", msg.c_str());
24  else
25  testDiag("%s", msg.c_str());
26 
27  } else {
28  // multi-line output
29  std::istringstream lines(msg);
30  std::string line;
31  bool first = true;
32  while(std::getline(lines ,line)) {
33  if(dotest && first) {
34  first = false;
35  testOk(pass, "%s", line.c_str());
36  } else {
37  testDiag("%s", line.c_str());
38  }
39  }
40  }
41 }
int testDiag(const char *fmt,...)
char * line
Definition: reader.c:25
int testOk(int pass, const char *fmt,...)
detail::testPassx::testPassx ( testPassx o)

Definition at line 43 of file pvUnitTest.cpp.

44  :strm(o.strm.str())
45  ,dotest(o.dotest)
46  ,pass(o.pass)
47  ,alive(o.alive)
48 {
49  strm.seekp(0, std::ios_base::end);
50  o.alive = false;
51 }

Member Function Documentation

template<typename T >
testPassx& detail::testPassx::operator<< ( const T &  v)
inline

Definition at line 42 of file pvUnitTest.h.

42  {
43  strm<<v;
44  return *this;
45  }

The documentation for this class was generated from the following files: