IOT-1583: Removing /W3 warnings inside connectivity/ (part 3)
authorPawel Winogrodzki <pawelwi@microsoft.com>
Tue, 28 Feb 2017 02:47:30 +0000 (18:47 -0800)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Fri, 10 Mar 2017 00:15:11 +0000 (00:15 +0000)
Removing the /W3 warnings in order to add the /WX option to prevent new
ones from being added inside the resource/csdk/connectivity/ directory.

Change-Id: Ie1bce977c027e985cd5ba14458d2026b5d391d4f
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17549
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
23 files changed:
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.h
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrutils.c
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrutils.h
resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrutils.c
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c
resource/csdk/connectivity/src/bt_le_adapter/android/caleserver.c
resource/csdk/connectivity/src/bt_le_adapter/android/calestate.c
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c
resource/csdk/connectivity/src/nfc_adapter/canfcadapter.c
resource/csdk/connectivity/src/ra_adapter/caraadapter.c
resource/csdk/connectivity/test/SConscript
resource/csdk/connectivity/test/cablocktransfertest.cpp
resource/csdk/connectivity/test/caprotocolmessagetest.cpp
resource/csdk/connectivity/test/octhread_tests.cpp
resource/csdk/connectivity/test/ssladapter_test.cpp
resource/csdk/connectivity/test/uarraylist_test.cpp
resource/csdk/connectivity/test/ulinklist_test.cpp
resource/csdk/connectivity/util/src/camanager/capolicymanager.c
resource/csdk/connectivity/util/src/cautilinterface.c

index e3a0a2a..770cd70 100644 (file)
@@ -157,10 +157,10 @@ static void CAReceiveHandler(void *data)
 
         // if new socket object is added in socket list after below logic is ran.
         // new socket will be started to read after next while loop
-        uint32_t length = CAEDRGetSocketListLength();
+        size_t length = CAEDRGetSocketListLength();
         if (0 != length)
         {
-            for (uint32_t idx = 0; idx < length; idx++)
+            for (size_t idx = 0; idx < length; idx++)
             {
                 CAEDRNativeReadData(env, idx);
             }
@@ -597,7 +597,7 @@ CAResult_t CAEDRStopReceiveThread()
     return CA_STATUS_OK;
 }
 
