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
b03be9a3
Commit
b03be9a3
authored
Jun 11, 2018
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Cygwin tests.
parent
3353ff72
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
async-io-test.c++
c++/src/kj/async-io-test.c++
+1
-1
filesystem-disk-test.c++
c++/src/kj/filesystem-disk-test.c++
+4
-2
filesystem-disk-unix.c++
c++/src/kj/filesystem-disk-unix.c++
+7
-5
No files found.
c++/src/kj/async-io-test.c++
View file @
b03be9a3
...
...
@@ -194,7 +194,7 @@ TEST(AsyncIo, TwoWayPipe) {
EXPECT_EQ
(
"bar"
,
result2
);
}
#if !_WIN32
#if !_WIN32
&& !__CYGWIN__
TEST
(
AsyncIo
,
CapabilityPipe
)
{
auto
ioContext
=
setupAsyncIo
();
...
...
c++/src/kj/filesystem-disk-test.c++
View file @
b03be9a3
...
...
@@ -196,7 +196,7 @@ private:
bool
isWine
()
{
return
false
;
}
#if __APPLE__
#if __APPLE__
|| __CYGWIN__
#define HOLES_NOT_SUPPORTED 1
#endif
...
...
@@ -324,7 +324,7 @@ KJ_TEST("DiskFile") {
file
->
write
(
12
,
StringPtr
(
"corge"
).
asBytes
());
KJ_EXPECT
(
kj
::
str
(
mapping
.
slice
(
12
,
17
).
asChars
())
==
"corge"
);
#if !_WIN32 // Windows doesn't allow the file size to change while mapped.
#if !_WIN32
&& !__CYGWIN__
// Windows doesn't allow the file size to change while mapped.
// Can shrink.
file
->
truncate
(
6
);
KJ_EXPECT
(
kj
::
str
(
mapping
.
slice
(
12
,
17
).
asChars
())
==
kj
::
StringPtr
(
"
\0\0\0\0\0
"
,
5
));
...
...
@@ -723,6 +723,7 @@ KJ_TEST("DiskDirectory createTemporary") {
KJ_EXPECT
(
dir
->
listNames
()
==
nullptr
);
}
#if !__CYGWIN__ // TODO(soon): Figure out why this doesn't work on Cygwin.
KJ_TEST
(
"DiskDirectory replaceSubdir()"
)
{
TempDir
tempDir
;
auto
dir
=
tempDir
.
get
();
...
...
@@ -762,6 +763,7 @@ KJ_TEST("DiskDirectory replaceSubdir()") {
KJ_EXPECT
(
!
dir
->
exists
(
Path
({
"foo"
,
"bar"
})));
KJ_EXPECT
(
dir
->
openFile
(
Path
({
"foo"
,
"corge"
}))
->
readAllText
()
==
"bazqux"
);
}
#endif // !__CYGWIN__
KJ_TEST
(
"DiskDirectory replace directory with file"
)
{
TempDir
tempDir
;
...
...
c++/src/kj/filesystem-disk-unix.c++
View file @
b03be9a3
...
...
@@ -222,7 +222,12 @@ struct MmapRange {
};
static
MmapRange
getMmapRange
(
uint64_t
offset
,
uint64_t
size
)
{
// Rounds the given byte range up to page boundaries.
// Comes up with an offset and size to pass to mmap(), given an offset and size requested by
// the caller, and considering the fact that mappings must start at a page boundary.
//
// The offset is rounded down to the nearest page boundary, and the size is increased to
// compensate. Note that the endpoint of the mapping is *not* rounded up to a page boundary, as
// mmap() does not actually require this, and it causes trouble on some systems (notably Cygwin).
#ifndef _SC_PAGESIZE
#define _SC_PAGESIZE _SC_PAGE_SIZE
...
...
@@ -232,10 +237,7 @@ static MmapRange getMmapRange(uint64_t offset, uint64_t size) {
uint64_t
realOffset
=
offset
&
~
pageMask
;
uint64_t
end
=
offset
+
size
;
uint64_t
realEnd
=
(
end
+
pageMask
)
&
~
pageMask
;
return
{
realOffset
,
realEnd
-
realOffset
};
return
{
realOffset
,
offset
+
size
-
realOffset
};
}
class
MmapDisposer
:
public
ArrayDisposer
{
...
...
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