diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2019-05-10 14:46:26 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-05-20 14:20:29 +1000 |
commit | bc0a30f0bc58ef1406e595d101b70c067b80ea53 (patch) | |
tree | 080b45157ce100f52236ebd860ccfa286b585a99 /libc/test | |
parent | 27d1ef2ebabb07a1958b94049cac3d90a101c3d5 (diff) | |
download | skiboot-bc0a30f0bc58ef1406e595d101b70c067b80ea53.zip skiboot-bc0a30f0bc58ef1406e595d101b70c067b80ea53.tar.gz skiboot-bc0a30f0bc58ef1406e595d101b70c067b80ea53.tar.bz2 |
libfdt: upgrade to upstream dtc.git 243176c
Upgrade libfdt/ to github.com/dgibson/dtc.git 243176c ("Fix bogus
error on rebuild")
This copies dtc/libfdt/ to skiboot/libfdt/, with the only change in
that directory being the addition of README.skiboot and Makefile.inc.
This adds about 14kB text, 2.5kB compressed xz. This could be reduced
or mostly eliminated by cutting out fdt version checks and unused
code, but tracking upstream is a bigger benefit at the moment.
This loses commits:
14ed2b842f61 ("libfdt: add basic sanity check to fdt_open_into")
bc7bb3d12bc1 ("sparse: fix declaration of fdt_strerror")
As well as some prehistoric similar kinds of things, which is the
punishment for us not being good downstream citizens and sending
things upstream! Syncing to upstream will make that effort simpler
in future.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'libc/test')
-rw-r--r-- | libc/test/run-memops-test.c | 7 | ||||
-rw-r--r-- | libc/test/run-memops.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libc/test/run-memops-test.c b/libc/test/run-memops-test.c index cb2d7f8..6303b33 100644 --- a/libc/test/run-memops-test.c +++ b/libc/test/run-memops-test.c @@ -32,6 +32,7 @@ #include "../string/strcasecmp.c" #include "../string/strcat.c" #include "../string/strchr.c" +#include "../string/strrchr.c" #include "../string/strcmp.c" #include "../string/strcpy.c" /* #include "../string/strdup.c" */ @@ -48,6 +49,7 @@ int test_memchr(const void *ptr, int c, size_t n, void* expected); int test_memcmp(const void *ptr1, const void *ptr2, size_t n, int expected); int test_strcmp(const void *ptr1, const void *ptr2, int expected); int test_strchr(const char *s, int c, char *expected); +int test_strrchr(const char *s, int c, char *expected); int test_strcasecmp(const char *s1, const char *s2, int expected); int test_strncasecmp(const char *s1, const char *s2, size_t n, int expected); int test_memmove(void *dest, const void *src, size_t n, const void *r, const void *expected, size_t expected_n); @@ -85,6 +87,11 @@ int test_strchr(const char *s, int c, char *expected) return(expected == strchr(s, c)); } +int test_strrchr(const char *s, int c, char *expected) +{ + return(expected == strrchr(s, c)); +} + int test_strcasecmp(const char *s1, const char *s2, int expected) { return(expected == strcasecmp(s1, s2)); diff --git a/libc/test/run-memops.c b/libc/test/run-memops.c index 5c425f2..55912ea 100644 --- a/libc/test/run-memops.c +++ b/libc/test/run-memops.c @@ -26,6 +26,7 @@ int test_memchr(const void *ptr, int c, size_t n, void* expected); int test_memcmp(const void *ptr1, const void *ptr2, size_t n, int expected); int test_strcmp(const void *ptr1, const void *ptr2, int expected); int test_strchr(const char *s, int c, char *expected); +int test_strrchr(const char *s, int c, char *expected); int test_strcasecmp(const char *s1, const char *s2, int expected); int test_strncasecmp(const char *s1, const char *s2, size_t n, int expected); int test_memmove(void *dest, const void *src, size_t n, const void *r, const void *expected, size_t expected_n); @@ -64,6 +65,12 @@ int main(void) assert(test_strchr(buf, 'a', NULL)); assert(test_strchr(buf, '!', buf+11)); + assert(test_strrchr(buf, 'H', buf)); + assert(test_strrchr(buf, 'o', buf+7)); + assert(test_strrchr(buf, 'a', NULL)); + assert(test_strrchr(buf, 'l', buf+9)); + assert(test_strrchr(buf, '!', buf+11)); + assert(test_strcasecmp(buf, "Hello World!", 0)); assert(test_strcasecmp(buf, "HELLO WORLD!", 0)); assert(test_strcasecmp(buf, "IELLO world!", -1)); |