mirror of https://github.com/Icinga/icinga2.git
Test: Add multiline PerfData test case
This commit is contained in:
parent
24d95e1178
commit
e7c5554d87
|
@ -147,6 +147,7 @@ add_boost_test(base
|
|||
icinga_perfdata/simple
|
||||
icinga_perfdata/quotes
|
||||
icinga_perfdata/multiple
|
||||
icinga_perfdata/multiline
|
||||
icinga_perfdata/normalize
|
||||
icinga_perfdata/uom
|
||||
icinga_perfdata/warncritminmax
|
||||
|
|
|
@ -43,6 +43,21 @@ BOOST_AUTO_TEST_CASE(multiple)
|
|||
BOOST_CHECK(str == "testA=123456 testB=123456");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(multiline)
|
||||
{
|
||||
Array::Ptr pd = PluginUtility::SplitPerfdata(" 'testA'=123456 'testB'=123456");
|
||||
BOOST_CHECK(pd->GetLength() == 2);
|
||||
|
||||
String str = PluginUtility::FormatPerfdata(pd);
|
||||
BOOST_CHECK(str == "testA=123456 testB=123456");
|
||||
|
||||
pd = PluginUtility::SplitPerfdata(" 'testA'=123456 \n'testB'=123456");
|
||||
BOOST_CHECK(pd->GetLength() == 2);
|
||||
|
||||
str = PluginUtility::FormatPerfdata(pd);
|
||||
BOOST_CHECK(str == "testA=123456 testB=123456");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(normalize)
|
||||
{
|
||||
Array::Ptr pd = PluginUtility::SplitPerfdata("testA=2m;3;4;1;5 testB=2foobar");
|
||||
|
|
Loading…
Reference in New Issue