Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
8cf40567
Commit
8cf40567
authored
Apr 19, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
3d7e4d06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
cppa/intrusive/single_reader_queue.hpp
cppa/intrusive/single_reader_queue.hpp
+1
-0
unit_testing/test__intrusive_containers.cpp
unit_testing/test__intrusive_containers.cpp
+20
-3
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+2
-0
No files found.
cppa/intrusive/single_reader_queue.hpp
View file @
8cf40567
...
...
@@ -206,6 +206,7 @@ class single_reader_queue
m_head
=
e
;
e
=
next
;
}
return
true
;
}
// next iteration
}
...
...
unit_testing/test__intrusive_containers.cpp
View file @
8cf40567
...
...
@@ -112,14 +112,31 @@ size_t test__intrusive_containers()
int
iarr3
[]
=
{
2
,
4
};
CPPA_CHECK
((
std
::
equal
(
begin
(
iarr3
),
end
(
iarr3
),
begin
(
ilist2
))));
auto
x
=
ilist2
.
take_after
(
ilist2
.
before_begin
());
CPPA_CHECK_EQUAL
(
x
->
value
,
2
);
delete
x
;
auto
x
y
=
ilist2
.
take_after
(
ilist2
.
before_begin
());
CPPA_CHECK_EQUAL
(
x
y
->
value
,
2
);
delete
x
y
;
ilist2
.
clear
();
// two dummies
CPPA_CHECK_EQUAL
(
s_iint_instances
,
2
);
CPPA_CHECK
(
ilist2
.
empty
());
cppa
::
intrusive
::
single_reader_queue
<
iint
>
q
;
q
.
push_back
(
new
iint
(
1
));
q
.
push_back
(
new
iint
(
2
));
q
.
push_back
(
new
iint
(
3
));
auto
x
=
q
.
pop
();
CPPA_CHECK_EQUAL
(
1
,
x
->
value
);
delete
x
;
x
=
q
.
pop
();
CPPA_CHECK_EQUAL
(
2
,
x
->
value
);
delete
x
;
x
=
q
.
pop
();
CPPA_CHECK_EQUAL
(
3
,
x
->
value
);
delete
x
;
x
=
q
.
try_pop
();
CPPA_CHECK
(
x
==
nullptr
);
return
CPPA_TEST_RESULT
;
}
unit_testing/test__spawn.cpp
View file @
8cf40567
#define CPPA_VERBOSE_CHECK
#include <stack>
#include <chrono>
#include <iostream>
...
...
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