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
dcce2eca
Commit
dcce2eca
authored
Jun 27, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sign warnings
parent
3f4d5566
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
libcaf_core/test/streambuf.cpp
libcaf_core/test/streambuf.cpp
+17
-15
No files found.
libcaf_core/test/streambuf.cpp
View file @
dcce2eca
...
...
@@ -55,29 +55,31 @@ CAF_TEST(signed_arraybuf) {
}
CAF_TEST
(
unsigned_arraybuf
)
{
using
buf_type
=
arraybuf
<
uint8_t
>
;
std
::
vector
<
uint8_t
>
data
=
{
0x0a
,
0x0b
,
0x0c
,
0x0d
};
arraybuf
<
uint8_t
>
ab
{
data
};
buf_type
ab
{
data
};
decltype
(
data
)
buf
;
std
::
copy
(
std
::
istreambuf_iterator
<
uint8_t
>
{
&
ab
},
std
::
istreambuf_iterator
<
uint8_t
>
{},
std
::
back_inserter
(
buf
));
CAF_CHECK_EQUAL
(
data
,
buf
);
// Relative positioning.
using
pos
=
arraybuf
<
uint8_t
>::
pos_type
;
CAF_CHECK_EQUAL
(
ab
.
pubseekoff
(
2
,
std
::
ios
::
beg
,
std
::
ios
::
in
),
pos
{
2
});
CAF_CHECK_EQUAL
(
ab
.
sbumpc
(),
static_cast
<
int
>
(
0x0c
));
CAF_CHECK_EQUAL
(
ab
.
sgetc
(),
0x0d
);
CAF_CHECK_EQUAL
(
ab
.
pubseekoff
(
0
,
std
::
ios
::
cur
,
std
::
ios
::
in
),
pos
{
3
});
CAF_CHECK_EQUAL
(
ab
.
pubseekoff
(
-
2
,
std
::
ios
::
cur
,
std
::
ios
::
in
),
pos
{
1
});
CAF_CHECK_EQUAL
(
ab
.
sgetc
(),
0x0b
);
CAF_CHECK_EQUAL
(
ab
.
pubseekoff
(
-
4
,
std
::
ios
::
end
,
std
::
ios
::
in
),
pos
{
0
});
CAF_CHECK_EQUAL
(
ab
.
sgetc
(),
0x0a
);
using
pos_type
=
buf_type
::
pos_type
;
using
int_type
=
buf_type
::
int_type
;
CAF_CHECK_EQUAL
(
ab
.
pubseekoff
(
2
,
std
::
ios
::
beg
,
std
::
ios
::
in
),
pos_type
{
2
});
CAF_CHECK_EQUAL
(
ab
.
sbumpc
(),
int_type
{
0x0c
});
CAF_CHECK_EQUAL
(
ab
.
sgetc
(),
int_type
{
0x0d
});
CAF_CHECK_EQUAL
(
ab
.
pubseekoff
(
0
,
std
::
ios
::
cur
,
std
::
ios
::
in
),
pos_type
{
3
});
CAF_CHECK_EQUAL
(
ab
.
pubseekoff
(
-
2
,
std
::
ios
::
cur
,
std
::
ios
::
in
),
pos_type
{
1
});
CAF_CHECK_EQUAL
(
ab
.
sgetc
(),
int_type
{
0x0b
});
CAF_CHECK_EQUAL
(
ab
.
pubseekoff
(
-
4
,
std
::
ios
::
end
,
std
::
ios
::
in
),
pos_type
{
0
});
CAF_CHECK_EQUAL
(
ab
.
sgetc
(),
int_type
{
0x0a
});
// Absolute positioning.
CAF_CHECK_EQUAL
(
ab
.
pubseekpos
(
1
,
std
::
ios
::
in
),
pos
{
1
});
CAF_CHECK_EQUAL
(
ab
.
sgetc
(),
0x0b
);
CAF_CHECK_EQUAL
(
ab
.
pubseekpos
(
3
,
std
::
ios
::
in
),
pos
{
3
});
CAF_CHECK_EQUAL
(
ab
.
sbumpc
(),
0x0d
);
CAF_CHECK_EQUAL
(
ab
.
in_avail
(),
0
);
CAF_CHECK_EQUAL
(
ab
.
pubseekpos
(
1
,
std
::
ios
::
in
),
pos
_type
{
1
});
CAF_CHECK_EQUAL
(
ab
.
sgetc
(),
int_type
{
0x0b
}
);
CAF_CHECK_EQUAL
(
ab
.
pubseekpos
(
3
,
std
::
ios
::
in
),
pos
_type
{
3
});
CAF_CHECK_EQUAL
(
ab
.
sbumpc
(),
int_type
{
0x0d
}
);
CAF_CHECK_EQUAL
(
ab
.
in_avail
(),
std
::
streamsize
{
0
}
);
}
CAF_TEST
(
containerbuf
)
{
...
...
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