Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f93259b3
Commit
f93259b3
authored
Jan 10, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added _setmode tests.
parent
a0ef8845
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
file.c
dlls/msvcrt/tests/file.c
+56
-0
No files found.
dlls/msvcrt/tests/file.c
View file @
f93259b3
...
...
@@ -1496,6 +1496,61 @@ static void test__wfopen_s( void )
ok
(
_unlink
(
name
)
==
0
,
"Couldn't unlink file named '%s'
\n
"
,
name
);
}
static
void
test_setmode
(
void
)
{
const
char
name
[]
=
"empty1"
;
int
fd
,
ret
;
if
(
!
p_fopen_s
)
{
win_skip
(
"unicode file modes are not available, skipping setmode tests
\n
"
);
return
;
}
fd
=
_open
(
name
,
_O_CREAT
|
_O_WRONLY
,
_S_IWRITE
);
ok
(
fd
!=
-
1
,
"failed to open file
\n
"
);
errno
=
0xdeadbeef
;
ret
=
_setmode
(
fd
,
0xffffffff
);
ok
(
ret
==
-
1
,
"_setmode returned %x, expected -1
\n
"
,
ret
);
ok
(
errno
==
EINVAL
,
"errno = %d
\n
"
,
errno
);
errno
=
0xdeadbeef
;
ret
=
_setmode
(
fd
,
0
);
ok
(
ret
==
-
1
,
"_setmode returned %x, expected -1
\n
"
,
ret
);
ok
(
errno
==
EINVAL
,
"errno = %d
\n
"
,
errno
);
errno
=
0xdeadbeef
;
ret
=
_setmode
(
fd
,
_O_BINARY
|
_O_TEXT
);
ok
(
ret
==
-
1
,
"_setmode returned %x, expected -1
\n
"
,
ret
);
ok
(
errno
==
EINVAL
,
"errno = %d
\n
"
,
errno
);
errno
=
0xdeadbeef
;
ret
=
_setmode
(
fd
,
_O_WTEXT
|
_O_U16TEXT
);
ok
(
ret
==
-
1
,
"_setmode returned %x, expected -1
\n
"
,
ret
);
ok
(
errno
==
EINVAL
,
"errno = %d
\n
"
,
errno
);
ret
=
_setmode
(
fd
,
_O_BINARY
);
ok
(
ret
==
_O_TEXT
,
"_setmode returned %x, expected _O_TEXT
\n
"
,
ret
);
ret
=
_setmode
(
fd
,
_O_WTEXT
);
ok
(
ret
==
_O_BINARY
,
"_setmode returned %x, expected _O_BINARY
\n
"
,
ret
);
ret
=
_setmode
(
fd
,
_O_TEXT
);
ok
(
ret
==
_O_WTEXT
,
"_setmode returned %x, expected _O_WTEXT
\n
"
,
ret
);
ret
=
_setmode
(
fd
,
_O_U16TEXT
);
ok
(
ret
==
_O_TEXT
,
"_setmode returned %x, expected _O_TEXT
\n
"
,
ret
);
ret
=
_setmode
(
fd
,
_O_U8TEXT
);
ok
(
ret
==
_O_WTEXT
,
"_setmode returned %x, expected _O_WTEXT
\n
"
,
ret
);
ret
=
_setmode
(
fd
,
_O_TEXT
);
ok
(
ret
==
_O_WTEXT
,
"_setmode returned %x, expected _O_WTEXT
\n
"
,
ret
);
_close
(
fd
);
_unlink
(
name
);
}
static
void
test_get_osfhandle
(
void
)
{
int
fd
;
...
...
@@ -1784,6 +1839,7 @@ START_TEST(file)
test_fopen_fclose_fcloseall
();
test_fopen_s
();
test__wfopen_s
();
test_setmode
();
test_fileops
();
test_asciimode
();
test_asciimode2
();
...
...
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