1 /* 2 * Copyright (c) 2023 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 <gtest/gtest.h> 17 #include "ptable_manager.h" 18 #include "ptable.h" 19 #include "ptable_process.h" 20 21 using namespace Updater; 22 using namespace testing; 23 using namespace testing::ext; 24 25 namespace { 26 class UTestPtableProcess : public ::testing::Test { 27 public: UTestPtableProcess()28 UTestPtableProcess() {} 29 30 ~UTestPtableProcess() = default; 31 TestPtableProcess()32 void TestPtableProcess() 33 { 34 UpdaterParams upParams; 35 bool ret = PtableProcess(upParams); 36 ASSERT_EQ(ret, true); 37 std::string path = "data/updater/ptable_parse/updater.zip"; 38 upParams.updatePackage.push_back(path); 39 ret = PtableProcess(upParams); 40 ASSERT_EQ(ret, true); 41 } 42 protected: SetUp()43 void SetUp() {} TearDown()44 void TearDown() {} TestBody()45 void TestBody() {} 46 }; 47 48 49 HWTEST_F(UTestPtableProcess, TestPtableProcess, TestSize.Level1) 50 { 51 UTestPtableProcess{}.TestPtableProcess(); 52 } 53 }