From patchwork Mon Jun 26 16:45:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9810109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D249F60329 for ; Mon, 26 Jun 2017 16:53:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C818428520 for ; Mon, 26 Jun 2017 16:53:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBBDB28550; Mon, 26 Jun 2017 16:53:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6FB1228520 for ; Mon, 26 Jun 2017 16:53:10 +0000 (UTC) Received: from localhost ([::1]:47652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPXG9-0007N5-J2 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 26 Jun 2017 12:53:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPXAJ-0002Df-1x for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:47:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPXAF-0002zn-VZ for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:47:07 -0400 Received: from mail-eopbgr50098.outbound.protection.outlook.com ([40.107.5.98]:63063 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dPXAF-0002z5-G3 for qemu-devel@nongnu.org; Mon, 26 Jun 2017 12:47:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=P4AGpE8Yz0/wnIrQTpfOzBPMeNn51UzsXwG+6axllfc=; b=CucTmJcd1y7Pjvkgt4dUS5Mp44TmmiD2JWO/S2dhmvlbOTIb83QkmdhXiZ2W7HqdeJX2mFjHvojAJVbRdyduLuNGbqU0QWrfQ00cNbVGy56qOQV/vnkUDmMMk70COnd7Hr0YYFJhYj/LbU1wdnk/tJG3YHomCftr//IbwMieXc4= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by VI1PR0801MB1998.eurprd08.prod.outlook.com (2603:10a6:800:8a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Mon, 26 Jun 2017 16:46:57 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Mon, 26 Jun 2017 19:45:44 +0300 Message-ID: <1498495550-72357-8-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498495550-72357-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1498495550-72357-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2P15301CA0013.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::23) To VI1PR0801MB1998.eurprd08.prod.outlook.com (2603:10a6:800:8a::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 94cb7cd6-0554-498f-a910-08d4bcb2f7a6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095); SRVR:VI1PR0801MB1998; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 3:C1RQdUPeskUhmVql276eztblXJdBBjlEFFX2M5QKlrQE6Rzv+wbWSWBH9jHLK/Q5bVM01NVLfC6W+qlssEQd7cVoBjzkOZM8G0DUIbvJGzLb2elKAq/FK9FK1yuHdbZrmXSa8GPTKVZgQJWkeEJqKDHt/Ol9K1gN0fCML1mOQD2E5CUfqax9VxTb0slOiTgG8cIN9xoe7+q7j8giY3/K7byzDkRwl9w9ICQXV0ngzO+Oucv+YxFR789CJnph6ZKvDZz9I+asOuhBPuix9mY5CZ9T1sn+JM3njRGzBeD8IY2KqVXAZitJlWL5txWIikuce4jcpm88B1IdIuVBMR+GxdKpt5jEh6TWee8GIIPTwyx60CFcZ57N86qCzAiOJcgPFV+geUN2h6ObcGu1IPRPfiG8/a7DXSZNS/HYDeg7bqNOpBjOT772Hk99a1XpRdRbLPPo83dpewI0WJS9V4YdJzF9/yLYfYteRzfTTV6VlQ4VWxrKbofzO9Fgi5o4PtFf5si5ZxrQELVY0N606TWHkypJfP6jKpyf9B5FvsOfLioPY2oj5Kij8f4uq4JRoyPgddk9ogFgVMVDlLUSsJKgoIY2op7IXyfKwip0rvm3JZZZpO8vaF16Uq2gTaIni1brXX2mbusnWGezBijTHF7c4gQoDTZeCHFAQjLhhw3h2rNleSLM9hqP5LNV0cRl9UT3 X-MS-TrafficTypeDiagnostic: VI1PR0801MB1998: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 25:opUvWiA+fWeCJkN/638hxM78Pi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Hwrd8ZFf4dL0eonWfFzFzg2aLmY8b96XFsWbqg+DJQhgtzhwue7VYfK60uz9sTPxrRNM6j41FazKLxgt0BGYSiRjwGnAPds+CC6dW54p/yMMDvWfffedkeAhXO+qZrWQG2dROWO7PHuYzfyxIw+q/CJZo8N/7m03FgbWY2SuM4E7gw6k+83tc6WcmZXbX+gKy6SfzF1dw0B9+zyAUbQ8JsRX5uBZcaSfQBZp5soY9t04hB+znySDAcymEd4qtCwclqYNEhGGUBZiR2MKC+WM4eebtDLA77O5MVqsvrZBVgWmDbGksxkAtBxhw8FRmbwE4m1g7aprDhP69YTgzTV5HDqI8rQhrN7uWY04fRA+dmt5LX8qAJC4YcT7QvfNF0PRT+jwh80CNOpVOLhqpzwsJp0ObtSw8Ya+LFZMOWrdctl7g5MWVsOf1MU0P06TEb8bjZldrg0CksHc+O7IjmzLHVld+vX+Gxys8BuzB7IWPxnC/g9+x0afRFVwnCE6dPw3HjOnccBEqtsrHVjh0r4NPlp94Kdjo3pfpv06C2nBmx/LIjz6U= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 20:bAWl4nc7B4VaEwhyT9flZumyM2lt/1S5FojgLAto4n6rEfRNTsEHE61q0CTgYD4NyU5OC+ax0Ns0HwPNBDFvuIPhUqDF8T+2pxLCDQMZ1z2Q0ClDqsh6nj5xm4fQj+RkMlCpmrNIT+JzWvSYPssFYY8o20chjKyV+T4F5zxTTDHo6FcxjaYDg7NgpnK2EKffdxWP5pmZO4lZKT+DyI+fIV3ppvl36SYLPOE9xyehPBEbRtwdc33R/DuaxvV7nvhUAQi9CZygy5gxsXVlps3rNIBsN0xE+U5q6YxX+KcKMWSmJKwhKOZFzxriTc0JKyuZIx9F9oSvhR/ldcHNsI5eq8V1X93B1ghXnrMwtiItsrxsoFhllOFvIKsO12Lvvydwmbce3jHT8JlsN3Q2xy0VDktUaT9JJiMWgsroamz5Kh4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0801MB1998; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0801MB1998; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 4:CnsDViMq5wiKk8zJQMqE1Pc71CoG5xYspTWhGnTG?= =?us-ascii?Q?WDhCJPEjICid9VYYS3KtyAqi696N9Nv/qrQztE0tdvfnyLmOQLC6S+C/LVV8?= =?us-ascii?Q?ST5xY0W7Tiv4ZFHplwKbgXBo/Ya1ONUFZynhBBXBQVHXkNDbt6edMbnK/VEb?= =?us-ascii?Q?abgqpsaP/YO7lgLx8wBR7DtrwRBxkzhqfnm8UGiQ+kSmGykpeWYwZhbBGrZ0?= =?us-ascii?Q?wnbR/0Oqj0/GhRA5AdSroCjdO+1Q+RbwgO/GfXvJ0K3PZTH/EtrB2FrYMAtX?= =?us-ascii?Q?bmu27c4F6h3LaiTS9jcSyDGkx59F8Eg1fIT/iObpej3GyUmyvko3FbgSTiW5?= =?us-ascii?Q?cYQElFHYLBa38R11+cJVOul6TbH0OTj+th6I6yYfLFWCrlt9GO3jPhJbKRcO?= =?us-ascii?Q?BB7OqBOSP6LsOjLhrmLYmnUqTv+5wSRN1UkFOiM9u8AYxeK6FsMlEsuPPE9P?= =?us-ascii?Q?KordoEQVk4fPqpYUGDH3jJaMSwodkudpEMK3r2RHSJz2002DWDr85YzSJBpR?= =?us-ascii?Q?xeZD3vpRmGzsBo183qKSW8y3yDqayTvm4Z9ZLzCI6X0N4fkE6Ap5285y883E?= =?us-ascii?Q?7oqbW6ZMgM4vH6JPPY09JLPUg9rVg0u+jDQlIgxbfWxA4GDW/vahzzGfPx+h?= =?us-ascii?Q?XtnLXle6fg2rFE5llbv7a9npnH/ZrvjCuTUM93aS0hjIOdP5KI2zGbWtMrW7?= =?us-ascii?Q?V+l4v15YLanyOPZz2rdSOYVurRVLOV1hAssrsMDvyeMLQ7LDcoVItkACWCOL?= =?us-ascii?Q?+k/k31EQYl6lNDKAyfG3/abncP5xEdPGcM4M+TMIyLCeHSJ10oOPdKg2Hq0p?= =?us-ascii?Q?8VaMlHbQ+kKeMVVPM5F/m5ompN989SFLilbYpCYbEkcqH6p+NTMS73lqLiJH?= =?us-ascii?Q?H9JBtu/BMwxuRPYChRPmXR9pCd2f1XHKJMQ4KcOao/5phsHk2PNVBOwoEeLt?= =?us-ascii?Q?dxaC2cG1pktYrynUhIgGTudhFQybxWrctit7sJDIu0E6zYHSzWujH8qSZ6Cx?= =?us-ascii?Q?YBS6mAR2PcQT0vj0OfmSgF8n6D7yYt/4AczAEuubFNZyw8796Jb3/nQFEjbQ?= =?us-ascii?Q?RacMxMW6fF+T2lzbRsc3rux2xDC9TG5GuNpDTq8R7k0pXWkBcg98shRwrjw6?= =?us-ascii?Q?f28tKMvcxnYU8C7/J+Bxs5S1FyU//nInZ6U8P3GskNu+qRiAH/WzeBo23gjb?= =?us-ascii?Q?OoTQ+UqGEBPiD2I=3D?= X-Forefront-PRVS: 0350D7A55D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39840400002)(39450400003)(189998001)(575784001)(86362001)(53416004)(2870700001)(478600001)(53936002)(6486002)(5660300001)(50226002)(50466002)(42186005)(36756003)(81166006)(25786009)(50986999)(6506006)(76176999)(3846002)(23676002)(66066001)(47776003)(305945005)(33646002)(2906002)(38730400002)(110136004)(2361001)(6116002)(107886003)(4326008)(7736002)(6512007)(2351001)(2950100002)(8676002)(6666003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1998; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 23:HdJihaOS15LzIFMaTtdPSNMPQagdLzsWAMTYWUZ?= =?us-ascii?Q?O9akfC9NTcIEDJ5VXpKPWv1ccaQ2P6Z3GnrkE+k9N8NE8pa5pBiQPXOEzj8l?= =?us-ascii?Q?GGO9wHg0TSODdjDofZbcKANl3etlFejKMEcTLfNvhMwIXyZeh2/gMtE/yiSV?= =?us-ascii?Q?W4VOt35j4Swt0ASdTIfVtSD9zJq7zpXvslQ4Cn1vbRsAORIIr4Ykf5kk8GqZ?= =?us-ascii?Q?EgdL5uNNLl8IR8xs+EXbmTKiAOaY3CfqY2mtvklbYalVkO9Pme/o0xE0BO3U?= =?us-ascii?Q?IgS93T/aSSeS4B8hUu2EdTM6gm0phwSiIA4U4UUSNqjdZDvNNdTo7Hf0MYnP?= =?us-ascii?Q?1Da4uPpPRP46ZbYRCnvC8TK20lYzMu6ljWr5shWYYjC5bwFjCh0JGzcjcXMH?= =?us-ascii?Q?zX5yUW6AubegZ+086PmUc4HzHGdlAGB8ZWhcccxw5gdfLwIosPiGHCIhnadJ?= =?us-ascii?Q?HOdYnS7galWw5B9Qx80qfxuXTWCVzHLJDY4H+CJhxfVglDJvYOD4hX8Swihz?= =?us-ascii?Q?fh8hZB6Mv5lyIVTY18Sca3oD6wiN5MTeOfXcWA7FaDT3EURCke/sLKkuCLxa?= =?us-ascii?Q?xo4cKZYZBHTyUsKAo2vxdII8qklCwSRHCYk8vh4VVrvG0YQyk+a3f6V7nHA1?= =?us-ascii?Q?MedJZRZqOof7o0NlofthBomUSilClLpkw0Be2nLWL5fnUYJ6eO3TjWSfXUBY?= =?us-ascii?Q?XuwLajlj4duH92iQbiJGwsFFJUXb1p+T7TvGNbfT47OrQJMseFHY+Od2iyoO?= =?us-ascii?Q?Sf9ks8/kcMFhoiQxk8ideWYivwXiIopoWJP1630tfk2CFVGG8Hgb4lyd8OGw?= =?us-ascii?Q?cc5YKdcpFVXYV+Fujk0y9AvF39ATqQ6XhKJ3JUgI9yhJry9kQZOMfMGhHHqD?= =?us-ascii?Q?VVYWjEDd1RrcdyKBMzQM+n80Q24O8mPaQt96gy/rnoPBDSJaWKGLtEU1N/Df?= =?us-ascii?Q?XsbZTTamR/E31EbTgNCf1gIQiy7DH5m/0ngA2tT1/9ZCmRjKlVeL2aJ38nDE?= =?us-ascii?Q?VAxPvSps8sMz5+ebv6zeXOjuxNKyhTF5pETvR3d6x1Yie9qd8rMchWkf+4zP?= =?us-ascii?Q?akbwYID2SVt0QIOt0jshkKoY7R4l61bf8YyopcIneybMg8kQmOQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1998; 6:e7yE4vU50A67a85KuDpTCqgGHsrxLlQehR3BP7xq?= =?us-ascii?Q?QBfjbuL6TjY3u0xL05+Kv3Nnbp1Gr+pWQraaNeMOpnTHsgO5v/mOSuCbxGMH?= =?us-ascii?Q?sNDga8uqN9H9t9MvoEkpVM/Ckv+WfHaru8EbhDDFJK7tDzIlbRQKmgmZfv/J?= =?us-ascii?Q?P68PRE7yejCWP9wCkuR8eHGqpnXMqURap0gYw+JHpJqNvDLo0EWi0Ts7LwGS?= =?us-ascii?Q?uwk76OA/kFdOfRMitataZBetDD1gOkE6K1/oLNY4jEv6l+MSqWvUhZtYsx9a?= =?us-ascii?Q?dkHzHprHUsfIBKJqoDLqK65EuLlbMU3yw73EuritAnIy8e9veSBjoG8pNp31?= =?us-ascii?Q?54Zyh7TW13mO+VqHwUodd/qyjxmh3cWOcgqezOSYIkfn1chbRFCUkoRKzBZB?= =?us-ascii?Q?jpLSyKS75i20yPmyQsseeEuKDjUAYsqGRuhONMbW8OT1hM4GWb5y50H/7S0a?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TFKXUxJU9wxVM8kOyzBuTZbbvQLvChipccS/yD5UcygFuaSxjF5FlF9GqnP7NREVD/lGN5yie1Alj/4/rqBCXdaEp8wrDFa54= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1998; 20:nfJh5Ak6ts5J4Op9necL0znBInjwxdJbYBc2V46zap5eeceq/jw9RBCho/qArODfIKVtrgEOc7HUKUo+RkHZY5MgCB+8UxzBZmtml9SeCJ2OJjdCDb2Wstpc56YDcNSLzjiiHp+JTgDsmW6kNN87JaQA+aL1widOHKPwnmXR1eY= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2017 16:46:57.4146 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1998 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.5.98 Subject: [Qemu-devel] [PATCH v4 07/13] test-char: split char_udp_test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, Anton Nefedov , den@virtuozzo.com, marcandre.lureau@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP makes it possible to test the existing chardev-udp Signed-off-by: Anton Nefedov Reviewed-by: Marc-André Lureau --- tests/test-char.c | 57 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/tests/test-char.c b/tests/test-char.c index 90b1f50..1f0de25 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -409,16 +409,11 @@ static void char_pipe_test(void) } #endif -static void char_udp_test(void) +static int make_udp_socket(int *port) { - struct sockaddr_in addr = { 0, }, other; - SocketIdleData d = { 0, }; - Chardev *chr; - CharBackend be; + struct sockaddr_in addr = { 0, }; socklen_t alen = sizeof(addr); int ret, sock = qemu_socket(PF_INET, SOCK_DGRAM, 0); - char buf[10]; - char *tmp; g_assert_cmpint(sock, >, 0); addr.sin_family = AF_INET ; @@ -429,19 +424,41 @@ static void char_udp_test(void) ret = getsockname(sock, (struct sockaddr *)&addr, &alen); g_assert_cmpint(ret, ==, 0); - tmp = g_strdup_printf("udp:127.0.0.1:%d", - ntohs(addr.sin_port)); - chr = qemu_chr_new("client", tmp); - g_assert_nonnull(chr); + *port = ntohs(addr.sin_port); + return sock; +} + +static void char_udp_test_internal(Chardev *reuse_chr, int sock) +{ + struct sockaddr_in other; + SocketIdleData d = { 0, }; + Chardev *chr; + CharBackend *be; + socklen_t alen = sizeof(other); + int ret; + char buf[10]; + char *tmp = NULL; + + if (reuse_chr) { + chr = reuse_chr; + be = chr->be; + } else { + int port; + sock = make_udp_socket(&port); + tmp = g_strdup_printf("udp:127.0.0.1:%d", port); + chr = qemu_chr_new("client", tmp); + g_assert_nonnull(chr); + + be = g_alloca(sizeof(CharBackend)); + qemu_chr_fe_init(be, chr, &error_abort); + } d.chr = chr; - qemu_chr_fe_init(&be, chr, &error_abort); - qemu_chr_fe_set_handlers(&be, socket_can_read_hello, socket_read_hello, + qemu_chr_fe_set_handlers(be, socket_can_read_hello, socket_read_hello, NULL, NULL, &d, NULL, true); ret = qemu_chr_write_all(chr, (uint8_t *)"hello", 5); g_assert_cmpint(ret, ==, 5); - alen = sizeof(addr); ret = recvfrom(sock, buf, sizeof(buf), 0, (struct sockaddr *)&other, &alen); g_assert_cmpint(ret, ==, 5); @@ -450,10 +467,16 @@ static void char_udp_test(void) main_loop(); - close(sock); + if (!reuse_chr) { + close(sock); + qemu_chr_fe_deinit(be, true); + } g_free(tmp); - qemu_chr_fe_deinit(&be); - object_unparent(OBJECT(chr)); +} + +static void char_udp_test(void) +{ + char_udp_test_internal(NULL, 0); } #ifdef HAVE_CHARDEV_SERIAL