]> granicus.if.org Git - php/commitdiff
Improve create_verify_dir() diagnostics
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 17 Jun 2019 14:44:49 +0000 (16:44 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 17 Jun 2019 14:49:52 +0000 (16:49 +0200)
If create_verify_dir() fails[1], we need more info why that happened.

[1] <https://ci.appveyor.com/project/cmb69/php-src/builds/25324138/job/dm1n12gqhdqa3ln5#L5753>

ext/standard/tests/file/windows_mb_path/util.inc

index de4072a1aaf14c6766744cb3aa7e6a669baa840a..fc80a7613fe41441faf167e2be83124271ddb332 100644 (file)
@@ -94,8 +94,14 @@ function create_verify_dir($prefix, $basename, $cp = 65001)
 {
        $full = $prefix . DIRECTORY_SEPARATOR . $basename;
 
-       if (!mkdir($full) || get_basename_with_cp($full, $cp, false) !== $basename) {
+       if (!mkdir($full)) {
                echo "failed to create dir '$full'\n";
+               return;
+       }
+
+       $now = get_basename_with_cp($full, $cp, false);
+       if ($now !== $basename) {
+               echo "expected '$basename', got '$now'\n";
        }
 }