summaryrefslogtreecommitdiffstats
path: root/test/openpower-pels/user_header_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PEL: Add license prologue to test source filesMatt Spinler2019-11-061-0/+15
| | | | | Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I67c62ab5ac6e69ad0a84937834581f9a280a9167
* PEL: Const accessors for Private/UserHeaderMatt Spinler2019-11-041-14/+0
| | | | | | | | | | | | | | | | | | | Change the combined non-const accessor/setter functions for the PrivateHeader and UserHeader fields to the standard const accessors, and have separate setters for the fields that need to be modified. In addition, make the 'get PrivateHeader' and 'get UserHeader' functions on the PEL class return a const reference. This allows const enforcement on the PEL class, for things like: void func(const PEL& pel) { auto id = pel.privateHeader().id(); } Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I840170e72b41e9e2465f716617500269244de6d9
* PEL: Refactor the test data factoryMatt Spinler2019-10-221-14/+14
| | | | | | | | | | | | | | | This commit has no functional changes, it just does some things to make the PEL data creator for testcases, pelDataFactory(), be more manageable: - Change to return a plain vector instead of a unique_ptr<vector>. - Keeps the data for each section in separate vectors and then either returns those as-is or combines them into a PEL. - Change the TestPelType enum to TestPELType to match the style guide. - Have pelDataFactory provide the SRC section instead of srcDataFactory. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I4770aa6a8169e89b6b8f685a9994d845c9e93cfe
* PEL: Create UserHeader from parametersMatt Spinler2019-10-091-0/+69
| | | | | | | | | | | Add a constructor to the UserHeader section class so it can be built from the message registry entry for that error along with the event log severity. This will be used when creating PELs from OpenBMC event logs. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I7e432f59de7b3f0ba77c3e5887ed5ec3f442ed44
* PEL: Add a flatten() to Section base classMatt Spinler2019-09-101-2/+2
| | | | | | | | | | | | | | | To prepare for supporting PEL sections that can be in any order, which will probably be stored in a std::vector<unique_ptr<Section>>, add a pure virtual function in the Section base class so this list of sections can just be iterated on and have every object in it flattened. This flatten() call replaces the operator<<(Stream&, <object>) functions currently in use, so also convert the operator>> to unflatten() to make things consistent. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id68f16fe4197b389a8495c21539a64f9f583c800
* PEL: Add UserHeader classMatt Spinler2019-07-261-0/+93
The second section in a PEL is always the 'User Header' section. This commit adds a class to represent that. Right now, the only constructor available is filling in its data fields from a PEL stream. Several of the fields in this section have predefined values that are defined by the PEL specification. Defining any constants or enums for those will be left to future commits where they will actually be used. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I8b5f856a4284d44c31b04e98a664f20cd8fa0cb6
OpenPOWER on IntegriCloud