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 16 #ifndef OS_ACCOUNT_TEST_SYSTEMTEST_COMMON_RESOURCE_FUZZTEST_INCLUDE_GET_PARAM_H 17 #define OS_ACCOUNT_TEST_SYSTEMTEST_COMMON_RESOURCE_FUZZTEST_INCLUDE_GET_PARAM_H 18 19 #include <memory> 20 #include <string> 21 #include <vector> 22 #include "app_account_info.h" 23 #include "app_account_manager.h" 24 #include "app_account_subscribe_info.h" 25 #include "app_account_subscriber.h" 26 #include "os_account_manager.h" 27 28 namespace OHOS { 29 namespace AccountSA { 30 bool GetBoolParam(); 31 uint8_t GetU8Param(); 32 unsigned int GetUIntParam(); 33 uint16_t GetU16Param(); 34 uint32_t GetU32Param(); 35 uint64_t GetU64Param(); 36 int8_t GetS8Param(); 37 int16_t GetS16Param(); 38 int32_t GetS32Param(); 39 int64_t GetS64Param(); 40 char32_t GetChar32Param(); 41 42 short GetShortParam(); 43 long GetLongParam(); 44 int GetIntParam(); 45 double GetDoubleParam(); 46 float GetFloatParam(); 47 char GetCharParam(); 48 char *GetCharArryParam(); 49 std::string GetStringParam(); 50 std::vector<bool> GetBoolVectorParam(); 51 std::vector<short> GetShortVectorParam(); 52 std::vector<long> GetLongVectorParam(); 53 std::vector<int> GetIntVectorParam(); 54 std::vector<float> GetFloatVectorParam(); 55 std::vector<double> GetDoubleVectorParam(); 56 std::vector<char> GetCharVectorParam(); 57 std::vector<std::string> GetStringVectorParam(); 58 template<class T> 59 std::vector<T> GetUnsignVectorParam(); 60 std::vector<int8_t> GetS8VectorParam(); 61 std::vector<int16_t> GetS16VectorParam(); 62 std::vector<int32_t> GetS32VectorParam(); 63 std::vector<int64_t> GetS64VectorParam(); 64 OsAccountType GetParamOsAccountType(); 65 OsAccountInfo GetParamOsAccountInfo(); 66 DomainAccountInfo GetParamDomainAccountInfo(); 67 68 AppAccountInfo GetParamAppAccountInfo(); 69 std::vector<AppAccountInfo> GetVectorParamAppAccountInfo(); 70 std::shared_ptr<AppAccountSubscriber> GetAppAccountSubscriber(); 71 72 class TestAppAccountSubscriber : public AppAccountSubscriber { 73 public: TestAppAccountSubscriber()74 TestAppAccountSubscriber() {} ~TestAppAccountSubscriber()75 ~TestAppAccountSubscriber() {} OnAccountsChanged(const std::vector<AppAccountInfo> & accounts)76 virtual void OnAccountsChanged(const std::vector<AppAccountInfo> &accounts) 77 { 78 printf("Fuzz Test OnAccountsChanged\n"); 79 } 80 }; 81 82 class TestOsAccountSubscriber : public OsAccountSubscriber { 83 public: TestOsAccountSubscriber()84 TestOsAccountSubscriber() {}; ~TestOsAccountSubscriber()85 ~TestOsAccountSubscriber() {}; OnAccountsChanged(const int & id)86 virtual void OnAccountsChanged(const int &id) 87 { 88 printf("Fuzz Test OnAccountsChanged\n"); 89 } 90 }; 91 } // namespace AccountSA 92 } // namespace OHOS 93 #endif // OS_ACCOUNT_TEST_SYSTEMTEST_COMMON_RESOURCE_FUZZTEST_INCLUDE_GET_PARAM_H