Loading...
Searching...
No Matches
Descriptions.cpp
Go to the documentation of this file.
#ifndef __cxxtest__Descriptions_cpp__
#define __cxxtest__Descriptions_cpp__
#include <cxxtest/Descriptions.h>
namespace CxxTest
{
TestDescription::~TestDescription() {}
SuiteDescription::~SuiteDescription() {}
WorldDescription::~WorldDescription() {}
//
// Convert total tests to string
//
#ifndef _CXXTEST_FACTOR
char *WorldDescription::strTotalTests( char *s ) const
{
numberToString( numTotalTests(), s );
return s;
}
#else // _CXXTEST_FACTOR
char *WorldDescription::strTotalTests( char *s ) const
{
char *p = numberToString( numTotalTests(), s );
if ( numTotalTests() <= 1 )
return s;
unsigned n = numTotalTests();
unsigned numFactors = 0;
for ( unsigned factor = 2; (factor * factor) <= n; factor += (factor == 2) ? 1 : 2 ) {
unsigned power;
for ( power = 0; (n % factor) == 0; n /= factor )
++ power;
if ( !power )
continue;
p = numberToString( factor, copyString( p, (numFactors == 0) ? " = " : " * " ) );
if ( power > 1 )
p = numberToString( power, copyString( p, "^" ) );
++ numFactors;
}
if ( n > 1 ) {
if ( !numFactors )
copyString( p, tracker().failedTests() ? " :(" : tracker().warnings() ? " :|" : " :)" );
else
numberToString( n, copyString( p, " * " ) );
}
return s;
}
#endif // _CXXTEST_FACTOR
};
#endif // __cxxtest__Descriptions_cpp__
Descriptions.h
power
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
Definition canonicalform.cc:1896
p
int p
Definition cfModGcd.cc:4086
CxxTest::SuiteDescription::~SuiteDescription
virtual ~SuiteDescription()
Definition Descriptions.cpp:9
CxxTest::TestDescription::~TestDescription
virtual ~TestDescription()
Definition Descriptions.cpp:8
CxxTest::WorldDescription::strTotalTests
char * strTotalTests(char *) const
Definition Descriptions.cpp:16
CxxTest::WorldDescription::numTotalTests
virtual unsigned numTotalTests(void) const =0
CxxTest::WorldDescription::~WorldDescription
virtual ~WorldDescription()
Definition Descriptions.cpp:10
factor
CanonicalForm factor
Definition facAbsFact.cc:97
CxxTest
Definition Descriptions.cpp:7
CxxTest::copyString
char * copyString(char *dst, const char *src)
Definition ValueTraits.cpp:30
CxxTest::s
char * s
Definition ValueTraits.h:143
CxxTest::tracker
TestTracker & tracker()
Definition TestTracker.h:111