activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq-cpp git commit: some additional fixes for warnings and incorrect error message creation
Date Wed, 05 Aug 2015 21:09:31 GMT
Repository: activemq-cpp
Updated Branches:
  refs/heads/master e74c5f3f4 -> c452848eb


some additional fixes for warnings and incorrect error message creation

Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/c452848e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/c452848e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/c452848e

Branch: refs/heads/master
Commit: c452848eb8ae047850c5fa7734c5c0ceb3bc254c
Parents: e74c5f3
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Aug 5 17:09:23 2015 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Wed Aug 5 17:09:23 2015 -0400

----------------------------------------------------------------------
 activemq-cpp/src/test/decaf/lang/MathTest.cpp         |  2 +-
 activemq-cpp/src/test/decaf/lang/MathTest.h           |  4 ++--
 activemq-cpp/src/test/decaf/lang/StringTest.cpp       | 11 ++++++-----
 activemq-cpp/src/test/decaf/util/BitSetTest.cpp       | 14 +++++++-------
 .../src/test/decaf/util/concurrent/FutureTaskTest.cpp |  2 +-
 5 files changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/c452848e/activemq-cpp/src/test/decaf/lang/MathTest.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test/decaf/lang/MathTest.cpp b/activemq-cpp/src/test/decaf/lang/MathTest.cpp
index 89d5e25..1c06eba 100644
--- a/activemq-cpp/src/test/decaf/lang/MathTest.cpp
+++ b/activemq-cpp/src/test/decaf/lang/MathTest.cpp
@@ -26,7 +26,7 @@ using namespace decaf;
 using namespace decaf::lang;
 
 ////////////////////////////////////////////////////////////////////////////////
-MathTest::MathTest() : HYP(Math::sqrt(2.0)), OPP(1.0), ADJ(1.0) {
+MathTest::MathTest() : HYP(Math::sqrt(2.0)) { //, OPP(1.0), ADJ(1.0) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/c452848e/activemq-cpp/src/test/decaf/lang/MathTest.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test/decaf/lang/MathTest.h b/activemq-cpp/src/test/decaf/lang/MathTest.h
index c0baa26..e38cee7 100644
--- a/activemq-cpp/src/test/decaf/lang/MathTest.h
+++ b/activemq-cpp/src/test/decaf/lang/MathTest.h
@@ -76,8 +76,8 @@ namespace lang{
     private:
 
         double HYP;
-        double OPP;
-        double ADJ;
+        // double OPP;
+        // double ADJ;
 
     public:
 

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/c452848e/activemq-cpp/src/test/decaf/lang/StringTest.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test/decaf/lang/StringTest.cpp b/activemq-cpp/src/test/decaf/lang/StringTest.cpp
index 6a5734e..1eb589f 100644
--- a/activemq-cpp/src/test/decaf/lang/StringTest.cpp
+++ b/activemq-cpp/src/test/decaf/lang/StringTest.cpp
@@ -18,6 +18,7 @@
 #include "StringTest.h"
 
 #include <decaf/lang/String.h>
+#include <decaf/lang/Integer.h>
 #include <decaf/lang/exceptions/IndexOutOfBoundsException.h>
 #include <decaf/lang/exceptions/NullPointerException.h>
 #include <decaf/lang/exceptions/StringIndexOutOfBoundsException.h>
@@ -741,7 +742,7 @@ void StringTest::testLastIndexOfString2() {
 
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Returned incorrect index", 5, input.lastIndexOf(String("World"),
9));
     int result = input.lastIndexOf(String("Hello"), 2);
-    CPPUNIT_ASSERT_MESSAGE("Found String outside of index: " + result, result == 0);
+    CPPUNIT_ASSERT_MESSAGE("Found String outside of index: " + Integer::toString(result),
result == 0);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Reported wrong error code", -1, hello.lastIndexOf(String(""),
-5));
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Did not accept valid large starting position",
                                  5, hello.lastIndexOf(String(""), 5));
@@ -763,7 +764,7 @@ void StringTest::testLastIndexOfStdString2() {
 
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Returned incorrect index", 5, input.lastIndexOf(std::string("World"),
9));
     int result = input.lastIndexOf(std::string("Hello"), 2);
-    CPPUNIT_ASSERT_MESSAGE("Found String outside of index: " + result, result == 0);
+    CPPUNIT_ASSERT_MESSAGE("Found String outside of index: " + Integer::toString(result),
result == 0);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Reported wrong error code", -1, hello.lastIndexOf(std::string(""),
-5));
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Did not accept valid large starting position",
                                  5, hello.lastIndexOf(std::string(""), 5));
@@ -786,7 +787,7 @@ void StringTest::testLastIndexOfCString2() {
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Returned incorrect index", -1, input.lastIndexOf(nullString,
0));
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Returned incorrect index", 5, input.lastIndexOf("World",
9));
     int result = input.lastIndexOf("Hello", 2);
-    CPPUNIT_ASSERT_MESSAGE("Found String outside of index: " + result, result == 0);
+    CPPUNIT_ASSERT_MESSAGE("Found String outside of index: " + Integer::toString(result),
result == 0);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Reported wrong error code", -1, hello.lastIndexOf("", -5));
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Did not accept valid large starting position", 5, hello.lastIndexOf("",
5));
 }
