• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 #ifndef MMS_MSG_TEST_H
16 #define MMS_MSG_TEST_H
17 
18 #include "mms_msg.h"
19 
20 namespace OHOS {
21 namespace Telephony {
22 class MmsMsgTest {
23 public:
24     MmsMsgTest();
25     ~MmsMsgTest();
26     void ProcessTest() const;
27     void ProcessDecodeInput(int inputCMD) const;
28     void ProcessEncodeInput(int inputCMD) const;
29     void MmsDecodeTest(std::string strPath) const;
30     void MmsSendReqEncodeTest() const;
31     void MmsSendConfEncodeTest() const;
32     void MmsNotificationIndEncodeTest() const;
33     void MmsNotifyRespIndEncodeTest() const;
34     void MmsRetrieveConfEncodeTest() const;
35     void MmsAcknowledgeIndEncodeTest() const;
36     void MmsDeliveryIndEncodeTest() const;
37     void MmsReadRecIndEncodeTest() const;
38     void MmsReadOrigIndEncodeTest() const;
39 
40 private:
41     void MmsSendReqDecodeTest(MmsMsg &decodeMsg) const;
42     void MmsSendConfDecodeTest(MmsMsg &decodeMsg) const;
43     void MmsNotificationIndDecodeTest(MmsMsg &decodeMsg) const;
44     void MmsNotifyRespIndDecodeTest(MmsMsg &decodeMsg) const;
45     void MmsRetrieveConfDecodeTest(MmsMsg &decodeMsg) const;
46     void MmsAcknowledgeIndDecodeTest(MmsMsg &decodeMsg) const;
47     void MmsDeliveryIndDecodeTest(MmsMsg &decodeMsg) const;
48     void MmsReadRecIndDecodeTest(MmsMsg &decodeMsg) const;
49     void MmsReadOrigIndDecodeTest(MmsMsg &decodeMsg) const;
50     bool MmsAddAttachment(
51         MmsMsg &msg, std::string pathName, std::string contentId, std::string contenType, bool isSmil) const;
52     std::string BuffToHex(const std::unique_ptr<char[]> &buff, uint32_t len) const;
53     bool WriteBufferToFile(const std::unique_ptr<char[]> &buff, uint32_t len, const std::string &strPathName) const;
54 };
55 } // namespace Telephony
56 } // namespace OHOS
57 #endif
58