aboutsummaryrefslogtreecommitdiffstats
path: root/memrchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'memrchr.c')
-rw-r--r--memrchr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/memrchr.c b/memrchr.c
index 30c818e..36385ec 100644
--- a/memrchr.c
+++ b/memrchr.c
@@ -19,9 +19,15 @@ libsimple_memrchr(const void *s_, int c_, size_t n_)
int
main(void)
{
- assert(!strcmpnul(libsimple_memrchr("1234512345", '3', sizeof("1234512345") - 1), "345"));
- assert(!strcmpnul(libsimple_memrchr("1234512345", '5', sizeof("1234512345") - 1), "5"));
- assert(!libsimple_memrchr("1234512345", 'x', sizeof("1234512345") - 1));
+ assert(!strcmpnul(libsimple_memrchr("abcABCabcABC", 'a', sizeof("abcABCabcABC") - 1), "abcABC"));
+ assert(!strcmpnul(libsimple_memrchr("abcABCabcABC", 'c', sizeof("abcABCabcABC") - 1), "cABC"));
+ assert(!strcmpnul(libsimple_memrchr("abcABCabcABC", 'A', sizeof("abcABCabcABC") - 1), "ABC"));
+ assert(!strcmpnul(libsimple_memrchr("abcABCabcABC", 'C', sizeof("abcABCabcABC") - 1), "C"));
+ assert(!strcmpnul(libsimple_memrchr("ABCabcABCabc", 'a', sizeof("ABCabcABCabc") - 1), "abc"));
+ assert(!strcmpnul(libsimple_memrchr("ABCabcABCabc", 'c', sizeof("ABCabcABCabc") - 1), "c"));
+ assert(!strcmpnul(libsimple_memrchr("ABCabcABCabc", 'A', sizeof("ABCabcABCabc") - 1), "ABCabc"));
+ assert(!strcmpnul(libsimple_memrchr("ABCabcABCabc", 'C', sizeof("ABCabcABCabc") - 1), "Cabc"));
+ assert(!libsimple_memrchr("abcABCabcABC", 'x', sizeof("abcABCabcABC") - 1));
return 0;
}