blob: 1731e759100f2d9549943fa92cdd639182b62302 [file] [log] [blame]
John Edward Broadbente6ffe702021-10-14 14:03:11 -07001#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>
9using sdbusplus::xyz::openbmc_project::eStoraged::Error::EraseError;
10
11TEST(VerifyGeometry, TooBigFail)
12{
13 VerifyDriveGeometry maxVerify("");
14 EXPECT_THROW(maxVerify.geometryOkay(ERASE_MAX_GEOMETRY + 1), EraseError);
15}
16
17TEST(VerifyGeometry, TooSmallFail)
18{
19 VerifyDriveGeometry minVerify("");
20 EXPECT_THROW(minVerify.geometryOkay(ERASE_MIN_GEOMETRY - 1), EraseError);
21}
22
23TEST(VerifyGeometry, pass)
24{
25 VerifyDriveGeometry passVerify("");
26 EXPECT_NO_THROW(passVerify.geometryOkay(ERASE_MIN_GEOMETRY + 1));
27}