Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
09902985
Commit
09902985
authored
Jan 13, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core::posix: skip some locale tests on win32
parent
fe1fb36e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
tests/core/posix.c
+18
-7
No files found.
tests/core/posix.c
View file @
09902985
...
@@ -15,11 +15,15 @@
...
@@ -15,11 +15,15 @@
#include "posix.h"
#include "posix.h"
#include "userdiff.h"
#include "userdiff.h"
#if LC_ALL > 0
static
const
char
*
old_locales
[
LC_ALL
];
static
const
char
*
old_locales
[
LC_ALL
];
#endif
void
test_core_posix__initialize
(
void
)
void
test_core_posix__initialize
(
void
)
{
{
#if LC_ALL > 0
memset
(
&
old_locales
,
0
,
sizeof
(
old_locales
));
memset
(
&
old_locales
,
0
,
sizeof
(
old_locales
));
#endif
#ifdef GIT_WIN32
#ifdef GIT_WIN32
/* on win32, the WSA context needs to be initialized
/* on win32, the WSA context needs to be initialized
...
@@ -33,13 +37,6 @@ void test_core_posix__initialize(void)
...
@@ -33,13 +37,6 @@ void test_core_posix__initialize(void)
void
test_core_posix__cleanup
(
void
)
void
test_core_posix__cleanup
(
void
)
{
{
int
i
;
for
(
i
=
0
;
i
<
LC_ALL
;
i
++
)
{
if
(
old_locales
[
i
])
setlocale
(
i
,
old_locales
[
i
]);
}
p_unlink
(
"fallocate_test"
);
p_unlink
(
"fallocate_test"
);
}
}
...
@@ -165,7 +162,9 @@ void test_core_posix__utimes(void)
...
@@ -165,7 +162,9 @@ void test_core_posix__utimes(void)
static
void
try_set_locale
(
int
category
)
static
void
try_set_locale
(
int
category
)
{
{
#if LC_ALL > 0
old_locales
[
category
]
=
setlocale
(
category
,
NULL
);
old_locales
[
category
]
=
setlocale
(
category
,
NULL
);
#endif
if
(
!
setlocale
(
category
,
"UTF-8"
)
&&
if
(
!
setlocale
(
category
,
"UTF-8"
)
&&
!
setlocale
(
category
,
"c.utf8"
)
&&
!
setlocale
(
category
,
"c.utf8"
)
&&
...
@@ -191,6 +190,10 @@ void test_core_posix__p_regcomp_ignores_global_locale_collate(void)
...
@@ -191,6 +190,10 @@ void test_core_posix__p_regcomp_ignores_global_locale_collate(void)
{
{
p_regex_t
preg
;
p_regex_t
preg
;
#ifdef GIT_WIN32
cl_skip
();
#endif
try_set_locale
(
LC_COLLATE
);
try_set_locale
(
LC_COLLATE
);
cl_assert
(
!
p_regcomp
(
&
preg
,
"[
\xc0
-
\xff
][
\x80
-
\xbf
]"
,
P_REG_EXTENDED
));
cl_assert
(
!
p_regcomp
(
&
preg
,
"[
\xc0
-
\xff
][
\x80
-
\xbf
]"
,
P_REG_EXTENDED
));
...
@@ -202,6 +205,10 @@ void test_core_posix__p_regcomp_matches_digits_with_locale(void)
...
@@ -202,6 +205,10 @@ void test_core_posix__p_regcomp_matches_digits_with_locale(void)
p_regex_t
preg
;
p_regex_t
preg
;
char
c
,
str
[
2
];
char
c
,
str
[
2
];
#ifdef GIT_WIN32
cl_skip
();
#endif
try_set_locale
(
LC_COLLATE
);
try_set_locale
(
LC_COLLATE
);
try_set_locale
(
LC_CTYPE
);
try_set_locale
(
LC_CTYPE
);
...
@@ -221,6 +228,10 @@ void test_core_posix__p_regcomp_matches_alphabet_with_locale(void)
...
@@ -221,6 +228,10 @@ void test_core_posix__p_regcomp_matches_alphabet_with_locale(void)
p_regex_t
preg
;
p_regex_t
preg
;
char
c
,
str
[
2
];
char
c
,
str
[
2
];
#ifdef GIT_WIN32
cl_skip
();
#endif
try_set_locale
(
LC_COLLATE
);
try_set_locale
(
LC_COLLATE
);
try_set_locale
(
LC_CTYPE
);
try_set_locale
(
LC_CTYPE
);
...
...
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