[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1f8316c 16/22: Test actual return value
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1f8316c 16/22: Test actual return value |
Date: |
Sun, 6 Jun 2021 21:38:02 -0400 (EDT) |
branch: master
commit 1f8316ceadd9b129e9eccac203bbdf5c49222880
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Test actual return value
If a function calculates an intermediate value x and returns f(x), and
it is desired to test the return value, then test f(x) rather than x.
---
ihs_avsolve.cpp | 2 +-
solve.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index c6c5e77..ed076be 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -475,7 +475,7 @@ currency AccountValue::Solve
break;
case root_not_bracketed:
{
- LMI_ASSERT(0.0 == solution.root);
+ LMI_ASSERT(C0 == solution_cents);
// Don't want this firing continually in census runs.
if(!SolvingForGuarPremium)
{
diff --git a/solve.cpp b/solve.cpp
index 0a0f60d..eff08a0 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -354,7 +354,7 @@ currency AccountValue::Solve()
break;
case root_not_bracketed:
{
- LMI_ASSERT(0.0 == solution.root);
+ LMI_ASSERT(C0 == solution_cents);
warning() << "solution not found. Using zero instead." <<
LMI_FLUSH;
}
break;
- [lmi-commits] [lmi] master 83eb025 05/22: Rename a local variable, (continued)
- [lmi-commits] [lmi] master 83eb025 05/22: Rename a local variable, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master ec0a308 06/22: Refactor, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 99aebcc 07/22: Treat decimal_root return value more flexibly, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 5c31ab3 09/22: Fix latent unit-test errors, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 2391573 11/22: Rename a variable, for terseness, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master b14e318 18/22: Adjust tolerance for a particular unit-test function, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 1c448d8 20/22: Augment decimal_root()'s return type, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 53c3513 21/22: Reorder unit tests, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 5cf534c 04/22: Constify, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 3865416 10/22: Rearrange certain unit tests, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 1f8316c 16/22: Test actual return value,
Greg Chicares <=
- [lmi-commits] [lmi] master 3d4adb3 17/22: Clarify, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 200e756 03/22: Clarify documentation, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 1b0ed06 12/22: Change argument order, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 86661b6 22/22: Validate number of iterations, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 9027fef 13/22: Refactor, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master c1a020a 14/22: Include appropriate headers, and say why they're included, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 4d9ed2d 19/22: Abstract the Brent error limit, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 776f09c 15/22: Return a struct rather than a std::pair, Greg Chicares, 2021/06/06