1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #include "audio_dsp_base_test.h" 10 #include "audio_dsp_base.h" 11 #include "audio_driver_log.h" 12 13 #define HDF_LOG_TAG audio_dsp_base_test 14 #define KCONTROL_TEST_SERVICE_NAME "dsp_service_0" 15 DspGetServiceNameTest(void)16int32_t DspGetServiceNameTest(void) 17 { 18 struct DeviceResourceAttr attr; 19 struct DeviceResourceNode node; 20 struct HdfDeviceObject device; 21 if (DspGetServiceName(NULL, NULL) == HDF_SUCCESS) { 22 AUDIO_DRIVER_LOG_ERR("TestDspGetServiceName fail"); 23 return HDF_FAILURE; 24 } 25 26 attr.value = KCONTROL_TEST_SERVICE_NAME; 27 attr.name = "serviceName"; 28 node.attrData = &attr; 29 device.property = &node; 30 if (DspGetServiceName(&device, NULL) == HDF_SUCCESS) { 31 AUDIO_DRIVER_LOG_ERR("TestDspGetServiceName fail"); 32 return HDF_FAILURE; 33 } 34 35 return HDF_SUCCESS; 36 } 37 DspGetDaiNameTest(void)38int32_t DspGetDaiNameTest(void) 39 { 40 struct DeviceResourceNode node; 41 struct HdfDeviceObject device; 42 struct DeviceResourceAttr attr; 43 44 if (DspGetDaiName(NULL, NULL) == HDF_SUCCESS) { 45 AUDIO_DRIVER_LOG_ERR("TestDspGetDaiName fail"); 46 return HDF_FAILURE; 47 } 48 49 attr.value = KCONTROL_TEST_SERVICE_NAME; 50 attr.name = "dspDaiName"; 51 node.attrData = &attr; 52 device.property = &node; 53 if (DspGetDaiName(&device, NULL) == HDF_SUCCESS) { 54 AUDIO_DRIVER_LOG_ERR("TestDspGetDaiName fail"); 55 return HDF_FAILURE; 56 } 57 58 return HDF_SUCCESS; 59 } 60 61