From 5e8158245446028d86edf3a166217eda4a78ba47 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Wed, 24 Jun 2015 15:06:20 +1000 Subject: add tests for libc tolower() and toupper() Signed-off-by: Stewart Smith --- libc/test/run-ctype-test.c | 12 ++++++++++++ libc/test/run-ctype.c | 10 ++++++++++ 2 files changed, 22 insertions(+) (limited to 'libc') 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; } -- cgit v1.1