[IOT-2539] Clean sign-compare warnings 99/22199/3
authorGeorge Nash <george.nash@intel.com>
Mon, 31 Jul 2017 21:12:13 +0000 (14:12 -0700)
committerGeorge Nash <george.nash@intel.com>
Tue, 29 Aug 2017 15:39:22 +0000 (15:39 +0000)
commit0b6958b98af17ae264fa6814dbd3df9ee95ca6ea
treeb3b706315b9ea167df23f4cea1b08cc0fd9079f4
parent9fa87391050797e5bebba6204083e1f157a0949e
[IOT-2539] Clean sign-compare warnings

It is common to do a compair with a const value in unit
tests. For example EXPECT_EQ(3, value).  If `value` is an
unsigned type this will produce the sign-compare compiler
warning. The compiler defaults to treating constant
numbers as a signed data type.  Adding a sufix u (i.e. 3u)
will tell the compiler to treat the constant as an
unsigned data type.

In other cases the type is cast to an unsigned or signed
value before the comparison.

In aclresourcetest.cpp the return type for GetNumberOfResource
function was updated to return size_t since in all the test
conditions it is compared with variable of size_t or a
constant number.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I7e47bfb9f027304abd975eb0d8e577cbd484545a
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21689
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 65cc1e5d3b263c13fd6d784303d8e3640c88ef56)
resource/csdk/connectivity/test/caprotocolmessagetest.cpp
resource/csdk/connectivity/test/ssladapter_test.cpp
resource/csdk/security/unittest/aclresourcetest.cpp
resource/csdk/security/unittest/base64tests.cpp
resource/csdk/stack/test/cbortests.cpp