Unverified Commit 1fea6058 authored by Andy Simmonett's avatar Andy Simmonett
Browse files

Fix to test tolerance and superfluous loop

parent 0e396127
...@@ -336,7 +336,7 @@ double testPositionsAfterShortRun(Platform &platform) { ...@@ -336,7 +336,7 @@ double testPositionsAfterShortRun(Platform &platform) {
const auto &v = state.getVelocities(); const auto &v = state.getVelocities();
const auto &p = state.getPositions(); const auto &p = state.getPositions();
const double TOL = 5e-4; const double TOL = 1e-3;
ASSERT_EQUAL_VEC(Vec3( 0.35675068, 0.65083786, 0.27473552), v[0], TOL); ASSERT_EQUAL_VEC(Vec3( 0.35675068, 0.65083786, 0.27473552), v[0], TOL);
ASSERT_EQUAL_VEC(Vec3( 0.099853537, 0.2840745, 0.069048963), v[1], TOL); ASSERT_EQUAL_VEC(Vec3( 0.099853537, 0.2840745, 0.069048963), v[1], TOL);
ASSERT_EQUAL_VEC(Vec3( 0.24183664, 0.12975303, -1.1057667), v[2], TOL); ASSERT_EQUAL_VEC(Vec3( 0.24183664, 0.12975303, -1.1057667), v[2], TOL);
......
...@@ -248,12 +248,10 @@ void testCheckpoints() { ...@@ -248,12 +248,10 @@ void testCheckpoints() {
State state1 = context.getState(State::Positions | State::Velocities); State state1 = context.getState(State::Positions | State::Velocities);
State state2 = newContext.getState(State::Positions | State::Velocities); State state2 = newContext.getState(State::Positions | State::Velocities);
for (int i=0; i<3;i++){ ASSERT_EQUAL_VEC(state1.getPositions()[0], state2.getPositions()[0], 1e-6);
ASSERT_EQUAL_VEC(state1.getPositions()[0], state2.getPositions()[0], 1e-6); ASSERT_EQUAL_VEC(state1.getPositions()[1], state2.getPositions()[1], 1e-6);
ASSERT_EQUAL_VEC(state1.getPositions()[1], state2.getPositions()[1], 1e-6); ASSERT_EQUAL_VEC(state1.getVelocities()[0], state2.getVelocities()[0], 1e-6);
ASSERT_EQUAL_VEC(state1.getVelocities()[0], state2.getVelocities()[0], 1e-6); ASSERT_EQUAL_VEC(state1.getVelocities()[1], state2.getVelocities()[1], 1e-6);
ASSERT_EQUAL_VEC(state1.getVelocities()[1], state2.getVelocities()[1], 1e-6);
}
} }
void testAPIChangeNumParticles() { void testAPIChangeNumParticles() {
...@@ -265,7 +263,6 @@ void testAPIChangeNumParticles() { ...@@ -265,7 +263,6 @@ void testAPIChangeNumParticles() {
std::vector<Vec3> positions(numMolecules*2); std::vector<Vec3> positions(numMolecules*2);
int numDOF = makeDimerBox(system, positions, constrain, numMolecules, bondLength); int numDOF = makeDimerBox(system, positions, constrain, numMolecules, bondLength);
} }
void runPlatformTests(); void runPlatformTests();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment