1 /*
2  * Copyright (c) 2022 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 "parcel.h"
18 
19 #define private public
20 #include "page_state_data.h"
21 #undef private
22 
23 using namespace testing;
24 using namespace testing::ext;
25 
26 namespace OHOS {
27 namespace AAFwk {
28 class PageStateDataTest : public testing::Test {
29 public:
30     static void SetUpTestCase();
31     static void TearDownTestCase();
32     void SetUp() override;
33     void TearDown() override;
34 };
35 
SetUpTestCase(void)36 void PageStateDataTest::SetUpTestCase(void)
37 {}
38 
TearDownTestCase(void)39 void PageStateDataTest::TearDownTestCase(void)
40 {}
41 
SetUp()42 void PageStateDataTest::SetUp()
43 {}
44 
TearDown()45 void PageStateDataTest::TearDown()
46 {}
47 
48 /**
49  * @tc.name: ReadFromParcel_0100
50  * @tc.desc: ReadFromParcel
51  * @tc.type: FUNC
52  * @tc.require: issueI5OD2E
53  */
54 HWTEST_F(PageStateDataTest, ReadFromParcel_0100, TestSize.Level1)
55 {
56     GTEST_LOG_(INFO) << "PageStateDataTest, ReadFromParcel_0100, TestSize.Level1";
57     OHOS::AppExecFwk::PageStateData info;
58     Parcel parcel;
59     auto result = info.ReadFromParcel(parcel);
60     EXPECT_TRUE(result);
61 }
62 
63 /**
64  * @tc.name: Marshalling_0100
65  * @tc.desc: Marshalling
66  * @tc.type: FUNC
67  * @tc.require: issueI5OD2E
68  */
69 HWTEST_F(PageStateDataTest, Marshalling_0100, TestSize.Level1)
70 {
71     GTEST_LOG_(INFO) << "PageStateDataTest, Marshalling_0100, TestSize.Level1";
72     OHOS::AppExecFwk::PageStateData info;
73     Parcel parcel;
74     auto result = info.Marshalling(parcel);
75     EXPECT_TRUE(result);
76 }
77 
78 /**
79  * @tc.name: Unmarshalling_0100
80  * @tc.desc: Unmarshalling
81  * @tc.type: FUNC
82  * @tc.require: issueI5OD2E
83  */
84 HWTEST_F(PageStateDataTest, Unmarshalling_0100, TestSize.Level1)
85 {
86     GTEST_LOG_(INFO) << "PageStateDataTest, Unmarshalling_0100, TestSize.Level1";
87     OHOS::AppExecFwk::PageStateData info;
88     Parcel parcel;
89     auto result = info.Unmarshalling(parcel);
90     EXPECT_TRUE(result);
91 }
92 } // namespace AppExecFwk
93 } // namespace OHOS