Changeset c4d5a34 in rtems


Ignore:
Timestamp:
Feb 29, 2020, 10:34:53 AM (4 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
60b76933
Parents:
198c07e5
git-author:
Sebastian Huber <sebastian.huber@…> (02/29/20 10:34:53)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/03/20 10:35:11)
Message:

fstests/fsrename: Rename a file twice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/fstests/fsrename/test.c

    r198c07e5 rc4d5a34  
    209209}
    210210
     211static void rename_file_twice_test (void)
     212{
     213  const char *name01 = "name01";
     214  const char *name02 = "name02";
     215  const char *name03 = "name03";
     216  mode_t      mode;
     217  int         fd;
     218  int         status;
     219
     220  puts ("\nRename file twice\n");
     221
     222  mode = S_IRWXU | S_IRWXG | S_IRWXO;
     223  fd = creat (name01, mode);
     224  rtems_test_assert (fd >= 0);
     225  status = close (fd);
     226  rtems_test_assert (status == 0);
     227
     228  EXPECT_EQUAL (0, rename, name01, name02);
     229  EXPECT_EQUAL (0, rename, name02, name03);
     230
     231  errno = 0;
     232  EXPECT_EQUAL (-1, unlink, name01);
     233  rtems_test_assert (errno == ENOENT);
     234  EXPECT_EQUAL (-1, unlink, name02);
     235  rtems_test_assert (errno == ENOENT);
     236  EXPECT_EQUAL (0, unlink, name03);
     237}
     238
    211239static void same_file_test (void)
    212240{
     
    12221250{
    12231251  symbolic_link_test ();
     1252  rename_file_twice_test ();
    12241253  same_file_test ();
    12251254  directory_test ();
Note: See TracChangeset for help on using the changeset viewer.