diff options
author | Richard Levitte <levitte@openssl.org> | 2021-06-02 08:14:08 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-06-06 07:34:44 +0200 |
commit | d00be9f38760b5f143a7cdecf6c61ad6316f4cc8 (patch) | |
tree | e0159474ea4348ce24fb75ca6c7a21ef43566870 /test | |
parent | 0ebef5b5098e5d15cf2e7f48a78b22cced41f352 (diff) | |
download | openssl-new-d00be9f38760b5f143a7cdecf6c61ad6316f4cc8.tar.gz |
test/recipes/80-test_cmp_http.t: Simplify test_cmp_http()
test_cmp_http() made some assumptions about what values that exit_checker
could get that aren't quite right.
Furthermore, the expected result isn't about exit codes, but about
true or false. This is better served by getting the value from
OpenSSL::Test::run(), and checking that value against $expected_result
with Test::More::is().
Fixes #15557
Fixes #15571
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/15580)
Diffstat (limited to 'test')
-rw-r--r-- | test/recipes/80-test_cmp_http.t | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/recipes/80-test_cmp_http.t b/test/recipes/80-test_cmp_http.t index 910c751eec..fbd7470ff0 100644 --- a/test/recipes/80-test_cmp_http.t +++ b/test/recipes/80-test_cmp_http.t @@ -12,7 +12,7 @@ use strict; use warnings; use POSIX; -use OpenSSL::Test qw/:DEFAULT with data_file data_dir srctop_dir bldtop_dir result_dir/; +use OpenSSL::Test qw/:DEFAULT data_file data_dir srctop_dir bldtop_dir result_dir/; use OpenSSL::Test::Utils; BEGIN { @@ -133,19 +133,17 @@ sub test_cmp_http { $params = [ '-server', "127.0.0.1:$server_port", @$params ] unless grep { $_ eq '-server' } @$params; - with({ exit_checker => sub { - my $actual_result = shift == 0; - my $OK = $actual_result == $expected_result; - if ($faillog && !$OK) { + unless (is(my $actual_result = run(cmd([$path_app, @$params,])), + $expected_result, + $title)) { + if ($faillog) { my $quote_spc_empty = sub { $_ eq "" ? '""' : $_ =~ m/ / ? '"'.$_.'"' : $_ }; my $invocation = "$path_app ".join(' ', map $quote_spc_empty->($_), @$params); print $faillog "$server_name $aspect \"$title\" ($i/$n)". " expected=$expected_result actual=$actual_result\n"; print $faillog "$invocation\n\n"; } - return $OK; } }, - sub { ok(run(cmd([$path_app, @$params,])), - $title); }); + } } sub test_cmp_http_aspect { |