[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;
- [lmi-commits] [lmi] master updated (81185a8 -> 11eedff), Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master bd7b696 5/6: Improve concinnity, Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master 11eedff 6/6: Improve concinnity, Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master 795707f 1/6: Prefer braced-init-list to push_back, Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master 4209d20 2/6: Further strengthen input-sequence unit test,
Greg Chicares <=
- [lmi-commits] [lmi] master 6805835 4/6: Shorten long lines, Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master 6921ed7 3/6: Belay array decay, Greg Chicares, 2017/01/27