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
2132eb54
Commit
2132eb54
authored
Jun 13, 2006
by
Andrew Ziem
Committed by
Alexandre Julliard
Jun 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix _initterm, with tests.
parent
fe70078a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
1 deletion
+78
-1
data.c
dlls/msvcrt/data.c
+3
-1
.gitignore
dlls/msvcrt/tests/.gitignore
+1
-0
Makefile.in
dlls/msvcrt/tests/Makefile.in
+1
-0
data.c
dlls/msvcrt/tests/data.c
+73
-0
No files found.
dlls/msvcrt/data.c
View file @
2132eb54
...
...
@@ -342,6 +342,7 @@ void CDECL __wgetmainargs(int *argc, MSVCRT_wchar_t** *wargv, MSVCRT_wchar_t** *
unsigned
int
CDECL
_initterm
(
_INITTERMFUN
*
start
,
_INITTERMFUN
*
end
)
{
_INITTERMFUN
*
current
=
start
;
unsigned
int
count
=
0
;
TRACE
(
"(%p,%p)
\n
"
,
start
,
end
);
while
(
current
<
end
)
...
...
@@ -351,10 +352,11 @@ unsigned int CDECL _initterm(_INITTERMFUN *start,_INITTERMFUN *end)
TRACE
(
"Call init function %p
\n
"
,
*
current
);
(
**
current
)();
TRACE
(
"returned
\n
"
);
count
++
;
}
current
++
;
}
return
0
;
return
count
;
}
/*********************************************************************
...
...
dlls/msvcrt/tests/.gitignore
View file @
2132eb54
Makefile
cpp.ok
data.ok
dir.ok
environ.ok
file.ok
...
...
dlls/msvcrt/tests/Makefile.in
View file @
2132eb54
...
...
@@ -9,6 +9,7 @@ EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt -I$(SRCDIR)/..
CTESTS
=
\
cpp.c
\
data.c
\
dir.c
\
environ.c
\
file.c
\
...
...
dlls/msvcrt/tests/data.c
0 → 100644
View file @
2132eb54
/*
* Tests msvcrt/data.c
*
* Copyright 2006 Andrew Ziem
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "msvcrt.h"
#include "wine/test.h"
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <io.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <process.h>
#include <errno.h>
typedef
void
(
*
_INITTERMFUN
)(
void
);
extern
unsigned
int
CDECL
_initterm
(
_INITTERMFUN
*
start
,
_INITTERMFUN
*
end
);
static
int
callbacked
;
void
initcallback
(
void
)
{
callbacked
++
;
}
#define initterm_test(start, end, expected) \
callbacked = 0; \
rc = _initterm(start, end); \
ok(expected == rc, "_initterm: return result mismatch: got %i, expected %i\n", rc, expected); \
ok(expected == callbacked,"_initterm: callbacks count mismatch: got %i, expected %i\n", callbacked, expected);
void
test_initterm
(
void
)
{
int
i
;
int
rc
;
static
_INITTERMFUN
callbacks
[
4
];
for
(
i
=
0
;
i
<
4
;
i
++
)
{
callbacks
[
i
]
=
initcallback
;
}
initterm_test
(
&
callbacks
[
0
],
&
callbacks
[
1
],
1
);
initterm_test
(
&
callbacks
[
0
],
&
callbacks
[
2
],
2
);
initterm_test
(
&
callbacks
[
0
],
&
callbacks
[
3
],
3
);
callbacks
[
1
]
=
NULL
;
initterm_test
(
&
callbacks
[
0
],
&
callbacks
[
3
],
2
);
}
START_TEST
(
data
)
{
test_initterm
();
}
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