Skip to content

Commit

Permalink
test: skip some tests until fopen existing is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
adammoody committed Jan 30, 2023
1 parent 762a5d3 commit ab3c272
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions t/std/fopen-fclose.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ int fopen_fclose_test(char* unifyfs_root)
__FILE__, __LINE__, path, strerror(err));
end_todo;

#if 0
/* Verify close succeeds. */
skip(fd == NULL, 1, "fopen(w) fails with EEXIST on existing files.");
errno = 0;
rc = fclose(fd);
err = errno;
ok(rc == 0 && err == 0,
"%s:%d fclose existing file: %s",
__FILE__, __LINE__, strerror(err));
#endif
end_skip;

return 0;
}
6 changes: 4 additions & 2 deletions t/std/size.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ int truncate_on_open(char* unifyfs_root)

errno = 0;

todo("fopen(w) fails with EEXIST on existing file.");
testutil_rand_path(path, sizeof(path), unifyfs_root);

/* Write "hello world" to a file */
Expand All @@ -193,16 +192,19 @@ int truncate_on_open(char* unifyfs_root)
__FILE__, __LINE__, global, strerror(errno));

/* Opening an existing file for writing with fopen should truncate file */
todo("fopen(w) fails with EEXIST on existing file.");
fp = fopen(path, "w");
ok(fp != NULL, "%s:%d fopen(%s): %s",
__FILE__, __LINE__, path, strerror(errno));
end_todo;
skip(fp == NULL, 2, "enable when fopen(w) EEXIST is fixed.");
ok(fclose(fp) == 0, "%s:%d fclose(): %s",
__FILE__, __LINE__, strerror(errno));

testutil_get_size(path, &global);
ok(global == 0, "%s:%d global size after fopen(%s, \"w\") = %d: %s",
__FILE__, __LINE__, path, global, strerror(errno));
end_todo;
end_skip;

diag("Finished truncate on fopen tests");

Expand Down

0 comments on commit ab3c272

Please sign in to comment.