lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 4209d20 2/6: Further strengthen input-sequenc


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 4209d20 2/6: Further strengthen input-sequence unit test
Date: Sat, 28 Jan 2017 04:52:22 +0000 (UTC)

branch: master
commit 4209d209d2fabc3508c4d46f478c8ef6d55bfd8c
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Further strengthen input-sequence unit test
    
    The 2017-01-27T20:30:54 change caused a previously overlooked anomalous
    circumstance to be detected and reported...by dereferencing nullptr.
    Now, instead, an explanation is written to stdout.
---
 input_seq_test.cpp |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index eb8e5a5..fe36faf 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -55,17 +55,17 @@ void check
         }
 
     std::vector<std::string> const& s(seq.linear_keyword_representation());
-    std::vector<std::string> const expected_keyword_representation =
+    std::vector<std::string> const t =
         (nullptr == c)
         ? std::vector<std::string>(n)
         : std::vector<std::string>(c, c + n)
         ;
-    bool const bs = s == expected_keyword_representation;
+    bool const bs = s == t;
     if(!bs)
         {
         std::cout << "\nExpression: '" << e << '\'';
         std::cout << "\n  expected: ";
-        std::copy(c, c + n, std::ostream_iterator<char const*>(std::cout, 
"|"));
+        std::copy(t.begin(), t.end(), 
std::ostream_iterator<std::string>(std::cout, "|"));
         std::cout << "\n   but got: ";
         std::copy(s.begin(), s.end(), 
std::ostream_iterator<std::string>(std::cout, "|"));
         std::cout << std::endl;



reply via email to

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