Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
minor PIR refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Apr 23, 2010
1 parent 8a9bd24 commit 2ca9f4e
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions t/digest_t.in
Expand Up @@ -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()
Expand All @@ -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'()
Expand Down

0 comments on commit 2ca9f4e

Please sign in to comment.