summaryrefslogtreecommitdiffstats
path: root/test/elog_errorwrap_test.cpp
blob: f34144718f359ff0f9416eba9e9ded6c91020236 (plain)
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
#include "elog_errorwrap_test.hpp"

namespace phosphor
{
namespace logging
{
namespace internal
{

TEST_F(TestLogManager, logCap)
{
    for (auto i = 0; i < ERROR_INFO_CAP + 20; i++)
    {
        manager.commitWithLvl(i, "FOO", 6);
    }

    // Max num of Info( and below Sev) errors can be created is qual to
    // ERROR_INFO_CAP
    EXPECT_EQ(ERROR_INFO_CAP , manager.getInfoErrSize());

    for (auto i = 0; i < ERROR_CAP + 20; i++)
    {
        manager.commitWithLvl(i, "FOO", 0);
    }
    // Max num of high severity errors can be created is qual to ERROR_CAP
    EXPECT_EQ(ERROR_CAP, manager.getRealErrSize());

}

}// namespace internal
}// namespace logging
}// namespace phosphor
OpenPOWER on IntegriCloud