Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
16ea7c75
Commit
16ea7c75
authored
Feb 11, 2010
by
Peter Eastman
Browse files
Test cases which may occasionally fail say so in the error message.
parent
172f8759
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
11 additions
and
9 deletions
+11
-9
platforms/cuda/tests/TestCudaBrownianIntegrator.cpp
platforms/cuda/tests/TestCudaBrownianIntegrator.cpp
+1
-1
platforms/cuda/tests/TestCudaLangevinIntegrator.cpp
platforms/cuda/tests/TestCudaLangevinIntegrator.cpp
+1
-1
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
+1
-1
platforms/opencl/tests/TestOpenCLBrownianIntegrator.cpp
platforms/opencl/tests/TestOpenCLBrownianIntegrator.cpp
+1
-1
platforms/opencl/tests/TestOpenCLLangevinIntegrator.cpp
platforms/opencl/tests/TestOpenCLLangevinIntegrator.cpp
+1
-1
platforms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
...rms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
+1
-1
platforms/reference/tests/TestReferenceBrownianIntegrator.cpp
...forms/reference/tests/TestReferenceBrownianIntegrator.cpp
+1
-1
platforms/reference/tests/TestReferenceLangevinIntegrator.cpp
...forms/reference/tests/TestReferenceLangevinIntegrator.cpp
+1
-1
platforms/reference/tests/TestReferenceVariableLangevinIntegrator.cpp
...ference/tests/TestReferenceVariableLangevinIntegrator.cpp
+1
-1
tests/AssertionUtilities.h
tests/AssertionUtilities.h
+2
-0
No files found.
platforms/cuda/tests/TestCudaBrownianIntegrator.cpp
View file @
16ea7c75
...
...
@@ -121,7 +121,7 @@ void testTemperature() {
}
pe
/=
steps
;
double
expected
=
0.5
*
numBonds
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
pe
,
0.1
*
expected
);
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
pe
,
0.1
*
expected
);
}
void
testConstraints
()
{
...
...
platforms/cuda/tests/TestCudaLangevinIntegrator.cpp
View file @
16ea7c75
...
...
@@ -126,7 +126,7 @@ void testTemperature() {
}
ke
/=
10000
;
double
expected
=
0.5
*
numParticles
*
3
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
ke
,
6
/
std
::
sqrt
(
10000.0
));
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
ke
,
6
/
std
::
sqrt
(
10000.0
));
}
void
testConstraints
()
{
...
...
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
View file @
16ea7c75
...
...
@@ -126,7 +126,7 @@ void testTemperature() {
}
ke
/=
1000
;
double
expected
=
0.5
*
numParticles
*
3
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
ke
,
3
*
expected
/
std
::
sqrt
(
1000.0
));
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
ke
,
3
*
expected
/
std
::
sqrt
(
1000.0
));
}
void
testConstraints
()
{
...
...
platforms/opencl/tests/TestOpenCLBrownianIntegrator.cpp
View file @
16ea7c75
...
...
@@ -121,7 +121,7 @@ void testTemperature() {
}
pe
/=
steps
;
double
expected
=
0.5
*
numBonds
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
pe
,
0.1
*
expected
);
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
pe
,
0.1
*
expected
);
}
void
testConstraints
()
{
...
...
platforms/opencl/tests/TestOpenCLLangevinIntegrator.cpp
View file @
16ea7c75
...
...
@@ -126,7 +126,7 @@ void testTemperature() {
}
ke
/=
10000
;
double
expected
=
0.5
*
numParticles
*
3
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
ke
,
6
/
std
::
sqrt
(
10000.0
));
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
ke
,
6
/
std
::
sqrt
(
10000.0
));
}
void
testConstraints
()
{
...
...
platforms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
View file @
16ea7c75
...
...
@@ -126,7 +126,7 @@ void testTemperature() {
}
ke
/=
1000
;
double
expected
=
0.5
*
numParticles
*
3
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
ke
,
3
*
expected
/
std
::
sqrt
(
1000.0
));
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
ke
,
3
*
expected
/
std
::
sqrt
(
1000.0
));
}
void
testConstraints
()
{
...
...
platforms/reference/tests/TestReferenceBrownianIntegrator.cpp
View file @
16ea7c75
...
...
@@ -119,7 +119,7 @@ void testTemperature() {
}
pe
/=
steps
;
double
expected
=
0.5
*
numBonds
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
pe
,
0.1
*
expected
);
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
pe
,
0.1
*
expected
);
}
void
testConstraints
()
{
...
...
platforms/reference/tests/TestReferenceLangevinIntegrator.cpp
View file @
16ea7c75
...
...
@@ -126,7 +126,7 @@ void testTemperature() {
}
ke
/=
10000
;
double
expected
=
0.5
*
numParticles
*
3
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
ke
,
6
/
std
::
sqrt
(
10000.0
));
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
ke
,
6
/
std
::
sqrt
(
10000.0
));
}
void
testConstraints
()
{
...
...
platforms/reference/tests/TestReferenceVariableLangevinIntegrator.cpp
View file @
16ea7c75
...
...
@@ -126,7 +126,7 @@ void testTemperature() {
}
ke
/=
1000
;
double
expected
=
0.5
*
numParticles
*
3
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
ke
,
3
*
expected
/
std
::
sqrt
(
1000.0
));
ASSERT_
USUALLY_
EQUAL_TOL
(
expected
,
ke
,
3
*
expected
/
std
::
sqrt
(
1000.0
));
}
void
testConstraints
()
{
...
...
tests/AssertionUtilities.h
View file @
16ea7c75
...
...
@@ -62,4 +62,6 @@ void throwException(const char* file, int line, const std::string& details) {
#define ASSERT_EQUAL_VEC(expected, found, tol) {ASSERT_EQUAL_TOL((expected)[0], (found)[0], (tol)); ASSERT_EQUAL_TOL((expected)[1], (found)[1], (tol)); ASSERT_EQUAL_TOL((expected)[2], (found)[2], (tol));};
#define ASSERT_USUALLY_EQUAL_TOL(expected, found, tol) {double _scale_ = std::fabs(expected) > 1.0 ? std::fabs(expected) : 1.0; if (!(std::fabs((expected)-(found))/_scale_ <= (tol))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found)<<" (This test is stochastic and may occasionally fail)"; throwException(__FILE__, __LINE__, details.str());}};
#endif
/*OPENMM_ASSERTIONUTILITIES_H_*/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment