aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-06-24 15:06:20 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-06-24 15:06:20 +1000
commit5e8158245446028d86edf3a166217eda4a78ba47 (patch)
tree78a410b384fdcee4ca3bda9a782e2c124cffb2d9
parent3cafe0e80b6f57115bc059e26f11c5d613112984 (diff)
downloadskiboot-5e8158245446028d86edf3a166217eda4a78ba47.zip
skiboot-5e8158245446028d86edf3a166217eda4a78ba47.tar.gz
skiboot-5e8158245446028d86edf3a166217eda4a78ba47.tar.bz2
add tests for libc tolower() and toupper()
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--libc/test/run-ctype-test.c12
-rw-r--r--libc/test/run-ctype.c10
2 files changed, 22 insertions, 0 deletions
diff --git a/libc/test/run-ctype-test.c b/libc/test/run-ctype-test.c
index 999292b..bbe91d3 100644
--- a/libc/test/run-ctype-test.c
+++ b/libc/test/run-ctype-test.c
@@ -35,6 +35,8 @@ int skiboot_isdigit(int ch);
int skiboot_isprint(int ch);
int skiboot_isspace(int ch);
int skiboot_isxdigit(int ch);
+int skiboot_tolower(int ch);
+int skiboot_toupper(int ch);
int skiboot_isdigit(int ch)
{
@@ -55,3 +57,13 @@ int skiboot_isxdigit(int ch)
{
return isxdigit(ch);
}
+
+int skiboot_tolower(int ch)
+{
+ return tolower(ch);
+}
+
+int skiboot_toupper(int ch)
+{
+ return toupper(ch);
+}
diff --git a/libc/test/run-ctype.c b/libc/test/run-ctype.c
index eac04ec..3851a5d 100644
--- a/libc/test/run-ctype.c
+++ b/libc/test/run-ctype.c
@@ -27,6 +27,8 @@ int skiboot_isdigit(int ch);
int skiboot_isprint(int ch);
int skiboot_isspace(int ch);
int skiboot_isxdigit(int ch);
+int skiboot_tolower(int ch);
+int skiboot_toupper(int ch);
int main(void)
{
@@ -92,5 +94,13 @@ int main(void)
assert(!r2);
}
+ for (i = 0; i < 257; i++) {
+ assert(skiboot_tolower(i) == tolower(i));
+ }
+
+ for (i = 0; i < 257; i++) {
+ assert(skiboot_toupper(i) == toupper(i));
+ }
+
return 0;
}