This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated via cf6c40b8881cfe78e134e2919b184e04025c1e25 (commit) from 2b3cdadee36b0445ed799932358dd94a1e839b46 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit cf6c40b8881cfe78e134e2919b184e04025c1e25 Author: Waldemar Brodkorb wbx@uclibc-ng.org Date: Tue Apr 26 19:43:48 2016 +0200
test: add memmove test
Triggers a bug in MIPS code under certain circumstances, which are unclear at the moment.
-----------------------------------------------------------------------
Summary of changes: test/string/tst-memmove.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/string/tst-memmove.c
diff --git a/test/string/tst-memmove.c b/test/string/tst-memmove.c new file mode 100644 index 0000000..799e72e --- /dev/null +++ b/test/string/tst-memmove.c @@ -0,0 +1,44 @@ +# Copyright (C) 2016 Rene Nielsen rene.nielsen@microsemi.com +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + +#include <string.h> +#include <stdio.h> + +#define LEN 1024 + +int main(int argc, char *argv[]) +{ + unsigned char a[LEN], exp; + int i, move_len, move_src, err = 0; + + // Fill the array with increasing values from 0 to LEN - 1 (wrap is fine) + for (i = 0; i < LEN; i++) { + a[i] = i; + } + + // move_src is the index into the array to move from. + // move_len is the number of indices to move. Here, we take the remainder. + move_src = LEN / 64; + move_len = LEN - move_src; + + printf("Moving %d entries from index %d to 0\n", move_len, move_src); + memmove(a, &a[move_src], sizeof(a[0]) * move_len); + + // Check that the memmove went well + for (i = 0; i < LEN; i++) { + // Expect that the first #move_len entries contain increasing values + // starting at #move_src and the last #move_src entries are untouched. + exp = i >= move_len ? i : i + move_src; + if (a[i] != exp) { + printf("Error: memmove() failed. Expected a[%d] = %u, got %u\n", i, exp, a[i]); + err = 1; + } + } + + if (!err) { + printf("memmove() succeeded\n"); + } + + return err; +} +
hooks/post-receive