summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Cole <robert.cole@intel.com>2015-06-01 20:09:44 -0400
committerErich Keane <erich.keane@intel.com>2015-06-03 22:30:55 +0000
commit0786c728f45262ae654d6c205eba99086b6cd768 (patch)
tree8e861437c1ec5e4ed253e5447f685c3523a8ac07
parentda0645a06e1bf267ec3f53b499dcebeeb6e7afba (diff)
Fixed compile-time warnings in gcc 4.9.2 in the test code.
Disabled link-time optimization for the libccfxmpp.a static library as it appeared to be causing linker issues in 4.9.2. Further research into the underlying cause may be valuable. Change-Id: I52218dbe7fb9faf1e03faa9b919f602cc634ff8b Signed-off-by: Robert Cole <robert.cole@intel.com> Reviewed-on: https://gerrit.iotivity.org/gerrit/1162 Reviewed-by: Charlie Lenahan <charlie.lenahan@intel.com> Reviewed-by: Erich Keane <erich.keane@intel.com> Tested-by: Erich Keane <erich.keane@intel.com>
-rw-r--r--build_common/SConscript.py14
-rw-r--r--ra_xmpp/test/xmpp_tests.cpp10
-rw-r--r--src/SConscript.py1
-rw-r--r--test/bosh_tests.cpp4
-rw-r--r--test/common_tests.cpp56
-rw-r--r--test/portabledom_tests.cpp14
-rw-r--r--test/xmpp_compliance_tests.cpp2
-rw-r--r--test/xmpp_dummy_server.cpp2
-rw-r--r--test/xmpp_tests.cpp4
9 files changed, 53 insertions, 54 deletions
diff --git a/build_common/SConscript.py b/build_common/SConscript.py
index 6212793..8929fc3 100644
--- a/build_common/SConscript.py
+++ b/build_common/SConscript.py
@@ -103,12 +103,12 @@ print "TARGET_ARCH:", platform_arch()
#if platform_host() == 'windows':
# if not env.WhereIs('7z'):
# print_warning('7-Zip is required to unpack externally downloaded libraries. Attempting to get 7-zip.')
-#
-# if '64' in platform_arch():
+#
+# if '64' in platform_arch():
# sevenzip_exe = env.URLDownload('7z920-x64.msi', 'http://www.7-zip.org/a/7z920-x64.msi')
# else:
# sevenzip_exe = env.URLDownload('7z920.exe', 'http://www.7-zip.org/a/7z920.exe')
-#
+#
# Configure help for command-line options
help_vars.Update(env)
@@ -225,12 +225,12 @@ def versionSufficient(sourceVer, requiredVer):
verOkay = False
break
if p[0]>p[1]:
- break
+ break
return verOkay
if 'linux' in env['HOST']:
- # Check g++ version (GCC C-version shouldn't matter as much, but can be checked too
+ # Check g++ version (GCC C-version shouldn't matter as much, but can be checked too
# here if needed)
REQUIRED_VER = "4.8.1"
# Check gcc version
@@ -238,8 +238,8 @@ if 'linux' in env['HOST']:
print "g++ version is insufficient to compile the client. Required:", REQUIRED_VER, " Found:", env['CXXVERSION']
Exit(2)
- print "CCERVSION", env['CCVERSION']
- print "CXXERVSION", env['CXXVERSION']
+ print "CCVERVSION", env['CCVERSION']
+ print "CXXVERVSION", env['CXXVERSION']
env = conf.Finish()
diff --git a/ra_xmpp/test/xmpp_tests.cpp b/ra_xmpp/test/xmpp_tests.cpp
index 3af4cc2..e12ada6 100644
--- a/ra_xmpp/test/xmpp_tests.cpp
+++ b/ra_xmpp/test/xmpp_tests.cpp
@@ -529,7 +529,7 @@ struct SimpleConnection
EXPECT_NE(msg, nullptr);
// Strictly speaking, messageOctets may be 0 for a zero-length message, but
// we are not testing 0-length messages here at the moment.
- EXPECT_GT(messageOctets, 0);
+ EXPECT_GT(messageOctets, 0UL);
if (param && msg)
{
@@ -616,8 +616,8 @@ TEST(ra_xmpp, message_send_receive_test)
// Run the send-receive test for approx. 5 seconds.
this_thread::sleep_for(chrono::seconds(5));
- EXPECT_GT(connection1.messageQueue().size(), 0);
- EXPECT_GT(connection1.sentCalls(), 0);
+ EXPECT_GT(connection1.messageQueue().size(), 0UL);
+ EXPECT_GT(connection1.sentCalls(), 0UL);
for (const auto &s : connection1.messageQueue())
{
@@ -625,8 +625,8 @@ TEST(ra_xmpp, message_send_receive_test)
}
- EXPECT_GT(connection2.messageQueue().size(), 0);
- EXPECT_GT(connection2.sentCalls(), 0);
+ EXPECT_GT(connection2.messageQueue().size(), 0UL);
+ EXPECT_GT(connection2.sentCalls(), 0UL);
for (const auto &s : connection2.messageQueue())
{
diff --git a/src/SConscript.py b/src/SConscript.py
index 3cfaa2d..99eca22 100644
--- a/src/SConscript.py
+++ b/src/SConscript.py
@@ -62,7 +62,6 @@ if target_os not in ['windows', 'winrt']:
'-std=c++11',
'-fdata-sections',
'-ffunction-sections',
- '-flto',
'-fno-rtti',
'-DCCF_XMPP_EXPORTS',
'-DASIO_STANDALONE',
diff --git a/test/bosh_tests.cpp b/test/bosh_tests.cpp
index da2fe38..63e1001 100644
--- a/test/bosh_tests.cpp
+++ b/test/bosh_tests.cpp
@@ -373,7 +373,7 @@ TEST(BOSH, BoshKeyGen)
// Send enough payloads to generate at least one rollover.
const size_t rollover = static_cast<ITestConnectionManager *>
(manager.get())->keyRolloverCount("testsid");
- EXPECT_GT(rollover, 0);
+ EXPECT_GT(rollover, 0UL);
size_t index = rollover * 2;
const string testStr = "<dummypayload/>";
@@ -412,7 +412,7 @@ TEST(BOSH, BoshClientInactivity)
// in this 3 second interval from the dummy server.
this_thread::sleep_for(chrono::seconds(3));
- EXPECT_GT(simServer->bodyCount(), 1);
+ EXPECT_GT(simServer->bodyCount(), 1UL);
EXPECT_TRUE(simServer->clientWasWellBehaved());
}
diff --git a/test/common_tests.cpp b/test/common_tests.cpp
index 97f979f..f658963 100644
--- a/test/common_tests.cpp
+++ b/test/common_tests.cpp
@@ -390,13 +390,13 @@ TEST(BufferEncrypt, SecureBuffer_Constructor_And_Assignment)
0);
ASSERT_EQ((const void *)testBuffer1, testBuffer1.cursor());
- EXPECT_EQ(testBuffer1.position(), 0);
+ EXPECT_EQ(testBuffer1.position(), 0UL);
char tempBuff[sizeof(memBlock)];
EXPECT_EQ(testBuffer1.read(tempBuff, sizeof(tempBuff)), sizeof(tempBuff));
EXPECT_EQ(testBuffer1.position(), sizeof(tempBuff));
EXPECT_TRUE(testBuffer1.seek(0));
ASSERT_EQ((const void *)testBuffer1, testBuffer1.cursor());
- EXPECT_EQ(testBuffer1.position(), 0);
+ EXPECT_EQ(testBuffer1.position(), 0UL);
ByteBuffer testBuffer2(testBuffer1);
EXPECT_EQ(testBuffer2, testBuffer1);
@@ -635,8 +635,8 @@ TEST(BufferEncrypt, SecureBuffer_Base64_Encode)
size_t inLen = string(testPairs[i]._inStr).size();
size_t outLen = string(testPairs[i]._outStr).size();
- EXPECT_GT(inLen, 0);
- EXPECT_GT(outLen, 0);
+ EXPECT_GT(inLen, 0UL);
+ EXPECT_GT(outLen, 0UL);
SecureBuffer inBuf(testPairs[i]._inStr, inLen), outBuf;
EXPECT_EQ(inBuf.size(), (size_t)inLen);
@@ -714,8 +714,8 @@ TEST(BufferEncrypt, SecureBuffer_Base64_Decode)
size_t inLen = string(testPairs[i]._inStr).size();
size_t outLen = string(testPairs[i]._outStr).size();
- EXPECT_GT(inLen, 0);
- EXPECT_GT(outLen, 0);
+ EXPECT_GT(inLen, 0UL);
+ EXPECT_GT(outLen, 0UL);
SecureBuffer inBuf(testPairs[i]._inStr, inLen), outBuf;
EXPECT_EQ(inBuf.size(), (size_t)inLen);
@@ -786,19 +786,19 @@ TEST(BufferEncrypt, SecureBuffer_BufferOverrunTest)
TEST(BufferEncrypt, SecureBuffer_FromString)
{
SecureBuffer bufFromEmpty(string(""));
- EXPECT_EQ(bufFromEmpty.size(), 0);
+ EXPECT_EQ(bufFromEmpty.size(), 0UL);
SecureBuffer bufNullTerminatedFromEmpty(string(""), SecureBuffer::NullTerminator::IncludeNull);
- EXPECT_EQ(bufNullTerminatedFromEmpty.size(), 1);
+ EXPECT_EQ(bufNullTerminatedFromEmpty.size(), 1UL);
SecureBuffer bufFromString(string("THIS IS A TEST"));
- EXPECT_EQ(bufFromString.size(), 14);
- ASSERT_GT(bufFromString.size(), 1);
+ EXPECT_EQ(bufFromString.size(), 14UL);
+ ASSERT_GT(bufFromString.size(), 1UL);
EXPECT_EQ(bufFromString[0], 'T');
SecureBuffer bufNullTerminatedFromString(string("THIS IS A TEST"),
SecureBuffer::NullTerminator::IncludeNull);
- ASSERT_EQ(bufNullTerminatedFromString.size(), 15);
+ ASSERT_EQ(bufNullTerminatedFromString.size(), 15UL);
EXPECT_EQ(bufNullTerminatedFromString[0], 'T');
EXPECT_EQ(bufNullTerminatedFromString[14], '\0');
@@ -888,7 +888,7 @@ TEST(STCQueue, Queue_Tests)
{
this_thread::sleep_for(chrono::milliseconds(1));
++cycleCount;
- ASSERT_LT(cycleCount, 5000);
+ ASSERT_LT(cycleCount, 5000UL);
}
threadQueue.close();
@@ -1042,7 +1042,7 @@ TEST(Str_Helpers, UTF8ToUTF32)
size_t inLength = nextOut - &tempBuffer[0];
- ASSERT_GT(inLength, 0);
+ ASSERT_GT(inLength, 0UL);
size_t consumed = 0;
ASSERT_EQ(convertChar, c);
@@ -1241,13 +1241,13 @@ TEST(Log_Stream, MultiThread_Log_Callback)
TEST(RandomBuffer, Rand_Buffer)
{
RandomBuffer emptyBuf(0);
- EXPECT_EQ(emptyBuf.size(), 0);
+ EXPECT_EQ(emptyBuf.size(), 0UL);
RandomBuffer someBuf(4096);
- EXPECT_EQ(someBuf.size(), 4096);
+ EXPECT_EQ(someBuf.size(), 4096UL);
RandomBuffer someBuf2(4096);
- EXPECT_EQ(someBuf2.size(), 4096);
+ EXPECT_EQ(someBuf2.size(), 4096UL);
// NOTE: There is a very small chance that these two buffers will actually be the same,
// presuming hardware random-numer generation. If this fails for you here and the code
@@ -1462,8 +1462,8 @@ TEST(AsyncNotifier_Tests, NotifyAsyncFunc)
auto testCallback = [](NotifierTestEvent & e) { e.incrementUseCount(); };
typedef Iotivity::NotifyAsyncFunc<NotifierTestEvent, decltype(testCallback)> FuncNotify;
- EXPECT_EQ(NotifierTestEvent::useCount(), 0);
- EXPECT_EQ(NotifierTestEvent::destructorCount(), 0);
+ EXPECT_EQ(NotifierTestEvent::useCount(), 0UL);
+ EXPECT_EQ(NotifierTestEvent::destructorCount(), 0UL);
FuncNotify::Ptr newCondition(new FuncNotify(testCallback));
ASSERT_NE(newCondition, nullptr);
@@ -1473,16 +1473,16 @@ TEST(AsyncNotifier_Tests, NotifyAsyncFunc)
newCondition->notify(testEventNoThrow);
- EXPECT_EQ(NotifierTestEvent::useCount(), 1);
- EXPECT_EQ(NotifierTestEvent::destructorCount(), 1);
+ EXPECT_EQ(NotifierTestEvent::useCount(), 1UL);
+ EXPECT_EQ(NotifierTestEvent::destructorCount(), 1UL);
NotifierTestEvent *testEventThrow(new NotifierTestEvent(true));
ASSERT_NE(testEventThrow, nullptr);
EXPECT_THROW(newCondition->notify(testEventThrow), std::runtime_error);
- EXPECT_EQ(NotifierTestEvent::useCount(), 1);
- EXPECT_EQ(NotifierTestEvent::destructorCount(), 2);
+ EXPECT_EQ(NotifierTestEvent::useCount(), 1UL);
+ EXPECT_EQ(NotifierTestEvent::destructorCount(), 2UL);
}
@@ -1510,8 +1510,8 @@ TEST(SyncNotifier_Tests, NotifySyncFunc)
auto testCallback = [](NotifierTestEvent & e) { e.incrementUseCount(); };
typedef Iotivity::NotifySyncFunc<NotifierTestEvent, decltype(testCallback)> FuncNotify;
- EXPECT_EQ(NotifierTestEvent::useCount(), 0);
- EXPECT_EQ(NotifierTestEvent::destructorCount(), 0);
+ EXPECT_EQ(NotifierTestEvent::useCount(), 0UL);
+ EXPECT_EQ(NotifierTestEvent::destructorCount(), 0UL);
FuncNotify::Ptr newCondition(new FuncNotify(testCallback));
ASSERT_NE(newCondition, nullptr);
@@ -1522,8 +1522,8 @@ TEST(SyncNotifier_Tests, NotifySyncFunc)
newCondition->notify(testEventNoThrow);
}
- EXPECT_EQ(NotifierTestEvent::useCount(), 1);
- EXPECT_EQ(NotifierTestEvent::destructorCount(), 1);
+ EXPECT_EQ(NotifierTestEvent::useCount(), 1UL);
+ EXPECT_EQ(NotifierTestEvent::destructorCount(), 1UL);
{
NotifierTestEvent testEventThrow(true);
@@ -1531,8 +1531,8 @@ TEST(SyncNotifier_Tests, NotifySyncFunc)
EXPECT_THROW(newCondition->notify(testEventThrow), std::runtime_error);
}
- EXPECT_EQ(NotifierTestEvent::useCount(), 1);
- EXPECT_EQ(NotifierTestEvent::destructorCount(), 2);
+ EXPECT_EQ(NotifierTestEvent::useCount(), 1UL);
+ EXPECT_EQ(NotifierTestEvent::destructorCount(), 2UL);
}
diff --git a/test/portabledom_tests.cpp b/test/portabledom_tests.cpp
index f472430..7f7c6ca 100644
--- a/test/portabledom_tests.cpp
+++ b/test/portabledom_tests.cpp
@@ -253,7 +253,7 @@ TEST(portableDOM_Tests, XMLElement_selectNodes)
ASSERT_NE(node, nullptr);
++counter;
}
- EXPECT_EQ(counter, 3);
+ EXPECT_EQ(counter, 3UL);
size_t counter2 = 0;
for (const auto &node : documentElement->nodes())
@@ -261,7 +261,7 @@ TEST(portableDOM_Tests, XMLElement_selectNodes)
ASSERT_NE(node, nullptr);
++counter2;
}
- EXPECT_EQ(counter2, 6);
+ EXPECT_EQ(counter2, 6UL);
size_t counter3 = 0;
for (const auto &element : documentElement->elements())
@@ -269,7 +269,7 @@ TEST(portableDOM_Tests, XMLElement_selectNodes)
ASSERT_NE(element, nullptr);
++counter3;
}
- EXPECT_EQ(counter3, 5);
+ EXPECT_EQ(counter3, 5UL);
}
@@ -406,7 +406,7 @@ TEST(portableDOM_Tests, Streaming_Parser_Continuations)
size_t bytesRead = doc->parsePartial(payload.substr(totalBytesRead), node);
ASSERT_NE(node, nullptr);
- EXPECT_NE(bytesRead, 0);
+ EXPECT_NE(bytesRead, 0UL);
totalBytesRead += bytesRead;
++totalPayloads;
@@ -417,7 +417,7 @@ TEST(portableDOM_Tests, Streaming_Parser_Continuations)
}
}
while (totalBytesRead < payload.size());
- EXPECT_EQ(totalPayloads, 5);
+ EXPECT_EQ(totalPayloads, 5UL);
}
TEST(portableDOM_Tests, Streaming_Parser_Continuations_ByteBuffer)
@@ -443,7 +443,7 @@ TEST(portableDOM_Tests, Streaming_Parser_Continuations_ByteBuffer)
bytesRead = doc->parsePartial(payloadRef.slice(totalBytesRead), node);
ASSERT_NE(node, nullptr);
- EXPECT_NE(bytesRead, 0);
+ EXPECT_NE(bytesRead, 0UL);
totalBytesRead += bytesRead;
++totalPayloads;
@@ -454,7 +454,7 @@ TEST(portableDOM_Tests, Streaming_Parser_Continuations_ByteBuffer)
}
}
while (totalBytesRead < payload.size());
- EXPECT_EQ(totalPayloads, 5);
+ EXPECT_EQ(totalPayloads, 5UL);
}
diff --git a/test/xmpp_compliance_tests.cpp b/test/xmpp_compliance_tests.cpp
index f1603b4..4002b11 100644
--- a/test/xmpp_compliance_tests.cpp
+++ b/test/xmpp_compliance_tests.cpp
@@ -133,7 +133,7 @@ TEST(Xmpp_Compliance, bind_mtn)
auto stream = runner.stream();
ASSERT_NE(stream, nullptr);
JabberID boundID = stream->boundResource();
- ASSERT_GT(boundID.full().size(), 0);
+ ASSERT_GT(boundID.full().size(), 0UL);
// It is not clear whether the compliance to bind-mtn requires that stanzas be limited
// if binding does not complete. That is in constrast with the behavior of extensions like
diff --git a/test/xmpp_dummy_server.cpp b/test/xmpp_dummy_server.cpp
index 9316f37..1535b8d 100644
--- a/test/xmpp_dummy_server.cpp
+++ b/test/xmpp_dummy_server.cpp
@@ -377,7 +377,7 @@ void SegmentRunner::run(const SegmentArray &segments)
remoteTcp->closed().wait();
}
- EXPECT_EQ(remoteTcp->expressionMatchFailures(), 0);
+ EXPECT_EQ(remoteTcp->expressionMatchFailures(), 0UL);
m_captures = remoteTcp->captures();
}
diff --git a/test/xmpp_tests.cpp b/test/xmpp_tests.cpp
index 677e203..d394939 100644
--- a/test/xmpp_tests.cpp
+++ b/test/xmpp_tests.cpp
@@ -735,7 +735,7 @@ TEST(XmppClient, XMPP_StreamParseTests)
EXPECT_NO_THROW(xmppStream->close());
remoteTcp->closed().wait();
- EXPECT_EQ(remoteTcp->expressionMatchFailures(), 0);
+ EXPECT_EQ(remoteTcp->expressionMatchFailures(), 0UL);
}
}
catch (const connect_error &ce)
@@ -1222,7 +1222,7 @@ TEST(XmppClient, XMPP_Sasl_Prep)
str_helper::utf32ToUtf8(*nextIn++, &tempBuffer[0],
sizeof(tempBuffer) / sizeof(tempBuffer[0]), charsWritten);
- ASSERT_NE(charsWritten, 0);
+ ASSERT_NE(charsWritten, 0UL);
initialStr += string(&tempBuffer[0], charsWritten);
}