Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
e34e03d1
Commit
e34e03d1
authored
Feb 28, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: missing test case for addition of duplicate entry
Solution: added test case
parent
d5742281
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
unittest_mtrie.cpp
unittests/unittest_mtrie.cpp
+20
-0
No files found.
unittests/unittest_mtrie.cpp
View file @
e34e03d1
...
...
@@ -86,6 +86,25 @@ void test_add_single_entry_match_exact ()
TEST_ASSERT_EQUAL_INT
(
1
,
count
);
}
void
test_add_single_entry_twice_match_exact
()
{
int
pipe
;
zmq
::
generic_mtrie_t
<
int
>
mtrie
;
const
zmq
::
generic_mtrie_t
<
int
>::
prefix_t
test_name
=
reinterpret_cast
<
zmq
::
generic_mtrie_t
<
int
>::
prefix_t
>
(
"foo"
);
bool
res
=
mtrie
.
add
(
test_name
,
getlen
(
test_name
),
&
pipe
);
TEST_ASSERT_TRUE
(
res
);
res
=
mtrie
.
add
(
test_name
,
getlen
(
test_name
),
&
pipe
);
TEST_ASSERT_FALSE
(
res
);
int
count
=
0
;
mtrie
.
match
(
test_name
,
getlen
(
test_name
),
mtrie_count
,
&
count
);
TEST_ASSERT_EQUAL_INT
(
1
,
count
);
}
void
test_add_two_entries_with_same_name_match_exact
()
{
int
pipe_1
,
pipe_2
;
...
...
@@ -408,6 +427,7 @@ int main (void)
RUN_TEST
(
test_check_empty_match_nonempty_data
);
RUN_TEST
(
test_check_empty_match_empty_data
);
RUN_TEST
(
test_add_single_entry_match_exact
);
RUN_TEST
(
test_add_single_entry_twice_match_exact
);
RUN_TEST
(
test_add_rm_single_entry_match_exact
);
RUN_TEST
(
test_add_two_entries_match_prefix_and_exact
);
RUN_TEST
(
test_add_two_entries_with_same_name_match_exact
);
...
...
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