[mathicgb] 12/14: Specify negative ints as signed chars in tests.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sun Sep 6 00:27:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.

commit 9545e609ee472889dcbdaa3fbce6d69a97cae450
Author: Doug Torrance <dtorrance at piedmont.edu>
Date:   Thu Sep 3 01:20:40 2015 -0400

    Specify negative ints as signed chars in tests.
    
    This fixes failed tests on several architectures for which the default
    char is unsigned.
---
 src/test/PrimeField.cpp | 4 ++--
 src/test/Scanner.cpp    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/test/PrimeField.cpp b/src/test/PrimeField.cpp
index 969876f..e83d633 100755
--- a/src/test/PrimeField.cpp
+++ b/src/test/PrimeField.cpp
@@ -59,9 +59,9 @@ TEST(PrimeField, toElement) {
     toString(pf.toElement(std::numeric_limits<int>::min())));
 
   // Fewer number of bits (8)
-  ASSERT_EQ("127", toString(pf.toElement(std::numeric_limits<char>::max())));
+  ASSERT_EQ("127", toString(pf.toElement(std::numeric_limits<signed char>::max())));
   ASSERT_EQ("4294967163",
-    toString(pf.toElement(std::numeric_limits<char>::min())));
+    toString(pf.toElement(std::numeric_limits<signed char>::min())));
 
   ASSERT_EQ("255",
     toString(pf.toElement(std::numeric_limits<unsigned char>::max())));
diff --git a/src/test/Scanner.cpp b/src/test/Scanner.cpp
index f689665..4635c2f 100755
--- a/src/test/Scanner.cpp
+++ b/src/test/Scanner.cpp
@@ -102,10 +102,10 @@ TEST(Scanner, readInteger) {
   ASSERT_EQ(0, in.readInteger<unsigned char>());
   ASSERT_EQ(0, in.readInteger<char>());
   ASSERT_EQ(1, in.readInteger<char>());
-  ASSERT_EQ(-1, in.readInteger<char>());
+  ASSERT_EQ(-1, in.readInteger<signed char>());
   ASSERT_EQ(127, in.readInteger<char>());
-  ASSERT_EQ(-128, in.readInteger<char>());
-  ASSERT_EQ(-128, in.readInteger<char>(true));
+  ASSERT_EQ(-128, in.readInteger<signed char>());
+  ASSERT_EQ(-128, in.readInteger<signed char>(true));
 }
 
 TEST(Scanner, WhiteAndLineCount) {

-- 
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