diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-28 20:29:21 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-10-28 20:31:55 +0200 |
commit | 99ef2719fb3d703fe38c4113cd7f5adec516dd3a (patch) | |
tree | 2c1f77cb41b60ccbf8faa77a3640491a3546b546 /test/stdlib/qsort.c | |
parent | 543308f6c46cf2edf8a524bc9c631e472570fe72 (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/stdlib/qsort.c')
-rw-r--r-- | test/stdlib/qsort.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/test/stdlib/qsort.c b/test/stdlib/qsort.c deleted file mode 100644 index 74f93315f..000000000 --- a/test/stdlib/qsort.c +++ /dev/null @@ -1,53 +0,0 @@ -#include <stdio.h> -#include <dirent.h> -#include <stdlib.h> -#include <unistd.h> - -static int select_files(const struct dirent *dirbuf) -{ - if (dirbuf->d_name[0] == '.') - return 0; - else - return 1; -} - -int main(void) -{ - struct dirent **array; - struct dirent *dirbuf; - - int i, numdir; - - chdir("/"); - numdir = scandir(".", &array, select_files, NULL); - printf("\nGot %d entries from scandir().\n", numdir); - for (i = 0; i < numdir; ++i) { - dirbuf = array[i]; - printf("[%d] %s\n", i, dirbuf->d_name); - free(array[i]); - } - free(array); - numdir = scandir(".", &array, select_files, alphasort); - printf("\nGot %d entries from scandir() using alphasort().\n", numdir); - for (i = 0; i < numdir; ++i) { - dirbuf = array[i]; - printf("[%d] %s\n", i, dirbuf->d_name); - } - printf("\nCalling qsort()\n"); - /* Even though some manpages say that alphasort should be - * int alphasort(const void *a, const void *b), - * in reality glibc and uclibc have const struct dirent** - * instead of const void*. - * Therefore we get a warning here unless we use a cast, - * which makes people think that alphasort prototype - * needs to be fixed in uclibc headers. - */ - qsort(array, numdir, sizeof(struct dirent *), (void*) alphasort); - for (i = 0; i < numdir; ++i) { - dirbuf = array[i]; - printf("[%d] %s\n", i, dirbuf->d_name); - free(array[i]); - } - free(array); - return (0); -} |