summaryrefslogtreecommitdiff
path: root/test/string/tst-memmove.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:29:21 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:31:55 +0200
commit99ef2719fb3d703fe38c4113cd7f5adec516dd3a (patch)
tree2c1f77cb41b60ccbf8faa77a3640491a3546b546 /test/string/tst-memmove.c
parent543308f6c46cf2edf8a524bc9c631e472570fe72 (diff)
test: remove test suite
The test suite is now a developed in a separate git repository. See here: http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng-test.git The test suite should be just like every other software compiled with the cross-toolchain. In the past strange problems where found when the test suite got build in the toolchain creation step.
Diffstat (limited to 'test/string/tst-memmove.c')
-rw-r--r--test/string/tst-memmove.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/test/string/tst-memmove.c b/test/string/tst-memmove.c
deleted file mode 100644
index 2adc52740..000000000
--- a/test/string/tst-memmove.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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;
-}
-