Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
66cada00
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
66cada00
编写于
3月 23, 2023
作者:
Y
yangliping
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OPENSLES unspported interfaface testcase cover
Signed-off-by:
N
yangliping
<
yangliping25@huawei.com
>
上级
23d2510a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
248 addition
and
0 deletion
+248
-0
multimedia/audio/audio_cpp_standard/openslesPlayerNdk/ActsOpenslesPlayerNdkTest.cpp
..._standard/openslesPlayerNdk/ActsOpenslesPlayerNdkTest.cpp
+210
-0
multimedia/audio/audio_cpp_standard/openslesRecorderNdk/ActsOpenslesRecoderNdkTest.cpp
...andard/openslesRecorderNdk/ActsOpenslesRecoderNdkTest.cpp
+38
-0
未找到文件。
multimedia/audio/audio_cpp_standard/openslesPlayerNdk/ActsOpenslesPlayerNdkTest.cpp
浏览文件 @
66cada00
...
...
@@ -509,3 +509,213 @@ HWTEST_F(ActsOpenslesPlayerNdkTest, SUB_MULTIMEDIA_AUDIO_OPENSELES_PALYER_FUNCTI
ASSERT_EQ
(
SL_RESULT_SUCCESS
,
result
);
(
*
pcmPlayerObject
)
->
Destroy
(
pcmPlayerObject
);
}
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_OPENSELES_ENGINEITF_INVALID_0100
* @tc.name : engine itf invalid
* @tc.desc : Basic function test
*/
HWTEST_F
(
ActsOpenslesPlayerNdkTest
,
SUB_MULTIMEDIA_AUDIO_OPENSELES_ENGINEITF_INVALID_0100
,
TestSize
.
Level1
)
{
SLEngineItf
engineEngine
=
nullptr
;
engineObject
=
nullptr
;
SLresult
result
=
slCreateEngine
(
&
engineObject
,
0
,
nullptr
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_SUCCESS
,
result
);
result
=
(
*
engineObject
)
->
GetInterface
(
engineObject
,
SL_IID_ENGINE
,
&
engineEngine
);
ASSERT_EQ
(
SL_RESULT_SUCCESS
,
result
);
SLresult
result1
=
(
*
engineEngine
)
->
CreateLEDDevice
(
engineEngine
,
nullptr
,
0
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result1
);
SLresult
result2
=
(
*
engineEngine
)
->
CreateVibraDevice
(
engineEngine
,
nullptr
,
0
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result2
);
SLresult
result4
=
(
*
engineEngine
)
->
CreateListener
(
engineEngine
,
nullptr
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result4
);
SLresult
result5
=
(
*
engineEngine
)
->
Create3DGroup
(
engineEngine
,
nullptr
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result5
);
SLresult
result6
=
(
*
engineEngine
)
->
CreateMetadataExtractor
(
engineEngine
,
nullptr
,
nullptr
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result6
);
SLresult
result7
=
(
*
engineEngine
)
->
CreateExtensionObject
(
engineEngine
,
nullptr
,
nullptr
,
0
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result7
);
SLresult
result8
=
(
*
engineEngine
)
->
QueryNumSupportedInterfaces
(
engineEngine
,
0
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result8
);
SLresult
result9
=
(
*
engineEngine
)
->
QuerySupportedInterfaces
(
engineEngine
,
0
,
0
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result9
);
SLresult
result10
=
(
*
engineEngine
)
->
QueryNumSupportedExtensions
(
engineEngine
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result10
);
SLresult
result11
=
(
*
engineEngine
)
->
QuerySupportedExtension
(
engineEngine
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result11
);
SLresult
result12
=
(
*
engineEngine
)
->
IsExtensionSupported
(
engineEngine
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_FEATURE_UNSUPPORTED
,
result12
);
}
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_OPENSELES_ENGINEITF_INVALID_0200
* @tc.name : engine itf invalid
* @tc.desc : Basic function test
*/
HWTEST_F
(
ActsOpenslesPlayerNdkTest
,
SUB_MULTIMEDIA_AUDIO_OPENSELES_ENGINEITF_INVALID_0200
,
TestSize
.
Level1
)
{
SLObjectItf
engineObject_
;
SLresult
result
=
slCreateEngine
(
&
engineObject_
,
0
,
nullptr
,
0
,
nullptr
,
nullptr
);
EXPECT_TRUE
(
result
==
SL_RESULT_SUCCESS
);
SLresult
result1
=
(
*
engineObject_
)
->
RegisterCallback
(
engineObject_
,
nullptr
,
nullptr
);
EXPECT_TRUE
(
result1
==
SL_RESULT_FEATURE_UNSUPPORTED
);
(
*
engineObject_
)
->
AbortAsyncOperation
(
engineObject_
);
SLresult
result2
=
(
*
engineObject_
)
->
SetPriority
(
engineObject_
,
0
,
SL_BOOLEAN_FALSE
);
EXPECT_TRUE
(
result2
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result3
=
(
*
engineObject_
)
->
GetPriority
(
engineObject_
,
nullptr
,
nullptr
);
EXPECT_TRUE
(
result3
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result4
=
(
*
engineObject_
)
->
SetLossOfControlInterfaces
(
engineObject_
,
0
,
nullptr
,
false
);
EXPECT_TRUE
(
result4
==
SL_RESULT_FEATURE_UNSUPPORTED
);
}
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_OPENSELES_ENGINEITF_INVALID_0300
* @tc.name : engine itf invalid
* @tc.desc : Basic function test
*/
HWTEST_F
(
ActsOpenslesPlayerNdkTest
,
SUB_MULTIMEDIA_AUDIO_OPENSELES_ENGINEITF_INVALID_0300
,
TestSize
.
Level1
)
{
// get engineObject
engineObject
=
nullptr
;
SLresult
result
=
slCreateEngine
(
&
engineObject
,
0
,
nullptr
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_SUCCESS
,
result
);
// get engineEngine
SLEngineItf
engineEngine
=
nullptr
;
result
=
(
*
engineObject
)
->
GetInterface
(
engineObject
,
SL_IID_ENGINE
,
&
engineEngine
);
ASSERT_EQ
(
SL_RESULT_SUCCESS
,
result
);
// get pcmPlayerObject
pcmPlayerObject
=
nullptr
;
SLDataLocator_OutputMix
slOutputMix
=
{
SL_DATALOCATOR_OUTPUTMIX
,
outputMixObject
};
SLDataSink
slSink
=
{
&
slOutputMix
,
nullptr
};
SLDataLocator_BufferQueue
slBufferQueue
=
{
SL_DATALOCATOR_BUFFERQUEUE
,
0
};
SLDataFormat_PCM
pcmFormat
=
{
SL_DATAFORMAT_PCM
,
wavHeader_
.
NumOfChan
,
wavHeader_
.
SamplesPerSec
*
1000
,
wavHeader_
.
bitsPerSample
,
0
,
0
,
0
};
SLDataSource
slSource
=
{
&
slBufferQueue
,
&
pcmFormat
};
result
=
(
*
engineEngine
)
->
CreateAudioPlayer
(
engineEngine
,
&
pcmPlayerObject
,
&
slSource
,
&
slSink
,
number
,
nullptr
,
nullptr
);
EXPECT_TRUE
(
result
==
SL_RESULT_SUCCESS
);
// get playItf
playItf
=
nullptr
;
result
=
(
*
pcmPlayerObject
)
->
GetInterface
(
pcmPlayerObject
,
SL_IID_PLAY
,
&
playItf
);
EXPECT_TRUE
(
result
==
SL_RESULT_SUCCESS
);
SLresult
result1
=
(
*
playItf
)
->
GetDuration
(
playItf
,
nullptr
);
EXPECT_TRUE
(
result1
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result2
=
(
*
playItf
)
->
GetPositionUpdatePeriod
(
playItf
,
nullptr
);
EXPECT_TRUE
(
result2
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result3
=
(
*
playItf
)
->
RegisterCallback
(
playItf
,
nullptr
,
nullptr
);
EXPECT_TRUE
(
result3
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result4
=
(
*
playItf
)
->
SetCallbackEventsMask
(
playItf
,
0
);
EXPECT_TRUE
(
result4
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result5
=
(
*
playItf
)
->
GetCallbackEventsMask
(
playItf
,
0
);
EXPECT_TRUE
(
result5
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result6
=
(
*
playItf
)
->
SetMarkerPosition
(
playItf
,
0
);
EXPECT_TRUE
(
result6
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result7
=
(
*
playItf
)
->
GetMarkerPosition
(
playItf
,
nullptr
);
EXPECT_TRUE
(
result7
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result8
=
(
*
playItf
)
->
SetPositionUpdatePeriod
(
playItf
,
0
);
EXPECT_TRUE
(
result8
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result9
=
(
*
playItf
)
->
ClearMarkerPosition
(
playItf
);
EXPECT_TRUE
(
result9
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result10
=
(
*
playItf
)
->
GetPosition
(
playItf
,
nullptr
);
EXPECT_TRUE
(
result10
==
SL_RESULT_FEATURE_UNSUPPORTED
);
}
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_OPENSELES_ENGINEITF_INVALID_0400
* @tc.name : engine itf invalid
* @tc.desc : Basic function test
*/
HWTEST_F
(
ActsOpenslesPlayerNdkTest
,
SUB_MULTIMEDIA_AUDIO_OPENSELES_ENGINEITF_INVALID_0400
,
TestSize
.
Level1
)
{
// get engineObject
engineObject
=
nullptr
;
SLresult
result
=
slCreateEngine
(
&
engineObject
,
0
,
nullptr
,
0
,
nullptr
,
nullptr
);
ASSERT_EQ
(
SL_RESULT_SUCCESS
,
result
);
// get engineEngine
SLEngineItf
engineEngine
=
nullptr
;
result
=
(
*
engineObject
)
->
GetInterface
(
engineObject
,
SL_IID_ENGINE
,
&
engineEngine
);
ASSERT_EQ
(
SL_RESULT_SUCCESS
,
result
);
// get pcmPlayerObject
pcmPlayerObject
=
nullptr
;
SLDataLocator_OutputMix
slOutputMix
=
{
SL_DATALOCATOR_OUTPUTMIX
,
outputMixObject
};
SLDataSink
slSink
=
{
&
slOutputMix
,
nullptr
};
SLDataLocator_BufferQueue
slBufferQueue
=
{
SL_DATALOCATOR_BUFFERQUEUE
,
0
};
SLDataFormat_PCM
pcmFormat
=
{
SL_DATAFORMAT_PCM
,
wavHeader_
.
NumOfChan
,
wavHeader_
.
SamplesPerSec
*
1000
,
wavHeader_
.
bitsPerSample
,
0
,
0
,
0
};
SLDataSource
slSource
=
{
&
slBufferQueue
,
&
pcmFormat
};
result
=
(
*
engineEngine
)
->
CreateAudioPlayer
(
engineEngine
,
&
pcmPlayerObject
,
&
slSource
,
&
slSink
,
number
,
nullptr
,
nullptr
);
EXPECT_TRUE
(
result
==
SL_RESULT_SUCCESS
);
// get volumeItf
SLVolumeItf
volumeItf
=
nullptr
;
result
=
(
*
pcmPlayerObject
)
->
GetInterface
(
pcmPlayerObject
,
SL_IID_VOLUME
,
&
volumeItf
);
EXPECT_TRUE
(
result
==
SL_RESULT_SUCCESS
);
SLresult
result1
=
(
*
volumeItf
)
->
SetMute
(
volumeItf
,
SL_BOOLEAN_FALSE
);
EXPECT_TRUE
(
result1
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result2
=
(
*
volumeItf
)
->
GetMute
(
volumeItf
,
nullptr
);
EXPECT_TRUE
(
result2
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result3
=
(
*
volumeItf
)
->
EnableStereoPosition
(
volumeItf
,
SL_BOOLEAN_FALSE
);
EXPECT_TRUE
(
result3
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result4
=
(
*
volumeItf
)
->
IsEnabledStereoPosition
(
volumeItf
,
nullptr
);
EXPECT_TRUE
(
result4
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result5
=
(
*
volumeItf
)
->
SetStereoPosition
(
volumeItf
,
0
);
EXPECT_TRUE
(
result5
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result6
=
(
*
volumeItf
)
->
GetStereoPosition
(
volumeItf
,
nullptr
);
EXPECT_TRUE
(
result6
==
SL_RESULT_FEATURE_UNSUPPORTED
);
}
\ No newline at end of file
multimedia/audio/audio_cpp_standard/openslesRecorderNdk/ActsOpenslesRecoderNdkTest.cpp
浏览文件 @
66cada00
...
...
@@ -261,3 +261,41 @@ HWTEST_F(ActsOpenslesRecoderNdkTest, SUB_MULTIMEDIA_AUDIO_OPENSELES_RECODER_FUNC
result
=
CaptureStop
(
recordItf
);
ASSERT_EQ
(
SL_RESULT_SUCCESS
,
result
);
}
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_OPENSELES_RECODER_INVALID_FUNCTION_0100
* @tc.name : record invalid 001
* @tc.desc : Basic function test
*/
HWTEST_F
(
ActsOpenslesRecoderNdkTest
,
SUB_MULTIMEDIA_AUDIO_OPENSELES_RECODER_INVALID_FUNCTION_0100
,
TestSize
.
Level1
)
{
SLresult
result1
=
(
*
recordItf
)
->
SetDurationLimit
(
nullptr
,
0
);
EXPECT_TRUE
(
result1
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result2
=
(
*
recordItf
)
->
GetPosition
(
nullptr
,
0
);
EXPECT_TRUE
(
result2
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result3
=
(
*
recordItf
)
->
RegisterCallback
(
recordItf
,
nullptr
,
wavFile_
);
EXPECT_TRUE
(
result3
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result4
=
(
*
recordItf
)
->
SetCallbackEventsMask
(
nullptr
,
0
);
EXPECT_TRUE
(
result4
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result5
=
(
*
recordItf
)
->
GetCallbackEventsMask
(
nullptr
,
nullptr
);
EXPECT_TRUE
(
result5
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result6
=
(
*
recordItf
)
->
SetMarkerPosition
(
nullptr
,
0
);
EXPECT_TRUE
(
result6
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result7
=
(
*
recordItf
)
->
ClearMarkerPosition
(
nullptr
);
EXPECT_TRUE
(
result7
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result8
=
(
*
recordItf
)
->
GetMarkerPosition
(
nullptr
,
nullptr
);
EXPECT_TRUE
(
result8
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result9
=
(
*
recordItf
)
->
SetPositionUpdatePeriod
(
nullptr
,
0
);
EXPECT_TRUE
(
result9
==
SL_RESULT_FEATURE_UNSUPPORTED
);
SLresult
result10
=
(
*
recordItf
)
->
GetPositionUpdatePeriod
(
nullptr
,
nullptr
);
EXPECT_TRUE
(
result10
==
SL_RESULT_FEATURE_UNSUPPORTED
);
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录