Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
tcp_tests.h
00001 /* 00002 * Copyright (c) 2018, ARM Limited, All Rights Reserved 00003 * SPDX-License-Identifier: Apache-2.0 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); you may 00006 * 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, WITHOUT 00013 * 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 00018 #ifndef TCP_TESTS_H 00019 #define TCP_TESTS_H 00020 00021 NetworkInterface *get_interface(); 00022 void drop_bad_packets(TCPSocket &sock, int orig_timeout); 00023 void fill_tx_buffer_ascii(char *buff, size_t len); 00024 nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock); 00025 nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock); 00026 00027 /** 00028 * Single testcase might take only half of the remaining execution time 00029 */ 00030 int split2half_rmng_tcp_test_time(); // [s] 00031 00032 namespace tcp_global { 00033 static const int TESTS_TIMEOUT = 960; 00034 static const int TCP_OS_STACK_SIZE = 2048; 00035 00036 static const int RX_BUFF_SIZE = 1220; 00037 static const int TX_BUFF_SIZE = 1220; 00038 00039 extern char rx_buffer[RX_BUFF_SIZE]; 00040 extern char tx_buffer[TX_BUFF_SIZE]; 00041 } 00042 00043 /* 00044 * Test cases 00045 */ 00046 void TCPSOCKET_CONNECT_INVALID(); 00047 void TCPSOCKET_ECHOTEST(); 00048 void TCPSOCKET_ECHOTEST_NONBLOCK(); 00049 void TCPSOCKET_ECHOTEST_BURST(); 00050 void TCPSOCKET_ECHOTEST_BURST_NONBLOCK(); 00051 void TCPSOCKET_ENDPOINT_CLOSE(); 00052 void TCPSOCKET_OPEN_CLOSE_REPEAT(); 00053 void TCPSOCKET_OPEN_LIMIT(); 00054 void TCPSOCKET_RECV_100K(); 00055 void TCPSOCKET_RECV_100K_NONBLOCK(); 00056 void TCPSOCKET_RECV_TIMEOUT(); 00057 void TCPSOCKET_SEND_REPEAT(); 00058 void TCPSOCKET_SEND_TIMEOUT(); 00059 void TCPSOCKET_THREAD_PER_SOCKET_SAFETY(); 00060 00061 #endif //TCP_TESTS_H
Generated on Tue Aug 9 2022 00:37:21 by
1.7.2