1/* 2 * Copyright (c) 2024-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16#include <memory> 17#include <fstream> 18#include <gtest/gtest.h> 19 20#include "signing_block.h" 21 22namespace OHOS { 23namespace SignatureTools { 24 25class SigningBlockTest : public testing::Test { 26public: 27 static void SetUpTestCase(void) {}; 28 static void TearDownTestCase() {}; 29 void SetUp() {}; 30 void TearDown() {}; 31}; 32 33/** 34 * @tc.name: GetLength 35 * @tc.desc: Test function of SigningBlockTest::GetLength() interface for SUCCESS. 36 * @tc.size: MEDIUM 37 * @tc.type: FUNC 38 * @tc.level Level 1 39 * @tc.require: SR000H63TL 40 */ 41HWTEST_F(SigningBlockTest, GetLength, testing::ext::TestSize.Level1) 42{ 43 std::vector<int8_t> value; 44 SigningBlock signingBlock(0, value, 0); 45 int32_t length = signingBlock.GetLength(); 46 47 EXPECT_EQ(length, 0); 48} 49 50/** 51 * @tc.name: GetValue 52 * @tc.desc: Test function of SigningBlockTest::GetValue() interface for SUCCESS. 53 * @tc.size: MEDIUM 54 * @tc.type: FUNC 55 * @tc.level Level 1 56 * @tc.require: SR000H63TL 57 */ 58HWTEST_F(SigningBlockTest, GetValue, testing::ext::TestSize.Level1) 59{ 60 std::vector<int8_t> value; 61 SigningBlock signingBlock(0, value, 0); 62 std::vector<int8_t> val = signingBlock.GetValue(); 63 int size = val.size(); 64 65 EXPECT_EQ(size, 0); 66} 67 68/** 69 * @tc.name: GetOffset 70 * @tc.desc: Test function of SigningBlockTest::GetOffset() interface for SUCCESS. 71 * @tc.size: MEDIUM 72 * @tc.type: FUNC 73 * @tc.level Level 1 74 * @tc.require: SR000H63TL 75 */ 76HWTEST_F(SigningBlockTest, GetOffset, testing::ext::TestSize.Level1) 77{ 78 std::vector<int8_t> value; 79 SigningBlock signingBlock(0, value, 0); 80 int32_t offset = signingBlock.GetOffset(); 81 82 EXPECT_EQ(offset, 0); 83} 84} // namespace SignatureTools 85} // namespace OHOS