@@ -1083,7 +1084,7 @@ void StringTest::testOperatorLessCString() {
 
     CPPUNIT_ASSERT_THROW_MESSAGE(
         "Should have thrown a NullPointerException",
-        upper < NULL,
+        (upper < NULL),
         NullPointerException);
 
     // test lhs as std::string
@@ -1126,7 +1127,7 @@ void StringTest::testOperatorGreaterCString() {
 
     CPPUNIT_ASSERT_THROW_MESSAGE(
         "Should have thrown a NullPointerException",
-        lower < NULL,
+        (lower < NULL),
         NullPointerException);
 
     // test lhs as C string

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/c452848e/activemq-cpp/src/test/decaf/util/BitSetTest.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test/decaf/util/BitSetTest.cpp b/activemq-cpp/src/test/decaf/util/BitSetTest.cpp
index 6626b3f..ca6057e 100644
--- a/activemq-cpp/src/test/decaf/util/BitSetTest.cpp
+++ b/activemq-cpp/src/test/decaf/util/BitSetTest.cpp
@@ -142,7 +142,7 @@ void BitSetTest::testEquals() {
 void BitSetTest::testClear() {
     eightbs.clear();
     for (int i = 0; i < 8; i++) {
-        CPPUNIT_ASSERT_MESSAGE("Clear didn't clear bit " + i, !eightbs.get(i));
+        CPPUNIT_ASSERT_MESSAGE("Clear didn't clear bit " + Integer::toString(i), !eightbs.get(i));
     }
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Test1: Wrong length", 0, eightbs.length());
 
@@ -249,7 +249,7 @@ void BitSetTest::testClearII() {
     }
 
     for (int i = initialSize; i < bs.size(); i++) {
-        CPPUNIT_ASSERT_MESSAGE("Shouldn't have flipped bit " + i, !bs.get(i));
+        CPPUNIT_ASSERT_MESSAGE("Shouldn't have flipped bit " + Integer::toString(i), !bs.get(i));
     }
 
     // pos1 and pos2 is in the same bitset element, boundary testing
@@ -288,7 +288,7 @@ void BitSetTest::testClearII() {
         bs.set(0, initialSize);
         bs.clear(0, 65);
         for (int i = 0; i < 65; i++) {
-            CPPUNIT_ASSERT_MESSAGE("Failed to clear bit " + i, !bs.get(i));
+            CPPUNIT_ASSERT_MESSAGE("Failed to clear bit " + Integer::toString(i), !bs.get(i));
         }
         for (int i = 65; i < bs.size(); i++) {
             CPPUNIT_ASSERT_MESSAGE("Shouldn't have flipped bit " + Integer::toString(i),
!bs.get(i));
@@ -339,15 +339,15 @@ void BitSetTest::testClearII() {
         }
 
         for (int i = 9; i < 219; i++) {
-            CPPUNIT_ASSERT_MESSAGE("CPPUNIT_FAILed to clear bit " + i, !bs.get(i));
+            CPPUNIT_ASSERT_MESSAGE("CPPUNIT_FAILed to clear bit " + Integer::toString(i),
!bs.get(i));
         }
 
         for (int i = 219; i < 255; i++) {
-            CPPUNIT_ASSERT_MESSAGE("Shouldn't have cleared bit " + i, bs.get(i));
+            CPPUNIT_ASSERT_MESSAGE("Shouldn't have cleared bit " + Integer::toString(i),
bs.get(i));
         }
 
         for (int i = 255; i < bs.size(); i++) {
-            CPPUNIT_ASSERT_MESSAGE("Shouldn't have flipped bit " + i, !bs.get(i));
+            CPPUNIT_ASSERT_MESSAGE("Shouldn't have flipped bit " + Integer::toString(i),
!bs.get(i));
         }
     }
     {
@@ -695,7 +695,7 @@ void BitSetTest::testFlipII() {
     bs.set(10);
     bs.flip(7, 11);
     for (int i = 0; i < 7; i++) {
-        CPPUNIT_ASSERT_MESSAGE("Shouldn't have flipped bit " + i, !bs.get(i));
+        CPPUNIT_ASSERT_MESSAGE("Shouldn't have flipped bit " + Integer::toString(i), !bs.get(i));
     }
     CPPUNIT_ASSERT_MESSAGE("Failed to flip bit 7", !bs.get(7));
     CPPUNIT_ASSERT_MESSAGE("Failed to flip bit 8", bs.get(8));

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/c452848e/activemq-cpp/src/test/decaf/util/concurrent/FutureTaskTest.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test/decaf/util/concurrent/FutureTaskTest.cpp b/activemq-cpp/src/test/decaf/util/concurrent/FutureTaskTest.cpp
index 12244d4..0d0b2dd 100644
--- a/activemq-cpp/src/test/decaf/util/concurrent/FutureTaskTest.cpp
+++ b/activemq-cpp/src/test/decaf/util/concurrent/FutureTaskTest.cpp
@@ -137,7 +137,7 @@ void FutureTaskTest::testConstructor2() {
 
     CPPUNIT_ASSERT_THROW_MESSAGE(
         "Should have thrown a NullPointerException",
-        new FutureTask<std::string>(NULL, "Test"),
+        new FutureTask<std::string>(NULL, std::string("Test")),
         NullPointerException);
 }
 


Mime
View raw message