My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
libpolys
tests
cxxtest
Descriptions.cpp
Go to the documentation of this file.
1
#ifndef __cxxtest__Descriptions_cpp__
2
#define __cxxtest__Descriptions_cpp__
3
4
#include <
cxxtest/Descriptions.h
>
5
6
namespace
CxxTest
7
{
8
TestDescription::~TestDescription
() {}
9
SuiteDescription::~SuiteDescription
() {}
10
WorldDescription::~WorldDescription
() {}
11
12
//
13
// Convert total tests to string
14
//
15
#ifndef _CXXTEST_FACTOR
16
char
*
WorldDescription::strTotalTests
(
char
*
s
)
const
17
{
18
numberToString(
numTotalTests
(),
s
);
19
return
s
;
20
}
21
#else
// _CXXTEST_FACTOR
22
char
*
WorldDescription::strTotalTests
(
char
*
s
)
const
23
{
24
char
*
p
= numberToString(
numTotalTests
(),
s
);
25
26
if
(
numTotalTests
() <= 1 )
27
return
s
;
28
29
unsigned
n =
numTotalTests
();
30
unsigned
numFactors = 0;
31
32
for
(
unsigned
factor
= 2; (
factor
*
factor
) <= n;
factor
+= (
factor
== 2) ? 1 : 2 ) {
33
unsigned
power
;
34
35
for
(
power
= 0; (n %
factor
) == 0; n /=
factor
)
36
++
power
;
37
38
if
( !
power
)
39
continue
;
40
41
p
= numberToString(
factor
,
copyString
(
p
, (numFactors == 0) ?
" = "
:
" * "
) );
42
if
(
power
> 1 )
43
p
= numberToString(
power
,
copyString
(
p
,
"^"
) );
44
++ numFactors;
45
}
46
47
if
( n > 1 ) {
48
if
( !numFactors )
49
copyString
(
p
,
tracker
().failedTests() ?
" :("
:
tracker
().warnings() ?
" :|"
:
" :)"
);
50
else
51
numberToString( n,
copyString
(
p
,
" * "
) );
52
}
53
return
s
;
54
}
55
#endif
// _CXXTEST_FACTOR
56
};
57
58
#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
Generated on
for My Project by
doxygen 1.17.0
for
Singular