Test suite: minimal required to get mingw 'make test' work under Linux.
[openssl.git] / test / recipes / tconversion.pl
index 4eef7c17a322ec65e1383b45c15bb082a5d3d54a..07e34060f395ed63ded85645f9fcf6e89e30c96a 100644 (file)
@@ -9,8 +9,9 @@ use lib 'testlib';
 use OpenSSL::Test qw/:DEFAULT top_file/;
 
 my %conversionforms = (
 use OpenSSL::Test qw/:DEFAULT top_file/;
 
 my %conversionforms = (
+    # Default conversion forms.  Other series may be added with
+    # specific test types as key.
     "*"                => [ "d", "p" ],
     "*"                => [ "d", "p" ],
-    x509       => [ "d", "n", "p" ],
     );
 sub tconversion {
     my $testtype = shift;
     );
 sub tconversion {
     my $testtype = shift;
@@ -67,14 +68,14 @@ sub tconversion {
       }
 
       if ($testtype ne "p7d") {
       }
 
       if ($testtype ne "p7d") {
-         is(compare_text("$testtype-fff.p", "$testtype-f.p"), 0,
+         is(cmp_text("$testtype-fff.p", "$testtype-f.p"), 0,
             'comparing orig to p');
       }
 
       foreach my $to (@conversionforms) {
          next if $to eq "d";
          foreach my $from (@conversionforms) {
             'comparing orig to p');
       }
 
       foreach my $to (@conversionforms) {
          next if $to eq "d";
          foreach my $from (@conversionforms) {
-             is(compare_text("$testtype-f.$to", "$testtype-ff.$from$to"), 0,
+             is(cmp_text("$testtype-f.$to", "$testtype-ff.$from$to"), 0,
                 "comparing $to to $from$to");
          }
       }
                 "comparing $to to $from$to");
          }
       }
@@ -84,4 +85,12 @@ sub tconversion {
     unlink glob "$testtype-fff.*";
 }
 
     unlink glob "$testtype-fff.*";
 }
 
+sub cmp_text {
+    return compare_text(@_, sub {
+        $_[0] =~ s/\R//g;
+        $_[1] =~ s/\R//g;
+        return $_[0] ne $_[1];
+    });
+}
+
 1;
 1;