Skip to content

Commit

Permalink
Intrepid2: reenabling JacobiLegendrePolynomial_Tests and Hierarchical…
Browse files Browse the repository at this point in the history
…_Basis_Tests.

Made one of the tests in IntegratedLegendreTests.cpp more robust against architectural differences; it was failing on certain platforms.
  • Loading branch information
CamelliaDPG committed Feb 3, 2020
1 parent dadfec1 commit f95bca9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FILE(GLOB TEST_SOURCES "*.cpp")

# TRIBITS_ADD_EXECUTABLE_AND_TEST(
# Hierarchical_Basis_Tests
# SOURCES ${TEST_SOURCES}
# ARGS
# NUM_MPI_PROCS 1
# PASS_REGULAR_EXPRESSION "TEST PASSED"
# ADD_DIR_TO_NAME
# )
TRIBITS_ADD_EXECUTABLE_AND_TEST(
Hierarchical_Basis_Tests
SOURCES ${TEST_SOURCES}
ARGS
NUM_MPI_PROCS 1
PASS_REGULAR_EXPRESSION "TEST PASSED"
ADD_DIR_TO_NAME
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FILE(GLOB TEST_SOURCES "*.cpp")

# TRIBITS_ADD_EXECUTABLE_AND_TEST(
# JacobiLegendrePolynomial_Tests
# SOURCES ${TEST_SOURCES}
# ARGS
# NUM_MPI_PROCS 1
# PASS_REGULAR_EXPRESSION "TEST PASSED"
# ADD_DIR_TO_NAME
# )
TRIBITS_ADD_EXECUTABLE_AND_TEST(
JacobiLegendrePolynomial_Tests
SOURCES ${TEST_SOURCES}
ARGS
NUM_MPI_PROCS 1
PASS_REGULAR_EXPRESSION "TEST PASSED"
ADD_DIR_TO_NAME
)
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,17 @@ namespace

for (int i=0; i<=polyOrder; i++)
{
if (! approximatelyEqual(integrated_legendre_values_dt_second_path_host(i), integrated_legendre_values_dt_host(i), tol) )
bool valuesAreBothSmall = valuesAreSmall(integrated_legendre_values_dt_second_path_host(i), integrated_legendre_values_dt_host(i), tol);
if (!valuesAreBothSmall)
{
out << "for polyOrder " << i << ", x = " << x << ", t = " << t << ": ";
out << integrated_legendre_values_dt_second_path_host(i) << " != " << integrated_legendre_values_dt_host(i);
out << " (diff = " << abs(integrated_legendre_values_dt_second_path_host(i) - integrated_legendre_values_dt_host(i));
out << "; tol = " << tol << ")\n";
success = false;
if (! approximatelyEqual(integrated_legendre_values_dt_second_path_host(i), integrated_legendre_values_dt_host(i), tol) )
{
out << "for polyOrder " << i << ", x = " << x << ", t = " << t << ": ";
out << integrated_legendre_values_dt_second_path_host(i) << " != " << integrated_legendre_values_dt_host(i);
out << " (diff = " << abs(integrated_legendre_values_dt_second_path_host(i) - integrated_legendre_values_dt_host(i));
out << "; tol = " << tol << ")\n";
success = false;
}
}
}
}
Expand Down

0 comments on commit f95bca9

Please sign in to comment.