# Copyright (C) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/security/crypto_framework/frameworks/frameworks.gni") import("//base/security/crypto_framework/plugin/plugin.gni") import("//build/test.gni") module_output_path = "crypto_framework/crypto_framework_test" ohos_unittest("crypto_framework_test") { testonly = true module_out_path = module_output_path include_dirs = [ "./include" ] include_dirs += [ "//commonlibrary/c_utils/base/include", "//third_party/openssl/include/", ] include_dirs += framework_inc_path + plugin_inc_path sources = [ "src/crypto_3des_cipher_test.cpp", "src/crypto_aes_cipher_test.cpp", "src/crypto_ecc_asy_key_generator_test.cpp", "src/crypto_ecc_key_agreement_test.cpp", "src/crypto_ecc_sign_test.cpp", "src/crypto_ecc_verify_test.cpp", "src/crypto_mac_test.cpp", "src/crypto_md_test.cpp", "src/crypto_rand_test.cpp", "src/crypto_rsa_asy_key_generator_test.cpp", "src/crypto_rsa_cipher_test.cpp", "src/crypto_rsa_sign_test.cpp", "src/crypto_rsa_verify_test.cpp", "src/crypto_x509_cert_chain_validator_test.cpp", "src/crypto_x509_certificate_test.cpp", "src/crypto_x509_crl_test.cpp", ] sources += framework_files + plugin_files sources += [ "//base/security/crypto_framework/common/src/blob.c", "//base/security/crypto_framework/common/src/hcf_parcel.c", "//base/security/crypto_framework/common/src/hcf_string.c", "//base/security/crypto_framework/common/src/log.c", "//base/security/crypto_framework/common/src/object_base.c", "//base/security/crypto_framework/common/src/params_parser.c", "//base/security/crypto_framework/common/src/utils.c", "src/memory_mock.c", ] cflags = [ "-DHILOG_ENABLE" ] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ "//third_party/bounds_checking_function:libsec_shared", "//third_party/openssl:libcrypto_shared", ] defines = [ "HILOG_ENABLE" ] external_deps = [ "c_utils:utils", "hiviewdfx_hilog_native:libhilog", ] }