summaryrefslogtreecommitdiff
path: root/TC/testcase
diff options
context:
space:
mode:
Diffstat (limited to 'TC/testcase')
-rwxr-xr-xTC/testcase/Makefile25
-rw-r--r--TC/testcase/tslist2
-rw-r--r--TC/testcase/utc_media_audio_input.c307
-rw-r--r--TC/testcase/utc_media_audio_output.c377
4 files changed, 711 insertions, 0 deletions
diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile
new file mode 100755
index 0000000..04ee11e
--- /dev/null
+++ b/TC/testcase/Makefile
@@ -0,0 +1,25 @@
+CC ?= gcc
+
+C_FILES = $(shell ls *.c)
+
+PKGS = capi-media-audio-io dlog glib-2.0
+
+LDFLAGS = `pkg-config --libs $(PKGS)`
+LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
+CFLAGS += -I$(TET_ROOT)/inc/tet3
+CFLAGS += -Wall
+
+#TARGETS = $(C_FILES:%.c=tc-%)
+TCS := $(shell ls -1 *.c | cut -d. -f1)
+
+all: $(TCS)
+
+%: %.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+ rm -f $(TCS)
diff --git a/TC/testcase/tslist b/TC/testcase/tslist
new file mode 100644
index 0000000..c4f5399
--- /dev/null
+++ b/TC/testcase/tslist
@@ -0,0 +1,2 @@
+/testcase/utc_media_audio_input
+/testcase/utc_media_audio_output
diff --git a/TC/testcase/utc_media_audio_input.c b/TC/testcase/utc_media_audio_input.c
new file mode 100644
index 0000000..4755dbc
--- /dev/null
+++ b/TC/testcase/utc_media_audio_input.c
@@ -0,0 +1,307 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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.
+*/
+
+#include <tet_api.h>
+#include <media/audio_io.h>
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_media_audio_in_create_p(void);
+static void utc_media_audio_in_create_n(void);
+static void utc_media_audio_in_destroy_p(void);
+static void utc_media_audio_in_destroy_n(void);
+static void utc_media_audio_in_read_p(void);
+static void utc_media_audio_in_read_n(void);
+static void utc_media_audio_in_get_buffer_size_p(void);
+static void utc_media_audio_in_get_buffer_size_n(void);
+static void utc_media_audio_in_get_sample_rate_p(void);
+static void utc_media_audio_in_get_sample_rate_n(void);
+static void utc_media_audio_in_get_channel_p(void);
+static void utc_media_audio_in_get_channel_n(void);
+static void utc_media_audio_in_get_sample_type_p(void);
+static void utc_media_audio_in_get_sample_type_n(void);
+
+
+struct tet_testlist tet_testlist[] = {
+ { utc_media_audio_in_create_p , POSITIVE_TC_IDX },
+ { utc_media_audio_in_create_n , NEGATIVE_TC_IDX },
+ { utc_media_audio_in_destroy_p, POSITIVE_TC_IDX },
+ { utc_media_audio_in_destroy_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_in_read_p, POSITIVE_TC_IDX },
+ { utc_media_audio_in_read_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_in_get_buffer_size_p, POSITIVE_TC_IDX },
+ { utc_media_audio_in_get_buffer_size_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_in_get_sample_rate_p, POSITIVE_TC_IDX },
+ { utc_media_audio_in_get_sample_rate_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_in_get_channel_p , POSITIVE_TC_IDX },
+ { utc_media_audio_in_get_channel_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_in_get_sample_type_p, POSITIVE_TC_IDX },
+ { utc_media_audio_in_get_sample_type_n, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+ /* start of TC */
+}
+
+static void cleanup(void)
+{
+ /* end of TC */
+}
+
+static void utc_media_audio_in_create_p(void)
+{
+ char* api_name = "audio_in_create";
+ int ret;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE , &input)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_in_destroy(input);
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_create_n(void)
+{
+ char* api_name = "audio_in_create";
+ int ret;
+ audio_in_h input;
+ if ((ret = audio_in_create(45100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE, &input)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_destroy_p(void)
+{
+ char* api_name = "audio_in_destroy";
+ int ret;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE, &input)) == AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_in_destroy(input)) == AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_destroy_n(void)
+{
+ char* api_name = "audio_in_destroy";
+ int ret;
+ if ((ret = audio_in_destroy(NULL)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_read_p(void)
+{
+ char* api_name = "audio_in_read";
+ int ret, size;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE, &input)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_in_prepare(input);
+ if ((ret = audio_in_get_buffer_size(input, &size)) == AUDIO_IO_ERROR_NONE)
+ {
+ char *buffer = NULL;
+ buffer = alloca(size);
+ if ((ret = audio_in_read(input, (void*)buffer, size)) > AUDIO_IO_ERROR_NONE)
+ {
+ audio_in_destroy(input);
+ dts_pass(api_name);
+ }
+ }
+ audio_in_destroy(input);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_read_n(void)
+{
+ char* api_name = "audio_in_read";
+ int ret, size;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE, &input)) == AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_in_get_buffer_size(input, &size)) == AUDIO_IO_ERROR_NONE)
+ {
+ char *buffer = NULL;
+ buffer = alloca(size);
+ if ((ret = audio_in_read(input, (void*)buffer, 0)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_in_destroy(input);
+ dts_pass(api_name);
+ }
+ }
+ audio_in_destroy(input);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_get_buffer_size_p(void)
+{
+ char* api_name = "audio_in_get_buffer_size";
+ int ret, size;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE , &input)) == AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_in_get_buffer_size(input, &size)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_in_destroy(input);
+ dts_pass(api_name);
+ }
+ audio_in_destroy(input);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_get_buffer_size_n(void)
+{
+ char* api_name = "audio_in_get_buffer_size";
+ int ret, size;
+ audio_in_h input;
+ if ((ret = audio_in_create(45100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE , &input)) != AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_in_get_buffer_size(input, &size)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_get_sample_rate_p(void)
+{
+ char* api_name = "audio_in_get_sample_rate";
+ int ret;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE , &input)) == AUDIO_IO_ERROR_NONE)
+ {
+ int sample_rate;
+ if ((ret = audio_in_get_sample_rate(input, &sample_rate)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_in_destroy(input);
+ dts_pass(api_name);
+ }
+ audio_in_destroy(input);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_get_sample_rate_n(void)
+{
+ char* api_name = "audio_in_get_sample_rate";
+ int ret, sample_rate;
+ audio_in_h input = NULL;
+ if ((ret = audio_in_get_sample_rate(input, &sample_rate)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_get_channel_p(void)
+{
+ char* api_name = "audio_in_get_channel";
+ int ret;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE , &input)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_channel_e channel;
+ if ((ret = audio_in_get_channel(input, &channel)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_in_destroy(input);
+ dts_pass(api_name);
+ }
+ audio_in_destroy(input);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_get_channel_n(void)
+{
+ char* api_name = "audio_in_get_channel";
+ int ret;
+ audio_channel_e channel;
+ audio_in_h input = NULL;
+ if ((ret = audio_in_get_channel(input, &channel)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_get_sample_type_p(void)
+{
+ char* api_name = "audio_in_get_sample_type";
+ int ret;
+ audio_in_h input;
+ if ((ret = audio_in_create(44100, AUDIO_CHANNEL_MONO ,AUDIO_SAMPLE_TYPE_S16_LE , &input)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_sample_type_e type;
+ if ((ret = audio_in_get_sample_type(input, &type)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_in_destroy(input);
+ dts_pass(api_name);
+ }
+ audio_in_destroy(input);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_in_get_sample_type_n(void)
+{
+ char* api_name = "audio_in_get_sample_type";
+ int ret;
+ audio_sample_type_e type;
+ audio_in_h input = NULL;
+ if ((ret = audio_in_get_sample_type(input, &type)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
diff --git a/TC/testcase/utc_media_audio_output.c b/TC/testcase/utc_media_audio_output.c
new file mode 100644
index 0000000..7c924cf
--- /dev/null
+++ b/TC/testcase/utc_media_audio_output.c
@@ -0,0 +1,377 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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.
+*/
+
+#include <tet_api.h>
+#include <media/audio_io.h>
+
+#define AUDIO_FILE "/mnt/nfs/workspace/capi/media/audio-io/TC/media_samsung.mp3"
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_media_audio_out_create_p(void);
+static void utc_media_audio_out_create_n(void);
+static void utc_media_audio_out_destroy_p(void);
+static void utc_media_audio_out_destroy_n(void);
+static void utc_media_audio_out_write_p(void);
+static void utc_media_audio_out_write_n(void);
+static void utc_media_audio_out_get_buffer_size_p(void);
+static void utc_media_audio_out_get_buffer_size_n(void);
+static void utc_media_audio_out_get_sample_rate_p(void);
+static void utc_media_audio_out_get_sample_rate_n(void);
+static void utc_media_audio_out_get_channel_p(void);
+static void utc_media_audio_out_get_channel_n(void);
+static void utc_media_audio_out_get_sample_type_p(void);
+static void utc_media_audio_out_get_sample_type_n(void);
+static void utc_media_audio_out_get_sound_type_p(void);
+static void utc_media_audio_out_get_sound_type_n(void);
+
+
+struct tet_testlist tet_testlist[] = {
+ { utc_media_audio_out_create_p , POSITIVE_TC_IDX },
+ { utc_media_audio_out_create_n , NEGATIVE_TC_IDX },
+ { utc_media_audio_out_destroy_p, POSITIVE_TC_IDX },
+ { utc_media_audio_out_destroy_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_out_write_p, POSITIVE_TC_IDX },
+ { utc_media_audio_out_write_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_out_get_buffer_size_p, POSITIVE_TC_IDX },
+ { utc_media_audio_out_get_buffer_size_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_out_get_sample_rate_p, POSITIVE_TC_IDX },
+ { utc_media_audio_out_get_sample_rate_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_out_get_channel_p , POSITIVE_TC_IDX },
+ { utc_media_audio_out_get_channel_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_out_get_sample_type_p, POSITIVE_TC_IDX },
+ { utc_media_audio_out_get_sample_type_n, NEGATIVE_TC_IDX },
+ { utc_media_audio_out_get_sound_type_p, POSITIVE_TC_IDX },
+ { utc_media_audio_out_get_sound_type_n, NEGATIVE_TC_IDX },
+ { NULL, 0 },
+};
+
+static void startup(void)
+{
+ /* start of TC */
+}
+
+static void cleanup(void)
+{
+ /* end of TC */
+}
+
+static void utc_media_audio_out_create_p(void)
+{
+ char* api_name = "audio_out_create";
+ int ret;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE , SOUND_TYPE_SYSTEM, &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_out_destroy(output);
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_create_n(void)
+{
+ char* api_name = "audio_out_create";
+ int ret;
+ audio_out_h output;
+ if ((ret = audio_out_create(45100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE, SOUND_TYPE_SYSTEM , &output)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_destroy_p(void)
+{
+ char* api_name = "audio_out_destroy";
+ int ret;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE, SOUND_TYPE_SYSTEM , &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_out_destroy(output)) == AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_destroy_n(void)
+{
+ char* api_name = "audio_out_destroy";
+ int ret;
+ if ((ret = audio_out_destroy(NULL)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_write_p(void)
+{
+ char* api_name = "audio_out_write";
+ int ret, size;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE, SOUND_TYPE_SYSTEM , &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_out_get_buffer_size(output, &size)) == AUDIO_IO_ERROR_NONE)
+ {
+ FILE *fp = NULL;
+ fp = fopen(AUDIO_FILE,"r");
+ if(fp != NULL)
+ {
+ int read;
+ char *buffer = NULL;
+ buffer = alloca(size);
+ if((read = fread(buffer, size, sizeof(char), fp)) > 0 )
+ {
+ audio_out_prepare(output);
+ if ((ret = audio_out_write(output, (void*)buffer, read)) > AUDIO_IO_ERROR_NONE)
+ {
+ fclose(fp);
+ audio_out_destroy(output);
+ dts_pass(api_name);
+ }
+ }
+ else
+ {
+ ret = AUDIO_IO_ERROR_INVALID_BUFFER;
+ }
+ fclose(fp);
+ }
+ else
+ {
+ ret = AUDIO_IO_ERROR_INVALID_BUFFER ;
+ }
+ }
+ audio_out_destroy(output);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_write_n(void)
+{
+ char* api_name = "audio_out_write";
+ int ret, size;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE, SOUND_TYPE_SYSTEM , &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_out_get_buffer_size(output, &size)) == AUDIO_IO_ERROR_NONE)
+ {
+ FILE *fp = NULL;
+ fp = fopen(AUDIO_FILE,"r");
+ if(fp != NULL)
+ {
+ char *buffer = NULL;
+ int read;
+ audio_out_prepare(output);
+ if ((ret = audio_out_write(output, (void*)buffer, read)) != AUDIO_IO_ERROR_NONE)
+ {
+ fclose(fp);
+ audio_out_destroy(output);
+ dts_pass(api_name);
+ }
+ fclose(fp);
+ }
+ else
+ {
+ ret = AUDIO_IO_ERROR_INVALID_BUFFER ;
+ }
+ }
+ audio_out_destroy(output);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_buffer_size_p(void)
+{
+ char* api_name = "audio_out_get_buffer_size";
+ int ret, size;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE , SOUND_TYPE_SYSTEM, &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_out_get_buffer_size(output, &size)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_out_destroy(output);
+ dts_pass(api_name);
+ }
+ audio_out_destroy(output);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_buffer_size_n(void)
+{
+ char* api_name = "audio_out_get_buffer_size";
+ int ret, size;
+ audio_out_h output;
+ if ((ret = audio_out_create(45100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE , SOUND_TYPE_SYSTEM, &output)) != AUDIO_IO_ERROR_NONE)
+ {
+ if ((ret = audio_out_get_buffer_size(output, &size)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_sample_rate_p(void)
+{
+ char* api_name = "audio_out_get_sample_rate";
+ int ret;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE , SOUND_TYPE_SYSTEM , &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ int sample_rate;
+ if ((ret = audio_out_get_sample_rate(output, &sample_rate)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_out_destroy(output);
+ dts_pass(api_name);
+ }
+ audio_out_destroy(output);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_sample_rate_n(void)
+{
+ char* api_name = "audio_in_get_sample_rate";
+ int ret, sample_rate;
+ audio_in_h input = NULL;
+ if ((ret = audio_in_get_sample_rate(input, &sample_rate)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_channel_p(void)
+{
+ char* api_name = "audio_out_get_channel";
+ int ret;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE , SOUND_TYPE_SYSTEM , &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_channel_e channel;
+ if ((ret = audio_out_get_channel(output, &channel)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_out_destroy(output);
+ dts_pass(api_name);
+ }
+ audio_out_destroy(output);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_channel_n(void)
+{
+ char* api_name = "audio_out_get_channel";
+ int ret;
+ audio_channel_e channel;
+ audio_out_h output = NULL;
+ if ((ret = audio_out_get_channel(output, &channel)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_sample_type_p(void)
+{
+ char* api_name = "audio_out_get_sample_type";
+ int ret;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE , SOUND_TYPE_SYSTEM , &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_sample_type_e type;
+ if ((ret = audio_out_get_sample_type(output, &type)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_out_destroy(output);
+ dts_pass(api_name);
+ }
+ audio_out_destroy(output);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_sample_type_n(void)
+{
+ char* api_name = "audio_out_get_sample_type";
+ int ret;
+ audio_sample_type_e type;
+ audio_out_h output = NULL;
+ if ((ret = audio_out_get_sample_type(output, &type)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_sound_type_p(void)
+{
+ char* api_name = "audio_out_get_sound_type";
+ int ret;
+ audio_out_h output;
+ if ((ret = audio_out_create(44100, AUDIO_CHANNEL_STEREO ,AUDIO_SAMPLE_TYPE_S16_LE , SOUND_TYPE_SYSTEM , &output)) == AUDIO_IO_ERROR_NONE)
+ {
+ sound_type_e type;
+ if ((ret = audio_out_get_sound_type(output, &type)) == AUDIO_IO_ERROR_NONE)
+ {
+ audio_out_destroy(output);
+ dts_pass(api_name);
+ }
+ audio_out_destroy(output);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}
+
+static void utc_media_audio_out_get_sound_type_n(void)
+{
+ char* api_name = "audio_out_get_sound_type";
+ int ret;
+ audio_sample_type_e type;
+ audio_out_h output = NULL;
+ if ((ret = audio_out_get_sample_type(output, &type)) != AUDIO_IO_ERROR_NONE)
+ {
+ dts_pass(api_name);
+ }
+ dts_message(api_name, "Call log: %d", ret);
+ dts_fail(api_name);
+}