blob: 293196b842a0f28cb346c4432d4ba55b1ed1be1e [file] [log] [blame]
Matt Spinler8c686cc2019-09-20 13:46:02 -05001#include "extensions/openpower-pels/severity.hpp"
2
3#include <gtest/gtest.h>
4
5using namespace openpower::pels;
6using LogSeverity = phosphor::logging::Entry::Level;
7
8TEST(SeverityTest, SeverityMapTest)
9{
10 ASSERT_EQ(convertOBMCSeverityToPEL(LogSeverity::Informational), 0x00);
11 ASSERT_EQ(convertOBMCSeverityToPEL(LogSeverity::Notice), 0x00);
12 ASSERT_EQ(convertOBMCSeverityToPEL(LogSeverity::Debug), 0x00);
13 ASSERT_EQ(convertOBMCSeverityToPEL(LogSeverity::Warning), 0x20);
14 ASSERT_EQ(convertOBMCSeverityToPEL(LogSeverity::Critical), 0x50);
15 ASSERT_EQ(convertOBMCSeverityToPEL(LogSeverity::Emergency), 0x40);
16 ASSERT_EQ(convertOBMCSeverityToPEL(LogSeverity::Alert), 0x40);
17 ASSERT_EQ(convertOBMCSeverityToPEL(LogSeverity::Error), 0x40);
18}