-CAResult_t CAEDRNativeReadData(JNIEnv *env, uint32_t idx)
+CAResult_t CAEDRNativeReadData(JNIEnv *env, size_t idx)
 {
     if ((*env)->ExceptionCheck(env))
     {
index 483c90a..6d16649 100644 (file)
@@ -68,7 +68,7 @@ CAResult_t CAEDRStopReceiveThread();
  * @param[in]  id               index of remote address.
  * @return ::CA_STATUS_OK or Appropriate error code.
  */
-CAResult_t CAEDRNativeReadData(JNIEnv *env, uint32_t id);
+CAResult_t CAEDRNativeReadData(JNIEnv *env, size_t id);
 
 /**
  * Start Listen Task.
index 6dc604d..128d963 100644 (file)
@@ -788,7 +788,7 @@ void CAEDRNativeRemoveDeviceSocketBaseAddr(JNIEnv *env, jstring address)
     return;
 }
 
-jobject CAEDRNativeGetDeviceSocket(uint32_t index)
+jobject CAEDRNativeGetDeviceSocket(size_t index)
 {
     if (!g_deviceObjectList)
     {
@@ -864,7 +864,7 @@ jobject CAEDRNativeGetDeviceSocketBaseAddr(JNIEnv *env, const char* remoteAddres
     return NULL;
 }
 
-jobject CAEDRNativeGetInputStream(uint32_t index)
+jobject CAEDRNativeGetInputStream(size_t index)
 {
     if (!g_deviceObjectList)
     {
@@ -889,7 +889,7 @@ jobject CAEDRNativeGetInputStream(uint32_t index)
     return jarrayObj;
 }
 
-uint32_t CAEDRGetSocketListLength()
+size_t CAEDRGetSocketListLength()
 {
     if (!g_deviceObjectList)
     {
index 6b83897..dfb741e 100644 (file)
@@ -182,7 +182,7 @@ void CAEDRNativeRemoveDeviceSocketBaseAddr(JNIEnv *env, jstring address);
  * @param[in]  index            index of device list.
  * @return Device socket object or NULL.
  */
-jobject CAEDRNativeGetDeviceSocket(uint32_t index);
+jobject CAEDRNativeGetDeviceSocket(size_t index);
 
 /**
  * Get device socket address.
@@ -197,13 +197,13 @@ jobject CAEDRNativeGetDeviceSocketBaseAddr(JNIEnv *env, const char* remoteAddres
  * @param[in]   index           index of device list.
  * @return Input stream object or NULL.
  */
-jobject CAEDRNativeGetInputStream(uint32_t index);
+jobject CAEDRNativeGetInputStream(size_t index);
 
 /**
  * Get length of device socket list.
  * @return length of list.
  */
-uint32_t CAEDRGetSocketListLength();
+size_t CAEDRGetSocketListLength();
 
 /**
  * Get device information from list.
index a905e2f..cdff8ba 100644 (file)
@@ -326,7 +326,7 @@ int32_t CASendEDRMulticastData(const CAEndpoint_t *endpoint, const void *data, u
     return sentLen;
 }
 
-CAResult_t CAGetEDRInterfaceInformation(CAEndpoint_t **info, uint32_t *size)
+CAResult_t CAGetEDRInterfaceInformation(CAEndpoint_t **info, size_t *size)
 {
     VERIFY_NON_NULL(info, TAG, "LocalConnectivity info is null");
 
index 0173190..54e0df9 100644 (file)
@@ -319,8 +319,8 @@ void CAEDRDeviceDiscoveryCallback(int result, bt_adapter_device_discovery_state_
                         return;
                     }
 
-                    int lengthData = u_arraylist_length(g_multicastDataList);
-                    for(int len = 0; len < lengthData; len++)
+                    size_t lengthData = u_arraylist_length(g_multicastDataList);
+                    for(size_t len = 0; len < lengthData; len++)
                     {
                         // Adding to pending list
                         EDRData *multicastData =
index 72df325..3b9ac6f 100644 (file)
@@ -70,8 +70,8 @@ CAConnectedDeviceInfo_t *CAEDRGetDeviceInfoFromAddress(const char *remoteAddress
         return NULL;
     }
 
-    uint32_t length = u_arraylist_length(g_deviceStateList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_deviceStateList);
+    for (size_t index = 0; index < length; index++)
     {
         CAConnectedDeviceInfo_t* deviceInfo =
                 (CAConnectedDeviceInfo_t*) u_arraylist_get(g_deviceStateList, index);
index 2f29cc6..ccf2a18 100644 (file)
@@ -919,8 +919,8 @@ CAResult_t CALEClientSendUnicastMessageImpl(const char* address, const uint8_t*
 
     if (g_context && g_deviceList)
     {
-        uint32_t length = u_arraylist_length(g_deviceList);
-        for (uint32_t index = 0; index < length; index++)
+        size_t length = u_arraylist_length(g_deviceList);
+        for (size_t index = 0; index < length; index++)
         {
             jobject jarrayObj = (jobject) u_arraylist_get(g_deviceList, index);
             if (!jarrayObj)
@@ -1080,14 +1080,14 @@ CAResult_t CALEClientSendMulticastMessageImpl(JNIEnv *env, const uint8_t* data,
         goto error_exit;
     }
 
-    uint32_t length = u_arraylist_length(g_deviceList);
+    size_t length = u_arraylist_length(g_deviceList);
     g_targetCnt = length;
 
     jbyteArray jni_arr = (*env)->NewByteArray(env, dataLen);
     (*env)->SetByteArrayRegion(env, jni_arr, 0, dataLen, (jbyte*) data);
     g_sendBuffer = (jbyteArray)(*env)->NewGlobalRef(env, jni_arr);
 
-    for (uint32_t index = 0; index < length; index++)
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_deviceList, index);
         if (!jarrayObj)
@@ -2645,9 +2645,9 @@ CAResult_t CALEClientDisconnectAll(JNIEnv *env)
         return CA_STATUS_OK;
     }
 
-    uint32_t length = u_arraylist_length(g_gattObjectList);
+    size_t length = u_arraylist_length(g_gattObjectList);
     OIC_LOG_V(DEBUG, TAG, "list length : %d", length);
-    for (uint32_t index = 0; index < length; index++)
+    for (size_t index = 0; index < length; index++)
     {
         OIC_LOG(DEBUG, TAG, "start CALEClientDisconnectAll");
         jobject jarrayObj = (jobject) u_arraylist_get(g_gattObjectList, index);
@@ -2686,8 +2686,8 @@ CAResult_t CALEClientDisconnectforAddress(JNIEnv *env, jstring remote_address)
         return CA_STATUS_FAILED;
     }
 
-    uint32_t length = u_arraylist_length(g_gattObjectList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_gattObjectList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_gattObjectList, index);
         if (!jarrayObj)
@@ -3566,8 +3566,8 @@ bool CALEClientIsDeviceInScanDeviceList(JNIEnv *env, const char* remoteAddress)
         return true;
     }
 
-    uint32_t length = u_arraylist_length(g_deviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_deviceList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_deviceList, index);
         if (!jarrayObj)
@@ -3620,8 +3620,8 @@ CAResult_t CALEClientRemoveAllScanDevices(JNIEnv *env)
         return CA_STATUS_FAILED;
     }
 
-    uint32_t length = u_arraylist_length(g_deviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_deviceList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_deviceList, index);
         if (!jarrayObj)
@@ -3655,8 +3655,8 @@ CAResult_t CALEClientRemoveDeviceInScanDeviceList(JNIEnv *env, jstring address)
         return CA_STATUS_FAILED;
     }
 
-    uint32_t length = u_arraylist_length(g_deviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_deviceList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_deviceList, index);
         if (!jarrayObj)
@@ -3776,8 +3776,8 @@ bool CALEClientIsGattObjInList(JNIEnv *env, const char* remoteAddress)
     VERIFY_NON_NULL(env, TAG, "env is null");
     VERIFY_NON_NULL_RET(remoteAddress, TAG, "remoteAddress is null", true);
 
-    uint32_t length = u_arraylist_length(g_gattObjectList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_gattObjectList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_gattObjectList, index);
         if (!jarrayObj)
@@ -3824,8 +3824,8 @@ jobject CALEClientGetGattObjInList(JNIEnv *env, const char* remoteAddress)
     VERIFY_NON_NULL_RET(remoteAddress, TAG, "remoteAddress is null", NULL);
 
     oc_mutex_lock(g_gattObjectMutex);
-    uint32_t length = u_arraylist_length(g_gattObjectList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_gattObjectList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_gattObjectList, index);
         if (!jarrayObj)
@@ -3882,8 +3882,8 @@ CAResult_t CALEClientRemoveAllGattObjs(JNIEnv *env)
         return CA_STATUS_OK;
     }
 
-    uint32_t length = u_arraylist_length(g_gattObjectList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_gattObjectList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_gattObjectList, index);
         if (!jarrayObj)
@@ -3916,8 +3916,8 @@ CAResult_t CALEClientRemoveGattObj(JNIEnv *env, jobject gatt)
         return CA_STATUS_OK;
     }
 
-    uint32_t length = u_arraylist_length(g_gattObjectList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_gattObjectList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_gattObjectList, index);
         if (!jarrayObj)
@@ -4003,8 +4003,8 @@ CAResult_t CALEClientRemoveGattObjForAddr(JNIEnv *env, jstring addr)
         return CA_STATUS_OK;
     }
 
-    uint32_t length = u_arraylist_length(g_gattObjectList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_gattObjectList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_gattObjectList, index);
         if (!jarrayObj)
index 3cbb821..91eeef9 100644 (file)
@@ -1425,8 +1425,8 @@ CAResult_t CALEServerDisconnectAllDevices(JNIEnv *env)
         return CA_STATUS_FAILED;
     }
 
-    uint32_t length = u_arraylist_length(g_connectedDeviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_connectedDeviceList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_connectedDeviceList, index);
         if (!jarrayObj)
@@ -1873,8 +1873,8 @@ CAResult_t CALEServerSendUnicastMessageImpl(JNIEnv *env, const char* address, co
 
     oc_mutex_lock(g_threadSendMutex);
 
-    uint32_t length = u_arraylist_length(g_connectedDeviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_connectedDeviceList);
+    for (size_t index = 0; index < length; index++)
     {
         OIC_LOG(DEBUG, TAG, "check device address");
         jobject jarrayObj = (jobject) u_arraylist_get(g_connectedDeviceList, index);
@@ -1997,8 +1997,8 @@ CAResult_t CALEServerSendMulticastMessageImpl(JNIEnv *env, const uint8_t *data,
     g_sendBuffer = (jbyteArray)(*env)->NewGlobalRef(env, jni_arr);
     CACheckJNIException(env);
 
-    uint32_t length = u_arraylist_length(g_connectedDeviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_connectedDeviceList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_connectedDeviceList, index);
         if (!jarrayObj)
@@ -2098,8 +2098,8 @@ bool CALEServerIsDeviceInList(JNIEnv *env, const char* remoteAddress)
         return false;
     }
 
-    uint32_t length = u_arraylist_length(g_connectedDeviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_connectedDeviceList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_connectedDeviceList, index);
 
@@ -2197,8 +2197,8 @@ CAResult_t CALEServerRemoveAllDevices(JNIEnv *env)
         return CA_STATUS_FAILED;
     }
 
-    uint32_t length = u_arraylist_length(g_connectedDeviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_connectedDeviceList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_connectedDeviceList, index);
         if (jarrayObj)
@@ -2229,8 +2229,8 @@ CAResult_t CALEServerRemoveDevice(JNIEnv *env, jstring address)
         return CA_STATUS_FAILED;
     }
 
-    uint32_t length = u_arraylist_length(g_connectedDeviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(g_connectedDeviceList);
+    for (size_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_connectedDeviceList, index);
 
index c1b7101..1b83c32 100644 (file)
@@ -122,8 +122,8 @@ bool CALEIsDeviceInList(const char* remoteAddress,
     VERIFY_NON_NULL_RET(remoteAddress, TAG, "remoteAddress is null", false);
     VERIFY_NON_NULL_RET(deviceList, TAG, "deviceList is null", false);
 
-    uint32_t length = u_arraylist_length(deviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(deviceList);
+    for (size_t index = 0; index < length; index++)
     {
         CALEState_t* state = (CALEState_t*) u_arraylist_get(deviceList, index);
         if (!state)
@@ -153,8 +153,8 @@ CAResult_t CALERemoveAllDeviceState(u_arraylist_t *deviceList,
     VERIFY_NON_NULL(deviceList, TAG, "deviceList is null");
 
     oc_mutex_lock(deviceListMutex);
-    uint32_t length = u_arraylist_length(deviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(deviceList);
+    for (size_t index = 0; index < length; index++)
     {
         CALEState_t* state = (CALEState_t*) u_arraylist_get(deviceList, index);
         if (!state)
@@ -204,8 +204,8 @@ CAResult_t CALERemoveDeviceState(const char* remoteAddress,
     VERIFY_NON_NULL(remoteAddress, TAG, "remoteAddress is null");
     VERIFY_NON_NULL(deviceList, TAG, "deviceList is null");
 
-    uint32_t length = u_arraylist_length(deviceList);
-    for (uint32_t index = 0; index < length; index++)
+    size_t length = u_arraylist_length(deviceList);
+    for (size_t index = 0; index < length; index++)
     {
         CALEState_t* state = (CALEState_t*) u_arraylist_get(deviceList, index);
         if (!state)
@@ -239,9 +239,9 @@ CALEState_t* CALEGetStateInfo(const char* remoteAddress,
     VERIFY_NON_NULL_RET(remoteAddress, TAG, "remoteAddress is null", NULL);
     VERIFY_NON_NULL_RET(deviceList, TAG, "deviceList is null", NULL);
 
-    uint32_t length = u_arraylist_length(deviceList);
+    size_t length = u_arraylist_length(deviceList);
 
-    for (uint32_t index = 0; index < length; index++)
+    for (size_t index = 0; index < length; index++)
     {
         CALEState_t* state = (CALEState_t*) u_arraylist_get(deviceList, index);
         if (!state)
@@ -254,7 +254,7 @@ CALEState_t* CALEGetStateInfo(const char* remoteAddress,
         {
             return state;
         }
-        OIC_LOG_V(DEBUG, TAG, "state addr[%s, %d]", state->address, index);
+        OIC_LOG_V(DEBUG, TAG, "state addr[%s, %" PRIuPTR "]", state->address, index);
     }
 
     OIC_LOG_V(DEBUG, TAG, "[%s] doesn't exist in deviceStateList", remoteAddress, length);
index a7b82fd..596209d 100644 (file)
@@ -560,7 +560,7 @@ static CAResult_t CALEGetSenderInfo(const char *leAddress,
                                     const uint16_t port,
                                     u_arraylist_t *senderInfoList,
                                     CABLESenderInfo_t **senderInfo,
-                                    uint32_t *senderIndex);
+                                    size_t *senderIndex);
 
 /**
  * get ports related to remote address. It is need because multi application
@@ -857,7 +857,7 @@ static CAResult_t CALEGetSenderInfo(const char *leAddress,
                                     const uint16_t port,
                                     u_arraylist_t *senderInfoList,
                                     CABLESenderInfo_t **senderInfo,
-                                    uint32_t *senderIndex)
+                                    size_t *senderIndex)
 {
     VERIFY_NON_NULL_RET(leAddress,
                         CALEADAPTER_TAG,
@@ -868,9 +868,9 @@ static CAResult_t CALEGetSenderInfo(const char *leAddress,
                         "NULL index argument",
                         CA_STATUS_INVALID_PARAM);
 
-    const uint32_t listLength = u_arraylist_length(senderInfoList);
-    const uint32_t addrLength = strlen(leAddress);
-    for (uint32_t index = 0; index < listLength; index++)
+    const size_t listLength = u_arraylist_length(senderInfoList);
+    const size_t addrLength = strlen(leAddress);
+    for (size_t index = 0; index < listLength; index++)
     {
         CABLESenderInfo_t *info = (CABLESenderInfo_t *) u_arraylist_get(senderInfoList, index);
         if (!info || !(info->remoteEndpoint))
@@ -944,7 +944,7 @@ static void CALEDataReceiverHandler(void *threadData, CABLEAdapter_t receiverTyp
         }
 
         CABLESenderInfo_t *senderInfo = NULL;
-        uint32_t senderIndex = 0;
+        size_t senderIndex = 0;
 
         //packet parsing
         CABLEPacketStart_t startFlag = CA_BLE_PACKET_NOT_START;
@@ -1032,7 +1032,7 @@ static void CALEDataReceiverHandler(void *threadData, CABLEAdapter_t receiverTyp
                 bleData->dataLen - (CA_BLE_HEADER_SIZE + CA_BLE_LENGTH_HEADER_SIZE);
             OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "Total data to be accumulated [%u] bytes",
                       newSender->totalDataLen);
-            OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "data received in the first packet [%zu] bytes",
+            OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "data received in the first packet [%" PRIuPTR "] bytes",
                       dataOnlyLen);
 
             newSender->defragData = OICCalloc(newSender->totalDataLen + 1,
@@ -1106,7 +1106,7 @@ static void CALEDataReceiverHandler(void *threadData, CABLEAdapter_t receiverTyp
             if (senderInfo->recvDataLen + dataOnlyLen > senderInfo->totalDataLen)
             {
                 OIC_LOG_V(ERROR, CALEADAPTER_TAG,
-                          "Data Length exceeding error!! Receiving [%zu] total length [%u]",
+                          "Data Length exceeding error!! Receiving [%" PRIuPTR "] total length [%u]",
                           senderInfo->recvDataLen + dataOnlyLen, senderInfo->totalDataLen);
                 u_arraylist_remove(bleData->senderInfo, senderIndex);
                 OICFree(senderInfo->defragData);
@@ -1114,7 +1114,7 @@ static void CALEDataReceiverHandler(void *threadData, CABLEAdapter_t receiverTyp
                 oc_mutex_unlock(bleReceiveDataMutex);
                 return;
             }
-            OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "Copying the data of length [%zu]",
+            OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "Copying the data of length [%" PRIuPTR "]",
                       dataOnlyLen);
             memcpy(senderInfo->defragData + senderInfo->recvDataLen,
                    bleData->data + CA_BLE_HEADER_SIZE,
@@ -1237,12 +1237,12 @@ static void CALEServerSendDataThread(void *threadData)
     }
 
     OIC_LOG_V(DEBUG, CALEADAPTER_TAG,
-              "Packet info: data size[%d] midPacketCount[%u] remainingLen[%zu] totalLength[%zu]",
+              "Packet info: data size[%d] midPacketCount[%u] remainingLen[%" PRIuPTR "] totalLength[%" PRIuPTR "]",
               bleData->dataLen, midPacketCount, remainingLen, totalLength);
 
     OIC_LOG_V(DEBUG,
               CALEADAPTER_TAG,
-              "Server total Data length with header is [%zu]",
+              "Server total Data length with header is [%" PRIuPTR "]",
               totalLength);
 
     uint8_t dataSegment[CA_SUPPORTED_BLE_MTU_SIZE] = {0};
@@ -1434,7 +1434,7 @@ static void CALEServerSendDataThread(void *threadData)
             }
             OIC_LOG_V(DEBUG,
                       CALEADAPTER_TAG,
-                      "Server Sent Unicast Last Data - data length [%zu]",
+                      "Server Sent Unicast Last Data - data length [%" PRIuPTR "]",
                       remainingLen + CA_BLE_HEADER_SIZE);
         }
      }
@@ -1539,7 +1539,7 @@ static void CALEServerSendDataThread(void *threadData)
             }
             OIC_LOG_V(DEBUG,
                       CALEADAPTER_TAG,
-                      "Server Sent Multicast Last Data - data length [%zu]",
+                      "Server Sent Multicast Last Data - data length [%" PRIuPTR "]",
                       remainingLen + CA_BLE_HEADER_SIZE);
         }
 #else
@@ -1613,7 +1613,7 @@ static void CALEClientSendDataThread(void *threadData)
     }
 
     OIC_LOG_V(DEBUG, CALEADAPTER_TAG,
-              "Packet info: data size[%d] midPacketCount[%u] remainingLen[%zu] totalLength[%zu]",
+              "Packet info: data size[%d] midPacketCount[%u] remainingLen[%" PRIuPTR "] totalLength[%" PRIuPTR "]",
               bleData->dataLen, midPacketCount, remainingLen, totalLength);
 
     uint8_t dataSegment[CA_SUPPORTED_BLE_MTU_SIZE] = {0};
@@ -1807,7 +1807,7 @@ static void CALEClientSendDataThread(void *threadData)
             }
             OIC_LOG_V(DEBUG,
                       CALEADAPTER_TAG,
-                      "Client Sent Unicast Last Data - data length [%zu]",
+                      "Client Sent Unicast Last Data - data length [%" PRIuPTR "]",
                       remainingLen + CA_BLE_HEADER_SIZE);
         }
     }
@@ -1915,7 +1915,7 @@ static void CALEClientSendDataThread(void *threadData)
             }
             OIC_LOG_V(DEBUG,
                       CALEADAPTER_TAG,
-                      "Client Sent Multicast Last Data - data length [%zu]",
+                      "Client Sent Multicast Last Data - data length [%" PRIuPTR "]",
                       remainingLen + CA_BLE_HEADER_SIZE);
         }
 #else
@@ -2499,7 +2499,7 @@ static int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint,
  * @return ::CA_STATUS_OK or Appropriate error code.
  */
 static CAResult_t CAGetLEInterfaceInformation(CAEndpoint_t **info,
-                                              uint32_t *size);
+                                              size_t *size);
 
 /**
  * Read Synchronous API callback.
@@ -3253,7 +3253,7 @@ static int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint,
     return dataLen;
 }
 
-static CAResult_t CAGetLEInterfaceInformation(CAEndpoint_t **info, uint32_t *size)
+static CAResult_t CAGetLEInterfaceInformation(CAEndpoint_t **info, size_t *size)
 {
     OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN");
 
@@ -3778,13 +3778,13 @@ static void CALERemoveReceiveQueueData(u_arraylist_t *dataInfoList, const char*
     VERIFY_NON_NULL_VOID(address, CALEADAPTER_TAG, "address");
 
     CABLESenderInfo_t *senderInfo = NULL;
-    uint32_t senderIndex = 0;
+    size_t senderIndex = 0;
 
     u_arraylist_t *portList = u_arraylist_create();
     if (CA_STATUS_OK == CALEGetPortsFromSenderInfo(address, dataInfoList, portList))
     {
-        uint32_t arrayLength = u_arraylist_length(portList);
-        for (uint32_t i = 0; i < arrayLength; i++)
+        size_t arrayLength = u_arraylist_length(portList);
+        for (size_t i = 0; i < arrayLength; i++)
         {
             uint16_t *port = (uint16_t *)u_arraylist_get(portList, i);
             if (!port)
@@ -3825,10 +3825,10 @@ static CAResult_t CALEGetPortsFromSenderInfo(const char *leAddress,
                     CALEADAPTER_TAG,
                     "NULL BLE address argument");
 
-    const uint32_t listLength = u_arraylist_length(senderInfoList);
-    const uint32_t addrLength = strlen(leAddress);
+    const size_t listLength = u_arraylist_length(senderInfoList);
+    const size_t addrLength = strlen(leAddress);
 
-    for (uint32_t index = 0; index < listLength; index++)
+    for (size_t index = 0; index < listLength; index++)
     {
         CABLESenderInfo_t *info = (CABLESenderInfo_t *) u_arraylist_get(senderInfoList, index);
         if (!info || !(info->remoteEndpoint))
index b77d623..6f92699 100644 (file)
@@ -165,8 +165,8 @@ bool CALEIsDeviceDiscovered(const char * address)
     if (g_deviceDiscoveredList)
     {
         oc_mutex_lock(g_deviceDiscoveredListMutex);
-        uint32_t arrayLength = u_arraylist_length(g_deviceDiscoveredList);
-        for (int i = 0; i < arrayLength; i++)
+        size_t arrayLength = u_arraylist_length(g_deviceDiscoveredList);
+        for (size_t i = 0; i < arrayLength; i++)
         {
             char *deviceAddr = u_arraylist_get(g_deviceDiscoveredList, i);
             if (0 == strcasecmp(deviceAddr, address))
@@ -1019,8 +1019,8 @@ CAResult_t CALEGattDiscoverServices(const char *remoteAddress)
     if (g_multicastDataList)
     {
         oc_mutex_lock(g_multicastDataListMutex);
-        uint32_t arrayLength = u_arraylist_length(g_multicastDataList);
-        for (int i = 0; i < arrayLength; i++)
+        size_t arrayLength = u_arraylist_length(g_multicastDataList);
+        for (size_t i = 0; i < arrayLength; i++)
         {
             CALEData_t *multicastData = u_arraylist_get(g_multicastDataList, i);
             if (NULL == multicastData)
index 084fbf3..4d8fc17 100644 (file)
@@ -68,7 +68,7 @@ static CAAdapterChangeCallback g_adapterStateCallback = NULL;
 static CAErrorHandleCallback g_errorCallback = NULL;
 
 static void CANFCPacketReceivedCB(const CASecureEndpoint_t *endpoint, const void *data,
-                                  uint32_t dataLength);
+                                  size_t dataLength);
 #ifndef SINGLE_THREAD
 
 static CAResult_t CANFCInitializeQueueHandles();
@@ -137,7 +137,7 @@ void CANFCConnectionStateCB(const char *nfcAddress, CANetworkStatus_t status)
     (void)status;
 }
 
-void CANFCPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data, uint32_t dataLength)
+void CANFCPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data, size_t dataLength)
 {
     OIC_LOG(DEBUG, TAG, "IN");
 
@@ -160,7 +160,7 @@ void CANFCPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data, uint
     OIC_LOG(DEBUG, TAG, "OUT");
 }
 
-void CANFCErrorHandler(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLength,
+void CANFCErrorHandler(const CAEndpoint_t *endpoint, const void *data, size_t dataLength,
                        CAResult_t result)
 {
     OIC_LOG(DEBUG, TAG, "IN");
@@ -412,7 +412,7 @@ void CANFCDataDestroyer(void *data, uint32_t size)
     (void)size;
 }
 
-CAResult_t CAGetNFCInterfaceInformation(CAEndpoint_t **info, uint32_t *size)
+CAResult_t CAGetNFCInterfaceInformation(CAEndpoint_t **info, size_t *size)
 {
     OIC_LOG(DEBUG, TAG, "CAGetNFCInterfaceInformation not supported");
     if (!info || !size)
index 696d096..141f7c9 100644 (file)
@@ -925,7 +925,7 @@ int32_t CASendRAUnicastData(const CAEndpoint_t *remoteEndpoint, const void *data
     return dataLength;
 }
 
-CAResult_t CAGetRAInterfaceInformation(CAEndpoint_t **info, uint32_t *size)
+CAResult_t CAGetRAInterfaceInformation(CAEndpoint_t **info, size_t *size)
 {
     VERIFY_NON_NULL(info, RA_ADAPTER_TAG, "info is NULL");
     VERIFY_NON_NULL(size, RA_ADAPTER_TAG, "size is NULL");
index 7cb90f6..5132429 100644 (file)
@@ -68,6 +68,8 @@ if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
 
 if target_os not in ['msys_nt', 'windows']:
     catest_env.AppendUnique(LIBS = ['m'])
+else:
+    catest_env.AppendUnique(CCFLAGS=['/W3', '/WX'])
 
 catest_env.AppendUnique(LIBS = ['timer'])
 
index 0c6fae2..5e89e35 100644 (file)
  *
  ******************************************************************/
 
+// Warning disabled globally but VS2013 ignores the /wd4200 option in C++ files.
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#pragma warning(disable : 4200)
+#endif
+
 #include "gtest/gtest.h"
 #include "cainterface.h"
 #include "cautilinterface.h"
 #include "cacommon.h"
-#include "caprotocolmessage.h"
 #include "cablockwisetransfer.h"
 
 #define LARGE_PAYLOAD_LENGTH    1024
index eb4e079..a31ed6e 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+// Warning disabled globally but VS2013 ignores the /wd4200 option in C++ files.
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#pragma warning(disable : 4200)
+#endif
+
 #include <stdio.h>
 
 #include "gtest/gtest.h"
@@ -198,9 +203,12 @@ TEST(CAProtocolMessage, CAGetTokenFromPDU)
     coap_transport_t transport = COAP_UDP;
 
     CAInfo_t inData;
+    size_t tokenLength = 0;
     memset(&inData, 0, sizeof(CAInfo_t));
     inData.token = (CAToken_t)"token";
-    inData.tokenLength = strlen(inData.token);
+    tokenLength = strlen(inData.token);
+    ASSERT_LE(tokenLength, UINT8_MAX);
+    inData.tokenLength = (uint8_t)tokenLength;
     inData.type = CA_MSG_NONCONFIRM;
 
     pdu = CAGeneratePDU(CA_GET, &inData, &tempRep, &options, &transport);
@@ -229,7 +237,7 @@ TEST(CAProtocolMessage, CAGetInfoFromPDU)
     CAInfo_t inData;
     memset(&inData, 0, sizeof(CAInfo_t));
     inData.token = (CAToken_t)"token";
-    inData.tokenLength = strlen(inData.token);
+    inData.tokenLength = (uint8_t)strlen(inData.token);
     inData.type = CA_MSG_NONCONFIRM;
     inData.payload = (CAPayload_t) "requestPayload";
     inData.payloadSize = sizeof(inData.payload);;
index 670bed9..08081b3 100644 (file)
@@ -518,7 +518,7 @@ TEST(ConditionTests, TC_07_WAITDURATION)
     uint64_t beg = getAbsTime();
 
     OCWaitResult_t ret = oc_cond_wait_for(sharedCond, sharedMutex,
-                                          TARGET_WAIT * USECS_PER_SEC);
+                                          (uint64_t)(TARGET_WAIT * USECS_PER_SEC));
     EXPECT_EQ(OC_WAIT_TIMEDOUT,ret);
 
     uint64_t end = getAbsTime();
