Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
935fcc90
Commit
935fcc90
authored
Feb 03, 2016
by
Willem Thiart
Browse files
Refactor: clean up log test valgrind errors
parent
663f4be1
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/test_log.c
View file @
935fcc90
...
...
@@ -70,7 +70,7 @@ static int __log_pop(
{
raft_entry_t
*
copy
=
malloc
(
sizeof
(
*
entry
));
memcpy
(
copy
,
entry
,
sizeof
(
*
entry
));
llqueue_offer
(
(
void
*
)
raft
,
copy
);
llqueue_offer
(
user_data
,
copy
);
return
0
;
}
...
...
@@ -80,12 +80,14 @@ void TestLog_delete(CuTest * tc)
raft_entry_t
e1
,
e2
,
e3
;
void
*
queue
=
llqueue_new
();
void
*
r
=
raft_new
();
l
=
log_new
();
raft_cbs_t
funcs
=
{
.
log_pop
=
__log_pop
};
log_set_callbacks
(
l
,
&
funcs
,
queue
);
raft_set_callbacks
(
r
,
&
funcs
,
queue
);
log_set_callbacks
(
l
,
&
funcs
,
r
);
e1
.
id
=
1
;
CuAssertTrue
(
tc
,
0
==
log_append_entry
(
l
,
&
e1
));
...
...
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