Public Member Functions | Private Attributes
GlobalPrintingFixture Class Reference

#include <common.h>

Public Member Functions

 GlobalPrintingFixture (bool redirect=false)
 
 ~GlobalPrintingFixture ()
 
void Redirect ()
 
virtual bool setUpWorld ()
 
virtual bool tearDownWorld ()
 
virtual bool setUp ()
 
virtual bool tearDown ()
 
- Public Member Functions inherited from CxxTest::GlobalFixture
 GlobalFixture ()
 
 ~GlobalFixture ()
 
GlobalFixturenextGlobalFixture ()
 
GlobalFixtureprevGlobalFixture ()
 

Private Attributes

std::ofstream _ofs
 
bool _redirect
 

Additional Inherited Members

- Static Public Member Functions inherited from CxxTest::GlobalFixture
static GlobalFixturefirstGlobalFixture ()
 
static GlobalFixturelastGlobalFixture ()
 

Detailed Description

Definition at line 91 of file common.h.

Constructor & Destructor Documentation

§ GlobalPrintingFixture()

GlobalPrintingFixture::GlobalPrintingFixture ( bool  redirect = false)
inline

Definition at line 96 of file common.h.

96 : _redirect(redirect){}

§ ~GlobalPrintingFixture()

GlobalPrintingFixture::~GlobalPrintingFixture ( )
inline

Definition at line 98 of file common.h.

99  {
100  if( _ofs)
101  _ofs.close();
102  }
std::ofstream _ofs
Definition: common.h:93

Member Function Documentation

§ Redirect()

void GlobalPrintingFixture::Redirect ( )
inline

Definition at line 104 of file common.h.

105  {
106  const int ll = strlen(argv0);
107  const int l = 5 + ll;
108  char* s = (char *)omAlloc0(l);
109  s = strncpy(s, argv0, ll);
110  strncpy(s + ll, ".log", 4);
111  _ofs.open(s); // , ios_base::out)
112  omFreeSize((ADDRESS)s, l);
113 
114  std::clog.rdbuf(_ofs.rdbuf());
115  }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:115
std::ofstream _ofs
Definition: common.h:93
char * argv0
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94

§ setUp()

virtual bool GlobalPrintingFixture::setUp ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Definition at line 138 of file common.h.

138 { std::clog << std::endl << std::endl <<( "<test>" ) << std::endl << std::endl; return true; }

§ setUpWorld()

virtual bool GlobalPrintingFixture::setUpWorld ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Reimplemented in MyGlobalPrintingFixture, and MyGlobalPrintingFixture.

Definition at line 117 of file common.h.

118  {
119  if( _redirect )
120  Redirect();
121 
122  std::clog << std::endl << ( "<world>" ) << std::endl << std::endl;
124 
125  StringSetS("ressources in use (as reported by feStringAppendResources(0):\n");
127 
128  { char* s = StringEndS(); PrintS(s); omFree(s); }
129 
130  return true;
131  }
const CanonicalForm int s
Definition: facAbsFact.cc:55
void feStringAppendResources(int warn)
Definition: reporter.cc:398
void feInitResources(const char *argv0)
Definition: feResource.cc:170
char * StringEndS()
Definition: reporter.cc:151
#define omFree(addr)
Definition: omAllocDecl.h:261
void StringSetS(const char *st)
Definition: reporter.cc:128
void PrintS(const char *s)
Definition: reporter.cc:284
char * argv0

§ tearDown()

virtual bool GlobalPrintingFixture::tearDown ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Definition at line 139 of file common.h.

139 { std::clog << std::endl << std::endl <<( "</test>" ) << std::endl << std::endl; return true; }

§ tearDownWorld()

virtual bool GlobalPrintingFixture::tearDownWorld ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Definition at line 133 of file common.h.

134  {
135  std::clog << std::endl << std::endl <<( "</world>" ) << std::endl << std::endl ;
136  return true;
137  }

Field Documentation

§ _ofs

std::ofstream GlobalPrintingFixture::_ofs
private

Definition at line 93 of file common.h.

§ _redirect

bool GlobalPrintingFixture::_redirect
private

Definition at line 94 of file common.h.


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