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:
Darin Adler 2001-09-17 15:27:04 +00:00
parent a96d96a947
commit 44b8df4370
10 changed files with 101 additions and 76 deletions

View File

@ -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> 2001-09-17 Tor Lillqvist <tml@iki.fi>
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the * configure.in: Add variable for LT_CURRENT minus LT_AGE (the

View File

@ -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> 2001-09-17 Tor Lillqvist <tml@iki.fi>
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the * configure.in: Add variable for LT_CURRENT minus LT_AGE (the

View File

@ -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> 2001-09-17 Tor Lillqvist <tml@iki.fi>
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the * configure.in: Add variable for LT_CURRENT minus LT_AGE (the

View File

@ -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> 2001-09-17 Tor Lillqvist <tml@iki.fi>
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the * configure.in: Add variable for LT_CURRENT minus LT_AGE (the

View File

@ -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> 2001-09-17 Tor Lillqvist <tml@iki.fi>
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the * configure.in: Add variable for LT_CURRENT minus LT_AGE (the

View File

@ -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> 2001-09-17 Tor Lillqvist <tml@iki.fi>
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the * configure.in: Add variable for LT_CURRENT minus LT_AGE (the

View File

@ -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> 2001-09-17 Tor Lillqvist <tml@iki.fi>
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the * configure.in: Add variable for LT_CURRENT minus LT_AGE (the

View File

@ -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> 2001-09-17 Tor Lillqvist <tml@iki.fi>
* configure.in: Add variable for LT_CURRENT minus LT_AGE (the * configure.in: Add variable for LT_CURRENT minus LT_AGE (the

View File

@ -37,6 +37,7 @@ strfunc-test
string-test string-test
thread-test thread-test
threadpool-test threadpool-test
timeloop-closure
tree-test tree-test
type-test type-test
unicode-encoding unicode-encoding

View File

@ -91,73 +91,35 @@ str_check (gchar *str,
return ok; return ok;
} }
static gboolean #define FOR_ALL_CTYPE(macro) \
test_isalnum (gchar c) macro(isalnum) \
{ macro(isalpha) \
return g_ascii_isalnum (c); macro(iscntrl) \
} macro(isdigit) \
macro(isgraph) \
macro(islower) \
macro(isprint) \
macro(ispunct) \
macro(isspace) \
macro(isupper) \
macro(isxdigit)
static gboolean #define DEFINE_CALL_CTYPE(function) \
test_isalpha (gchar c) static int \
{ call_##function (int c) \
return g_ascii_isalpha (c); { \
} return function (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_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 static void
test_is_function (const char *name, 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));
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); FOR_ALL_CTYPE(TEST_IS)
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);
#undef TEST_IS #undef TEST_IS