Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
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
Kirill Smelkov
mariadb
Commits
1e865f0a
Commit
1e865f0a
authored
Dec 01, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync() the file to try to fix pagecache test.
storage/maria/unittest/ma_pagecache_single.c: Check flush result.
parent
b7ae94d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
storage/maria/unittest/ma_pagecache_single.c
storage/maria/unittest/ma_pagecache_single.c
+16
-4
storage/maria/unittest/test_file.c
storage/maria/unittest/test_file.c
+5
-0
No files found.
storage/maria/unittest/ma_pagecache_single.c
View file @
1e865f0a
...
@@ -111,7 +111,11 @@ int simple_read_write_test()
...
@@ -111,7 +111,11 @@ int simple_read_write_test()
0
);
0
);
ok
((
res
=
test
(
memcmp
(
buffr
,
buffw
,
PAGE_SIZE
)
==
0
)),
ok
((
res
=
test
(
memcmp
(
buffr
,
buffw
,
PAGE_SIZE
)
==
0
)),
"Simple write-read page "
);
"Simple write-read page "
);
flush_pagecache_blocks
(
&
pagecache
,
&
file1
,
FLUSH_FORCE_WRITE
);
if
(
flush_pagecache_blocks
(
&
pagecache
,
&
file1
,
FLUSH_FORCE_WRITE
))
{
diag
(
"Got error during flushing pagecache
\n
"
);
exit
(
1
);
}
ok
((
res
&=
test
(
test_file
(
file1
,
file1_name
,
PAGE_SIZE
,
PAGE_SIZE
,
ok
((
res
&=
test
(
test_file
(
file1
,
file1_name
,
PAGE_SIZE
,
PAGE_SIZE
,
simple_read_write_test_file
))),
simple_read_write_test_file
))),
"Simple write-read page file"
);
"Simple write-read page file"
);
...
@@ -141,7 +145,11 @@ int simple_read_change_write_read_test()
...
@@ -141,7 +145,11 @@ int simple_read_change_write_read_test()
PAGECACHE_PIN_LEFT_UNPINNED
,
PAGECACHE_PIN_LEFT_UNPINNED
,
PAGECACHE_WRITE_DELAY
,
PAGECACHE_WRITE_DELAY
,
0
,
LSN_IMPOSSIBLE
);
0
,
LSN_IMPOSSIBLE
);
flush_pagecache_blocks
(
&
pagecache
,
&
file1
,
FLUSH_FORCE_WRITE
);
if
(
flush_pagecache_blocks
(
&
pagecache
,
&
file1
,
FLUSH_FORCE_WRITE
))
{
diag
(
"Got error during flushing pagecache
\n
"
);
exit
(
1
);
}
/* test */
/* test */
pagecache_read
(
&
pagecache
,
&
file1
,
0
,
3
,
(
char
*
)
buffw
,
pagecache_read
(
&
pagecache
,
&
file1
,
0
,
3
,
(
char
*
)
buffw
,
PAGECACHE_PLAIN_PAGE
,
PAGECACHE_PLAIN_PAGE
,
...
@@ -161,7 +169,11 @@ int simple_read_change_write_read_test()
...
@@ -161,7 +169,11 @@ int simple_read_change_write_read_test()
0
);
0
);
ok
((
res
=
test
(
memcmp
(
buffr
,
buffw
,
PAGE_SIZE
)
==
0
)),
ok
((
res
=
test
(
memcmp
(
buffr
,
buffw
,
PAGE_SIZE
)
==
0
)),
"Simple read-change-write-read page "
);
"Simple read-change-write-read page "
);
flush_pagecache_blocks
(
&
pagecache
,
&
file1
,
FLUSH_FORCE_WRITE
);
if
(
flush_pagecache_blocks
(
&
pagecache
,
&
file1
,
FLUSH_FORCE_WRITE
))
{
diag
(
"Got error during flushing pagecache
\n
"
);
exit
(
1
);
}
ok
((
res
&=
test
(
test_file
(
file1
,
file1_name
,
PAGE_SIZE
,
PAGE_SIZE
,
ok
((
res
&=
test
(
test_file
(
file1
,
file1_name
,
PAGE_SIZE
,
PAGE_SIZE
,
simple_read_change_write_read_test_file
))),
simple_read_change_write_read_test_file
))),
"Simple read-change-write-read page file"
);
"Simple read-change-write-read page file"
);
...
@@ -198,7 +210,7 @@ int simple_pin_test()
...
@@ -198,7 +210,7 @@ int simple_pin_test()
/* test */
/* test */
if
(
flush_pagecache_blocks
(
&
pagecache
,
&
file1
,
FLUSH_FORCE_WRITE
))
if
(
flush_pagecache_blocks
(
&
pagecache
,
&
file1
,
FLUSH_FORCE_WRITE
))
{
{
diag
(
"
error in flush_pagecache_blocks
\n
"
);
diag
(
"
Got error during flushing pagecache
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
pagecache_read
(
&
pagecache
,
&
file1
,
0
,
3
,
(
char
*
)
buffw
,
pagecache_read
(
&
pagecache
,
&
file1
,
0
,
3
,
(
char
*
)
buffw
,
...
...
storage/maria/unittest/test_file.c
View file @
1e865f0a
...
@@ -29,6 +29,11 @@ int test_file(PAGECACHE_FILE file, char *file_name,
...
@@ -29,6 +29,11 @@ int test_file(PAGECACHE_FILE file, char *file_name,
size_t
byte
;
size_t
byte
;
int
step
=
0
;
int
step
=
0
;
if
(
my_sync
(
file
.
file
,
MYF
(
MY_WME
|
MY_IGNORE_BADFD
)))
{
diag
(
"Got error during syncing file
\n
"
);
exit
(
1
);
}
if
((
stat
=
my_stat
(
file_name
,
&
stat_buff
,
MYF
(
0
)))
==
NULL
)
if
((
stat
=
my_stat
(
file_name
,
&
stat_buff
,
MYF
(
0
)))
==
NULL
)
{
{
diag
(
"Can't stat() %s (errno: %d)
\n
"
,
file_name
,
errno
);
diag
(
"Can't stat() %s (errno: %d)
\n
"
,
file_name
,
errno
);
...
...
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