{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1752655436,
"reponame":"openssl",
"desc":"OpenSSL",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"aa86115633ef23e86510df494f16d724",
"commit": {"type":"commit",
"time": 1524649465,
"time_ofs": 120,
"oid_tree": { "oid": "f0302ea1916ecfe745bbd8811be23a53cb7fde3b", "alias": []},
"oid":{ "oid": "39e32be1ccc527036e0a52c3cf64a40faf28ab9d", "alias": []},
"msg": "test/recipes/15-test_out_option.t: refine tests",
"sig_commit": { "git_time": { "time": 1524649465, "offset": 120 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" },
"sig_author": { "git_time": { "time": 1524206178, "offset": 120 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" }},
"body": "test/recipes/15-test_out_option.t: refine tests\n\nTest writing to the null device. This should be successful.\n\nAlso, refactor so the planned number of tests is calculated.\n\nReviewed-by: Andy Polyakov \u003cappro@openssl.org\u003e\n(Merged from https://github.com/openssl/openssl/pull/6033)\n"
,
"diff": "diff --git a/test/recipes/15-test_out_option.t b/test/recipes/15-test_out_option.t\nindex f50001d..e1129cc 100644\n--- a/test/recipes/15-test_out_option.t\n+++ b/test/recipes/15-test_out_option.t\n@@ -16,46 +16,49 @@ use OpenSSL::Test::Utils;\n \n setup(\u0022test_out_option\u0022);\n \n-plan skip_all \u003d\u003e \u0022'-out' option tests are not available on Windows\u0022\n- if $^O eq 'MSWin32';\n-\n-plan tests \u003d\u003e 11;\n-\n-# The following patterns should be tested:\n-#\n-# path dirname\n-# /usr/ /\n-# / /\n-# . .\n-# .. .\n-\n-test_illegal_path('/usr/');\n-test_illegal_path('/');\n-test_illegal_path('./');\n-test_illegal_path('../');\n+# Paths that should generate failure when trying to write to them.\n+# Directories are a safe bet for failure on all platforms.\n+# Note that directories must end with a slash here, because of how\n+# File::Spec massages them into directory specs on some platforms.\n+my @failure_paths \u003d (\n+ './',\n+ );\n+my @success_paths \u003d (\n+ 'randomname.bin'\n+ );\n \n # Test for trying to create a file in a non-exist directory\n-my @chars \u003d (\u0022A\u0022..\u0022Z\u0022, \u0022a\u0022..\u0022z\u0022, \u00220\u0022..\u00229\u0022);\n my $rand_path \u003d \u0022\u0022;\n-$rand_path .\u003d $chars[rand @chars] for 1..32;\n-$rand_path .\u003d \u0022/test.pem\u0022;\n+do {\n+ my @chars \u003d (\u0022A\u0022..\u0022Z\u0022, \u0022a\u0022..\u0022z\u0022, \u00220\u0022..\u00229\u0022);\n+ $rand_path .\u003d $chars[rand @chars] for 1..32;\n+} while (-d File::Spec-\u003ecatdir('.', $rand_path));\n+$rand_path .\u003d \u0022/randomname.bin\u0022;\n \n-test_illegal_path($rand_path);\n-test_legal_path('test.pem');\n-unlink 'test.pem';\n+push @failure_paths, $rand_path;\n \n-sub test_illegal_path {\n- my $path \u003d File::Spec-\u003ecanonpath($_[0]);\n-\n- my $start \u003d time();\n- ok(!run(app([ 'openssl', 'genrsa', '-out', $path, '16384'])), \u0022invalid output path: $path\u0022);\n- my $end \u003d time();\n- # The above process should exit in 2 seconds if the path is not valid\n- ok($end - $start \u003c 2, \u0022check time consumed\u0022);\n+# All explicit cross compilations run a risk of failing this, because the\n+# null device provided by perl might not match what the cross compiled\n+# application expects to see as a null device. Therefore, we skip the check\n+# of outputing to the null device if the cross compile prefix is set.\n+if ((config('CROSS_COMPILE') // '') eq '') {\n+ # Check that we can write to the NULL device\n+ push @success_paths, File::Spec-\u003edevnull();\n }\n \n-sub test_legal_path {\n- my $path \u003d File::Spec-\u003ecanonpath($_[0]);\n+plan tests \u003d\u003e scalar @failure_paths + scalar @success_paths;\n+\n+foreach (@failure_paths) {\n+ my $path \u003d File::Spec-\u003ecanonpath($_);\n+ ok(!run(app([ 'openssl', 'rand', '-out', $path, '1'])),\n+ \u0022invalid output path: $path\u0022);\n+}\n+foreach (@success_paths) {\n+ my $path \u003d File::Spec-\u003ecanonpath($_);\n+ ok(run(app([ 'openssl', 'rand', '-out', $path, '1'])),\n+ \u0022valid output path: $path\u0022);\n+}\n \n- ok(run(app([ 'openssl', 'genrsa', '-out', $path, '2048'])), \u0022valid output path: $path\u0022);\n+END {\n+ unlink 'randomname.bin' if -f 'randomname.bin';\n }\n","s":{"c":1752655436,"u": 34922}}
],"g": 36633,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}