Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libloc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
libloc
Commits
d3a5f691
Commit
d3a5f691
authored
Nov 26, 2020
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network-list: Add more networks to test
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
3e8d86ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
src/test-network-list.c
src/test-network-list.c
+28
-1
No files found.
src/test-network-list.c
View file @
d3a5f691
...
...
@@ -72,6 +72,20 @@ int main(int argc, char** argv) {
exit
(
EXIT_FAILURE
);
}
struct
loc_network
*
subnet5
;
err
=
loc_network_new_from_string
(
ctx
,
&
subnet5
,
"2001:db8:e::/48"
);
if
(
err
)
{
fprintf
(
stderr
,
"Could not create the subnet5
\n
"
);
exit
(
EXIT_FAILURE
);
}
struct
loc_network
*
subnet6
;
err
=
loc_network_new_from_string
(
ctx
,
&
subnet6
,
"2001:db8:1::/48"
);
if
(
err
)
{
fprintf
(
stderr
,
"Could not create the subnet6
\n
"
);
exit
(
EXIT_FAILURE
);
}
// Make a list with both subnets
struct
loc_network_list
*
subnets
;
err
=
loc_network_list_new
(
ctx
,
&
subnets
);
...
...
@@ -117,10 +131,23 @@ int main(int argc, char** argv) {
exit
(
EXIT_FAILURE
);
}
// Add more subnets
err
=
loc_network_list_push
(
subnets
,
subnet5
);
if
(
err
)
{
fprintf
(
stderr
,
"Could not add subnet5 to subnets list
\n
"
);
exit
(
EXIT_FAILURE
);
}
err
=
loc_network_list_push
(
subnets
,
subnet6
);
if
(
err
)
{
fprintf
(
stderr
,
"Could not add subnet6 to subnets list
\n
"
);
exit
(
EXIT_FAILURE
);
}
loc_network_list_dump
(
subnets
);
size
=
loc_network_list_size
(
subnets
);
if
(
size
!=
4
)
{
if
(
size
!=
6
)
{
fprintf
(
stderr
,
"Network list is reporting an incorrect size: %zu
\n
"
,
size
);
exit
(
EXIT_FAILURE
);
}
...
...
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