aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/unit1397.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-04-03 16:21:10 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-04-03 22:38:36 +0200
commita981141b199702ffd780a4390e601db565102c65 (patch)
treec92b2a21887fb1f9683372c2564584d1ee79fea7 /tests/unit/unit1397.c
parentd3252e000c96f31456667c3033c13d83e2628d29 (diff)
unit: make unit test source code checksrc compliant
Diffstat (limited to 'tests/unit/unit1397.c')
-rw-r--r--tests/unit/unit1397.c70
1 files changed, 49 insertions, 21 deletions
diff --git a/tests/unit/unit1397.c b/tests/unit/unit1397.c
index c05c119db..37e8e49de 100644
--- a/tests/unit/unit1397.c
+++ b/tests/unit/unit1397.c
@@ -1,3 +1,24 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
#include "curlcheck.h"
#include "hostcheck.h" /* from the lib dir */
@@ -19,29 +40,36 @@ UNITTEST_START
/* here you start doing things and checking that the results are good */
-fail_unless( Curl_cert_hostcheck("www.example.com", "www.example.com"), "good 1" );
-fail_unless( Curl_cert_hostcheck("*.example.com", "www.example.com"), "good 2" );
-fail_unless( Curl_cert_hostcheck("xxx*.example.com", "xxxwww.example.com"), "good 3" );
-fail_unless( Curl_cert_hostcheck("f*.example.com", "foo.example.com"), "good 4" );
-fail_unless( Curl_cert_hostcheck("192.168.0.0", "192.168.0.0"), "good 5" );
-
-fail_if( Curl_cert_hostcheck("xxx.example.com", "www.example.com"), "bad 1" );
-fail_if( Curl_cert_hostcheck("*", "www.example.com"), "bad 2" );
-fail_if( Curl_cert_hostcheck("*.*.com", "www.example.com"), "bad 3" );
-fail_if( Curl_cert_hostcheck("*.example.com", "baa.foo.example.com"), "bad 4" );
-fail_if( Curl_cert_hostcheck("f*.example.com", "baa.example.com"), "bad 5" );
-fail_if( Curl_cert_hostcheck("*.com", "example.com"), "bad 6" );
-fail_if( Curl_cert_hostcheck("*fail.com", "example.com"), "bad 7" );
-fail_if( Curl_cert_hostcheck("*.example.", "www.example."), "bad 8" );
-fail_if( Curl_cert_hostcheck("*.example.", "www.example"), "bad 9" );
-fail_if( Curl_cert_hostcheck("", "www"), "bad 10" );
-fail_if( Curl_cert_hostcheck("*", "www"), "bad 11" );
-fail_if( Curl_cert_hostcheck("*.168.0.0", "192.168.0.0"), "bad 12" );
-fail_if( Curl_cert_hostcheck("www.example.com", "192.168.0.0"), "bad 13" );
+fail_unless(Curl_cert_hostcheck("www.example.com", "www.example.com"),
+ "good 1");
+fail_unless(Curl_cert_hostcheck("*.example.com", "www.example.com"),
+ "good 2");
+fail_unless(Curl_cert_hostcheck("xxx*.example.com", "xxxwww.example.com"),
+ "good 3");
+fail_unless(Curl_cert_hostcheck("f*.example.com", "foo.example.com"),
+ "good 4");
+fail_unless(Curl_cert_hostcheck("192.168.0.0", "192.168.0.0"),
+ "good 5");
+
+fail_if(Curl_cert_hostcheck("xxx.example.com", "www.example.com"), "bad 1" );
+fail_if(Curl_cert_hostcheck("*", "www.example.com"), "bad 2" );
+fail_if(Curl_cert_hostcheck("*.*.com", "www.example.com"), "bad 3" );
+fail_if(Curl_cert_hostcheck("*.example.com", "baa.foo.example.com"), "bad 4" );
+fail_if(Curl_cert_hostcheck("f*.example.com", "baa.example.com"), "bad 5" );
+fail_if(Curl_cert_hostcheck("*.com", "example.com"), "bad 6" );
+fail_if(Curl_cert_hostcheck("*fail.com", "example.com"), "bad 7" );
+fail_if(Curl_cert_hostcheck("*.example.", "www.example."), "bad 8" );
+fail_if(Curl_cert_hostcheck("*.example.", "www.example"), "bad 9");
+fail_if(Curl_cert_hostcheck("", "www"), "bad 10");
+fail_if(Curl_cert_hostcheck("*", "www"), "bad 11");
+fail_if(Curl_cert_hostcheck("*.168.0.0", "192.168.0.0"), "bad 12");
+fail_if(Curl_cert_hostcheck("www.example.com", "192.168.0.0"), "bad 13");
#ifdef ENABLE_IPV6
-fail_if( Curl_cert_hostcheck("*::3285:a9ff:fe46:b619", "fe80::3285:a9ff:fe46:b619"), "bad 14" );
-fail_unless( Curl_cert_hostcheck("fe80::3285:a9ff:fe46:b619", "fe80::3285:a9ff:fe46:b619"), "good 6" );
+fail_if(Curl_cert_hostcheck("*::3285:a9ff:fe46:b619",
+ "fe80::3285:a9ff:fe46:b619"), "bad 14");
+fail_unless(Curl_cert_hostcheck("fe80::3285:a9ff:fe46:b619",
+ "fe80::3285:a9ff:fe46:b619"), "good 6");
#endif
#endif