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
d03020a9
Commit
d03020a9
authored
Apr 19, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Added setlocale tests.
parent
be5a6a03
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
Makefile.in
dlls/msvcrt/tests/Makefile.in
+1
-0
locale.c
dlls/msvcrt/tests/locale.c
+81
-0
No files found.
dlls/msvcrt/tests/Makefile.in
View file @
d03020a9
...
...
@@ -16,6 +16,7 @@ C_SRCS = \
file.c
\
headers.c
\
heap.c
\
locale.c
\
misc.c
\
printf.c
\
scanf.c
\
...
...
dlls/msvcrt/tests/locale.c
0 → 100644
View file @
d03020a9
/*
* Unit test suite for locale functions.
*
* Copyright 2010 Piotr Caban for CodeWeavers
*
* 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 <locale.h>
#include "wine/test.h"
static
void
test_setlocale
(
void
)
{
static
const
char
lc_all
[]
=
"LC_COLLATE=C;LC_CTYPE=C;"
"LC_MONETARY=Greek_Greece.1253;LC_NUMERIC=Polish_Poland.1250;LC_TIME=C"
;
char
*
ret
,
buf
[
100
];
ret
=
setlocale
(
20
,
"C"
);
ok
(
ret
==
NULL
,
"ret = %s
\n
"
,
ret
);
ret
=
setlocale
(
LC_ALL
,
""
);
ok
(
ret
!=
NULL
,
"ret == NULL
\n
"
);
ret
=
setlocale
(
LC_ALL
,
"C"
);
ok
(
!
strcmp
(
ret
,
"C"
),
"ret = %s
\n
"
,
ret
);
ret
=
setlocale
(
LC_ALL
,
NULL
);
todo_wine
ok
(
!
strcmp
(
ret
,
"C"
),
"ret = %s
\n
"
,
ret
);
if
(
!
setlocale
(
LC_NUMERIC
,
"Polish"
)
||
!
setlocale
(
LC_NUMERIC
,
"Greek"
)
||
!
setlocale
(
LC_NUMERIC
,
"German"
)
||
!
setlocale
(
LC_NUMERIC
,
"English"
))
{
win_skip
(
"System with limited locales
\n
"
);
return
;
}
ret
=
setlocale
(
LC_NUMERIC
,
"Polish"
);
ok
(
!
strcmp
(
ret
,
"Polish_Poland.1250"
),
"ret = %s
\n
"
,
ret
);
ret
=
setlocale
(
LC_MONETARY
,
"Greek"
);
ok
(
!
strcmp
(
ret
,
"Greek_Greece.1253"
),
"ret = %s
\n
"
,
ret
);
ret
=
setlocale
(
LC_ALL
,
NULL
);
ok
(
!
strcmp
(
ret
,
lc_all
),
"ret = %s
\n
"
,
ret
);
strcpy
(
buf
,
ret
);
ret
=
setlocale
(
LC_ALL
,
buf
);
todo_wine
ok
(
!
strcmp
(
ret
,
lc_all
),
"ret = %s
\n
"
,
ret
);
ret
=
setlocale
(
LC_ALL
,
"German"
);
todo_wine
ok
(
!
strcmp
(
ret
,
"German_Germany.1252"
),
"ret = %s
\n
"
,
ret
);
/* This test shows that _country_synonims table is incorrect */
/* It translates "America" to "US" */
ret
=
setlocale
(
LC_ALL
,
"America"
);
ok
(
ret
==
NULL
,
"ret = %s
\n
"
,
ret
);
ret
=
setlocale
(
LC_ALL
,
"US"
);
todo_wine
ok
(
ret
!=
NULL
,
"ret == NULL
\n
"
);
if
(
ret
)
ok
(
!
strcmp
(
ret
,
"English_United States.1252"
),
"ret = %s
\n
"
,
ret
);
}
START_TEST
(
locale
)
{
test_setlocale
();
}
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