Matt Spinler | d3335df | 2019-07-10 11:04:21 -0500 | [diff] [blame] | 1 | #include <filesystem> |
| 2 | #include <memory> |
| 3 | #include <vector> |
| 4 | |
| 5 | #include <gtest/gtest.h> |
| 6 | |
| 7 | /** |
| 8 | * @brief Tells the factory which PEL to create |
| 9 | */ |
| 10 | enum class TestPelType |
| 11 | { |
| 12 | pelSimple, |
Matt Spinler | 03c1d91 | 2019-07-10 14:12:15 -0500 | [diff] [blame^] | 13 | privateHeaderSimple, |
| 14 | userHeaderSimple |
Matt Spinler | d3335df | 2019-07-10 11:04:21 -0500 | [diff] [blame] | 15 | }; |
| 16 | |
| 17 | /** |
| 18 | * @brief PEL data factory, for testing |
| 19 | * |
| 20 | * @param[in] type - the type of data to create |
| 21 | * |
| 22 | * @return std::unique_ptr<std::vector<uint8_t>> - the PEL data |
| 23 | */ |
| 24 | std::unique_ptr<std::vector<uint8_t>> pelDataFactory(TestPelType type); |
| 25 | |
| 26 | /** |
| 27 | * @brief Helper function to read raw PEL data from a file |
| 28 | * |
| 29 | * @param[in] path - the path to read |
| 30 | * |
| 31 | * @return std::unique_ptr<std::vector<uint8_t>> - the data from the file |
| 32 | */ |
| 33 | std::unique_ptr<std::vector<uint8_t>> |
| 34 | readPELFile(const std::filesystem::path& path); |