1 #include "estoraged_conf.hpp" 2 #include "verifyDriveGeometry.hpp" 3 4 #include <xyz/openbmc_project/Common/error.hpp> 5 6 #include <gmock/gmock-matchers.h> 7 #include <gmock/gmock.h> 8 #include <gtest/gtest.h> 9 10 using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; 11 12 TEST(VerifyGeometry, TooBigFail) 13 { 14 VerifyDriveGeometry maxVerify(""); 15 EXPECT_THROW(maxVerify.geometryOkay(ERASE_MAX_GEOMETRY + 1), 16 InternalFailure); 17 } 18 19 TEST(VerifyGeometry, TooSmallFail) 20 { 21 VerifyDriveGeometry minVerify(""); 22 EXPECT_THROW(minVerify.geometryOkay(ERASE_MIN_GEOMETRY - 1), 23 InternalFailure); 24 } 25 26 TEST(VerifyGeometry, pass) 27 { 28 VerifyDriveGeometry passVerify(""); 29 EXPECT_NO_THROW(passVerify.geometryOkay(ERASE_MIN_GEOMETRY + 1)); 30 } 31