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
|
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#include <BALL/CONCEPT/classTest.h>
#include <BALLTestConfig.h>
///////////////////////////
#include <BALL/KERNEL/system.h>
#include <BALL/FORMAT/HINFile.h>
#include <BALL/FORMAT/INIFile.h>
#include <BALL/MOLMEC/COMMON/radiusRuleProcessor.h>
#include <BALL/SOLVATION/pair6_12InteractionEnergyProcessor.h>
///////////////////////////
START_TEST(Pair6_12InteractionEnergyProcessor)
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
using namespace BALL;
using namespace std;
Pair6_12InteractionEnergyProcessor* pointer;
CHECK(Pair6_12InteractionEnergyProcessor::Pair6_12InteractionEnergyProcessor())
pointer = new Pair6_12InteractionEnergyProcessor;
TEST_NOT_EQUAL(pointer, 0)
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::~Pair6_12InteractionEnergyProcessor())
delete pointer;
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::Pair6_12InteractionEnergyProcessor(const Pair6_12InteractionEnergyProcessor& proc))
Pair6_12InteractionEnergyProcessor proc1;
Pair6_12InteractionEnergyProcessor proc2(proc1);
// ?????
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::setSolventDescriptor())
Pair6_12InteractionEnergyProcessor proc;
SolventDescriptor solvent;
proc.setSolventDescriptor(solvent);
bool test = (proc.getSolventDescriptor() == solvent);
TEST_EQUAL(test, true)
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::setRDFParameters())
Pair6_12InteractionEnergyProcessor proc;
RDFParameter param;
proc.setRDFParameters(param);
bool test = (proc.getRDFParameter() == param);
TEST_EQUAL(test, true)
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::setRDFIntegrator())
Pair6_12InteractionEnergyProcessor proc;
Pair6_12RDFIntegrator integ;
proc.setRDFIntegrator(integ);
bool test = (proc.getRDFIntegrator() == integ);
TEST_EQUAL(test, true)
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::clear())
Pair6_12InteractionEnergyProcessor proc;
Pair6_12InteractionEnergyProcessor proc2;
proc2.clear();
bool test = (proc == proc2);
TEST_EQUAL(test, true)
SolventDescriptor solvent;
proc2.setSolventDescriptor(solvent);
proc2.clear();
test = (proc == proc2);
TEST_EQUAL(test, true)
RDFParameter param;
proc2.setRDFParameters(param);
proc2.clear();
test = (proc == proc2);
TEST_EQUAL(test, true)
Pair6_12RDFIntegrator integ;
proc2.setRDFIntegrator(integ);
proc2.clear();
test = (proc == proc2);
TEST_EQUAL(test, true)
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::operator = (const Pair6_12InteractionEnergyProcessor& proc))
Pair6_12InteractionEnergyProcessor proc;
SolventDescriptor solvent;
RDFParameter param;
Pair6_12RDFIntegrator integ;
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::finish())
PRECISION(0.0001)
System S;
HINFile f(BALL_TEST_DATA_PATH(6_12-test.hin));
f >> S;
f.close();
INIFile ini(BALL_TEST_DATA_PATH(6_12-test.rul));
ini.read();
RadiusRuleProcessor radius_rules;
radius_rules.initialize(ini, "RadiusRules");
S.apply(radius_rules);
Pair6_12InteractionEnergyProcessor proc;
proc.options.readOptionFile(BALL_TEST_DATA_PATH(6_12-test.options));
// ensure the correct absolute path to the data directory
proc.options.set(Pair6_12InteractionEnergyProcessor::Option::RDF_FILENAME,
String(BALL_TEST_DATA_PATH())+proc.options[Pair6_12InteractionEnergyProcessor::Option::RDF_FILENAME].c_str());
proc.options.set(Pair6_12InteractionEnergyProcessor::Option::SOLVENT_FILENAME,
String(BALL_TEST_DATA_PATH())+proc.options[Pair6_12InteractionEnergyProcessor::Option::SOLVENT_FILENAME].c_str());
S.apply(proc);
double val = proc.getEnergy();
TEST_REAL_EQUAL(val, -6.027207050)
proc.options.set(Pair6_12InteractionEnergyProcessor::Option::RDF_FILENAME,
BALL_TEST_DATA_PATH(6_12-test.rdf-fake.ini));
proc.options.setBool(Pair6_12InteractionEnergyProcessor::Option::USE_RDF,
true);
proc.options.setInteger(Pair6_12RDFIntegrator::Option::METHOD,
Pair6_12RDFIntegrator::METHOD__TRAPEZIUM);
S.apply(proc);
val = proc.getEnergy();
TEST_REAL_EQUAL(val, -6.027207050)
proc.options.set(Pair6_12InteractionEnergyProcessor::Option::RDF_FILENAME,
BALL_TEST_DATA_PATH(6_12-test.rdf.ini));
S.apply(proc);
val = proc.getEnergy();
TEST_REAL_EQUAL(val, -7.62216)
// ?????: USE_RDF=true geht trotz nicht gesetzten Dateinamens!!!
// Was ist mit dem default? Exception?
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::isValid())
Pair6_12InteractionEnergyProcessor proc;
TEST_EQUAL(proc.isValid(), true)
// ?????
RESULT
CHECK(Pair6_12InteractionEnergyProcessor::operator == ())
Pair6_12InteractionEnergyProcessor proc;
Pair6_12InteractionEnergyProcessor proc2;
bool test = (proc == proc2);
TEST_EQUAL(test, true)
RESULT
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
END_TEST
|