Permalink
Browse files

minor PIR refactor

  • Loading branch information...
1 parent 8a9bd24 commit 2ca9f4e35757c7554a4ad080ce596e52cd546710 @fperrad committed Apr 23, 2010
Showing with 14 additions and 13 deletions.
  1. +14 −13 t/digest_t.in
View
@@ -3,34 +3,37 @@
=head1 NAME
-t/dynpmc/@TEMP_md_file@.t - test the @TEMP_md_name@ PMC (part of digest_group)
+t/@TEMP_md_file@.t - test the @TEMP_md_name@ PMC (part of digest_group)
=head1 SYNOPSIS
- % perl -Ilib t/dynpmc/@TEMP_md_file@.t
+ % parrot t/@TEMP_md_file@.t
=head1 DESCRIPTION
Tests the C<digest_group> a libcrypto wrapper.
=cut
-.sub main :main
+.include 'iglobals.pasm'
+
+.sub 'main' :main
.include 'test_more.pir'
- .include 'iglobals.pasm'
- .local pmc config_hash, interp
plan(2)
- interp = getinterp
- config_hash = interp[.IGLOBALS_CONFIG_HASH]
- $S0 = config_hash['has_crypto']
- $S1 = config_hash['openssl_version']
+ .local pmc config
+ $P0 = getinterp
+ config = $P0[.IGLOBALS_CONFIG_HASH]
+ $S0 = config['has_crypto']
+ $S1 = config['openssl_version']
unless $S0 goto no_crypto
if $S1 < '@TEMP_md_skip@' goto old_openssl
+ $P0 = loadlib 'digest_group'
test_typeof()
test_digest()
.return()
+
no_crypto:
skip(2, 'No crypto library available')
.return()
@@ -39,16 +42,14 @@ Tests the C<digest_group> a libcrypto wrapper.
.end
-.sub test_typeof
- $P0 = loadlib 'digest_group'
+.sub 'test_typeof'
.local pmc md
md = new '@TEMP_md_name@'
$S0 = typeof md
is($S0, '@TEMP_md_name@', '@TEMP_md_name@ typeof')
.end
-.sub test_digest
- $P0 = loadlib 'digest_group'
+.sub 'test_digest'
.local pmc md
md = new '@TEMP_md_name@'
md.'Init'()

0 comments on commit 2ca9f4e

Please sign in to comment.