lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 98295b5 2/4: Fix defects demonstrated in the


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 98295b5 2/4: Fix defects demonstrated in the immediately preceding commit
Date: Thu, 2 Feb 2017 02:13:13 +0000 (UTC)

branch: master
commit 98295b5fee481bfb82017560932b1dac5451e777
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix defects demonstrated in the immediately preceding commit
    
    Formerly, when comparing formatted_diagnostics() against its expected
    value, the test verified only that either
      - actual matched expected, or
      - actual was empty (even if expected was not).
    The test now validates whether actual equals expected.
    
    This is uncomfortably similar to the 2017-01-27T20:30:54 commit.
    
    Unfortunately, this change destroys the austere simplicity of variable
    names, which must be restored posthaste; then the temporary tests added
    in the immediately preceding commit (which now correctly fail) can be
    removed.
---
 input_seq_test.cpp |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index 7562846..84545e1 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -74,15 +74,16 @@ void check
         std::cout << std::endl;
         }
 
-    std::string const& y = seq.formatted_diagnostics();
-    bool const by = y.empty() || y == std::string(x);
+    std::string const& y0(seq.formatted_diagnostics());
+    std::string const y1 = (nullptr == x) ? std::string() : std::string(x);
+    bool const by = y0 == y1;
     if(!by)
         {
         std::cout
             <<   "\nObserved diagnostics:"
-            << "\n\n'" << y << "'"
+            << "\n\n'" << y0 << "'"
             << "\n\ndiffer from expected:"
-            << "\n\n'" << x << "'"
+            << "\n\n'" << y1 << "'"
             << std::endl
             ;
         }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]