1#! /usr/bin/perl -w 2 3use strict; 4 5use ExtUtils::testlib; 6 7use GSSAPI qw(:all); 8use Test::More tests => 1 + 3 * 11; 9 10 11my $oidset = GSSAPI::OID::Set->new(); 12ok(ref $oidset eq 'GSSAPI::OID::Set', 'OID set created'); 13 14my %tobetested 15 = ( 16 'gss_nt_user_name' => gss_nt_user_name, 17 'gss_nt_hostbased_service' => GSSAPI::OID::gss_nt_hostbased_service, 18 'gss_mech_krb5_old' => gss_mech_krb5_old, 19 'gss_mech_krb5' => gss_mech_krb5, 20 'gss_mech_spnego' => gss_mech_spnego, 21 'gss_nt_exported_name' => gss_nt_exported_name, 22 'gss_nt_krb5_name' => gss_nt_krb5_name, 23 'gss_nt_krb5_principal' => gss_nt_krb5_principal, 24 'gss_mech_krb5_v2' => gss_mech_krb5_v2, 25 'gss_nt_machine_uid_name' => gss_nt_machine_uid_name, 26 'gss_nt_string_uid_name' => gss_nt_string_uid_name, 27 ); 28 29while ( my ($key,$value) = each %tobetested ) { 30 check_oid( $oidset, $value ,$key); 31} 32 33#---------------------------------------------------- 34sub check_oid { 35 my ($oidset, $oid, $text) = @_; 36 my $isin = 0; 37 38 my $status; 39 40 # check if set does not contain oid 41 $status = $oidset->contains( $oid , $isin ); 42 ok( ! $isin , "$text is not contained in OIDSET"); 43 44 # insert oid 45 $status = $oidset->insert( $oid ); 46 ok($status, "$text is inserted... "); 47 48 # check again if set does not contain oid 49 $status = $oidset->contains( $oid , $isin ); 50 ok( $isin , "$text is contained in OIDSET"); 51 52} 53#----------------------------------------------------