aboutsummaryrefslogtreecommitdiffstats
path: root/rawmemchr.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-10-21 15:38:00 +0200
committerMattias Andrée <maandree@kth.se>2018-10-21 18:15:34 +0200
commit5f5e216a4abae6860f40c6bedd37db275dbb92d0 (patch)
tree3f22ab92c57fbac30c14d548cd545ed1ec77f395 /rawmemchr.c
parentm (diff)
downloadlibsimple-5f5e216a4abae6860f40c6bedd37db275dbb92d0.tar.gz
libsimple-5f5e216a4abae6860f40c6bedd37db275dbb92d0.tar.bz2
libsimple-5f5e216a4abae6860f40c6bedd37db275dbb92d0.tar.xz
Add rawmemcasechr and memrcasechr
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'rawmemchr.c')
-rw-r--r--rawmemchr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/rawmemchr.c b/rawmemchr.c
index e7803e2..2ed1709 100644
--- a/rawmemchr.c
+++ b/rawmemchr.c
@@ -18,8 +18,14 @@ libsimple_rawmemchr(const void *s_, int c_)
int
main(void)
{
- assert(!strcmpnul(libsimple_rawmemchr("1234512345", '3'), "34512345"));
- assert(!strcmpnul(libsimple_rawmemchr("1234512345", '1'), "1234512345"));
+ assert(!strcmpnul(libsimple_rawmemchr("abcABCabcABC", 'a'), "abcABCabcABC"));
+ assert(!strcmpnul(libsimple_rawmemchr("abcABCabcABC", 'c'), "cABCabcABC"));
+ assert(!strcmpnul(libsimple_rawmemchr("abcABCabcABC", 'A'), "ABCabcABC"));
+ assert(!strcmpnul(libsimple_rawmemchr("abcABCabcABC", 'C'), "CabcABC"));
+ assert(!strcmpnul(libsimple_rawmemchr("ABCabcABCabc", 'a'), "abcABCabc"));
+ assert(!strcmpnul(libsimple_rawmemchr("ABCabcABCabc", 'c'), "cABCabc"));
+ assert(!strcmpnul(libsimple_rawmemchr("ABCabcABCabc", 'A'), "ABCabcABCabc"));
+ assert(!strcmpnul(libsimple_rawmemchr("ABCabcABCabc", 'C'), "CabcABCabc"));
return 0;
}