Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
cd74cbba
Commit
cd74cbba
authored
Jan 31, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plug test leaks
parent
cf7038a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
tests-clar/network/urlparse.c
+16
-12
No files found.
tests-clar/network/urlparse.c
View file @
cd74cbba
#include "clar_libgit2.h"
#include "netops.h"
void
test_network_urlparse__trivial
(
void
)
char
*
host
,
*
port
,
*
user
,
*
pass
;
void
test_network_urlparse__initialize
(
void
)
{
char
*
host
,
*
port
,
*
user
,
*
pass
;
host
=
port
=
user
=
pass
=
NULL
;
}
void
test_network_urlparse__cleanup
(
void
)
{
#define FREE_AND_NULL(x) if (x) { git__free(x); x = NULL; }
FREE_AND_NULL
(
host
);
FREE_AND_NULL
(
port
);
FREE_AND_NULL
(
user
);
FREE_AND_NULL
(
pass
);
}
void
test_network_urlparse__trivial
(
void
)
{
cl_git_pass
(
gitno_extract_url_parts
(
&
host
,
&
port
,
&
user
,
&
pass
,
"example.com/resource"
,
"8080"
));
cl_assert_equal_s
(
host
,
"example.com"
);
...
...
@@ -15,8 +29,6 @@ void test_network_urlparse__trivial(void)
void
test_network_urlparse__user
(
void
)
{
char
*
host
,
*
port
,
*
user
,
*
pass
;
cl_git_pass
(
gitno_extract_url_parts
(
&
host
,
&
port
,
&
user
,
&
pass
,
"user@example.com/resource"
,
"8080"
));
cl_assert_equal_s
(
host
,
"example.com"
);
...
...
@@ -27,8 +39,6 @@ void test_network_urlparse__user(void)
void
test_network_urlparse__user_pass
(
void
)
{
char
*
host
,
*
port
,
*
user
,
*
pass
;
/* user:pass@hostname.tld/resource */
cl_git_pass
(
gitno_extract_url_parts
(
&
host
,
&
port
,
&
user
,
&
pass
,
"user:pass@example.com/resource"
,
"8080"
));
...
...
@@ -40,8 +50,6 @@ void test_network_urlparse__user_pass(void)
void
test_network_urlparse__port
(
void
)
{
char
*
host
,
*
port
,
*
user
,
*
pass
;
/* hostname.tld:port/resource */
cl_git_pass
(
gitno_extract_url_parts
(
&
host
,
&
port
,
&
user
,
&
pass
,
"example.com:9191/resource"
,
"8080"
));
...
...
@@ -53,8 +61,6 @@ void test_network_urlparse__port(void)
void
test_network_urlparse__user_port
(
void
)
{
char
*
host
,
*
port
,
*
user
,
*
pass
;
/* user@hostname.tld:port/resource */
cl_git_pass
(
gitno_extract_url_parts
(
&
host
,
&
port
,
&
user
,
&
pass
,
"user@example.com:9191/resource"
,
"8080"
));
...
...
@@ -66,8 +72,6 @@ void test_network_urlparse__user_port(void)
void
test_network_urlparse__user_pass_port
(
void
)
{
char
*
host
,
*
port
,
*
user
,
*
pass
;
/* user:pass@hostname.tld:port/resource */
cl_git_pass
(
gitno_extract_url_parts
(
&
host
,
&
port
,
&
user
,
&
pass
,
"user:pass@example.com:9191/resource"
,
"8080"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment