From 489df48f9d1891b46ae4be911080ab4667058f2d Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 8 Feb 2007 15:58:15 +0000 Subject: Fixed warnings when no uom specified for add_perfdata git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1618 f882894a-f735-0410-b71e-b25c423dba1c --- t/Nagios-Plugin-01.t | 10 +++++++++- t/Nagios-Plugin-Performance.t | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/Nagios-Plugin-01.t b/t/Nagios-Plugin-01.t index db12c35..3ada472 100644 --- a/t/Nagios-Plugin-01.t +++ b/t/Nagios-Plugin-01.t @@ -1,7 +1,7 @@ # Nagios::Plugin original test cases use strict; -use Test::More tests => 12; +use Test::More tests => 13; BEGIN { use_ok('Nagios::Plugin') }; @@ -41,6 +41,14 @@ $p->add_perfdata( cmp_ok( $p->all_perfoutput, 'eq', "size=1kB;10:25;~:25", "Perfdata correct"); #diag "dumping perfdata: ". Dumper ($p->perfdata); +$p->add_perfdata( + label => "time", + value => "3.52", + threshold => $t, + ); + +is( $p->all_perfoutput, "size=1kB;10:25;~:25 time=3.52;10:25;~:25", "Perfdata correct when no uom specified"); + my $expected = {qw( -1 WARNING 1 WARNING diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t index e0eb2f6..1ae330a 100644 --- a/t/Nagios-Plugin-Performance.t +++ b/t/Nagios-Plugin-Performance.t @@ -80,3 +80,5 @@ cmp_ok( $p[0]->rrdlabel, "eq", "home_a_m", "changing / to _"); cmp_ok( $p[1]->rrdlabel, "eq", "shared_folder_big", "replacing bad characters"); cmp_ok( $p[2]->rrdlabel, "eq", "1234567890123456789", "shortening rrd label"); + +# add_perfdata tests in t/Nagios-Plugin-01.t -- cgit v1.2.3-74-g34f1