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 #ifndef TEST_FUZZTEST_MOCK_MOCK_I_REMOTE_OBJECT_H 17 #define TEST_FUZZTEST_MOCK_MOCK_I_REMOTE_OBJECT_H 18 19 #include "iremote_broker.h" 20 #include "iremote_object.h" 21 22 namespace OHOS { 23 class MockIRemoteObject : public IRemoteObject { 24 public: MockIRemoteObject()25 MockIRemoteObject() : IRemoteObject(u"mock_i_remote_object") {} 26 ~MockIRemoteObject()27 ~MockIRemoteObject() {} 28 GetObjectRefCount()29 int32_t GetObjectRefCount() override 30 { 31 return 0; 32 } 33 SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)34 int SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override 35 { 36 return 0; 37 } 38 IsProxyObject()39 bool IsProxyObject() const override 40 { 41 return true; 42 } 43 CheckObjectLegality()44 bool CheckObjectLegality() const override 45 { 46 return true; 47 } 48 AddDeathRecipient(const sptr<DeathRecipient> & recipient)49 bool AddDeathRecipient(const sptr<DeathRecipient> &recipient) override 50 { 51 return true; 52 } 53 RemoveDeathRecipient(const sptr<DeathRecipient> & recipient)54 bool RemoveDeathRecipient(const sptr<DeathRecipient> &recipient) override 55 { 56 return true; 57 } 58 Marshalling(Parcel & parcel)59 bool Marshalling(Parcel &parcel) const override 60 { 61 return true; 62 } 63 AsInterface()64 sptr<IRemoteBroker> AsInterface() override 65 { 66 return nullptr; 67 } 68 Dump(int fd,const std::vector<std::u16string> & args)69 int Dump(int fd, const std::vector<std::u16string> &args) override 70 { 71 return 0; 72 } 73 GetObjectDescriptor()74 std::u16string GetObjectDescriptor() const 75 { 76 std::u16string descriptor = std::u16string(); 77 return descriptor; 78 } 79 }; 80 } // namespace OHOS 81 #endif // TEST_FUZZTEST_MOCK_MOCK_I_REMOTE_OBJECT_H 82