X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Frecipes%2Ftconversion.pl;h=07e34060f395ed63ded85645f9fcf6e89e30c96a;hp=4eef7c17a322ec65e1383b45c15bb082a5d3d54a;hb=4ada8be2a6c538ee66a9a35a182052f359fc94b3;hpb=fd99c6b599a8ed87b726caaa6d88c6915a60e0f4 diff --git a/test/recipes/tconversion.pl b/test/recipes/tconversion.pl index 4eef7c17a3..07e34060f3 100644 --- a/test/recipes/tconversion.pl +++ b/test/recipes/tconversion.pl @@ -9,8 +9,9 @@ use lib 'testlib'; 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" ], - x509 => [ "d", "n", "p" ], ); sub tconversion { my $testtype = shift; @@ -67,14 +68,14 @@ sub tconversion { } 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) { - 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"); } } @@ -84,4 +85,12 @@ sub tconversion { unlink glob "$testtype-fff.*"; } +sub cmp_text { + return compare_text(@_, sub { + $_[0] =~ s/\R//g; + $_[1] =~ s/\R//g; + return $_[0] ne $_[1]; + }); +} + 1;