Bläddra i källkod

Fix fd dup tests to be more robust
i.e. not depending on the first fd to be 4.

Sean Kennedy 5 år sedan
förälder
incheckning
a1c3510761
4 ändrade filer med 4 tillägg och 4 borttagningar
  1. 1 1
      tests/expected/fcntl/fcntl.stdout
  2. 1 1
      tests/expected/unistd/dup.stdout
  3. 1 1
      tests/fcntl/fcntl.c
  4. 1 1
      tests/unistd/dup.c

+ 1 - 1
tests/expected/fcntl/fcntl.stdout

@@ -1 +1 @@
-fd 4 duped into fd 5
+duped fd is 1 greater than the original fd

+ 1 - 1
tests/expected/unistd/dup.stdout

@@ -1 +1 @@
-fd 4 duped into fd 5
+duped fd is 1 greater than the original fd

+ 1 - 1
tests/fcntl/fcntl.c

@@ -19,7 +19,7 @@ int main(void) {
     int newfd2 = fcntl(newfd, F_DUPFD, 0);
     // TODO: The standard doesn't define errors for F_DUPFD
 
-    printf("fd %d duped into fd %d\n", newfd, newfd2);
+    printf("duped fd is %d greater than the original fd\n", newfd2 - newfd);
 
     int c1 = close(newfd);
     ERROR_IF(close, c1, == -1);

+ 1 - 1
tests/unistd/dup.c

@@ -17,7 +17,7 @@ int main(void) {
     ERROR_IF(dup, fd2, == -1);
     UNEXP_IF(dup, fd2, < 0);
 
-    printf("fd %d duped into fd %d\n", fd1, fd2);
+    printf("duped fd is %d greater than the original fd\n", fd2 - fd1);
 
     int c1 = close(fd1);
     ERROR_IF(close, c1, == -1);