John Edward Broadbent | e6ffe70 | 2021-10-14 14:03:11 -0700 | [diff] [blame^] | 1 | #include "estoraged_conf.hpp" |
| 2 | #include "verifyDriveGeometry.hpp" |
| 3 | |
| 4 | #include <xyz/openbmc_project/eStoraged/error.hpp> |
| 5 | |
| 6 | #include <gmock/gmock-matchers.h> |
| 7 | #include <gmock/gmock.h> |
| 8 | #include <gtest/gtest.h> |
| 9 | using sdbusplus::xyz::openbmc_project::eStoraged::Error::EraseError; |
| 10 | |
| 11 | TEST(VerifyGeometry, TooBigFail) |
| 12 | { |
| 13 | VerifyDriveGeometry maxVerify(""); |
| 14 | EXPECT_THROW(maxVerify.geometryOkay(ERASE_MAX_GEOMETRY + 1), EraseError); |
| 15 | } |
| 16 | |
| 17 | TEST(VerifyGeometry, TooSmallFail) |
| 18 | { |
| 19 | VerifyDriveGeometry minVerify(""); |
| 20 | EXPECT_THROW(minVerify.geometryOkay(ERASE_MIN_GEOMETRY - 1), EraseError); |
| 21 | } |
| 22 | |
| 23 | TEST(VerifyGeometry, pass) |
| 24 | { |
| 25 | VerifyDriveGeometry passVerify(""); |
| 26 | EXPECT_NO_THROW(passVerify.geometryOkay(ERASE_MIN_GEOMETRY + 1)); |
| 27 | } |