some additional fixes for warnings and incorrect error message creation
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::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) {
}
////////////////////////////////////////////////////////////////////////////////
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 @@
private:
double HYP;
- double OPP;
- double ADJ;
+ // double OPP;
+ // double ADJ;
public:
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 @@
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 @@
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 @@
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 @@
CPPUNIT_ASSERT_THROW_MESSAGE(
"Should have thrown a NullPointerException",
- upper < NULL,
+ (upper < NULL),
NullPointerException);
// test lhs as std::string
@@ -1126,7 +1127,7 @@
CPPUNIT_ASSERT_THROW_MESSAGE(
"Should have thrown a NullPointerException",
- lower < NULL,
+ (lower < NULL),
NullPointerException);
// test lhs as C string
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::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 @@
}
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 @@
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 @@
}
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 @@
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));
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 @@
CPPUNIT_ASSERT_THROW_MESSAGE(
"Should have thrown a NullPointerException",
- new FutureTask<std::string>(NULL, "Test"),
+ new FutureTask<std::string>(NULL, std::string("Test")),
NullPointerException);
}