Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A7CFC200D27 for ; Wed, 25 Oct 2017 20:07:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A6496160BDA; Wed, 25 Oct 2017 18:07:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EF7F01609CE for ; Wed, 25 Oct 2017 20:07:07 +0200 (CEST) Received: (qmail 31408 invoked by uid 500); 25 Oct 2017 18:07:07 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 31399 invoked by uid 99); 25 Oct 2017 18:07:07 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2017 18:07:07 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 76D483A00AF for ; Wed, 25 Oct 2017 18:07:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1813330 - /apr/apr/trunk/test/testipsub.c Date: Wed, 25 Oct 2017 18:07:03 -0000 To: commits@apr.apache.org From: jorton@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20171025180705.76D483A00AF@svn01-us-west.apache.org> archived-at: Wed, 25 Oct 2017 18:07:08 -0000 Author: jorton Date: Wed Oct 25 18:07:03 2017 New Revision: 1813330 URL: http://svn.apache.org/viewvc?rev=1813330&view=rev Log: * test/testipsub.c (test_parse_addr_port): More tests. Modified: apr/apr/trunk/test/testipsub.c Modified: apr/apr/trunk/test/testipsub.c URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testipsub.c?rev=1813330&r1=1813329&r2=1813330&view=diff ============================================================================== --- apr/apr/trunk/test/testipsub.c (original) +++ apr/apr/trunk/test/testipsub.c Wed Oct 25 18:07:03 2017 @@ -173,18 +173,25 @@ static void test_parse_addr_port(abts_ca const char *addr, *scope_id; apr_port_t port; } *test, testcases[] = { + /* Success cases */ { "localhost:80", APR_SUCCESS, "localhost", NULL, 80 } + ,{ "localhost", APR_SUCCESS, "localhost", NULL, 0 } ,{ "www.example.com:8080", APR_SUCCESS, "www.example.com", NULL, 8080 } ,{ "w:1", APR_SUCCESS, "w", NULL, 1 } ,{ "127.0.0.1:80", APR_SUCCESS, "127.0.0.1", NULL, 80 } ,{ "[::]:80", APR_SUCCESS, "::", NULL, 80 } + ,{ "[::%eth0]:80", APR_SUCCESS, "::", "eth0", 80 } + ,{ "[::%eth0]", APR_SUCCESS, "::", "eth0", 0 } + ,{ "8080", APR_SUCCESS, NULL, NULL, 8080 } /* API doc has this case */ + + /* Failure cases */ ,{ "localhost:999999", APR_EINVAL, NULL, NULL, 0 } ,{ "localhost:0", APR_EINVAL, NULL, NULL, 0 } + ,{ "[abc]", APR_EINVAL, NULL, NULL, 0 } ,{ "[::]z:80", APR_EINVAL, NULL, NULL, 0 } ,{ "[:::80", APR_EINVAL, NULL, NULL, 0 } ,{ "[zzzz]:80", APR_EINVAL, NULL, NULL, 0 } ,{ "[::%]:80", APR_EINVAL, NULL, NULL, 0 } - ,{ "[::%eth0]:80", APR_SUCCESS, "::", "eth0", 80 } /* ,{ "127.0.0.1:80x", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */ /* ,{ "127.0.0.1x:80", APR_EINVAL, NULL, NULL, 0 } <- maybe should fail?, doesn't */ /* ,{ "localhost:-1", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */