diff options
author | Mattias Andrée <maandree@kth.se> | 2018-10-21 18:25:16 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-10-21 18:25:19 +0200 |
commit | 6099ce5acfaffc60fd832723a142e3d2719dae8c (patch) | |
tree | 275ea76ddfe93a0d2895c676866be81ba16ba65b /rawmemrchr.c | |
parent | Add rawmemcasechr and memrcasechr (diff) | |
download | libsimple-6099ce5acfaffc60fd832723a142e3d2719dae8c.tar.gz libsimple-6099ce5acfaffc60fd832723a142e3d2719dae8c.tar.bz2 libsimple-6099ce5acfaffc60fd832723a142e3d2719dae8c.tar.xz |
Add rawmemrcasechr
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | rawmemrchr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rawmemrchr.c b/rawmemrchr.c index 3731c00..80ddc41 100644 --- a/rawmemrchr.c +++ b/rawmemrchr.c @@ -18,8 +18,14 @@ libsimple_rawmemrchr(const void *s_, int c_, size_t n) int main(void) { - assert(!strcmpnul(libsimple_rawmemrchr("1234512345", '3', sizeof("1234512345") - 1), "345")); - assert(!strcmpnul(libsimple_rawmemrchr("1234512345", '5', sizeof("1234512345") - 1), "5")); + assert(!strcmpnul(libsimple_rawmemrchr("abcABCabcABC", 'a', sizeof("abcABCabcABC") - 1), "abcABC")); + assert(!strcmpnul(libsimple_rawmemrchr("abcABCabcABC", 'c', sizeof("abcABCabcABC") - 1), "cABC")); + assert(!strcmpnul(libsimple_rawmemrchr("abcABCabcABC", 'A', sizeof("abcABCabcABC") - 1), "ABC")); + assert(!strcmpnul(libsimple_rawmemrchr("abcABCabcABC", 'C', sizeof("abcABCabcABC") - 1), "C")); + assert(!strcmpnul(libsimple_rawmemrchr("ABCabcABCabc", 'a', sizeof("ABCabcABCabc") - 1), "abc")); + assert(!strcmpnul(libsimple_rawmemrchr("ABCabcABCabc", 'c', sizeof("ABCabcABCabc") - 1), "c")); + assert(!strcmpnul(libsimple_rawmemrchr("ABCabcABCabc", 'A', sizeof("ABCabcABCabc") - 1), "ABCabc")); + assert(!strcmpnul(libsimple_rawmemrchr("ABCabcABCabc", 'C', sizeof("ABCabcABCabc") - 1), "Cabc")); return 0; } |