11 #include <tst/Verify.h>
13 #include <utl/ParameterStorage.h>
15 #include <cppunit/extensions/HelperMacros.h>
28 CPPUNIT_TEST(testHasSetGet);
29 CPPUNIT_TEST_SUITE_END();
68 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.HasParameter(eHeight),
false));
72 ourParameterStorage.GetParameter(eHeight);
75 cerr <<
"Auger exception: " << ex.GetExceptionName()
82 ourParameterStorage.SetParameter(eHeight, 123.4,
false);
85 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.HasParameter(eHeight),
true));
88 CPPUNIT_ASSERT(Verify<CloseTo>(ourParameterStorage.GetParameter(eHeight), 123.4));
91 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.GetParameterLockStatus(eHeight),
false));
94 ourParameterStorage.SetParameter(eHeight, 246.8,
false);
97 CPPUNIT_ASSERT(Verify<CloseTo>(ourParameterStorage.GetParameter(eHeight), 246.8));
101 ourParameterStorage.SetParameterCovariance(eHeight,
eWidth, 0.11,
false);
104 cerr <<
"Auger exception: " << ex.GetExceptionName()
109 ourParameterStorage.DeleteParameter(eHeight);
112 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.HasParameter(eHeight),
false));
115 ourParameterStorage.DeleteParameter(eLength);
118 ourParameterStorage.SetParameter(eHeight, 369.12,
true);
121 CPPUNIT_ASSERT(Verify<CloseTo>(ourParameterStorage.GetParameter(eHeight), 369.12));
124 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.GetParameterLockStatus(eHeight),
true));
128 ourParameterStorage.DeleteParameter(eHeight);
131 cerr <<
"Auger exception: " << ex.GetExceptionName()
142 ourParameterStorage.GetParameterCovariance(eHeight,
eWidth);
145 cerr <<
"Auger exception: " << ex.GetExceptionName()
150 ourParameterStorage.SetParameter(
eWidth, 0.25,
false);
153 ourParameterStorage.SetParameterCovariance(eHeight,
eWidth, 0.33,
false);
156 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.HasParameterCovariance(eHeight,
eWidth),
true));
157 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.HasParameterCovariance(
eWidth, eHeight),
true));
160 CPPUNIT_ASSERT(Verify<CloseTo>(ourParameterStorage.GetParameterCovariance(eHeight,
eWidth), 0.33));
161 CPPUNIT_ASSERT(Verify<CloseTo>(ourParameterStorage.GetParameterCovariance(
eWidth, eHeight), 0.33));
164 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.GetParameterCovarianceLockStatus(eHeight,
eWidth),
false));
165 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.GetParameterCovarianceLockStatus(
eWidth, eHeight),
false));
168 ourParameterStorage.SetParameterCovariance(eHeight,
eWidth, 0.66,
false);
171 CPPUNIT_ASSERT(Verify<CloseTo>(ourParameterStorage.GetParameterCovariance(eHeight,
eWidth), 0.66));
172 CPPUNIT_ASSERT(Verify<CloseTo>(ourParameterStorage.GetParameterCovariance(
eWidth, eHeight), 0.66));
175 ourParameterStorage.DeleteParameterCovariance(eHeight,
eWidth);
178 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.HasParameterCovariance(eHeight,
eWidth),
false));
179 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.HasParameterCovariance(
eWidth, eHeight),
false));
182 ourParameterStorage.SetParameterCovariance(eHeight,
eWidth, 0.66,
false);
185 ourParameterStorage.DeleteParameter(
eWidth);
193 ourParameterStorage.SetParameter(
eWidth, 0.25,
true);
196 ourParameterStorage.SetParameterCovariance(eHeight,
eWidth, 0.77,
true);
197 CPPUNIT_ASSERT(Verify<CloseTo>(ourParameterStorage.GetParameterCovariance(eHeight,
eWidth), 0.77));
200 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.GetParameterCovarianceLockStatus(eHeight,
eWidth),
true));
201 CPPUNIT_ASSERT(Verify<Equal>(ourParameterStorage.GetParameterCovarianceLockStatus(
eWidth, eHeight),
true));
205 ourParameterStorage.DeleteParameterCovariance(eHeight,
eWidth);
208 cerr <<
"Auger exception: " << ex.GetExceptionName()
ParameterStorage< Dimension, double > ourParameterStorage
Base class for exceptions arising because configuration data are not valid.
Base class for exceptions trying to access non-existing components.
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
const std::string & GetMessage() const
Retrieve the message from the exception.