Debian Codegraph @

perl/TrapReceiver/t/1.t

raw
1 #!./perl
2 #
3 # Before `make install' is performed this script should be runnable with
4 # `make test'. After `make install' it should work as `perl 1.t'
5
6 #########################
7
8 use strict;
9 use warnings;
10 use Test;
11
12 BEGIN {
13 plan tests => 8
14 }
15
16 use NetSNMP::TrapReceiver;
17 ok(1); # If we made it this far, we're ok. Bogus test!
18
19
20 my $fail;
21 foreach my $constname (qw(
22 NETSNMPTRAPD_AUTH_HANDLER NETSNMPTRAPD_HANDLER_BREAK
23 NETSNMPTRAPD_HANDLER_FAIL NETSNMPTRAPD_HANDLER_FINISH
24 NETSNMPTRAPD_HANDLER_OK NETSNMPTRAPD_POST_HANDLER
25 NETSNMPTRAPD_PRE_HANDLER)) {
26 if (eval "my \$a = $constname; 1") {
27 ok(1);
28 next;
29 }
30 if ($@ =~ /^Your vendor has not defined NetSNMP::TrapReceiver macro $constname/) {
31 print "# pass: $@";
32 ok(1);
33 } else {
34 print "# fail: $@";
35 ok(0);
36 }
37 }
38
39 #########################
40
41 # Insert your test code below, the Test::More module is use()ed here so read
42 # its man page ( perldoc Test::More ) for help writing this test script.
43