1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#include <BALL/CONCEPT/classTest.h>
///////////////////////////
// insert includes here
#include <BALL/STRUCTURE/RDFIntegrator.h>
///////////////////////////
START_TEST(RDFIntegrator)
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
using namespace BALL;
/// insert tests for each member function here
///
Coefficients coef;
vector<Coefficients> coefs;
vector<Interval> intervals;
coef.push_back(0.0); coef.push_back(0.0);
coef.push_back(0.0); coef.push_back(0.0);
coefs.push_back(coef);
coef.clear();
coef.push_back(3.0); coef.push_back(1.0);
coef.push_back(0.0); coef.push_back(0.0);
coefs.push_back(coef);
coef.clear();
coef.push_back(0.0); coef.push_back(0.0);
coef.push_back(0.0); coef.push_back(3.0);
coefs.push_back(coef);
coef.clear();
coef.push_back(2.0); coef.push_back(0.0);
coef.push_back(0.0); coef.push_back(0.0);
coefs.push_back(coef);
coef.clear();
intervals.push_back(Interval(0.0, 1.0));
intervals.push_back(Interval(1.0, 2.0));
intervals.push_back(Interval(2.0, 3.0));
intervals.push_back(Interval(3.0, std::numeric_limits<double>::infinity()));
PiecewisePolynomial poly(4, intervals, coefs);
RadialDistributionFunction rdf(poly);
RDFIntegrator* pointer;
CHECK(RDFIntegrator::RDFIntegrator())
pointer = new RDFIntegrator;
TEST_NOT_EQUAL(pointer, 0)
RESULT
CHECK(RDFIntegrator::~RDFIntegrator())
delete pointer;
RESULT
CHECK(RDFIntegrator::RDFIntegrator(const RadialDistributionFunction& rdf))
RDFIntegrator integrator(rdf);
bool test = (integrator.getRDF().getRepresentation().getIntervals() == intervals);
TEST_EQUAL(test, true);
test = (integrator.getRDF().getRepresentation().getCoefficients() == coefs);
TEST_EQUAL(test, true);
RESULT
CHECK(RDFIntegrator::RDFIntegrator(const RDFIntegrator& integrator))
RDFIntegrator integrator(rdf);
RDFIntegrator integrator2(integrator);
bool test = (integrator2.getRDF().getRepresentation().getIntervals() == intervals);
TEST_EQUAL(test, true);
test = (integrator2.getRDF().getRepresentation().getCoefficients() == coefs);
TEST_EQUAL(test, true);
RESULT
CHECK(RDFIntegrator::clear())
RDFIntegrator integrator(rdf);
integrator.clear();
vector<Interval> no_intervals;
vector<Coefficients> no_coeffs;
bool test = (integrator.getRDF().getRepresentation().getIntervals() == no_intervals);
TEST_EQUAL(test, true);
test = (integrator.getRDF().getRepresentation().getCoefficients() == no_coeffs);
TEST_EQUAL(test, true);
TEST_EQUAL(integrator.getRDF().isValid(), false);
RESULT
CHECK(RDFIntegrator::RDFIntegrator& operator = (const RDFIntegrator& integrator))
//?????
RESULT
CHECK(bool RDFIntegrator::operator == (const RDFIntegrator& integrator))
RDFIntegrator int1, int2;
bool test = (int1 == int2);
TEST_EQUAL(test, true);
int1.setRDF(rdf);
test = (int1 == int2);
TEST_EQUAL(test, false);
int2.setRDF(rdf);
test = (int1 == int2);
TEST_EQUAL(test, true);
// ?????
RESULT
CHECK(bool RDFIntegrator::isValid())
RDFIntegrator int1;
TEST_EQUAL(int1.isValid(), false);
int1.setRDF(rdf);
TEST_EQUAL(int1.isValid(), false);
int1.clear();
TEST_EQUAL(int1.isValid(), false);
RESULT
CHECK(RDFIntegrator::double operator () (double x) const )
RDFIntegrator int1;
TEST_REAL_EQUAL(int1.operator()(1.5), 0.0);
//?????
RESULT
CHECK(RDFIntegrator::setRDF(const RadialDistributionFunction& rdf))
RDFIntegrator int1;
int1.setRDF(rdf);
RDFIntegrator int2(rdf);
bool test = (int1 == int2);
TEST_EQUAL(test, true);
//?????
RESULT
CHECK(RDFIntegrator::RadialDistributionFunction getRDF())
RDFIntegrator integrator(rdf);
RadialDistributionFunction rdf2 = integrator.getRDF();
bool test = (rdf2.getRepresentation().getIntervals() == intervals);
TEST_EQUAL(test, true);
test = (rdf2.getRepresentation().getCoefficients() == coefs);
TEST_EQUAL(test, true);
RESULT
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
END_TEST
|