Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
actor-incubator
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
cpp-libs
actor-incubator
Commits
fa392237
Commit
fa392237
authored
Sep 11, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix BASP unit tests
parent
90aa1d31
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
libcaf_net/test/application.cpp
libcaf_net/test/application.cpp
+4
-1
libcaf_net/test/header.cpp
libcaf_net/test/header.cpp
+6
-0
No files found.
libcaf_net/test/application.cpp
View file @
fa392237
...
...
@@ -129,10 +129,13 @@ struct fixture : test_coordinator_fixture<> {
#define RECEIVE(msg_type, op_data, ...) \
do { \
serializer_impl<buffer_type> source{sys, output};
\
binary_deserializer source{sys, output};
\
basp::header hdr; \
if (auto err = source(hdr, __VA_ARGS__)) \
CAF_FAIL("failed to receive data: " << sys.render(err)); \
if (source.remaining() != 0) \
CAF_FAIL("unable to read entire message, " << source.remaining() \
<< " bytes left in buffer"); \
CAF_CHECK_EQUAL(hdr.type, msg_type); \
CAF_CHECK_EQUAL(hdr.operation_data, op_data); \
output.clear(); \
...
...
libcaf_net/test/header.cpp
View file @
fa392237
...
...
@@ -36,12 +36,18 @@ CAF_TEST(serialization) {
CAF_CHECK_EQUAL
(
sink
(
x
),
none
);
}
CAF_CHECK_EQUAL
(
buf
.
size
(),
basp
::
header_size
);
auto
buf2
=
to_bytes
(
x
);
CAF_REQUIRE_EQUAL
(
buf
.
size
(),
buf2
.
size
());
CAF_CHECK
(
std
::
equal
(
buf
.
begin
(),
buf
.
end
(),
buf2
.
begin
()));
basp
::
header
y
;
{
binary_deserializer
source
{
nullptr
,
buf
};
CAF_CHECK_EQUAL
(
source
(
y
),
none
);
}
CAF_CHECK_EQUAL
(
x
,
y
);
auto
z
=
basp
::
header
::
from_bytes
(
buf
);
CAF_CHECK_EQUAL
(
x
,
z
);
CAF_CHECK_EQUAL
(
y
,
z
);
}
CAF_TEST
(
to_string
)
{
...
...
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