1 /*
2 * Copyright (c) 2025 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
18 #define private public
19 #include "session_info.h"
20 #undef private
21
22 using namespace testing;
23 using namespace testing::ext;
24
25 namespace OHOS {
26 namespace AAFwk {
27 class SessionInfoTest : public testing::Test {
28 public:
29 static void SetUpTestCase();
30 static void TearDownTestCase();
31 void SetUp();
32 void TearDown();
33 };
34
SetUpTestCase()35 void SessionInfoTest::SetUpTestCase()
36 {
37 }
38
TearDownTestCase()39 void SessionInfoTest::TearDownTestCase()
40 {
41 }
42
SetUp()43 void SessionInfoTest::SetUp()
44 {
45 }
46
TearDown()47 void SessionInfoTest::TearDown()
48 {
49 }
50
51 HWTEST_F(SessionInfoTest, SessionInfo_Marshalling_001, TestSize.Level1)
52 {
53 SessionInfo sessionInfo;
54 Parcel parcel;
55 ASSERT_TRUE(sessionInfo.Marshalling(parcel));
56 }
57
58 HWTEST_F(SessionInfoTest, SessionInfo_Unmarshalling_001, TestSize.Level1)
59 {
60 Parcel parcel;
61 SessionInfo* info = SessionInfo::Unmarshalling(parcel);
62 ASSERT_TRUE(info != nullptr);
63 }
64
65 HWTEST_F(SessionInfoTest, SessionInfo_DoMarshallingTwo_001, TestSize.Level1)
66 {
67 SessionInfo sessionInfo;
68 Parcel parcel;
69 ASSERT_TRUE(sessionInfo.DoMarshallingTwo(parcel));
70 }
71
72 HWTEST_F(SessionInfoTest, SessionInfo_DoMarshallingSix_001, TestSize.Level1)
73 {
74 SessionInfo sessionInfo;
75 Parcel parcel;
76 ASSERT_TRUE(sessionInfo.DoMarshallingSix(parcel));
77 }
78 } // namespace AAFwk
79 } // namespace OHOS