File: 05-rr-opt.t

package info (click to toggle)
libnet-dns-perl 0.63-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 836 kB
  • ctags: 425
  • sloc: perl: 6,796; sh: 109; ansic: 104; makefile: 59
file content (25 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (2)
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
# $Id: 05-rr-opt.t 616 2006-10-18 09:15:48Z olaf $   -*-perl-*-

use Test::More tests => 7;
use strict;

BEGIN { use_ok('Net::DNS'); }

my $size=2048;
my $ednsflags=0x9e22;


my $optrr= Net::DNS::RR->new(
			  Type         => 'OPT',
			  Name         => '',
			  Class        => $size,  # Decimal UDPpayload
			  ednsflags    => $ednsflags, # first bit set see RFC 3225
			  );
ok($optrr->do,"DO bit set");
is($optrr->clear_do,0x1e22,"Clearing do, leaving the other bits ");
ok(!$optrr->do,"DO bit cleared");
is($optrr->set_do,0x9e22,"Clearing do, leaving the other bits ");


is($optrr->size(),2048,"Size read");
is($optrr->size(1498),1498,"Size set");