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 namespace estoraged_test 11 { 12 using estoraged::VerifyDriveGeometry; 13 using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; 14 15 TEST(VerifyGeometry, TooBigFail) 16 { 17 VerifyDriveGeometry maxVerify(""); 18 EXPECT_THROW(maxVerify.geometryOkay(ERASE_MAX_GEOMETRY + 1), 19 InternalFailure); 20 } 21 22 TEST(VerifyGeometry, TooSmallFail) 23 { 24 VerifyDriveGeometry minVerify(""); 25 EXPECT_THROW(minVerify.geometryOkay(ERASE_MIN_GEOMETRY - 1), 26 InternalFailure); 27 } 28 29 TEST(VerifyGeometry, pass) 30 { 31 VerifyDriveGeometry passVerify(""); 32 EXPECT_NO_THROW(passVerify.geometryOkay(ERASE_MIN_GEOMETRY + 1)); 33 } 34 35 } // namespace estoraged_test 36