index 6e5e7da..f18dfaf 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+// Warning disabled globally but VS2013 ignores the /wd4200 option in C++ files.
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#pragma warning(disable : 4200)
+#endif
+
 #include <cinttypes>
 #include "iotivity_config.h"
 #include "gtest/gtest.h"
@@ -70,7 +75,7 @@
 #endif
 
 #if defined(_WIN32)
-#include "../../../../c_common/windows/include/pthread_create.h"
+#include "pthread_create.h"
 #endif
 #ifdef HAVE_WINDOWS_H
 #include <windows.h>
index 614d500..46d39be 100644 (file)
@@ -74,13 +74,13 @@ TEST(UArrayList, FreeNull)
 
 TEST_F(UArrayListF, Length)
 {
-    ASSERT_EQ(static_cast<uint32_t>(0), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(0), u_arraylist_length(list));
 
     int dummy = 0;
     bool rc = u_arraylist_add(list, &dummy);
     ASSERT_TRUE(rc);
 
-    ASSERT_EQ(static_cast<uint32_t>(1), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(1), u_arraylist_length(list));
 
     // Add a few times without checking, just in case checking has side-effects
     rc = u_arraylist_add(list, &dummy);
@@ -90,12 +90,12 @@ TEST_F(UArrayListF, Length)
     rc = u_arraylist_add(list, &dummy);
     ASSERT_TRUE(rc);
 
-    ASSERT_EQ(static_cast<uint32_t>(4), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(4), u_arraylist_length(list));
 }
 
 TEST_F(UArrayListF, LengthMulti)
 {
-    ASSERT_EQ(static_cast<uint32_t>(0), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(0), u_arraylist_length(list));
 
     int dummy = 0;
     for (int i = 0; i < 1000; ++i)
@@ -104,7 +104,7 @@ TEST_F(UArrayListF, LengthMulti)
         ASSERT_TRUE(rc);
     }
 
