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/stat/stat.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/stat/stat.c')
-rw-r--r-- | test/stat/stat.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/test/stat/stat.c b/test/stat/stat.c deleted file mode 100644 index 4980cdd78..000000000 --- a/test/stat/stat.c +++ /dev/null @@ -1,71 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <fcntl.h> -#include <sys/stat.h> -#include <unistd.h> -#include <stdlib.h> - -static void print_struct_stat(char *msg, struct stat *s) -{ - printf("%s\n", msg); - /* The casts are because glibc thinks it's cool */ - printf("device : 0x%llx\n",(long long)s->st_dev); - printf("inode : %lld\n", (long long)s->st_ino); - printf("mode : 0x%llx\n",(long long)s->st_mode); - printf("nlink : %lld\n", (long long)s->st_nlink); - printf("uid : %lld\n", (long long)s->st_uid); - printf("gid : %lld\n", (long long)s->st_gid); - printf("rdev : 0x%llx\n",(long long)s->st_rdev); - printf("size : %lld\n", (long long)s->st_size); - printf("blksize : %lld\n", (long long)s->st_blksize); - printf("blocks : %lld\n", (long long)s->st_blocks); - printf("atime : %lld\n", (long long)s->st_atime); - printf("mtime : %lld\n", (long long)s->st_mtime); - printf("ctime : %lld\n", (long long)s->st_ctime); -} - -int main(int argc,char **argv) -{ - int fd, ret; - char *file; - struct stat s; - - if (argc < 2) { - fprintf(stderr, "Usage: stat FILE\n"); - exit(1); - } - file = argv[1]; - - memset(&s, 0, sizeof(struct stat)); - ret = stat(file, &s); - if(ret<0){ - perror("stat"); - exit(1); - } - print_struct_stat("\nTesting stat:", &s); - - memset(&s, 0, sizeof(struct stat)); - ret = lstat(file, &s); - if(ret<0){ - perror("lstat"); - exit(1); - } - print_struct_stat("\nTesting lstat:", &s); - - - fd = open(file, O_RDONLY); - if(fd<0){ - perror("open"); - exit(1); - } - memset(&s, 0, sizeof(struct stat)); - ret = fstat(fd,&s); - if(ret<0){ - perror("fstat"); - exit(1); - } - print_struct_stat("\nTesting fstat:", &s); - - exit(0); -} - |