Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
323df0d2
Commit
323df0d2
authored
Jul 09, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
199f3d79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+14
-1
No files found.
bigfile/tests/test_virtmem.c
View file @
323df0d2
...
...
@@ -1160,7 +1160,7 @@ void test_file_access_mmapbase(void)
RAM
*
ram
;
BigFileH
fh_struct
,
*
fh
=
&
fh_struct
;
VMA
vma_struct
,
*
vma
=
&
vma_struct
;
size_t
PS
;
size_t
PS
,
PSb
;
int
fd
,
err
;
diag
(
"Testing file access (mmap base)"
);
...
...
@@ -1168,6 +1168,7 @@ void test_file_access_mmapbase(void)
ram
=
ram_new
(
NULL
,
NULL
);
ok1
(
ram
);
PS
=
ram
->
pagesize
;
PSb
=
PS
/
sizeof
(
blk_t
);
/* page size in blk_t units */
/* ensure we are starting from new ram */
ok1
(
list_empty
(
&
ram
->
lru_list
));
...
...
@@ -1178,6 +1179,7 @@ void test_file_access_mmapbase(void)
ok1
(
fd
!=
-
1
);
err
=
unlink
(
path
);
ok1
(
!
err
);
// XXX write data
BigFileMMap
fileid
=
{
.
blksize
=
ram
->
pagesize
,
/* artificially blksize = pagesize */
...
...
@@ -1196,6 +1198,17 @@ void test_file_access_mmapbase(void)
err
=
fileh_mmap
(
vma
,
fh
,
100
,
4
);
ok1
(
!
err
);
/* all pages initially unmapped */
ok1
(
!
M
(
vma
,
0
));
CHECK_NOPAGE
(
100
);
ok1
(
!
M
(
vma
,
1
));
CHECK_NOPAGE
(
101
);
ok1
(
!
M
(
vma
,
2
));
CHECK_NOPAGE
(
102
);
ok1
(
!
M
(
vma
,
3
));
CHECK_NOPAGE
(
103
);
ok1
(
list_empty
(
&
ram
->
lru_list
));
/* read page[0] */
ok1
(
B
(
vma
,
0
*
PSb
)
==
100
);
}
...
...
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