[mathicgb] 01/01: changes to remove test error and warnings during compilation
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Sat Aug 5 00:54:57 UTC 2017
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.
commit bd634c895fedd7ae55fdde111b8539531d235fcd
Author: Mike Stillman <mikestillman1 at gmail.com>
Date: Tue Jun 6 12:08:53 2017 -0400
changes to remove test error and warnings during compilation
---
src/cli/HelpAction.cpp | 2 +-
src/mathicgb/LogDomain.hpp | 3 ++-
src/mathicgb/Range.hpp | 2 +-
src/test/Range.cpp | 27 +++++++++++++++------------
4 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/src/cli/HelpAction.cpp b/src/cli/HelpAction.cpp
index 73620c8..3b45a7c 100755
--- a/src/cli/HelpAction.cpp
+++ b/src/cli/HelpAction.cpp
@@ -78,7 +78,7 @@ void HelpAction::performAction() {
std::cerr <<
"\n none expands to nothing\n"
"\n"
- " all expands to all log names\n";
+ " all expands to all log names\n"
"\n";
}
diff --git a/src/mathicgb/LogDomain.hpp b/src/mathicgb/LogDomain.hpp
index a4fb46b..568257d 100755
--- a/src/mathicgb/LogDomain.hpp
+++ b/src/mathicgb/LogDomain.hpp
@@ -166,7 +166,8 @@ public:
std::ostream& stream() {
MATHICGB_ASSERT(false);
- return *static_cast< std::ostream*>(0);
+ abort();
+ //return *static_cast< std::ostream*>(0);
}
typedef unsigned long long Counter;
diff --git a/src/mathicgb/Range.hpp b/src/mathicgb/Range.hpp
index 836c59f..680bc35 100755
--- a/src/mathicgb/Range.hpp
+++ b/src/mathicgb/Range.hpp
@@ -143,7 +143,7 @@ auto zip(
///
/// The output will be "hello4 world2 ". If the ranges have different lengths
/// then the length of the range will be the length of the first range. If the
-/// first range is shorter than the second one, this means you will likely
+/// first range is longer than the second one, this means you will likely
/// run into undefined behavior. We can't even do an assert for that because
/// it's perfectly reasonable to use giant implicitly represented ranges for
/// the second parameter and if that's a forward iterator, doing std::distance
diff --git a/src/test/Range.cpp b/src/test/Range.cpp
index 00f1dd9..a446ed1 100755
--- a/src/test/Range.cpp
+++ b/src/test/Range.cpp
@@ -141,20 +141,23 @@ TEST(Range, indexRange) {
}
TEST(Range, oppositePairRange) {
- /// MES: The following commented out code using arrays, and
+ /// MES: The following commented out code using arrays of strings, and
/// iterators/ranges of them, fails to compile on clang, 1 Jan 2017
/// (clang version 3.8, and also on earlier versions of clang):
- // std::string strs[] = {"hello", "world", "!"};
- // const auto r = zip(strs, intRange(10));
- // const auto opR = zip(intRange(3), strs);
- // ASSERT_EQ(rangeToVector(r), rangeToVector(oppositePairRange(opR)));
- // ASSERT_EQ(
- // rangeToVector(opR),
- // rangeToVector(oppositePairRange(std::begin(r), std::end(r)))
- // );
- const auto int3 = intRange(3,6);
- const auto r = zip(int3, intRange(10));
- const auto opR = zip(intRange(3), int3);
+ // If one uses
+ // std::string elems[] {"hello", "world", "!"};
+ // instead of
+ int elems[] {1,13,17};
+ // this doesn't compile. Why not??
+ const auto r = zip(elems, intRange(10));
+ const auto opR = zip(intRange(3), elems);
+ auto val1 = rangeToVector(r);
+ auto val2a = oppositePairRange(opR);
+ auto val3a = std::begin(val2a);
+ auto val3b = std::end(val2a);
+ auto val3 = rangeToVector(val3a,val3b);
+ auto val2 = rangeToVector(val2a);
+ ASSERT_EQ(val1, val2);
ASSERT_EQ(rangeToVector(r), rangeToVector(oppositePairRange(opR)));
ASSERT_EQ(
rangeToVector(opR),
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathicgb.git
More information about the debian-science-commits
mailing list