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
b3c19edb
Commit
b3c19edb
authored
Feb 25, 2008
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of fmemopen. Fixes #446.
git-svn-id:
file:///svn/tokudb@2408
c7de825b-a66e-492c-adef-691d508d4ae1
parent
dfc95d64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
36 deletions
+46
-36
src/tests/test_error.c
src/tests/test_error.c
+46
-36
No files found.
src/tests/test_error.c
View file @
b3c19edb
//NOTE: fmemopen does not exist in OSX
// I want fmemopen
#define _GNU_SOURCE
#include <assert.h>
#include <assert.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <errno.h>
#include <errno.h>
#include <stdio.h>
#include <stdio.h>
#include <unistd.h>
#include "test.h"
#include "test.h"
char
const
*
expect_errpfx
;
char
const
*
expect_errpfx
;
...
@@ -39,9 +36,12 @@ int main (int argc, const char *argv[]) {
...
@@ -39,9 +36,12 @@ int main (int argc, const char *argv[]) {
for
(
do_errpfx
=
0
;
do_errpfx
<
2
;
do_errpfx
++
)
{
for
(
do_errpfx
=
0
;
do_errpfx
<
2
;
do_errpfx
++
)
{
for
(
do_errfile
=
0
;
do_errfile
<
2
;
do_errfile
++
)
{
for
(
do_errfile
=
0
;
do_errfile
<
2
;
do_errfile
++
)
{
for
(
do_errcall
=
0
;
do_errcall
<
2
;
do_errcall
++
)
{
for
(
do_errcall
=
0
;
do_errcall
<
2
;
do_errcall
++
)
{
char
errfname
[]
=
__FILE__
".errs"
;
unlink
(
errfname
);
{
DB_ENV
*
env
;
DB_ENV
*
env
;
char
buf
[
10000
]
=
""
;
FILE
*
write_here
=
fopen
(
errfname
,
"w"
)
;
FILE
*
write_here
=
fmemopen
(
buf
,
sizeof
(
buf
),
"w"
);
assert
(
write_here
);
n_handle_error
=
0
;
n_handle_error
=
0
;
r
=
db_env_create
(
&
env
,
0
);
assert
(
r
==
0
);
r
=
db_env_create
(
&
env
,
0
);
assert
(
r
==
0
);
if
(
do_errpfx
)
{
if
(
do_errpfx
)
{
...
@@ -59,6 +59,14 @@ int main (int argc, const char *argv[]) {
...
@@ -59,6 +59,14 @@ int main (int argc, const char *argv[]) {
assert
(
r
==
EINVAL
);
assert
(
r
==
EINVAL
);
r
=
env
->
close
(
env
,
0
);
assert
(
r
==
0
);
r
=
env
->
close
(
env
,
0
);
assert
(
r
==
0
);
fclose
(
write_here
);
fclose
(
write_here
);
}
{
FILE
*
read_here
=
fopen
(
errfname
,
"r"
);
assert
(
read_here
);
char
buf
[
10000
];
int
buflen
=
fread
(
buf
,
1
,
sizeof
(
buf
)
-
1
,
read_here
);
assert
(
buflen
>=
0
);
buf
[
buflen
]
=
0
;
if
(
do_errfile
)
{
if
(
do_errfile
)
{
printf
(
"buf=%s(end of buf)
\n
"
,
buf
);
printf
(
"buf=%s(end of buf)
\n
"
,
buf
);
if
(
do_errpfx
)
{
if
(
do_errpfx
)
{
...
@@ -77,6 +85,8 @@ int main (int argc, const char *argv[]) {
...
@@ -77,6 +85,8 @@ int main (int argc, const char *argv[]) {
assert
(
n_handle_error
==
0
);
assert
(
n_handle_error
==
0
);
}
}
}
}
unlink
(
errfname
);
}
}
}
}
}
#endif
#endif
...
...
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