mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-12 02:35:28 +01:00
Change so that it works on platforms where isalpha is a macro only,
* tests/strfunc-test.c: (main): Change so that it works on platforms where isalpha is a macro only, without the corresponding function that the C standard requires. Also eliminate the multiple lists of ctype functions. * tests/.cvsignore: Ignore the new test.
This commit is contained in:
parent
a96d96a947
commit
44b8df4370
@ -1,3 +1,12 @@
|
||||
2001-09-17 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* tests/strfunc-test.c: (main): Change so that it works
|
||||
on platforms where isalpha is a macro only, without the
|
||||
corresponding function that the C standard requires.
|
||||
Also eliminate the multiple lists of ctype functions.
|
||||
|
||||
* tests/.cvsignore: Ignore the new test.
|
||||
|
||||
2001-09-17 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-09-17 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* tests/strfunc-test.c: (main): Change so that it works
|
||||
on platforms where isalpha is a macro only, without the
|
||||
corresponding function that the C standard requires.
|
||||
Also eliminate the multiple lists of ctype functions.
|
||||
|
||||
* tests/.cvsignore: Ignore the new test.
|
||||
|
||||
2001-09-17 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-09-17 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* tests/strfunc-test.c: (main): Change so that it works
|
||||
on platforms where isalpha is a macro only, without the
|
||||
corresponding function that the C standard requires.
|
||||
Also eliminate the multiple lists of ctype functions.
|
||||
|
||||
* tests/.cvsignore: Ignore the new test.
|
||||
|
||||
2001-09-17 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-09-17 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* tests/strfunc-test.c: (main): Change so that it works
|
||||
on platforms where isalpha is a macro only, without the
|
||||
corresponding function that the C standard requires.
|
||||
Also eliminate the multiple lists of ctype functions.
|
||||
|
||||
* tests/.cvsignore: Ignore the new test.
|
||||
|
||||
2001-09-17 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-09-17 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* tests/strfunc-test.c: (main): Change so that it works
|
||||
on platforms where isalpha is a macro only, without the
|
||||
corresponding function that the C standard requires.
|
||||
Also eliminate the multiple lists of ctype functions.
|
||||
|
||||
* tests/.cvsignore: Ignore the new test.
|
||||
|
||||
2001-09-17 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-09-17 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* tests/strfunc-test.c: (main): Change so that it works
|
||||
on platforms where isalpha is a macro only, without the
|
||||
corresponding function that the C standard requires.
|
||||
Also eliminate the multiple lists of ctype functions.
|
||||
|
||||
* tests/.cvsignore: Ignore the new test.
|
||||
|
||||
2001-09-17 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-09-17 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* tests/strfunc-test.c: (main): Change so that it works
|
||||
on platforms where isalpha is a macro only, without the
|
||||
corresponding function that the C standard requires.
|
||||
Also eliminate the multiple lists of ctype functions.
|
||||
|
||||
* tests/.cvsignore: Ignore the new test.
|
||||
|
||||
2001-09-17 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-09-17 Darin Adler <darin@bentspoon.com>
|
||||
|
||||
* tests/strfunc-test.c: (main): Change so that it works
|
||||
on platforms where isalpha is a macro only, without the
|
||||
corresponding function that the C standard requires.
|
||||
Also eliminate the multiple lists of ctype functions.
|
||||
|
||||
* tests/.cvsignore: Ignore the new test.
|
||||
|
||||
2001-09-17 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the
|
||||
|
@ -37,6 +37,7 @@ strfunc-test
|
||||
string-test
|
||||
thread-test
|
||||
threadpool-test
|
||||
timeloop-closure
|
||||
tree-test
|
||||
type-test
|
||||
unicode-encoding
|
||||
|
@ -91,73 +91,35 @@ str_check (gchar *str,
|
||||
return ok;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_isalnum (gchar c)
|
||||
{
|
||||
return g_ascii_isalnum (c);
|
||||
}
|
||||
#define FOR_ALL_CTYPE(macro) \
|
||||
macro(isalnum) \
|
||||
macro(isalpha) \
|
||||
macro(iscntrl) \
|
||||
macro(isdigit) \
|
||||
macro(isgraph) \
|
||||
macro(islower) \
|
||||
macro(isprint) \
|
||||
macro(ispunct) \
|
||||
macro(isspace) \
|
||||
macro(isupper) \
|
||||
macro(isxdigit)
|
||||
|
||||
static gboolean
|
||||
test_isalpha (gchar c)
|
||||
{
|
||||
return g_ascii_isalpha (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_iscntrl (gchar c)
|
||||
{
|
||||
return g_ascii_iscntrl (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_isdigit (gchar c)
|
||||
{
|
||||
return g_ascii_isdigit (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_isgraph (gchar c)
|
||||
{
|
||||
return g_ascii_isgraph (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_islower (gchar c)
|
||||
{
|
||||
return g_ascii_islower (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_isprint (gchar c)
|
||||
{
|
||||
return g_ascii_isprint (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_ispunct (gchar c)
|
||||
{
|
||||
return g_ascii_ispunct (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_isspace (gchar c)
|
||||
{
|
||||
return g_ascii_isspace (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_isupper (gchar c)
|
||||
{
|
||||
return g_ascii_isupper (c);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
test_isxdigit (gchar c)
|
||||
{
|
||||
return g_ascii_isxdigit (c);
|
||||
}
|
||||
#define DEFINE_CALL_CTYPE(function) \
|
||||
static int \
|
||||
call_##function (int c) \
|
||||
{ \
|
||||
return function (c); \
|
||||
}
|
||||
|
||||
#define DEFINE_CALL_G_ASCII_CTYPE(function) \
|
||||
static gboolean \
|
||||
call_g_ascii_##function (gchar c) \
|
||||
{ \
|
||||
return g_ascii_##function (c); \
|
||||
}
|
||||
|
||||
FOR_ALL_CTYPE (DEFINE_CALL_CTYPE)
|
||||
FOR_ALL_CTYPE (DEFINE_CALL_G_ASCII_CTYPE)
|
||||
|
||||
static void
|
||||
test_is_function (const char *name,
|
||||
@ -335,19 +297,9 @@ main (int argc,
|
||||
TEST (NULL, strv_check (g_strsplit (",,x,,y,,z,,", ",", 2), "", ",x,,y,,z,,", NULL));
|
||||
TEST (NULL, strv_check (g_strsplit (",,x,,y,,z,,", ",,", 2), "", "x,,y,,z,,", NULL));
|
||||
|
||||
#define TEST_IS(name) test_is_function (#name, test_##name, name, g_unichar_##name)
|
||||
#define TEST_IS(name) test_is_function (#name, call_g_ascii_##name, call_##name, g_unichar_##name);
|
||||
|
||||
TEST_IS (isalnum);
|
||||
TEST_IS (isalpha);
|
||||
TEST_IS (iscntrl);
|
||||
TEST_IS (isdigit);
|
||||
TEST_IS (isgraph);
|
||||
TEST_IS (islower);
|
||||
TEST_IS (isprint);
|
||||
TEST_IS (ispunct);
|
||||
TEST_IS (isspace);
|
||||
TEST_IS (isupper);
|
||||
TEST_IS (isxdigit);
|
||||
FOR_ALL_CTYPE(TEST_IS)
|
||||
|
||||
#undef TEST_IS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user