test: firmware notYetStarted: minor cleanup
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I080f868863b5d1b01364b2fb5e26d9cd4aa11496
diff --git a/test/firmware_state_notyetstarted_unittest.cpp b/test/firmware_state_notyetstarted_unittest.cpp
index 819f26a..85a664a 100644
--- a/test/firmware_state_notyetstarted_unittest.cpp
+++ b/test/firmware_state_notyetstarted_unittest.cpp
@@ -5,6 +5,10 @@
#include "firmware_handler.hpp"
#include "firmware_unittest.hpp"
+#include <cstdint>
+#include <string>
+#include <vector>
+
#include <gtest/gtest.h>
namespace ipmi_flash
@@ -17,6 +21,10 @@
class FirmwareHandlerNotYetStartedTest : public IpmiOnlyFirmwareStaticTest
{
+ protected:
+ std::uint16_t session = 1;
+ std::uint16_t flags =
+ blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi;
};
/*
@@ -79,26 +87,22 @@
*/
TEST_F(FirmwareHandlerNotYetStartedTest, OpenStaticImageFileVerifyStateChange)
{
- std::uint16_t flags =
- blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi;
auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
EXPECT_CALL(imageMock, open(staticLayoutBlobId)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(1, flags, staticLayoutBlobId));
+ EXPECT_TRUE(handler->open(session, flags, staticLayoutBlobId));
EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
realHandler->getCurrentState());
}
TEST_F(FirmwareHandlerNotYetStartedTest, OpenHashFileVerifyStateChange)
{
- std::uint16_t flags =
- blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi;
auto realHandler = dynamic_cast<FirmwareBlobHandler*>(handler.get());
EXPECT_CALL(imageMock, open(hashBlobId)).WillOnce(Return(true));
- EXPECT_TRUE(handler->open(1, flags, hashBlobId));
+ EXPECT_TRUE(handler->open(session, flags, hashBlobId));
EXPECT_EQ(FirmwareBlobHandler::UpdateState::uploadInProgress,
realHandler->getCurrentState());
}