5 #include "sw/device/silicon_creator/lib/boot_svc/boot_svc_min_bl0_sec_ver.h"
7 #include "gtest/gtest.h"
8 #include "sw/device/silicon_creator/lib/boot_data.h"
9 #include "sw/device/silicon_creator/lib/boot_svc/mock_boot_svc_header.h"
10 #include "sw/device/silicon_creator/testing/rom_test.h"
12 namespace boot_svc_min_bl0_sec_ver_unittest {
17 rom_test::MockBootSvcHeader boot_svc_header_;
22 constexpr uint32_t kMinBl0SecVersion = 0x12345678;
23 EXPECT_CALL(boot_svc_header_,
24 Finalize(kBootSvcMinBl0SecVerReqType,
sizeof(msg), &msg.header));
26 boot_svc_min_bl0_sec_ver_req_init(kMinBl0SecVersion, &msg);
28 EXPECT_EQ(msg.min_bl0_sec_ver, kMinBl0SecVersion);
31 TEST_F(BootSvcMinBl0SecVerTest, ResInit) {
33 constexpr rom_error_t kStatus = kErrorOk;
34 constexpr uint32_t kMinBl0SecVersion = 0x12345678;
35 EXPECT_CALL(boot_svc_header_,
36 Finalize(kBootSvcMinBl0SecVerResType,
sizeof(msg), &msg.header));
38 boot_svc_min_bl0_sec_ver_res_init(kMinBl0SecVersion, kStatus, &msg);
40 EXPECT_EQ(msg.min_bl0_sec_ver, kMinBl0SecVersion);
41 EXPECT_EQ(msg.status, kStatus);