Commit 9b56815d authored by Richard Levitte's avatar Richard Levitte
Browse files

Do not use redirection on binary files



On some platforms, the shell will determine what attributes a file
will have, so while the program might think it's safely outputting
binary data, it's not always true.

For the sake of the tests, it's therefore safer to use -out than to
use redirection.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 67949615
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -51,10 +51,8 @@ if (!$init) {
		 @d = ( "enc", @{$variant{$t}}, "-d" );
	     }

	     ok(run(app([$cmd, @e],
			stdin => $test, stdout => $cipherfile))
		&& run(app([$cmd, @d],
			   stdin => $cipherfile, stdout => $clearfile))
	     ok(run(app([$cmd, @e, "-in", $test, "-out", $cipherfile]))
		&& run(app([$cmd, @d, "-in", $cipherfile, "-out", $clearfile]))
		&& compare_text($test,$clearfile) == 0, $t);
	     unlink $cipherfile, $clearfile;
	 }
+6 −4
Original line number Diff line number Diff line
@@ -53,8 +53,9 @@ sub tconversion {
	  ok(run(app([@cmd,
		      "-in", "$testtype-fff.p",
		      "-inform", "p",
		      "-outform", $to],
		     stdout => "$testtype-f.$to")), "p -> $to");
		      "-out", "$testtype-f.$to",
		      "-outform", $to])),
	     "p -> $to");
      }

      foreach my $to (@conversionforms) {
@@ -62,8 +63,9 @@ sub tconversion {
	      ok(run(app([@cmd,
			  "-in", "$testtype-f.$from",
			  "-inform", $from,
			  "-outform", $to],
			 stdout => "$testtype-ff.$from$to")), "$from -> $to");
			  "-out", "$testtype-ff.$from$to",
			  "-outform", $to])),
		 "$from -> $to");
	  }
      }