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

Constructor & Destructor Documentation

GlobalPrintingFixture::GlobalPrintingFixture ( bool  redirect = false)
inline

Definition at line 100 of file common.h.

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

Definition at line 102 of file common.h.

103  {
104  if( _ofs)
105  _ofs.close();
106  }
std::ofstream _ofs
Definition: common.h:97

Member Function Documentation

void GlobalPrintingFixture::Redirect ( )
inline

Definition at line 108 of file common.h.

109  {
110  const int ll = strlen(argv0);
111  const int l = 5 + ll;
112  char* s = (char *)omAlloc0(l);
113  s = strncpy(s, argv0, ll);
114  strncpy(s + ll, ".log", 4);
115  _ofs.open(s); // , ios_base::out)
116  omFreeSize((ADDRESS)s, l);
117 
118  std::clog.rdbuf(_ofs.rdbuf());
119  }
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:97
#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 142 of file common.h.

142 { 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 121 of file common.h.

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

Reimplemented from CxxTest::GlobalFixture.

Definition at line 143 of file common.h.

143 { 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 137 of file common.h.

138  {
139  std::clog << std::endl << std::endl <<( "</world>" ) << std::endl << std::endl ;
140  return true;
141  }

Field Documentation

std::ofstream GlobalPrintingFixture::_ofs
private

Definition at line 97 of file common.h.

bool GlobalPrintingFixture::_redirect
private

Definition at line 98 of file common.h.


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