Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: tests/glibc_syscall_wrappers/test_stat.c

Issue 6018003: Add fxstat check to glibc_syscall_wrappers test. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/glibc_syscall_wrappers/test_stat.c
===================================================================
--- tests/glibc_syscall_wrappers/test_stat.c (revision 4008)
+++ tests/glibc_syscall_wrappers/test_stat.c (working copy)
@@ -16,6 +16,8 @@
int main(int argc, char** argv) {
struct stat st;
struct stat64 st64;
+ FILE* file;
+ int fileDesc;
pasko-google - do not use 2010/12/21 12:00:41 s/fileDesc/fd/
if (2 != argc) {
printf("Usage: sel_ldr test_stat.nexe test_stat_data\n");
@@ -42,5 +44,20 @@
assert(0 == errno);
assert(KNOWN_FILE_SIZE == st64.st_size);
+ file = fopen(argv[1], "r");
pasko-google - do not use 2010/12/21 12:00:41 please, make a separate test_fstat.c
+ assert (NULL != file);
+ fileDesc = fileno(file);
+ assert (0 == fstat(fileDesc, &st));
+ assert (KNOWN_FILE_SIZE == st.st_size);
pasko-google - do not use 2010/12/21 12:00:41 also check for errno
+ assert (0 == fstat64(fileDesc, &st64));
+ assert (KNOWN_FILE_SIZE == st64.st_size);
+ assert (0 == fclose(file));
+ errno = 0;
+ assert (-1 == fstat(-1, &st));
+ assert (EBADF == errno);
+ errno = 0;
+ assert (-1 == fstat64(-1, &st64));
+ assert (EBADF == errno);
+
return 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698