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 99 of file common.h.

Constructor & Destructor Documentation

GlobalPrintingFixture::GlobalPrintingFixture ( bool  redirect = false)
inline

Definition at line 104 of file common.h.

104 : _redirect(redirect){}
GlobalPrintingFixture::~GlobalPrintingFixture ( )
inline

Definition at line 106 of file common.h.

107  {
108  if( _ofs)
109  _ofs.close();
110  }
std::ofstream _ofs
Definition: common.h:101

Member Function Documentation

void GlobalPrintingFixture::Redirect ( )
inline

Definition at line 112 of file common.h.

113  {
114  const int ll = strlen(argv0);
115  const int l = 5 + ll;
116  char* s = (char *)omAlloc0(l);
117  s = strncpy(s, argv0, ll);
118  strncpy(s + ll, ".log", 4);
119  _ofs.open(s); // , ios_base::out)
120  omFreeSize((ADDRESS)s, l);
121 
122  std::clog.rdbuf(_ofs.rdbuf());
123  }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:161
std::ofstream _ofs
Definition: common.h:101
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94
virtual bool GlobalPrintingFixture::setUp ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Definition at line 146 of file common.h.

146 { std::clog << std::endl << std::endl <<( "<test>" ) << std::endl << std::endl; return true; }
virtual bool GlobalPrintingFixture::setUpWorld ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Reimplemented in MyGlobalPrintingFixture, and MyGlobalPrintingFixture.

Definition at line 125 of file common.h.

126  {
127  if( _redirect )
128  Redirect();
129 
130  std::clog << std::endl << ( "<world>" ) << std::endl << std::endl;
131  feInitResources(argv0);
132 
133  StringSetS("ressources in use (as reported by feStringAppendResources(0):\n");
135 
136  { char* s = StringEndS(); PrintS(s); omFree(s); }
137 
138  return true;
139  }
const CanonicalForm int s
Definition: facAbsFact.cc:55
void feStringAppendResources(int warn)
Definition: reporter.cc:410
void feInitResources(const char *argv0)
Definition: feResource.cc:164
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:294
virtual bool GlobalPrintingFixture::tearDown ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Definition at line 147 of file common.h.

147 { std::clog << std::endl << std::endl <<( "</test>" ) << std::endl << std::endl; return true; }
virtual bool GlobalPrintingFixture::tearDownWorld ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Definition at line 141 of file common.h.

142  {
143  std::clog << std::endl << std::endl <<( "</world>" ) << std::endl << std::endl ;
144  return true;
145  }

Field Documentation

std::ofstream GlobalPrintingFixture::_ofs
private

Definition at line 101 of file common.h.

bool GlobalPrintingFixture::_redirect
private

Definition at line 102 of file common.h.


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