Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers test_coap_service_api.c Source File

test_coap_service_api.c

00001 /*
00002  * Copyright (c) 2015-2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 #include "test_coap_service_api.h"
00018 #include <string.h>
00019 #include "coap_service_api.h"
00020 #include "nsdynmemLIB_stub.h"
00021 #include "coap_connection_handler_stub.h"
00022 #include "coap_message_handler_stub.h"
00023 #include "eventOS_event_stub.h"
00024 #include "eventOS_event.h"
00025 #include "net_interface.h"
00026 #include "coap_service_api.c"
00027 
00028 int sec_done_cb_test(int8_t service_id, uint8_t address[static 16], uint8_t keyblock[static 40]){
00029     return 2;
00030 }
00031 
00032 int sec_start_cb(int8_t service_id, uint8_t address[static 16], uint16_t port, uint8_t* pw, uint8_t *pw_len)
00033 {
00034     return 0;
00035 }
00036 
00037 int request_recv_cb(int8_t service_id, uint8_t source_address[static 16], uint16_t source_port, sn_coap_hdr_s *request_ptr)
00038 {
00039     return 2;
00040 }
00041 
00042 int virtual_sock_send_cb(int8_t service_id, uint8_t destination_addr_ptr[static 16], uint16_t port, const uint8_t *data_ptr, uint16_t data_len)
00043 {
00044     return 2;
00045 }
00046 
00047 bool test_coap_service_initialize()
00048 {
00049     if( -1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00050         return false;
00051 
00052 
00053     nsdynmemlib_stub.returnCounter = 1;
00054     thread_conn_handler_stub.handler_obj = NULL;
00055     if( -1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00056         return false;
00057 
00058     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00059     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00060     coap_message_handler_stub.coap_ptr = NULL;
00061 
00062     nsdynmemlib_stub.returnCounter = 1;
00063     thread_conn_handler_stub.int_value = -1;
00064     if( -1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00065             return false;
00066 
00067     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00068     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00069     nsdynmemlib_stub.returnCounter = 1;
00070     thread_conn_handler_stub.int_value = 0;
00071 
00072     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00073         return false;
00074 
00075     nsdynmemlib_stub.returnCounter = 1;
00076     if( 2 != coap_service_initialize(3, 4, 0, NULL, NULL ))
00077         return false;
00078 
00079     coap_service_delete(2);
00080     coap_service_delete(1);
00081 
00082     free( thread_conn_handler_stub.handler_obj );
00083     thread_conn_handler_stub.handler_obj = NULL;
00084     return true;
00085 }
00086 
00087 bool test_coap_service_delete()
00088 {
00089     coap_service_delete(1);
00090 
00091     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00092     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00093     nsdynmemlib_stub.returnCounter = 1;
00094     coap_message_handler_stub.coap_ptr = NULL;
00095 
00096     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00097         return false;
00098 
00099     coap_service_delete(1);
00100 
00101     free( thread_conn_handler_stub.handler_obj );
00102     thread_conn_handler_stub.handler_obj = NULL;
00103 
00104     return true;
00105 }
00106 
00107 bool test_coap_service_virtual_socket_recv()
00108 {
00109     uint8_t buf[16];
00110     if( -1 != coap_service_virtual_socket_recv(1, &buf, 10, NULL, 0) )
00111         return false;
00112 
00113     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00114     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00115     nsdynmemlib_stub.returnCounter = 1;
00116     coap_message_handler_stub.coap_ptr = NULL;
00117 
00118     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00119         return false;
00120 
00121     thread_conn_handler_stub.int_value = 5;
00122     if( 5 != coap_service_virtual_socket_recv(1, &buf, 10, NULL, 0) )
00123         return false;
00124 
00125     coap_service_delete(1);
00126 
00127     free( thread_conn_handler_stub.handler_obj );
00128     thread_conn_handler_stub.handler_obj = NULL;
00129 
00130     thread_conn_handler_stub.int_value = 0;
00131 
00132     return true;
00133 }
00134 
00135 bool test_coap_service_virtual_socket_set_cb()
00136 {
00137     if( -1 != coap_service_virtual_socket_set_cb(1, NULL) )
00138         return false;
00139 
00140     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00141     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00142     nsdynmemlib_stub.returnCounter = 1;
00143     coap_message_handler_stub.coap_ptr = NULL;
00144 
00145     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00146         return false;
00147 
00148     if( 0 != coap_service_virtual_socket_set_cb(1, NULL) )
00149         return false;
00150 
00151     coap_service_delete(1);
00152 
00153     free( thread_conn_handler_stub.handler_obj );
00154     thread_conn_handler_stub.handler_obj = NULL;
00155 
00156     return true;
00157 }
00158 
00159 bool test_coap_service_register_uri()
00160 {
00161     if( -1 != coap_service_register_uri(1, "as", 1, &request_recv_cb))
00162         return false;
00163 
00164     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00165     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00166     nsdynmemlib_stub.returnCounter = 1;
00167     coap_message_handler_stub.coap_ptr = NULL;
00168 
00169     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00170         return false;
00171 
00172     if( -2 != coap_service_register_uri(1, "as", 1, &request_recv_cb) )
00173         return false;
00174 
00175     nsdynmemlib_stub.returnCounter = 1;
00176     if( -2 != coap_service_register_uri(1, "as", 1, &request_recv_cb) )
00177         return false;
00178 
00179     nsdynmemlib_stub.returnCounter = 2;
00180     if( 0 != coap_service_register_uri(1, "as", 1, &request_recv_cb) )
00181         return false;
00182 
00183     coap_service_delete(1);
00184 
00185     free( thread_conn_handler_stub.handler_obj );
00186     thread_conn_handler_stub.handler_obj = NULL;
00187 
00188     return true;
00189 }
00190 
00191 bool test_coap_service_unregister_uri()
00192 {
00193     if( -1 != coap_service_unregister_uri(1, "as"))
00194         return false;
00195 
00196     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00197     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00198     nsdynmemlib_stub.returnCounter = 1;
00199     coap_message_handler_stub.coap_ptr = NULL;
00200     thread_conn_handler_stub.int_value = 0;
00201 
00202     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00203         return false;
00204 
00205     nsdynmemlib_stub.returnCounter = 2;
00206     if( 0 != coap_service_register_uri(1, "as", 1, &request_recv_cb) )
00207         return false;
00208 
00209     if( -2 != coap_service_unregister_uri(1, "ts") )
00210         return false;
00211 
00212     if( 0 != coap_service_unregister_uri(1, "as") )
00213         return false;
00214 
00215     coap_service_delete(1);
00216 
00217     free( thread_conn_handler_stub.handler_obj );
00218     thread_conn_handler_stub.handler_obj = NULL;
00219 
00220     return true;
00221 }
00222 
00223 bool test_coap_service_request_send()
00224 {
00225     uint8_t buf[16];
00226     coap_message_handler_stub.uint16_value = 6;
00227     if( 6 != coap_service_request_send(0,0,&buf,0,0,0,NULL, 0,NULL,0,NULL))
00228         return false;
00229     return true;
00230 }
00231 
00232 bool test_coap_service_request_delete()
00233 {
00234     if( 0 != coap_service_request_delete(NULL,0))
00235         return false;
00236     return true;
00237 }
00238 
00239 bool test_coap_service_response_send()
00240 {
00241     uint8_t buf[16];
00242     coap_message_handler_stub.int8_value = 6;
00243     if( 6 != coap_service_response_send(0,0,NULL, 65, 0,NULL, 0))
00244         return false;
00245     return true;
00246 }
00247 
00248 bool test_coap_callbacks()
00249 {
00250     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00251     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00252     nsdynmemlib_stub.returnCounter = 1;
00253     coap_message_handler_stub.coap_ptr = (coap_msg_handler_t *)malloc(sizeof(coap_msg_handler_t));
00254     memset(coap_message_handler_stub.coap_ptr, 0, sizeof(coap_msg_handler_t));
00255 
00256     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00257         return false;
00258 
00259     if( 0 != coap_message_handler_stub.coap_ptr->sn_coap_service_malloc(0))
00260         return false;
00261 
00262     nsdynmemlib_stub.returnCounter = 1;
00263     void *handle = coap_message_handler_stub.coap_ptr->sn_coap_service_malloc(5);
00264     if( 0 == handle )
00265         return false;
00266 
00267     coap_message_handler_stub.coap_ptr->sn_coap_service_free(handle);
00268 
00269     //coap_tx_function
00270     uint8_t data[14];
00271     memset(&data, 3, 14);
00272     sn_nsdl_addr_s addr;
00273     addr.addr_len = 2;
00274     addr.port = 4;
00275     addr.addr_ptr = &data;
00276     if( 0 != coap_message_handler_stub.coap_ptr->sn_coap_tx_callback(NULL, 0, &addr, NULL))
00277         return false;
00278 
00279     coap_transaction_t *tr = (coap_transaction_t *)malloc(sizeof(coap_transaction_t));
00280     memset(tr, 0, sizeof(coap_transaction_t));
00281 
00282     if( 0 != coap_message_handler_stub.coap_ptr->sn_coap_tx_callback(&data, 0, &addr, tr))
00283         return false;
00284 
00285     tr->service_id = 1;
00286     thread_conn_handler_stub.int_value = -2;
00287     if( 0 != coap_message_handler_stub.coap_ptr->sn_coap_tx_callback(&data, 0, &addr, tr))
00288         return false;
00289 
00290     nsdynmemlib_stub.returnCounter = 1;
00291     if( 0 != coap_message_handler_stub.coap_ptr->sn_coap_tx_callback(&data, 2, &addr, tr))
00292         return false;
00293 
00294     free(tr->data_ptr);
00295     free(tr);
00296 
00297     coap_service_delete(1);
00298 
00299     free( coap_message_handler_stub.coap_ptr );
00300     coap_message_handler_stub.coap_ptr = NULL;
00301     coap_service_handle = NULL;
00302 
00303     free( thread_conn_handler_stub.handler_obj );
00304     thread_conn_handler_stub.handler_obj = NULL;
00305 
00306     return true;
00307 }
00308 
00309 #define COAP_TICK_TIMER 0xf1 //MUST BE SAME AS IN coap_service_api.c
00310 bool test_eventOS_callbacks()
00311 {
00312     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00313     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00314     nsdynmemlib_stub.returnCounter = 1;
00315     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00316         return false;
00317 
00318     if( eventOs_event_stub.event_ptr ){
00319         arm_event_s event;
00320         event.event_type = ARM_LIB_TASKLET_INIT_EVENT;
00321         eventOs_event_stub.event_ptr(&event);
00322 
00323         event.event_type = ARM_LIB_SYSTEM_TIMER_EVENT;
00324         event.event_id = COAP_TICK_TIMER;
00325         eventOs_event_stub.event_ptr(&event);
00326     }
00327 
00328     coap_service_delete(1);
00329     free( thread_conn_handler_stub.handler_obj );
00330     thread_conn_handler_stub.handler_obj = NULL;
00331     return true;
00332 }
00333 
00334 bool test_conn_handler_callbacks()
00335 {
00336     uint8_t buf[16];
00337     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00338     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00339     nsdynmemlib_stub.returnCounter = 1;
00340     if( 1 != coap_service_initialize(1, 2, COAP_SERVICE_OPTIONS_SECURE_BYPASS, &sec_start_cb, &sec_done_cb_test ))
00341         return false;
00342 
00343     if( thread_conn_handler_stub.send_to_sock_cb ){
00344         thread_conn_handler_stub.bool_value = true;
00345         coap_service_virtual_socket_set_cb(1, &virtual_sock_send_cb);
00346         if( 2 != thread_conn_handler_stub.send_to_sock_cb(1, buf, 12, NULL, 0))
00347             return false;
00348         thread_conn_handler_stub.bool_value = false;
00349         if( -1 != thread_conn_handler_stub.send_to_sock_cb(1, buf, 12, NULL, 0))
00350             return false;
00351     }
00352 
00353     if( thread_conn_handler_stub.receive_from_sock_cb ){
00354         coap_message_handler_stub.int16_value = 2;
00355         if( -1 != thread_conn_handler_stub.receive_from_sock_cb(1, buf, 12, NULL, NULL, 0))
00356             return false;
00357 
00358         nsdynmemlib_stub.returnCounter = 1;
00359         uint8_t * ptr = ns_dyn_mem_alloc(5);
00360         memset(ptr, 3, 5);
00361         nsdynmemlib_stub.returnCounter = 1;
00362         if( 2 != thread_conn_handler_stub.receive_from_sock_cb(1, buf, 12, NULL, ptr, 5))
00363             return false;
00364         ns_dyn_mem_free(ptr);
00365         coap_message_handler_stub.int16_value = 0;
00366 
00367         //This could be moved to own test function,
00368         //but thread_conn_handler_stub.receive_from_sock_cb must be called successfully
00369         if( coap_message_handler_stub.cb ){
00370             if( -1 != coap_message_handler_stub.cb(1, NULL, NULL) )
00371                 return false;
00372 
00373             sn_coap_hdr_s * coap = (sn_coap_hdr_s *)malloc(sizeof(sn_coap_hdr_s));
00374             memset(coap, 0, sizeof(sn_coap_hdr_s));
00375 
00376             uint8_t  uri[2] = "as";
00377             coap->uri_path_ptr = &uri;
00378             coap->uri_path_len=2;
00379 
00380             if( -1 != coap_message_handler_stub.cb(1, coap, NULL) )
00381                 return false;
00382 
00383             thread_conn_handler_stub.bool_value = true;
00384             nsdynmemlib_stub.returnCounter = 2;
00385             if( 0 != coap_service_register_uri(1, "as", 1, &request_recv_cb) )
00386                 return false;
00387 
00388             if( -1 != coap_message_handler_stub.cb(1, coap, NULL) )
00389                 return false;
00390 
00391             coap_transaction_t *tr = (coap_transaction_t *)malloc(sizeof(coap_transaction_t));
00392             memset(tr, 0, sizeof(coap_transaction_t));
00393 
00394             if( 2 != coap_message_handler_stub.cb(1, coap, tr) )
00395                 return false;
00396 
00397             free(tr);
00398             tr = NULL;
00399 
00400             thread_conn_handler_stub.bool_value = false;
00401             free(coap);
00402             coap = NULL;
00403         }
00404     }
00405 
00406     if(thread_conn_handler_stub.get_passwd_cb){
00407         coap_security_keys_t security_ptr;
00408         memset(&security_ptr, 0, sizeof(coap_security_keys_t));
00409         nsdynmemlib_stub.returnCounter = 1;
00410         thread_conn_handler_stub.bool_value = true;
00411         if( 0 != thread_conn_handler_stub.get_passwd_cb(1, buf, 12, &security_ptr))
00412             return false;
00413         free(security_ptr._key);
00414         thread_conn_handler_stub.bool_value = false;
00415         if( -1 != thread_conn_handler_stub.get_passwd_cb(1, buf, 12, NULL))
00416             return false;
00417     }
00418 
00419     if(thread_conn_handler_stub.sec_done_cb){
00420         uint8_t block[40];
00421         thread_conn_handler_stub.bool_value = true;
00422 
00423         coap_transaction_t *tr = (coap_transaction_t *)malloc(sizeof(coap_transaction_t));
00424         memset(tr, 0, sizeof(coap_transaction_t));
00425         nsdynmemlib_stub.returnCounter = 1;
00426         tr->data_ptr = ns_dyn_mem_alloc(1);
00427         tr->data_len = 1;
00428         coap_message_handler_stub.coap_tx_ptr = tr;
00429 
00430         thread_conn_handler_stub.sec_done_cb(1, buf, 12, block);
00431 
00432         free(tr);
00433         coap_message_handler_stub.coap_tx_ptr = NULL;
00434 
00435         thread_conn_handler_stub.bool_value = false;
00436 
00437     }
00438 
00439     coap_service_delete(1);
00440     free( thread_conn_handler_stub.handler_obj );
00441     thread_conn_handler_stub.handler_obj = NULL;
00442 
00443     return true;
00444 }
00445 
00446 bool test_certificate_set()
00447 {
00448     /* Service not found, return failure */
00449     if (-1 != coap_service_certificate_set(1, NULL, 0, NULL, 0)) {
00450         return false;
00451     }
00452 
00453     /* Init service */
00454     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00455     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00456 
00457     nsdynmemlib_stub.returnCounter = 1;
00458     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00459         return false;
00460 
00461     /* Allocation fails */
00462     if (-1 != coap_service_certificate_set(1, NULL, 0, NULL, 0)) {
00463         return false;
00464     }
00465 
00466     /* All OK */
00467     nsdynmemlib_stub.returnCounter = 1;
00468     if (0 != coap_service_certificate_set(1, NULL, 0, NULL, 0)) {
00469         return false;
00470     }
00471 
00472     /* Teardown */
00473     coap_service_delete(1);
00474     free(thread_conn_handler_stub.handler_obj->security_keys);
00475     free(thread_conn_handler_stub.handler_obj);
00476 
00477     return true;
00478 }
00479 
00480 bool test_handshake_timeout_set()
00481 {
00482     /* Service not found, return failure */
00483     if (-1 != coap_service_set_handshake_timeout(1, 0, 0)) {
00484         return false;
00485     }
00486 
00487     /* Init service */
00488     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00489     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00490 
00491     nsdynmemlib_stub.returnCounter = 1;
00492     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00493         return false;
00494 
00495     /* All OK */
00496     nsdynmemlib_stub.returnCounter = 1;
00497     if (0 != coap_service_set_handshake_timeout(1, 0, 0)) {
00498         return false;
00499     }
00500 
00501     /* Teardown */
00502     coap_service_delete(1);
00503     free(thread_conn_handler_stub.handler_obj->security_keys);
00504     free(thread_conn_handler_stub.handler_obj);
00505 
00506     return true;
00507 }
00508 
00509 bool test_coap_duplcate_msg_buffer_set()
00510 {
00511     bool ret = true;
00512     /* no coap handle - return failure */
00513     if (-1 != coap_service_set_duplicate_message_buffer(0, 0)) {
00514         return false;
00515     }
00516 
00517     /* Init service */
00518     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00519     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00520     coap_message_handler_stub.coap_ptr = (coap_msg_handler_t *)malloc(sizeof(coap_msg_handler_t));
00521     memset(coap_message_handler_stub.coap_ptr, 0, sizeof(coap_msg_handler_t));
00522 
00523     nsdynmemlib_stub.returnCounter = 1;
00524     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00525         ret = false;
00526 
00527     /* All OK */
00528     if(0 != coap_service_set_duplicate_message_buffer(0, 0)) {
00529         ret = false;
00530     }
00531 
00532     /* Teardown */
00533     coap_service_delete(1);
00534     free(coap_message_handler_stub.coap_ptr);
00535     coap_message_handler_stub.coap_ptr = NULL;
00536     coap_service_handle = NULL;
00537     free(thread_conn_handler_stub.handler_obj);
00538     thread_conn_handler_stub.handler_obj = NULL;
00539 
00540     return ret;
00541 }
00542 
00543 bool test_coap_service_get_internal_timer_ticks()
00544 {
00545     coap_service_get_internal_timer_ticks();
00546     return true;
00547 }
00548 
00549 bool test_coap_service_if_find_by_socket()
00550 {
00551     /* No service ID - return failure */
00552     if (0 != coap_service_id_find_by_socket(1)) {
00553         return false;
00554     }
00555 
00556     /* Init service */
00557     thread_conn_handler_stub.handler_obj = (coap_conn_handler_t*)malloc(sizeof(coap_conn_handler_t));
00558     memset(thread_conn_handler_stub.handler_obj, 0, sizeof(coap_conn_handler_t));
00559 
00560     nsdynmemlib_stub.returnCounter = 1;
00561     thread_conn_handler_stub.bool_value = 0;
00562     if( 1 != coap_service_initialize(1, 2, 0, NULL, NULL ))
00563         return false;
00564 
00565     /* No matching service ID - return false */
00566     if(0 != coap_service_id_find_by_socket(1)) {
00567         return false;
00568     }
00569 
00570     thread_conn_handler_stub.bool_value = 1;
00571     /* All OK */
00572     if(1 != coap_service_id_find_by_socket(1)) {
00573         return false;
00574     }
00575 
00576     /* Teardown */
00577     coap_service_delete(1);
00578     free(thread_conn_handler_stub.handler_obj);
00579     thread_conn_handler_stub.handler_obj = NULL;
00580 
00581     return true;
00582 }
00583 
00584 bool test_coap_service_handshake_limit_set()
00585 {
00586     if (0 != coap_service_handshake_limits_set(2, 2)) {
00587         return false;
00588     }
00589 
00590     return true;
00591 }