File: 2status.t

package info (click to toggle)
libgssapi-perl 0.28-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 412 kB
  • sloc: perl: 758; makefile: 6
file content (43 lines) | stat: -rwxr-xr-x 1,123 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /usr/bin/perl -w

use strict;

use ExtUtils::testlib;

use GSSAPI qw(:all);
use Test::More tests => 9;



ok( GSSAPI::Status::GSS_ERROR(GSS_S_COMPLETE) == 0,
   'GSSAPI::Status::GSS_ERROR(GSS_S_COMPLETE) == 0' );

ok( GSSAPI::Status::GSS_ERROR(GSS_S_BAD_SIG) == 1,
    'GSSAPI::Status::GSS_ERROR(GSS_S_BAD_SIG) == 1' );

my $status = GSSAPI::Status->new(GSS_S_COMPLETE, 0);

ok(ref $status eq "GSSAPI::Status", 'created GSSAPI::Status object');

ok($status->major == GSS_S_COMPLETE, '$status->major == GSS_S_COMPLETE');
ok($status->minor == 0, '$status->minor == 0');
ok($status, '$status');

my @string;
ok(@string = $status->generic_message(),
             '$status->generic_message(): ' . join '', @string);
ok(@string = $status->specific_message(),
             '$status->specific_message(): ' . join '', @string);

my $okay = 1;
foreach (1 .. 1000) {
	my($maj, $min);
	$maj = int(rand(0xffffffff));
	$min = int(rand(0xffffffff));

	$status = GSSAPI::Status->new($maj, $min);

	$status->major == $maj && $status->minor == $min
			or $okay = 0, last;
}
ok($okay, 'GSSAPI::Status->new($maj, $min) with random values');