Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
795736fa
Commit
795736fa
authored
Jan 05, 2005
by
wax@kishkin.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#964
_stricmp was replaved on sting_compare_func added breakes for windows
parent
8a73a86e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
40 deletions
+64
-40
mysql-test/mysql_test_run_new.c
mysql-test/mysql_test_run_new.c
+64
-40
No files found.
mysql-test/mysql_test_run_new.c
View file @
795736fa
...
@@ -90,10 +90,20 @@ static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock";
...
@@ -90,10 +90,20 @@ static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock";
#endif
#endif
#define MAX_COUNT_TESTES 1024
#define MAX_COUNT_TESTES 1024
#ifdef __WIN__
# define sting_compare_func _stricmp
#else
# ifdef HAVE_STRCASECMP
# define sting_compare_func strcasecmp
# else
# define sting_compare_func strcmp
# endif
#endif
/* comma delimited list of tests to skip or empty string */
/* comma delimited list of tests to skip or empty string */
#ifndef __WIN__
#ifndef __WIN__
static
char
skip_test
[
FN_REFLEN
]
=
" lowercase_table3 , system_mysql_db_fix "
;
static
char
skip_test
[
FN_REFLEN
]
=
" lowercase_table3 , system_mysql_db_fix "
;
#define _stricmp strcasecmp
#else
#else
/*
/*
The most ignore testes contain the calls of system command
The most ignore testes contain the calls of system command
...
@@ -1439,7 +1449,7 @@ void setup(char *file __attribute__((unused)))
...
@@ -1439,7 +1449,7 @@ void setup(char *file __attribute__((unused)))
*/
*/
int
compare
(
const
void
*
arg1
,
const
void
*
arg2
)
int
compare
(
const
void
*
arg1
,
const
void
*
arg2
)
{
{
return
_stricmp
(
*
(
char
**
)
arg1
,
*
(
char
**
)
arg2
);
return
sting_compare_func
(
*
(
char
**
)
arg1
,
*
(
char
**
)
arg2
);
}
}
...
@@ -1520,7 +1530,9 @@ int main(int argc, char **argv)
...
@@ -1520,7 +1530,9 @@ int main(int argc, char **argv)
else
else
{
{
/* run all tests */
/* run all tests */
names
=
malloc
(
MAX_COUNT_TESTES
*
4
);
names
=
malloc
(
MAX_COUNT_TESTES
*
sizeof
(
void
*
));
if
(
!
names
)
die
(
"can not allcate memory for sorting"
);
testes
=
names
;
testes
=
names
;
name_index
=
0
;
name_index
=
0
;
#ifndef __WIN__
#ifndef __WIN__
...
@@ -1539,6 +1551,8 @@ int main(int argc, char **argv)
...
@@ -1539,6 +1551,8 @@ int main(int argc, char **argv)
strcpy
(
test
,
strlwr
(
entry
->
d_name
));
strcpy
(
test
,
strlwr
(
entry
->
d_name
));
/* find the test suffix */
/* find the test suffix */
if
((
position
=
strinstr
(
test
,
TEST_SUFFIX
))
!=
0
)
if
((
position
=
strinstr
(
test
,
TEST_SUFFIX
))
!=
0
)
{
if
(
name_index
<
MAX_COUNT_TESTES
)
{
{
/* null terminate at the suffix */
/* null terminate at the suffix */
*
(
test
+
position
-
1
)
=
'\0'
;
*
(
test
+
position
-
1
)
=
'\0'
;
...
@@ -1548,12 +1562,16 @@ int main(int argc, char **argv)
...
@@ -1548,12 +1562,16 @@ int main(int argc, char **argv)
names
++
;
names
++
;
name_index
++
;
name_index
++
;
}
}
else
die
(
"can not sort files, array is overloaded"
);
}
}
}
closedir
(
parent
);
closedir
(
parent
);
}
}
#else
#else
{
struct
_finddata_t
dir
;
struct
_finddata_t
dir
;
intptr_t
handle
;
int
*
handle
;
char
test
[
FN_LEN
];
char
test
[
FN_LEN
];
char
mask
[
FN_REFLEN
];
char
mask
[
FN_REFLEN
];
char
*
p
;
char
*
p
;
...
@@ -1578,6 +1596,8 @@ int main(int argc, char **argv)
...
@@ -1578,6 +1596,8 @@ int main(int argc, char **argv)
/* find the test suffix */
/* find the test suffix */
if
((
position
=
strinstr
(
test
,
TEST_SUFFIX
))
!=
0
)
if
((
position
=
strinstr
(
test
,
TEST_SUFFIX
))
!=
0
)
{
if
(
name_index
<
MAX_COUNT_TESTES
)
{
{
/* null terminate at the suffix */
/* null terminate at the suffix */
*
(
test
+
position
-
1
)
=
'\0'
;
*
(
test
+
position
-
1
)
=
'\0'
;
...
@@ -1587,10 +1607,14 @@ int main(int argc, char **argv)
...
@@ -1587,10 +1607,14 @@ int main(int argc, char **argv)
names
++
;
names
++
;
name_index
++
;
name_index
++
;
}
}
else
die
(
"can not sort files, array is overloaded"
);
}
}
}
}
while
(
_findnext
(
handle
,
&
dir
)
==
0
);
}
while
(
_findnext
(
handle
,
&
dir
)
==
0
);
_findclose
(
handle
);
_findclose
(
handle
);
}
#endif
#endif
qsort
(
(
void
*
)
testes
,
name_index
,
sizeof
(
char
*
),
compare
);
qsort
(
(
void
*
)
testes
,
name_index
,
sizeof
(
char
*
),
compare
);
...
...
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