Skip to content

Commit

Permalink
update test with tolerance (NEAR vs EQ) to pass tests on non-x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
mefuller committed Jan 19, 2022
1 parent b8937af commit 5f5de2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/kinetics/kineticsFromScratch3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,20 +368,20 @@ class KineticsAddSpecies3 : public testing::Test
kin.getRevRateConstants(k.data());
kin_ref->getRevRateConstants(k_ref.data());
for (size_t i = 0; i < kin.nReactions(); i++) {
EXPECT_DOUBLE_EQ(k_ref[i], k[i]) << "i = " << i << "; N = " << N;
EXPECT_NEAR(k_ref[i], k[i], k_ref[i]*1e-12) << "i = " << i << "; N = " << N;
}

kin.getRevRatesOfProgress(k.data());
kin_ref->getRevRatesOfProgress(k_ref.data());
for (size_t i = 0; i < kin.nReactions(); i++) {
EXPECT_DOUBLE_EQ(k_ref[i], k[i]) << "i = " << i << "; N = " << N;
EXPECT_NEAR(k_ref[i], k[i], k_ref[i]*1e-12) << "i = " << i << "; N = " << N;
}

kin.getCreationRates(w.data());
kin_ref->getCreationRates(w_ref.data());
for (size_t i = 0; i < kin.nTotalSpecies(); i++) {
size_t iref = p_ref.speciesIndex(p.speciesName(i));
EXPECT_DOUBLE_EQ(w_ref[iref], w[i]) << "sp = " << p.speciesName(i) << "; N = " << N;
EXPECT_NEAR(w_ref[iref], w[i], w_ref[i]*1e-12) << "sp = " << p.speciesName(i) << "; N = " << N;
}
}
};
Expand Down

0 comments on commit 5f5de2a

Please sign in to comment.