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 NATIVE_RDB_TEST_COMMON_H 17 #define NATIVE_RDB_TEST_COMMON_H 18 19 #include <string> 20 #include "values_bucket.h" 21 22 namespace OHOS { 23 namespace NativeRdb { 24 25 static const std::string RDB_TEST_PATH = "/data/test/"; 26 struct RowData { 27 int id; 28 std::string name; 29 int age; 30 double salary; 31 std::vector<uint8_t> blobType; 32 }; 33 34 struct RowDatas { 35 int id; 36 std::string eName; 37 int jobId; 38 ValueObject mgr; 39 std::string joinDate; 40 double salary; 41 ValueObject bonus; 42 int deptId; 43 }; 44 45 class UTUtils { 46 public: 47 static ValuesBucket SetRowData(const RowData &rowData); 48 49 static ValuesBucket SetRowDatas(const RowDatas &rowDatas); 50 51 static const RowData g_rowData[3]; 52 53 static const RowDatas gRowDatas[14]; 54 }; 55 56 } // namespace NativeRdb 57 } // namespace OHOS 58 59 #endif 60