Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
d208258f
Commit
d208258f
authored
Dec 06, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idtree: add unit test for ids around INT_MAX
This causes a SEGV on my laptop.
parent
637ee8ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
ccan/idtree/test/run-wrap.c
ccan/idtree/test/run-wrap.c
+22
-0
ccan/idtree/test/run.c
ccan/idtree/test/run.c
+1
-1
No files found.
ccan/idtree/test/run-wrap.c
0 → 100644
View file @
d208258f
#include <ccan/idtree/idtree.c>
#include <ccan/tap/tap.h>
#include <limits.h>
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
int
i
;
struct
idtree
*
idtree
;
plan_tests
(
6
);
idtree
=
idtree_new
(
NULL
);
ok1
(
idtree_add_above
(
idtree
,
&
i
,
INT_MAX
-
1
,
INT_MAX
)
==
INT_MAX
-
1
);
ok1
(
idtree_add_above
(
idtree
,
&
i
,
INT_MAX
-
1
,
INT_MAX
)
==
INT_MAX
);
ok1
(
idtree_add_above
(
idtree
,
&
i
,
INT_MAX
-
1
,
INT_MAX
)
==
-
1
);
ok1
(
idtree_remove
(
idtree
,
INT_MAX
-
1
)
==
true
);
ok1
(
idtree_add_above
(
idtree
,
&
i
,
INT_MAX
-
1
,
INT_MAX
)
==
INT_MAX
-
1
);
ok1
(
idtree_add_above
(
idtree
,
&
i
,
INT_MAX
-
1
,
INT_MAX
)
==
-
1
);
talloc_free
(
idtree
);
exit
(
exit_status
());
}
ccan/idtree/test/run.c
View file @
d208258f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#include <ccan/tap/tap.h>
#include <ccan/tap/tap.h>
#include <limits.h>
#include <limits.h>
#define ALLOC_MAX
32
#define ALLOC_MAX
(2 * IDTREE_SIZE)
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
...
...
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