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
617bf861
Commit
617bf861
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 fopen_s test with ccs option.
parent
447f4fa5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
file.c
dlls/msvcrt/tests/file.c
+64
-0
fcntl.h
include/msvcrt/fcntl.h
+3
-0
No files found.
dlls/msvcrt/tests/file.c
View file @
617bf861
...
...
@@ -1320,6 +1320,7 @@ static void test_fopen_s( void )
{
const
char
name
[]
=
"empty1"
;
char
buff
[
16
];
unsigned
char
*
ubuff
=
(
unsigned
char
*
)
buff
;
FILE
*
file
;
int
ret
;
int
len
;
...
...
@@ -1348,6 +1349,69 @@ static void test_fopen_s( void )
ret
=
fclose
(
file
);
ok
(
ret
!=
EOF
,
"File failed to close
\n
"
);
ret
=
p_fopen_s
(
&
file
,
name
,
"w, ccs=UNIcode"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
ret
=
fwrite
(
"a"
,
1
,
2
,
file
);
ok
(
ret
==
2
,
"fwrite returned %d
\n
"
,
ret
);
fclose
(
file
);
ret
=
p_fopen_s
(
&
file
,
name
,
"r"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
len
=
fread
(
buff
,
1
,
2
,
file
);
ok
(
len
==
2
,
"len = %d
\n
"
,
len
);
ok
(
ubuff
[
0
]
==
0xff
&&
ubuff
[
1
]
==
0xfe
,
"buff[0]=%02x, buff[1]=%02x
\n
"
,
ubuff
[
0
],
ubuff
[
1
]);
fclose
(
file
);
ret
=
p_fopen_s
(
&
file
,
name
,
"r,ccs=unicode"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
len
=
fread
(
buff
,
1
,
2
,
file
);
ok
(
len
==
2
,
"len = %d
\n
"
,
len
);
ok
(
ubuff
[
0
]
==
'a'
&&
ubuff
[
1
]
==
0
,
"buff[0]=%02x, buff[1]=%02x
\n
"
,
ubuff
[
0
],
ubuff
[
1
]);
fclose
(
file
);
ret
=
p_fopen_s
(
&
file
,
name
,
"r,ccs=utf-16le"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
len
=
fread
(
buff
,
1
,
2
,
file
);
ok
(
len
==
2
,
"len = %d
\n
"
,
len
);
ok
(
ubuff
[
0
]
==
'a'
&&
ubuff
[
1
]
==
0
,
"buff[0]=%02x, buff[1]=%02x
\n
"
,
ubuff
[
0
],
ubuff
[
1
]);
fclose
(
file
);
ret
=
p_fopen_s
(
&
file
,
name
,
"r,ccs=utf-8"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
len
=
fread
(
buff
,
1
,
2
,
file
);
ok
(
len
==
2
,
"len = %d
\n
"
,
len
);
ok
(
ubuff
[
0
]
==
'a'
&&
ubuff
[
1
]
==
0
,
"buff[0]=%02x, buff[1]=%02x
\n
"
,
ubuff
[
0
],
ubuff
[
1
]);
fclose
(
file
);
ret
=
p_fopen_s
(
&
file
,
name
,
"w,ccs=utf-16le"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
fclose
(
file
);
ret
=
p_fopen_s
(
&
file
,
name
,
"r"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
len
=
fread
(
buff
,
1
,
3
,
file
);
ok
(
len
==
2
,
"len = %d
\n
"
,
len
);
ok
(
ubuff
[
0
]
==
0xff
&&
ubuff
[
1
]
==
0xfe
,
"buff[0]=%02x, buff[1]=%02x
\n
"
,
ubuff
[
0
],
ubuff
[
1
]);
fclose
(
file
);
ret
=
p_fopen_s
(
&
file
,
name
,
"w,ccs=utf-8"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
fclose
(
file
);
ret
=
p_fopen_s
(
&
file
,
name
,
"r"
);
ok
(
ret
==
0
,
"fopen_s failed with %d
\n
"
,
ret
);
len
=
fread
(
buff
,
1
,
4
,
file
);
ok
(
len
==
3
,
"len = %d
\n
"
,
len
);
ok
(
ubuff
[
0
]
==
0xef
&&
ubuff
[
1
]
==
0xbb
&&
ubuff
[
2
]
==
0xbf
,
"buff[0]=%02x, buff[1]=%02x, buff[2]=%02x
\n
"
,
ubuff
[
0
],
ubuff
[
1
],
ubuff
[
2
]);
fclose
(
file
);
ok
(
_unlink
(
name
)
==
0
,
"Couldn't unlink file named '%s'
\n
"
,
name
);
}
...
...
include/msvcrt/fcntl.h
View file @
617bf861
...
...
@@ -27,6 +27,9 @@
#define _O_BINARY 0x8000
#define _O_RAW _O_BINARY
#define _O_WTEXT 0x10000
#define _O_U16TEXT 0x20000
#define _O_U8TEXT 0x40000
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
...
...
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