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
1f8636c5
Commit
1f8636c5
authored
Nov 05, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Enable compilation with -D__WINESRC__.
parent
2fa9b7eb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
37 deletions
+39
-37
Makefile.in
dlls/msvcrt/tests/Makefile.in
+0
-1
data.c
dlls/msvcrt/tests/data.c
+3
-3
dir.c
dlls/msvcrt/tests/dir.c
+9
-9
file.c
dlls/msvcrt/tests/file.c
+21
-21
heap.c
dlls/msvcrt/tests/heap.c
+1
-1
string.c
dlls/msvcrt/tests/string.c
+5
-2
No files found.
dlls/msvcrt/tests/Makefile.in
View file @
1f8636c5
...
...
@@ -2,7 +2,6 @@ TESTDLL = msvcrt.dll
APPMODE
=
-mno-cygwin
MODCFLAGS
=
@BUILTINFLAG@
EXTRAINCL
=
-I
$(top_srcdir)
/include/msvcrt
-I
$(srcdir)
/..
EXTRADEFS
=
-U__WINESRC__
-DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION
-DWIDL_C_INLINE_WRAPPERS
C_SRCS
=
\
cpp.c
\
...
...
dlls/msvcrt/tests/data.c
View file @
1f8636c5
...
...
@@ -76,7 +76,7 @@ static void test_initterm(void)
static
void
test_initvar
(
HMODULE
hmsvcrt
)
{
OSVERSIONINFO
osvi
=
{
sizeof
(
OSVERSIONINFO
)
};
OSVERSIONINFO
A
osvi
=
{
sizeof
(
OSVERSIONINFOA
)
};
int
*
pp_winver
=
(
int
*
)
GetProcAddress
(
hmsvcrt
,
"_winver"
);
int
*
pp_winmajor
=
(
int
*
)
GetProcAddress
(
hmsvcrt
,
"_winmajor"
);
int
*
pp_winminor
=
(
int
*
)
GetProcAddress
(
hmsvcrt
,
"_winminor"
);
...
...
@@ -91,7 +91,7 @@ static void test_initvar( HMODULE hmsvcrt )
winver
=
*
pp_winver
;
winminor
=
*
pp_winminor
;
winmajor
=
*
pp_winmajor
;
GetVersionEx
(
&
osvi
);
GetVersionEx
A
(
&
osvi
);
ok
(
winminor
==
osvi
.
dwMinorVersion
,
"Wrong value for _winminor %02x expected %02x
\n
"
,
winminor
,
osvi
.
dwMinorVersion
);
ok
(
winmajor
==
osvi
.
dwMajorVersion
,
"Wrong value for _winmajor %02x expected %02x
\n
"
,
...
...
@@ -196,7 +196,7 @@ static void test___getmainargs_parent(char *name)
{
char
cmdline
[
3
*
MAX_PATH
];
char
tmppath
[
MAX_PATH
],
filepath
[
MAX_PATH
];
STARTUPINFO
startup
;
STARTUPINFO
A
startup
;
PROCESS_INFORMATION
proc
;
FILE
*
f
;
int
ret
;
...
...
dlls/msvcrt/tests/dir.c
View file @
1f8636c5
...
...
@@ -345,28 +345,28 @@ static void test_fullpath(void)
BOOL
rc
,
free1
,
free2
;
free1
=
free2
=
TRUE
;
GetCurrentDirectory
(
MAX_PATH
,
prevpath
);
GetTempPath
(
MAX_PATH
,
tmppath
);
GetCurrentDirectory
A
(
MAX_PATH
,
prevpath
);
GetTempPath
A
(
MAX_PATH
,
tmppath
);
strcpy
(
level1
,
tmppath
);
strcat
(
level1
,
"msvcrt-test
\\
"
);
rc
=
CreateDirectory
(
level1
,
NULL
);
rc
=
CreateDirectory
A
(
level1
,
NULL
);
if
(
!
rc
&&
GetLastError
()
==
ERROR_ALREADY_EXISTS
)
free1
=
FALSE
;
strcpy
(
level2
,
level1
);
strcat
(
level2
,
"nextlevel
\\
"
);
rc
=
CreateDirectory
(
level2
,
NULL
);
rc
=
CreateDirectory
A
(
level2
,
NULL
);
if
(
!
rc
&&
GetLastError
()
==
ERROR_ALREADY_EXISTS
)
free2
=
FALSE
;
SetCurrentDirectory
(
level2
);
SetCurrentDirectory
A
(
level2
);
ok
(
_fullpath
(
full
,
"test"
,
MAX_PATH
)
!=
NULL
,
"_fullpath failed
\n
"
);
strcpy
(
teststring
,
level2
);
strcat
(
teststring
,
"test"
);
ok
(
strcmp
(
full
,
teststring
)
==
0
,
"Invalid Path returned %s
\n
"
,
full
);
ok
(
_fullpath
(
full
,
"
\\
test"
,
MAX_PATH
)
!=
NULL
,
"_fullpath failed
\n
"
);
strn
cpy
(
teststring
,
level2
,
3
);
mem
cpy
(
teststring
,
level2
,
3
);
teststring
[
3
]
=
0
;
strcat
(
teststring
,
"test"
);
ok
(
strcmp
(
full
,
teststring
)
==
0
,
"Invalid Path returned %s
\n
"
,
full
);
...
...
@@ -383,11 +383,11 @@ static void test_fullpath(void)
ok
(
strcmp
(
freeme
,
teststring
)
==
0
,
"Invalid Path returned %s
\n
"
,
freeme
);
free
(
freeme
);
SetCurrentDirectory
(
prevpath
);
SetCurrentDirectory
A
(
prevpath
);
if
(
free2
)
RemoveDirectory
(
level2
);
RemoveDirectory
A
(
level2
);
if
(
free1
)
RemoveDirectory
(
level1
);
RemoveDirectory
A
(
level1
);
}
START_TEST
(
dir
)
...
...
dlls/msvcrt/tests/file.c
View file @
1f8636c5
...
...
@@ -446,11 +446,11 @@ static void test_filemodeT(void)
FILE
*
f
;
size_t
bytesWritten
;
size_t
bytesRead
;
WIN32_FIND_DATA
findData
;
WIN32_FIND_DATA
A
findData
;
HANDLE
h
;
GetTempPath
(
MAX_PATH
,
temppath
);
GetTempFileName
(
temppath
,
""
,
0
,
tempfile
);
GetTempPath
A
(
MAX_PATH
,
temppath
);
GetTempFileName
A
(
temppath
,
""
,
0
,
tempfile
);
f
=
fopen
(
tempfile
,
"w+bDT"
);
bytesWritten
=
fwrite
(
DATA
,
1
,
sizeof
(
DATA
),
f
);
...
...
@@ -461,7 +461,7 @@ static void test_filemodeT(void)
ok
(
bytesRead
==
bytesWritten
&&
bytesRead
==
sizeof
(
DATA
),
"fopen file mode 'T' wrongly interpreted as 't'
\n
"
);
h
=
FindFirstFile
(
tempfile
,
&
findData
);
h
=
FindFirstFile
A
(
tempfile
,
&
findData
);
ok
(
h
==
INVALID_HANDLE_VALUE
,
"file wasn't deleted when closed.
\n
"
);
...
...
@@ -711,7 +711,7 @@ static void test_fgetwc( void )
ok
(
l
==
BUFSIZ
-
2
,
"ftell expected %d got %d
\n
"
,
BUFSIZ
-
2
,
l
);
fgetws
(
wtextW
,
LLEN
,
tempfh
);
l
=
ftell
(
tempfh
);
ok
(
l
==
BUFSIZ
-
2
+
strlen
(
mytext
),
"ftell expected %d got %d
\n
"
,
BUFSIZ
-
2
+
lstrlen
(
mytext
),
l
);
ok
(
l
==
BUFSIZ
-
2
+
strlen
(
mytext
),
"ftell expected %d got %d
\n
"
,
BUFSIZ
-
2
+
lstrlen
A
(
mytext
),
l
);
mytextW
=
AtoW
(
mytext
);
aptr
=
mytextW
;
wptr
=
wtextW
;
...
...
@@ -810,8 +810,8 @@ static void test_fgetwc_locale(const char* text, const char* locale, int codepag
return
;
}
GetTempPath
(
MAX_PATH
,
temppath
);
GetTempFileName
(
temppath
,
""
,
0
,
tempfile
);
GetTempPath
A
(
MAX_PATH
,
temppath
);
GetTempFileName
A
(
temppath
,
""
,
0
,
tempfile
);
tempfh
=
fopen
(
tempfile
,
"wb"
);
ok
(
tempfh
!=
NULL
,
"can't open tempfile
\n
"
);
...
...
@@ -874,8 +874,8 @@ static void test_fgetwc_unicode(void)
int
ret
,
i
;
wint_t
ch
;
GetTempPath
(
MAX_PATH
,
temppath
);
GetTempFileName
(
temppath
,
""
,
0
,
tempfile
);
GetTempPath
A
(
MAX_PATH
,
temppath
);
GetTempFileName
A
(
temppath
,
""
,
0
,
tempfile
);
if
(
!
p_fopen_s
)
{
...
...
@@ -930,8 +930,8 @@ static void test_fputwc(void)
char
buf
[
1024
];
int
ret
;
GetTempPath
(
MAX_PATH
,
temppath
);
GetTempFileName
(
temppath
,
""
,
0
,
tempfile
);
GetTempPath
A
(
MAX_PATH
,
temppath
);
GetTempFileName
A
(
temppath
,
""
,
0
,
tempfile
);
f
=
fopen
(
tempfile
,
"w"
);
ret
=
fputwc
(
'a'
,
f
);
...
...
@@ -1323,7 +1323,7 @@ static void test_file_inherit_child_no(const char* fd_s)
"Wrong write result in child process on %d (%s)
\n
"
,
fd
,
strerror
(
errno
));
}
static
void
create_io_inherit_block
(
STARTUPINFO
*
startup
,
unsigned
int
count
,
const
HANDLE
*
handles
)
static
void
create_io_inherit_block
(
STARTUPINFO
A
*
startup
,
unsigned
int
count
,
const
HANDLE
*
handles
)
{
static
BYTE
block
[
1024
];
BYTE
*
wxflag_ptr
;
...
...
@@ -1353,7 +1353,7 @@ static const char *read_file( HANDLE file )
return
buffer
;
}
static
void
test_stdout_handle
(
STARTUPINFO
*
startup
,
char
*
cmdline
,
HANDLE
hstdout
,
BOOL
expect_stdout
,
static
void
test_stdout_handle
(
STARTUPINFO
A
*
startup
,
char
*
cmdline
,
HANDLE
hstdout
,
BOOL
expect_stdout
,
const
char
*
descr
)
{
const
char
*
data
;
...
...
@@ -1393,7 +1393,7 @@ static void test_stdout_handle( STARTUPINFO *startup, char *cmdline, HANDLE hstd
}
CloseHandle
(
hErrorFile
);
DeleteFile
(
"fdopen.err"
);
DeleteFile
A
(
"fdopen.err"
);
}
static
void
test_file_inherit
(
const
char
*
selfname
)
...
...
@@ -1402,7 +1402,7 @@ static void test_file_inherit( const char* selfname )
const
char
*
arg_v
[
5
];
char
buffer
[
16
];
char
cmdline
[
MAX_PATH
];
STARTUPINFO
startup
;
STARTUPINFO
A
startup
;
SECURITY_ATTRIBUTES
sa
;
HANDLE
handles
[
3
];
...
...
@@ -1440,7 +1440,7 @@ static void test_file_inherit( const char* selfname )
sprintf
(
cmdline
,
"%s file inherit 1"
,
selfname
);
/* init an empty Reserved2, which should not be recognized as inherit-block */
ZeroMemory
(
&
startup
,
sizeof
(
STARTUPINFO
));
ZeroMemory
(
&
startup
,
sizeof
(
startup
));
startup
.
cb
=
sizeof
(
startup
);
create_io_inherit_block
(
&
startup
,
0
,
NULL
);
test_stdout_handle
(
&
startup
,
cmdline
,
0
,
FALSE
,
"empty block"
);
...
...
@@ -1453,7 +1453,7 @@ static void test_file_inherit( const char* selfname )
create_io_inherit_block
(
&
startup
,
3
,
handles
);
test_stdout_handle
(
&
startup
,
cmdline
,
handles
[
1
],
TRUE
,
"valid block"
);
CloseHandle
(
handles
[
1
]
);
DeleteFile
(
"fdopen.tst"
);
DeleteFile
A
(
"fdopen.tst"
);
/* test inherit block starting with unsigned zero */
handles
[
1
]
=
CreateFileA
(
"fdopen.tst"
,
GENERIC_READ
|
GENERIC_WRITE
,
...
...
@@ -1462,7 +1462,7 @@ static void test_file_inherit( const char* selfname )
*
(
unsigned
int
*
)
startup
.
lpReserved2
=
0
;
test_stdout_handle
(
&
startup
,
cmdline
,
handles
[
1
],
FALSE
,
"zero count block"
);
CloseHandle
(
handles
[
1
]
);
DeleteFile
(
"fdopen.tst"
);
DeleteFile
A
(
"fdopen.tst"
);
/* test inherit block with smaller size */
handles
[
1
]
=
CreateFileA
(
"fdopen.tst"
,
GENERIC_READ
|
GENERIC_WRITE
,
...
...
@@ -1471,7 +1471,7 @@ static void test_file_inherit( const char* selfname )
startup
.
cbReserved2
-=
3
;
test_stdout_handle
(
&
startup
,
cmdline
,
handles
[
1
],
TRUE
,
"small size block"
);
CloseHandle
(
handles
[
1
]
);
DeleteFile
(
"fdopen.tst"
);
DeleteFile
A
(
"fdopen.tst"
);
/* test inherit block with even smaller size */
handles
[
1
]
=
CreateFileA
(
"fdopen.tst"
,
GENERIC_READ
|
GENERIC_WRITE
,
...
...
@@ -1480,7 +1480,7 @@ static void test_file_inherit( const char* selfname )
startup
.
cbReserved2
=
sizeof
(
unsigned
int
)
+
sizeof
(
HANDLE
)
+
sizeof
(
char
);
test_stdout_handle
(
&
startup
,
cmdline
,
handles
[
1
],
FALSE
,
"smaller size block"
);
CloseHandle
(
handles
[
1
]
);
DeleteFile
(
"fdopen.tst"
);
DeleteFile
A
(
"fdopen.tst"
);
/* test inherit block with larger size */
handles
[
1
]
=
CreateFileA
(
"fdopen.tst"
,
GENERIC_READ
|
GENERIC_WRITE
,
...
...
@@ -1489,7 +1489,7 @@ static void test_file_inherit( const char* selfname )
startup
.
cbReserved2
+=
7
;
test_stdout_handle
(
&
startup
,
cmdline
,
handles
[
1
],
TRUE
,
"large size block"
);
CloseHandle
(
handles
[
1
]
);
DeleteFile
(
"fdopen.tst"
);
DeleteFile
A
(
"fdopen.tst"
);
}
static
void
test_tmpnam
(
void
)
...
...
dlls/msvcrt/tests/heap.c
View file @
1f8636c5
...
...
@@ -233,7 +233,7 @@ static void test_aligned_offset_realloc(unsigned int size1, unsigned int size2,
static
void
test_aligned
(
void
)
{
HMODULE
msvcrt
=
GetModuleHandle
(
"msvcrt.dll"
);
HMODULE
msvcrt
=
GetModuleHandle
A
(
"msvcrt.dll"
);
if
(
msvcrt
==
NULL
)
return
;
...
...
dlls/msvcrt/tests/string.c
View file @
1f8636c5
...
...
@@ -19,8 +19,6 @@
*/
#include "wine/test.h"
#include "winbase.h"
#include "winnls.h"
#include <string.h>
#include <mbstring.h>
#include <wchar.h>
...
...
@@ -32,6 +30,11 @@
#include <limits.h>
#include <math.h>
/* make it use a definition from string.h */
#undef strncpy
#include "winbase.h"
#include "winnls.h"
static
char
*
buf_to_string
(
const
unsigned
char
*
bin
,
int
len
,
int
nr
)
{
static
char
buf
[
2
][
1024
];
...
...
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