-    ASSERT_EQ(static_cast<uint32_t>(1000), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(1000), u_arraylist_length(list));
 }
 
 TEST_F(UArrayListF, NoReserve)
@@ -124,13 +124,13 @@ TEST_F(UArrayListF, NoReserve)
 
 TEST_F(UArrayListF, Reserve)
 {
-    static const int PAD_SIZE = 10000;
+    static const size_t PAD_SIZE = 10000;
 
     int dummy = 0;
 
     u_arraylist_reserve(list, PAD_SIZE);
 
-    for (int i = 0; i < PAD_SIZE; ++i)
+    for (size_t i = 0; i < PAD_SIZE; ++i)
     {
         bool rc = u_arraylist_add(list, &dummy);
         ASSERT_TRUE(rc);
@@ -140,19 +140,19 @@ TEST_F(UArrayListF, Reserve)
 
 TEST_F(UArrayListF, ShrinkToFit)
 {
-    static const int PAD_SIZE = 100;
+    static const size_t PAD_SIZE = 100;
 
     int dummy = 0;
 
     u_arraylist_reserve(list, PAD_SIZE);
 
-    for (int i = 0; i < PAD_SIZE; ++i)
+    for (size_t i = 0; i < PAD_SIZE; ++i)
     {
         bool rc = u_arraylist_add(list, &dummy);
         ASSERT_TRUE(rc);
     }
 
-    for (int i = PAD_SIZE; i > 0; --i)
+    for (size_t i = PAD_SIZE; i > 0; --i)
     {
         u_arraylist_remove(list, i);
     }
@@ -164,7 +164,7 @@ TEST_F(UArrayListF, ShrinkToFit)
 
 TEST_F(UArrayListF, Get)
 {
-    ASSERT_EQ(static_cast<uint32_t>(0), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(0), u_arraylist_length(list));
 
     int dummy[1000] = {0};
     size_t cap = sizeof(dummy) / sizeof(dummy[0]);
@@ -174,7 +174,7 @@ TEST_F(UArrayListF, Get)
         bool rc = u_arraylist_add(list, &dummy[i]);
         ASSERT_TRUE(rc);
     }
-    ASSERT_EQ(static_cast<uint32_t>(1000), u_arraylist_length(list));
+    ASSERT_EQ(cap, u_arraylist_length(list));
 
     for (size_t i = 0; i < cap; ++i)
     {
@@ -186,7 +186,7 @@ TEST_F(UArrayListF, Get)
 
 TEST_F(UArrayListF, Remove)
 {
-    ASSERT_EQ(static_cast<uint32_t>(0), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(0), u_arraylist_length(list));
 
     int dummy[1000] = {0};
     size_t cap = sizeof(dummy) / sizeof(dummy[0]);
@@ -196,10 +196,10 @@ TEST_F(UArrayListF, Remove)
         bool rc = u_arraylist_add(list, &dummy[i]);
         ASSERT_TRUE(rc);
     }
-    ASSERT_EQ(static_cast<uint32_t>(1000), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(1000), u_arraylist_length(list));
 
     // Remove walking forward so as to have a non-trivial case.
-    for (uint32_t idx = 0, old = 0;
+    for (size_t idx = 0, old = 0;
          idx < u_arraylist_length(list);
          ++idx, old += 2)
     {
@@ -207,12 +207,12 @@ TEST_F(UArrayListF, Remove)
         ASSERT_TRUE(value != NULL);
         ASSERT_EQ(value, &dummy[old]);
     }
-    ASSERT_EQ(static_cast<uint32_t>(500), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(500), u_arraylist_length(list));
 }
 
 TEST_F(UArrayListF, Contains)
 {
-    ASSERT_EQ(static_cast<uint32_t>(0), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(0), u_arraylist_length(list));
 
     int dummy[1000] = {0};
     size_t cap = sizeof(dummy) / sizeof(dummy[0]);
@@ -222,10 +222,10 @@ TEST_F(UArrayListF, Contains)
         bool rc = u_arraylist_add(list, &dummy[i]);
         ASSERT_TRUE(rc);
     }
-    ASSERT_EQ(static_cast<uint32_t>(1000), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(1000), u_arraylist_length(list));
 
     // Remove walking forward so as to have a non-trivial case.
-    for (uint32_t idx = 0, old = 0;
+    for (size_t idx = 0, old = 0;
          idx < u_arraylist_length(list);
          ++idx, old += 2)
     {
@@ -233,7 +233,7 @@ TEST_F(UArrayListF, Contains)
         ASSERT_TRUE(value != NULL);
         ASSERT_EQ(value, &dummy[old]);
     }
-    ASSERT_EQ(static_cast<uint32_t>(500), u_arraylist_length(list));
+    ASSERT_EQ(static_cast<size_t>(500), u_arraylist_length(list));
 
     // Finally, check that the ones we expect are present, and others are not.
     for (size_t i = 0; i < cap; ++i)
@@ -248,9 +248,9 @@ TEST_F(UArrayListF, Contains)
 // a poor implmentation will thrash memory.
 TEST_F(UArrayListF, Thrash)
 {
-    static const int PAD_SIZE = 1000;
-    static const int THRASH_COUNT = 1500;
-    ASSERT_EQ(static_cast<uint32_t>(0), u_arraylist_length(list));
+    static const size_t PAD_SIZE = 1000;
+    static const size_t THRASH_COUNT = 1500;
+    ASSERT_EQ(static_cast<size_t>(0), u_arraylist_length(list));
 
     int dummy2 = 0;
     int dummy[PAD_SIZE] = {0};
@@ -261,19 +261,19 @@ TEST_F(UArrayListF, Thrash)
         bool rc = u_arraylist_add(list, &dummy[i]);
         ASSERT_TRUE(rc);
     }
-    ASSERT_EQ(static_cast<uint32_t>(PAD_SIZE), u_arraylist_length(list));
+    ASSERT_EQ(PAD_SIZE, u_arraylist_length(list));
 
     // Finally add and remove a lot.
-    for (int i = 0; i < THRASH_COUNT; ++i)
+    for (size_t i = 0; i < THRASH_COUNT; ++i)
     {
         bool rc = u_arraylist_add(list, &dummy2);
         ASSERT_TRUE(rc);
-        ASSERT_EQ(static_cast<uint32_t>(PAD_SIZE + 1),
+        ASSERT_EQ((PAD_SIZE + 1),
                   u_arraylist_length(list));
 
         ASSERT_EQ(&dummy2,
                   u_arraylist_remove(list, u_arraylist_length(list) - 1));
 
-        ASSERT_EQ(static_cast<uint32_t>(PAD_SIZE), u_arraylist_length(list));
+        ASSERT_EQ(PAD_SIZE, u_arraylist_length(list));
     }
 }
index 5e93032..9ef777a 100644 (file)
@@ -117,7 +117,7 @@ TEST_F(ULinkListF, LengthMulti)
 {
     ASSERT_EQ(static_cast<uint32_t>(0), u_linklist_length(list));
 
-    int dummy[1000] = {0};
+    size_t dummy[1000] = {0};
     size_t cap = sizeof(dummy) / sizeof(dummy[0]);
 
     for (size_t i = 0; i < cap; ++i)
@@ -126,14 +126,14 @@ TEST_F(ULinkListF, LengthMulti)
         EXPECT_EQ(CA_STATUS_OK, u_linklist_add(list, &dummy[i]));
     }
 
-    ASSERT_EQ(static_cast<uint32_t>(1000), u_linklist_length(list));
+    ASSERT_EQ(static_cast<uint32_t>(cap), u_linklist_length(list));
 }
 
 TEST_F(ULinkListF, Get)
 {
     ASSERT_EQ(static_cast<uint32_t>(0), u_linklist_length(list));
 
-    int dummy[1000] = {0};
+    size_t dummy[1000] = {0};
     size_t cap = sizeof(dummy) / sizeof(dummy[0]);
 
     for (size_t i = 0; i < cap; ++i)
@@ -141,7 +141,7 @@ TEST_F(ULinkListF, Get)
         dummy[i] = i;
         EXPECT_EQ(CA_STATUS_OK, u_linklist_add(list, &dummy[i]));
     }
-    ASSERT_EQ(static_cast<uint32_t>(1000), u_linklist_length(list));
+    ASSERT_EQ(static_cast<uint32_t>(cap), u_linklist_length(list));
 
     u_linklist_iterator_t *iterTable = NULL;
     u_linklist_init_iterator(list, &iterTable);
@@ -158,7 +158,7 @@ TEST_F(ULinkListF, Remove)
 {
     ASSERT_EQ(static_cast<uint32_t>(0), u_linklist_length(list));
 
-    int dummy[1000] = {0};
+    size_t dummy[1000] = {0};
     size_t cap = sizeof(dummy) / sizeof(dummy[0]);
 
     for (size_t i = 0; i < cap; ++i)
@@ -166,7 +166,7 @@ TEST_F(ULinkListF, Remove)
         dummy[i] = i;
         EXPECT_EQ(CA_STATUS_OK, u_linklist_add(list, &dummy[i]));
     }
-    ASSERT_EQ(static_cast<uint32_t>(1000), u_linklist_length(list));
+    ASSERT_EQ(static_cast<uint32_t>(cap), u_linklist_length(list));
 
     u_linklist_iterator_t *iterTable = NULL;
     u_linklist_init_iterator(list, &iterTable);
index cbefc58..9acb412 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#include "cathreadpool.h"
-#include "octhread.h"
-#include "uarraylist.h"
-#include "cacommon.h"
+#include "oic_string.h"
 #include "logger.h"
 
 #include "caconnectionmanager.h"
-#include "capolicymanager.h"
 
 #define TAG "OIC_CM_POLICY"
 
index d76b112..1debea1 100644 (file)
@@ -18,6 +18,7 @@
  *
  ******************************************************************/
 
+#include "caadapterutils.h"
 #include "camanagerleinterface.h"
 #include "cabtpairinginterface.h"
 #include "cautilinterface.h"