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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
bccb2434
Commit
bccb2434
authored
Jul 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
56b8ddda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
18 deletions
+24
-18
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+24
-18
No files found.
bigfile/tests/test_virtmem.c
View file @
bccb2434
...
@@ -223,34 +223,40 @@ int M(VMA *vma, pgoff_t idx) { return bitmap_test_bit(vma->page_ismappedv, idx)
...
@@ -223,34 +223,40 @@ int M(VMA *vma, pgoff_t idx) { return bitmap_test_bit(vma->page_ismappedv, idx)
ok1(!pagemap_get(&(fileh)->pagemap, (pgoffset))); \
ok1(!pagemap_get(&(fileh)->pagemap, (pgoffset))); \
} while (0)
} while (0)
/* _pagev_str returns string representation for vector of pages.
* the memory has to be freed by user. */
char
*
_pagev_str
(
Page
**
pagev
,
int
pagec
)
{
char
*
vstr
;
size_t
_
;
FILE
*
w
=
open_memstream
(
&
vstr
,
&
_
);
fprintf
(
w
,
"["
);
for
(
int
i
=
0
;
i
<
pagec
;
i
++
)
fprintf
(
w
,
"%sp%ld"
,
(
i
>
0
?
", "
:
""
),
pagev
[
i
]
->
f_pgoffset
);
fprintf
(
w
,
"]"
);
fclose
(
w
);
return
vstr
;
}
/* _assert_pagev asserts that two page vectors are the same */
/* _assert_pagev asserts that two page vectors are the same */
void
_assert_pagev
(
const
char
*
subj
,
Page
**
vok
,
int
nok
,
Page
**
pagev
,
int
n
,
void
_assert_pagev
(
const
char
*
subj
,
Page
**
vok
,
int
nok
,
Page
**
pagev
,
int
n
,
const
char
*
func
,
const
char
*
file
,
int
line
)
const
char
*
func
,
const
char
*
file
,
int
line
)
{
{
int
i
;
char
*
vstr
=
_pagev_str
(
pagev
,
n
)
;
if
(
!
(
n
==
nok
&&
!
memcmp
(
pagev
,
vok
,
n
*
sizeof
(
*
pagev
))))
{
if
(
!
(
n
==
nok
&&
!
memcmp
(
pagev
,
vok
,
n
*
sizeof
(
*
pagev
))))
{
char
*
vstr_ok
=
_pagev_str
(
vok
,
nok
);
fprintf
(
stderr
,
"%s: failed
\n
"
,
subj
);
fprintf
(
stderr
,
"%s: failed
\n
"
,
subj
);
fprintf
(
stderr
,
"have: ["
);
fprintf
(
stderr
,
"have: %s
\n
"
,
vstr
);
for
(
i
=
0
;
i
<
n
;
i
++
)
fprintf
(
stderr
,
"want: %s
\n
"
,
vstr_ok
);
fprintf
(
stderr
,
"%sp%ld"
,
(
i
>
0
?
", "
:
""
),
pagev
[
i
]
->
f_pgoffset
);
fprintf
(
stderr
,
"]
\n
"
);
fprintf
(
stderr
,
"want: ["
);
for
(
i
=
0
;
i
<
nok
;
i
++
)
fprintf
(
stderr
,
"%sp%ld"
,
(
i
>
0
?
", "
:
""
),
vok
[
i
]
->
f_pgoffset
);
fprintf
(
stderr
,
"]
\n
"
);
_gen_result
(
0
,
func
,
file
,
line
,
"%s failed"
,
subj
);
_gen_result
(
0
,
func
,
file
,
line
,
"%s failed"
,
subj
);
}
free
(
vstr_ok
);
else
{
}
else
{
char
*
vstr
;
asprintf
(
&
vstr
,
"["
);
for
(
i
=
0
;
i
<
n
;
i
++
)
asprintf
(
&
vstr
,
"%sp%ld"
,
(
i
>
0
?
", "
:
""
),
pagev
[
i
]
->
f_pgoffset
);
asprintf
(
&
vstr
,
"]"
);
pass
(
"%s %s"
,
subj
,
vstr
);
pass
(
"%s %s"
,
subj
,
vstr
);
free
(
vstr
);
}
}
free
(
vstr
);
}
}
/* _check_mru checks that ram has MRU pages as specified by pagev. */
/* _check_mru checks that ram has MRU pages as specified by pagev. */
...
...
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