My Project
Loading...
Searching...
No Matches
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
virtual bool setUpWorld ()
 
virtual bool tearDownWorld ()
 
virtual bool setUp ()
 
virtual bool tearDown ()
 
 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 90 of file common.h.

Constructor & Destructor Documentation

◆ GlobalPrintingFixture()

GlobalPrintingFixture::GlobalPrintingFixture ( bool  redirect = false)
inline

Definition at line 95 of file common.h.

95: _redirect(redirect){}

◆ ~GlobalPrintingFixture()

GlobalPrintingFixture::~GlobalPrintingFixture ( )
inline

Definition at line 97 of file common.h.

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

Member Function Documentation

◆ Redirect()

void GlobalPrintingFixture::Redirect ( )
inline

Definition at line 103 of file common.h.

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

◆ setUp()

virtual bool GlobalPrintingFixture::setUp ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Definition at line 137 of file common.h.

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

117 {
118 if( _redirect )
119 Redirect();
120
121 std::clog << std::endl << ( "<world>" ) << std::endl << std::endl;
122 feInitResources(argv0);
123
124 StringSetS("ressources in use (as reported by feStringAppendResources(0):\n");
126
127 { char* s = StringEndS(); PrintS(s); omFree(s); }
128
129 return true;
130 }
void feInitResources(const char *argv0)
Definition: feResource.cc:163
#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
void feStringAppendResources(int warn)
Definition: reporter.cc:398
char * StringEndS()
Definition: reporter.cc:151

◆ tearDown()

virtual bool GlobalPrintingFixture::tearDown ( )
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; }

◆ tearDownWorld()

virtual bool GlobalPrintingFixture::tearDownWorld ( )
inlinevirtual

Reimplemented from CxxTest::GlobalFixture.

Definition at line 132 of file common.h.

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

Field Documentation

◆ _ofs

std::ofstream GlobalPrintingFixture::_ofs
private

Definition at line 92 of file common.h.

◆ _redirect

bool GlobalPrintingFixture::_redirect
private

Definition at line 93 of file common.h.


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