From 72ea0e9e7f717fab6cda4a4162c242928ea6030a Mon Sep 17 00:00:00 2001 From: Michal Paszta Date: Wed, 27 Nov 2019 19:23:25 +0200 Subject: [PATCH] Remove udpsocket_sendto_invalid It tested parameter checks in the now obsoleted string-based API. --- TESTS/netsocket/udp/main.cpp | 1 - .../udp/udpsocket_sendto_invalid.cpp | 48 ------------------- 2 files changed, 49 deletions(-) delete mode 100644 TESTS/netsocket/udp/udpsocket_sendto_invalid.cpp diff --git a/TESTS/netsocket/udp/main.cpp b/TESTS/netsocket/udp/main.cpp index 2f54588ff56..68b74a8f4df 100644 --- a/TESTS/netsocket/udp/main.cpp +++ b/TESTS/netsocket/udp/main.cpp @@ -191,7 +191,6 @@ Case cases[] = { Case("UDPSOCKET_BIND_ADDRESS", UDPSOCKET_BIND_ADDRESS), Case("UDPSOCKET_BIND_WRONG_TYPE", UDPSOCKET_BIND_WRONG_TYPE), Case("UDPSOCKET_BIND_UNOPENED", UDPSOCKET_BIND_UNOPENED), - Case("UDPSOCKET_SENDTO_INVALID", UDPSOCKET_SENDTO_INVALID), Case("UDPSOCKET_ECHOTEST_NONBLOCK", UDPSOCKET_ECHOTEST_NONBLOCK), Case("UDPSOCKET_ECHOTEST_BURST_NONBLOCK", UDPSOCKET_ECHOTEST_BURST_NONBLOCK), Case("UDPSOCKET_SENDTO_REPEAT", UDPSOCKET_SENDTO_REPEAT), diff --git a/TESTS/netsocket/udp/udpsocket_sendto_invalid.cpp b/TESTS/netsocket/udp/udpsocket_sendto_invalid.cpp deleted file mode 100644 index ef022d29146..00000000000 --- a/TESTS/netsocket/udp/udpsocket_sendto_invalid.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "mbed.h" -#include "UDPSocket.h" -#include "greentea-client/test_env.h" -#include "unity/unity.h" -#include "utest.h" -#include "udp_tests.h" - -using namespace utest::v1; - -void UDPSOCKET_SENDTO_INVALID() -{ - UDPSocket sock; - TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.open(NetworkInterface::get_default_instance())); - - SocketAddress addr; - addr.set_ip_address(""); - addr.set_port(0); - // Depending on the stack UDP may be able to send 0 bytes, but may also return some error code. - TEST_ASSERT_TRUE(sock.sendto(addr, NULL, 0) <= 0); - - TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, NetworkInterface::get_default_instance()->gethostbyname(ECHO_SERVER_ADDR, &addr)); - addr.set_port(9); - nsapi_error_t result = sock.sendto(addr, NULL, 0); - if (result != NSAPI_ERROR_UNSUPPORTED) { - TEST_ASSERT_EQUAL(0, result); - } - - TEST_ASSERT_EQUAL(5, sock.sendto(addr, "hello", 5)); - - TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.close()); -}