From: Philippe Coval Date: Thu, 20 Jul 2017 11:17:59 +0000 (+0200) Subject: coap-http-proxy: cast size_t type in test X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=244316c9f043dbcd641b73f2fd8a3f033ad6088c;p=platform%2Fupstream%2Fiotivity.git coap-http-proxy: cast size_t type in test Suppress a warning using clang-3.5 CoAPHttpUnitTest.cpp:277:60: error: \ non-constant-expression cannot be narrowed from \ type 'unsigned long' to 'uint16_t' (aka 'unsigned short') \ in initializer list [-Wc++11-narrowing] Change-Id: I8c740970a536a3bbc0d3d6d16cd4fe1dc81df6be Signed-off-by: Philippe Coval Reviewed-on: https://gerrit.iotivity.org/gerrit/21563 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai (cherry picked from commit a7468c261b3f59090ad49d09c690be45b94c8f9c) --- diff --git a/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp b/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp index 51e3872c2..6b1628a1c 100644 --- a/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp +++ b/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp @@ -274,8 +274,9 @@ TEST_F(CoApHttpTest, CHPGetHttpMethod) TEST_F(CoApHttpTest, CHPGetHttpOption) { - OCHeaderOption ocOp = {OC_COAP_ID, COAP_OPTION_ACCEPT, strlen(CBOR_CONTENT_TYPE) + 1, - (uint8_t *)CBOR_CONTENT_TYPE}; + OCHeaderOption ocOp = {OC_COAP_ID, COAP_OPTION_ACCEPT, + (uint16_t)(strlen(CBOR_CONTENT_TYPE) + 1), + (uint8_t *)CBOR_CONTENT_TYPE}; HttpHeaderOption_t *httpOp; EXPECT_NE(OC_STACK_OK, (CHPGetHttpOption(NULL, NULL)));