Ver Fonte

Fix scandir test on Redox

Jeremy Soller há 5 anos atrás
pai
commit
eae28f6dd9
2 ficheiros alterados com 8 adições e 3 exclusões
  1. 8 1
      tests/dirent/scandir.c
  2. 0 2
      tests/expected/dirent/scandir.stdout

+ 8 - 1
tests/dirent/scandir.c

@@ -17,7 +17,14 @@ int main(void) {
     UNEXP_IF(scandir, len, < 0);
 
     for(int i = 0; i < len; i += 1) {
-        puts(array[i]->d_name);
+        // TODO: Redox does not yet provide . or .. - so filter them out
+        // in order to make output match on all systems
+        if (
+            strcmp(array[i]->d_name, ".") != 0 &&
+            strcmp(array[i]->d_name, "..") != 0
+        ) {
+            puts(array[i]->d_name);
+        }
         free(array[i]);
     }
     free(array);

+ 0 - 2
tests/expected/dirent/scandir.stdout

@@ -1,5 +1,3 @@
-.
-..
 1-never-gonna-give-you-up
 2-never-gonna-let-you-down
 4-and-desert-you