Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
capnproto
Commits
479f0712
Commit
479f0712
authored
Dec 14, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup: Change KJ_ASSERT to KJ_EXPECT
parent
6141d71a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
memory-test.c++
c++/src/kj/memory-test.c++
+4
-4
No files found.
c++/src/kj/memory-test.c++
View file @
479f0712
...
...
@@ -212,12 +212,12 @@ TEST(Memory, OwnVoid) {
// On most (all?) C++ ABIs, the second base class in a multiply-inherited class is offset from
// the beginning of the object (assuming the first base class has non-zero size). We use this
// fact here to verify that then casting to Own<void> does in fact result in a pointer that
// points to the start of the overall object, not the base class. We
asser
t that the pointers
// points to the start of the overall object, not the base class. We
expec
t that the pointers
// are different here to prove that the test below is non-trivial.
//
// If there is some other ABI where these pointers are the same, and thus this
assert fails,
//
then it's no problem to #ifdef out the assert
on that platform.
KJ_
ASSER
T
(
static_cast
<
void
*>
(
baseAddr
)
!=
static_cast
<
void
*>
(
addr
));
// If there is some other ABI where these pointers are the same, and thus this
expectation
//
fails, then it's no problem to #ifdef out the expectation
on that platform.
KJ_
EXPEC
T
(
static_cast
<
void
*>
(
baseAddr
)
!=
static_cast
<
void
*>
(
addr
));
Own
<
void
>
voidPtr
=
kj
::
mv
(
basePtr
);
KJ_EXPECT
(
voidPtr
.
get
()
==
static_cast
<
void
*>
(
addr
));
...
...
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