#include <gtest/gtest.h>
#include <Ecore.h>
#include <system_info.h>
+#include <app_manager.h>
+#include <vconf.h>
+#include <tzplatform_config.h>
#include <voice_control.h>
+#include <voice_control_internal.h>
#include <voice_control_manager.h>
+#include <voice_control_command_expand.h>
#include "system_info_mock.h"
#include "cynara_mock.h"
+#include "test_util.h"
+
+
+static const char *TEST_COMMAND_JSON_PATH = tzplatform_mkpath(tzplatform_getid("TZ_SYS_RO_APP"), "/org.tizen.vc-unittests/res/test_command.json");
+static const char *TEST_APP_ID = "org.tizen.vc-unittests";
+static const char *TEST_INVOCATION_NAME = "invocation";
+static const char *TEST_CREDENTIAL = "credential";
+
static int g_vc_init = false;
static vc_state_e g_vc_state = VC_STATE_NONE;
+static vc_service_state_e g_vc_service_state = VC_SERVICE_STATE_NONE;
+
static vc_state_e g_vc_mgr_state = VC_STATE_NONE;
static vc_service_state_e g_vc_mgr_service_state = VC_SERVICE_STATE_NONE;
static bool g_vc_supported = false;
+static bool g_error_cb_invoked = false;
+
+vc_cmd_list_h g_test_commands = nullptr;
+
static bool __is_mgr_state_changed(vc_state_e state, int wait_delay)
{
int max_count = wait_delay * 10;
return true;
}
+static bool __is_state_changed(vc_state_e state, int wait_delay)
+{
+ int max_count = wait_delay * 10;
+ int count = 0;
+ while (max_count > count && state != g_vc_state) {
+ ecore_main_loop_iterate();
+ usleep(100000);
+ count++;
+ }
+
+ return (state == g_vc_state);
+}
+
+static bool __is_service_state_changed(vc_service_state_e state, int wait_delay)
+{
+ int max_count = wait_delay * 10;
+ int count = 0;
+ while (max_count > count && state != g_vc_service_state) {
+ ecore_main_loop_iterate();
+ usleep(100000);
+ count++;
+ }
+
+ return (state == g_vc_service_state);
+}
+
+static bool __is_error_cb_invoked(int wait_delay)
+{
+ int max_count = wait_delay * 10;
+ int count = 0;
+ while (max_count > count && false == g_error_cb_invoked) {
+ ecore_main_loop_iterate();
+ usleep(100000);
+ count++;
+ }
+
+ return g_error_cb_invoked;
+}
+
+static void __vc_mgr_state_changed_cb(vc_state_e previous, vc_state_e current, void* user_data)
+{
+ g_vc_mgr_state = current;
+}
+
+static void __vc_mgr_service_state_changed_cb(vc_service_state_e previous, vc_service_state_e current, void* user_data)
+{
+ g_vc_mgr_service_state = current;
+}
+
+static bool __vc_mgr_all_result_cb(vc_result_event_e event, vc_cmd_list_h vc_cmd_list, const char *result, const char *msg, void *user_data)
+{
+ return true;
+}
+
static void __vc_result_cb(vc_result_event_e event, vc_cmd_list_h vc_cmd_list, const char* result, void* user_data)
{
}
g_vc_state = current;
}
-static void __vc_mgr_state_changed_cb(vc_state_e previous, vc_state_e current, void* user_data)
+static void __vc_service_state_changed_cb(vc_service_state_e previous, vc_service_state_e current, void* user_data)
{
- g_vc_mgr_state = current;
+ g_vc_service_state = current;
}
-static void __vc_mgr_service_state_changed_cb(vc_service_state_e previous, vc_service_state_e current, void* user_data)
+static void __vc_error_cb(vc_error_e reason, void* user_data)
{
- g_vc_mgr_service_state = current;
+ g_error_cb_invoked = true;
}
-static void __vc_service_state_changed_cb(vc_service_state_e previous, vc_service_state_e current, void* user_data)
+static void __vc_tts_streaming_cb(vc_tts_event_e event, char* buffer, int len, int utt_id, void *user_data)
{
}
-static void __vc_error_cb(vc_error_e reason, void* user_data)
+static void __vc_tts_utterance_status_cb(int utt_id, vc_tts_utterance_status_e status, void *user_data)
{
}
EXPECT_EQ(vc_mgr_initialize(), VC_ERROR_NONE);
EXPECT_EQ(vc_mgr_set_state_changed_cb(__vc_mgr_state_changed_cb, nullptr), VC_ERROR_NONE);
EXPECT_EQ(vc_mgr_set_service_state_changed_cb(__vc_mgr_service_state_changed_cb, nullptr), VC_ERROR_NONE);
+ EXPECT_EQ(vc_mgr_set_all_result_cb(__vc_mgr_all_result_cb, nullptr), VC_ERROR_NONE);
EXPECT_EQ(vc_mgr_prepare(), VC_ERROR_NONE);
ASSERT_EQ(true, __is_mgr_state_changed(VC_STATE_READY, 5));
ASSERT_EQ(true, __is_mgr_service_state_changed(VC_SERVICE_STATE_READY, 5));
vc_cmd_h system_command = nullptr;
EXPECT_EQ(vc_cmd_create(&system_command), VC_ERROR_NONE);
- EXPECT_EQ(vc_cmd_set_command(system_command, "test"), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_command(system_command, "manager"), VC_ERROR_NONE);
EXPECT_EQ(vc_cmd_set_type(system_command, VC_COMMAND_TYPE_SYSTEM), VC_ERROR_NONE);
vc_cmd_list_h commands = nullptr;
return (is_vc_supported && is_mic_supported);
}
+static vc_cmd_list_h __create_test_command_list()
+{
+ vc_cmd_h system_command = nullptr;
+ EXPECT_EQ(vc_cmd_create(&system_command), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_command(system_command, "test"), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_type(system_command, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_NONE);
+
+ vc_cmd_list_h commands = nullptr;
+ EXPECT_EQ(vc_cmd_list_create(&commands), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_add(commands, system_command), VC_ERROR_NONE);
+
+ return commands;
+}
+
+static void __initialize_test_environment()
+{
+ ecore_init();
+ ecore_main_loop_glib_integrate();
+
+ g_vc_supported = __is_vc_supported();
+
+ g_vc_mgr_state = VC_STATE_NONE;
+ g_vc_mgr_service_state = VC_SERVICE_STATE_NONE;
+
+ g_vc_state = VC_STATE_NONE;
+ g_vc_service_state = VC_SERVICE_STATE_NONE;
+
+ g_error_cb_invoked = false;
+
+ g_test_commands = __create_test_command_list();
+}
+
+static void __shutdown_test_environment()
+{
+ vc_cmd_list_destroy(g_test_commands, true);
+ g_test_commands = nullptr;
+
+ wait_engine_terminated(1);
+
+ ecore_shutdown();
+}
+
namespace {
+class VCTestInNoneState : public testing::Test {
+ public:
+ virtual void SetUp() {
+ __initialize_test_environment();
+ }
+
+ virtual void TearDown()
+ {
+ vc_deinitialize();
+ __shutdown_test_environment();
+ }
+};
+
class VCTest : public testing::Test {
public:
virtual void SetUp() {
- ecore_init();
- ecore_main_loop_glib_integrate();
-
- g_vc_supported = __is_vc_supported();
+ __initialize_test_environment();
if (false == g_vc_supported) {
g_vc_init = false;
g_vc_init = true;
vc_initialize();
vc_set_state_changed_cb(__vc_state_changed_cb, NULL);
+ vc_set_service_state_changed_cb(__vc_service_state_changed_cb, nullptr);
+ }
+
+ virtual void TearDown()
+ {
+ if (true == g_vc_supported)
+ {
+ vc_unset_state_changed_cb();
+ vc_deinitialize();
+ }
+
+ __shutdown_test_environment();
+ }
+};
+
+class VCTestInReadyState : public testing::Test {
+ public:
+ virtual void SetUp() {
+ __initialize_test_environment();
+
+ if (false == g_vc_supported) {
+ return;
+ }
+
+ vc_initialize();
+ vc_set_state_changed_cb(__vc_state_changed_cb, nullptr);
+ vc_set_service_state_changed_cb(__vc_service_state_changed_cb, nullptr);
+
+ vc_prepare_sync();
+ EXPECT_EQ(__is_state_changed(VC_STATE_READY, 5), true);
+ EXPECT_EQ(__is_service_state_changed(VC_SERVICE_STATE_READY, 5), true);
}
virtual void TearDown()
{
if (true == g_vc_supported)
{
+ vc_unprepare();
vc_unset_state_changed_cb();
vc_deinitialize();
}
- ecore_shutdown();
+ __shutdown_test_environment();
}
};
}
/**
+ * @testcase utc_vc_deinitialize_p2
+ * @since_tizen 2.4
+ * @description Positive UTC for deinitialize voice control handle
+ */
+TEST_F(VCTest, utc_vc_deinitialize_p2)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_prepare(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_deinitialize_p3
+ * @since_tizen 2.4
+ * @description Positive UTC for deinitialize voice control handle
+ */
+TEST_F(VCTestInReadyState, utc_vc_deinitialize_p3)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
* @testcase utc_vc_deinitialize_n
* @since_tizen 2.4
* @description Negative UTC for deinitialize voice control handle (Already deinitialized)
* @since_tizen 2.4
* @description Negative UTC for connect service daemon (Invalid state)
*/
-TEST_F(VCTest, vc_prepare_n)
+TEST_F(VCTestInNoneState, utc_vc_prepare_n)
{
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_prepare(), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_prepare();
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_prepare(), VC_ERROR_INVALID_STATE);
- vc_deinitialize();
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_state_changed_cb(__vc_state_changed_cb, nullptr), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- ret = vc_prepare();
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
+ EXPECT_EQ(vc_prepare(), VC_ERROR_NONE);
+ EXPECT_EQ(__is_state_changed(VC_STATE_READY, 5), true);
+ EXPECT_EQ(vc_prepare(), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_prepare_sync_p
+ * @since_tizen 4.0
+ * @description Positive UTC for connect service engine synchronously
+ */
+TEST_F(VCTest, utc_vc_prepare_sync_p)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NONE);
+ EXPECT_EQ(__is_state_changed(VC_STATE_READY, 5), true);
+
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_prepare_sync_n
+ * @since_tizen 4.0
+ * @description Negative UTC for connect service engine synchronously (Invalid state)
+ */
+TEST_F(VCTestInNoneState, utc_vc_prepare_sync_n)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NOT_SUPPORTED);
+ return;
}
+
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_state_changed_cb(__vc_state_changed_cb, nullptr), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NONE);
+ EXPECT_EQ(__is_state_changed(VC_STATE_READY, 5), true);
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
}
/**
* @since_tizen 2.4
* @description Negative UTC for disconnect service daemon (Invalid state)
*/
-TEST_F(VCTest, vc_unprepare_n)
+TEST_F(VCTestInNoneState, utc_vc_unprepare_n)
{
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- ret = vc_unprepare();
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
-
- int ret = VC_ERROR_NONE;
- ret = vc_unprepare();
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NOT_SUPPORTED);
+ return;
}
-}
-
-/**
- * @testcase utc_vc_unprepare_n2
- * @since_tizen 2.4
- * @description Negative UTC for disconnect service daemon (Invalid state)
- */
-TEST_F(VCTest, vc_unprepare_n2)
-{
- if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
- int ret = VC_ERROR_NONE;
- ret = vc_unprepare();
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_INVALID_STATE);
- int ret = VC_ERROR_NONE;
- ret = vc_deinitialize();
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_INVALID_STATE);
- ret = vc_unprepare();
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
- }
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
}
/**
* @since_tizen 2.4
* @description Positive UTC for get current state
*/
-TEST_F(VCTest, vc_get_state_p)
+TEST_F(VCTestInNoneState, vc_get_state_p)
{
+ vc_state_e state = VC_STATE_NONE;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_state_e state = VC_STATE_NONE;
- ret = vc_get_state(&state);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
-
- int ret = VC_ERROR_NONE;
- vc_state_e state = VC_STATE_NONE;
- ret = vc_get_state(&state);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_get_state(&state), VC_ERROR_NOT_SUPPORTED);
+ return;
}
-}
-
-/**
- * @testcase utc_vc_get_state_p2
- * @since_tizen 2.4
- * @description Positive UTC for get current state after connection
- */
-TEST_F(VCTest, vc_get_state_p2)
-{
- if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_state_e state = VC_STATE_NONE;
- ret = vc_get_state(&state);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
- int ret = VC_ERROR_NONE;
- ret = vc_prepare();
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_get_state(&state), VC_ERROR_NONE);
+ EXPECT_EQ(state, VC_STATE_NONE);
- while (VC_STATE_READY != g_vc_state) {
- ecore_main_loop_iterate();
- }
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_get_state(&state), VC_ERROR_NONE);
+ EXPECT_EQ(state, VC_STATE_INITIALIZED);
- vc_state_e state = VC_STATE_NONE;
- ret = vc_get_state(&state);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_state_changed_cb(__vc_state_changed_cb, nullptr), VC_ERROR_NONE);
+ EXPECT_EQ(vc_prepare(), VC_ERROR_NONE);
+ EXPECT_EQ(__is_state_changed(VC_STATE_READY, 5), true);
+ EXPECT_EQ(vc_get_state(&state), VC_ERROR_NONE);
+ EXPECT_EQ(state, VC_STATE_READY);
- ret = vc_unprepare();
- EXPECT_EQ(ret, VC_ERROR_NONE);
- }
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
}
/**
}
/**
- * @testcase utc_vc_get_state_n2
+ * @testcase utc_vc_get_service_state_p
* @since_tizen 2.4
- * @description Negative UTC for get current state (Invalid state)
+ * @description Positive UTC for get current state of service daemon
*/
-TEST_F(VCTest, vc_get_state_n2)
+TEST_F(VCTestInReadyState, utc_vc_get_service_state_p)
{
+ vc_service_state_e state = VC_SERVICE_STATE_NONE;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_get_service_state(&state), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- vc_state_e state = VC_STATE_NONE;
- ret = vc_get_state(&state);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_get_service_state(&state), VC_ERROR_NONE);
+ EXPECT_EQ(state, VC_SERVICE_STATE_READY);
- int ret = VC_ERROR_NONE;
- ret = vc_deinitialize();
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ __vc_mgr_ready();
- vc_state_e state = VC_STATE_NONE;
- ret = vc_get_state(&state);
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
- }
+ EXPECT_EQ(vc_mgr_start(false), VC_ERROR_NONE);
+ EXPECT_EQ(__is_service_state_changed(VC_SERVICE_STATE_RECORDING, 5), true);
+
+ EXPECT_EQ(vc_get_service_state(&state), VC_ERROR_NONE);
+ EXPECT_EQ(state, VC_SERVICE_STATE_RECORDING);
+
+ EXPECT_EQ(vc_mgr_stop(), VC_ERROR_NONE);
+ EXPECT_EQ(__is_service_state_changed(VC_SERVICE_STATE_PROCESSING, 5), true);
+
+ EXPECT_EQ(vc_get_service_state(&state), VC_ERROR_NONE);
+ EXPECT_EQ(state, VC_SERVICE_STATE_PROCESSING);
+
+ __vc_mgr_finish();
}
/**
- * @testcase utc_vc_get_service_state_p
+ * @testcase utc_vc_get_service_state_n
* @since_tizen 2.4
- * @description Positive UTC for get current state of service daemon
+ * @description Negative UTC for get current state of service daemon (Invalid parameter)
*/
-TEST_F(VCTest, vc_get_service_state_p)
+TEST_F(VCTest, vc_get_service_state_n)
{
if (false == g_vc_supported) {
EXPECT_EQ(g_vc_init, false);
int ret = VC_ERROR_NONE;
- vc_service_state_e state = VC_SERVICE_STATE_NONE;
- ret = vc_get_service_state(&state);
+ ret = vc_get_service_state(NULL);
EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
} else {
EXPECT_EQ(g_vc_init, true);
int ret = VC_ERROR_NONE;
- ret = vc_prepare();
- EXPECT_EQ(ret, VC_ERROR_NONE);
-
- while (VC_STATE_READY != g_vc_state) {
- ecore_main_loop_iterate();
- }
-
- vc_service_state_e state = VC_SERVICE_STATE_NONE;
- ret = vc_get_service_state(&state);
- EXPECT_EQ(ret, VC_ERROR_NONE);
-
- ret = vc_unprepare();
- EXPECT_EQ(ret, VC_ERROR_NONE);
- }
-}
-
-/**
- * @testcase utc_vc_get_service_state_n
- * @since_tizen 2.4
- * @description Negative UTC for get current state of service daemon (Invalid parameter)
- */
-TEST_F(VCTest, vc_get_service_state_n)
-{
- if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- ret = vc_get_service_state(NULL);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
-
- int ret = VC_ERROR_NONE;
- ret = vc_get_service_state(NULL);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
- }
-}
+ ret = vc_get_service_state(NULL);
+ EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
+ }
+}
/**
* @testcase utc_vc_get_service_state_n2
* @since_tizen 2.4
* @description Negative UTC for get current state of service daemon (Invalid state)
*/
-TEST_F(VCTest, vc_get_service_state_n2)
+TEST_F(VCTestInNoneState, vc_get_service_state_n2)
{
+ vc_service_state_e state = VC_SERVICE_STATE_NONE;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_get_service_state(&state), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- vc_service_state_e state = VC_SERVICE_STATE_NONE;
- ret = vc_get_service_state(&state);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_get_service_state(&state), VC_ERROR_INVALID_STATE);
- int ret = VC_ERROR_NONE;
- ret = vc_deinitialize();
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_get_service_state(&state), VC_ERROR_INVALID_STATE);
- vc_service_state_e state = VC_SERVICE_STATE_NONE;
- ret = vc_get_service_state(&state);
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
- }
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
}
/**
* @since_tizen 3.0
* @description Negative UTC for get the system command list (Invalid state)
*/
-TEST_F(VCTest, vc_get_system_command_list_n2)
+TEST_F(VCTestInNoneState, vc_get_system_command_list_n2)
{
+ vc_cmd_list_h list = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_get_system_command_list(&list);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_get_system_command_list(&list), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_deinitialize();
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_get_system_command_list(&list), VC_ERROR_INVALID_STATE);
- vc_cmd_list_h list = NULL;
- ret = vc_get_system_command_list(&list);
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
- }
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_get_system_command_list(&list), VC_ERROR_INVALID_STATE);
}
/**
* @since_tizen 2.4
* @description Negative UTC for set command list used as candidate set (Invalid parameter)
*/
-TEST_F(VCTest, vc_set_command_list_n)
+TEST_F(VCTestInReadyState, utc_vc_set_command_list_n)
{
- if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- ret = vc_set_command_list(NULL, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ vc_cmd_list_h empty_cmd_list = nullptr;
+ EXPECT_EQ(vc_cmd_list_create(&empty_cmd_list), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- ret = vc_set_command_list(NULL, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_set_command_list(nullptr, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_set_command_list(empty_cmd_list, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_set_command_list(g_test_commands, -1), VC_ERROR_NOT_SUPPORTED);
+ vc_cmd_list_destroy(empty_cmd_list, true);
+ return;
}
+
+ EXPECT_EQ(vc_set_command_list(nullptr, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_set_command_list(empty_cmd_list, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_set_command_list(g_test_commands, -1), VC_ERROR_INVALID_PARAMETER);
+ vc_cmd_list_destroy(empty_cmd_list, true);
}
/**
* @since_tizen 2.4
* @description Negative UTC for set command list used as candidate set (Invalid state)
*/
-TEST_F(VCTest, vc_set_command_list_n2)
+TEST_F(VCTestInNoneState, utc_vc_set_command_list_n2)
{
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_set_command_list(list, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
-
- int ret = VC_ERROR_NONE;
- ret = vc_deinitialize();
- EXPECT_EQ(ret, VC_ERROR_NONE);
-
- vc_cmd_list_h list = NULL;
- ret = vc_cmd_list_create(&list);
- EXPECT_EQ(ret, VC_ERROR_NONE);
-
- ret = vc_set_command_list(list, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
-
- ret = vc_cmd_list_destroy(list, true);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_command_list(g_test_commands, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_NOT_SUPPORTED);
+ return;
}
-}
-
-/**
- * @testcase utc_vc_set_command_list_n3
- * @since_tizen 2.4
- * @description Negative UTC for set command list used as candidate set (Invalid state)
- */
-TEST_F(VCTest, vc_set_command_list_n3)
-{
- if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_set_command_list(list, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
- int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_cmd_list_create(&list);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_command_list(g_test_commands, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_INVALID_STATE);
- ret = vc_set_command_list(list, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_command_list(g_test_commands, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_INVALID_STATE);
- ret = vc_cmd_list_destroy(list, true);
- EXPECT_EQ(ret, VC_ERROR_NONE);
- }
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
}
/**
/**
* @testcase utc_vc_unset_command_list_n
* @since_tizen 2.4
- * @description Negative UTC for unset command list used as candidate set (Invalid state)
+ * @description Negative UTC for unset command list used as candidate set (Invalid parameter)
*/
-TEST_F(VCTest, vc_unset_command_list_n)
+TEST_F(VCTestInReadyState, utc_vc_unset_command_list_n)
{
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- ret = vc_unset_command_list(VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
-
- int ret = VC_ERROR_NONE;
- ret = vc_unset_command_list(VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
+ EXPECT_EQ(vc_unset_command_list(-1), VC_ERROR_NOT_SUPPORTED);
+ return;
}
+
+ EXPECT_EQ(vc_unset_command_list(-1), VC_ERROR_INVALID_PARAMETER);
}
/**
* @since_tizen 2.4
* @description Negative UTC for unset command list used as candidate set (Invalid state)
*/
-TEST_F(VCTest, vc_unset_command_list_n2)
+TEST_F(VCTestInNoneState, utc_vc_unset_command_list_n2)
{
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_unset_command_list(VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_unset_command_list(VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_unset_command_list(VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_INVALID_STATE);
- int ret = VC_ERROR_NONE;
- ret = vc_deinitialize();
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_unset_command_list(VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_INVALID_STATE);
- ret = vc_unset_command_list(VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_INVALID_STATE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_set_command_list_from_file_p
+ * @since_tizen 2.4
+ * @description Positive UTC for set command list used as candidate set from file
+ */
+TEST_F(VCTestInReadyState, utc_vc_set_command_list_from_file_p)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_set_invocation_name(TEST_INVOCATION_NAME), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_set_command_list_from_file_n
+ * @since_tizen 2.4
+ * @description Negative UTC for set command list used as candidate set from file (Invalid parameter)
+ */
+TEST_F(VCTestInReadyState, utc_vc_set_command_list_from_file_n)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, -1), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_set_command_list_from_file(nullptr, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, -1), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_set_command_list_from_file(nullptr, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_INVALID_PARAMETER);
+}
+
+/**
+ * @testcase utc_vc_set_command_list_from_file_n2
+ * @since_tizen 2.4
+ * @description Negative UTC for set command list used as candidate set from file (Invalid state)
+ */
+TEST_F(VCTestInNoneState, utc_vc_set_command_list_from_file_n2)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_NOT_SUPPORTED);
+ return;
}
+
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_command_list_from_file(TEST_COMMAND_JSON_PATH, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
}
/**
}
/**
+ * @testcase utc_vc_set_error_cb_p2
+ * @since_tizen 2.4
+ * @description Positive UTC for set error callback
+ */
+TEST_F(VCTest, utc_vc_set_error_cb_p2)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_set_error_cb(__vc_error_cb, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_set_error_cb(__vc_error_cb, nullptr), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NONE);
+ EXPECT_EQ(__is_state_changed(VC_STATE_READY, 5), true);
+ EXPECT_EQ(__is_service_state_changed(VC_SERVICE_STATE_READY, 5), true);
+
+ terminate_current_engine();
+
+ EXPECT_EQ(__is_error_cb_invoked(5), true);
+ EXPECT_EQ(__is_state_changed(VC_STATE_READY, 5), true);
+
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+}
+
+/**
* @testcase utc_vc_set_error_cb_n
* @since_tizen 2.4
* @description Negative UTC for set error callback (Invalid parameter)
}
}
+// TODO: invalid parameter TC is needed?
/**
* @testcase utc_vc_set_invocation_name_p
* @since_tizen 3.0
ret = vc_set_invocation_name(invoc_name);
EXPECT_EQ(ret, VC_ERROR_NONE);
+ ret = vc_set_invocation_name(invoc_name);
+ EXPECT_EQ(ret, VC_ERROR_NONE);
+
ret = vc_unprepare();
EXPECT_EQ(ret, VC_ERROR_NONE);
}
}
/**
+ * @testcase utc_vc_set_server_dialog_p
+ * @since_tizen 5.0
+ * @description Positive UTC for setting the server dialog
+ */
+TEST_F(VCTestInReadyState, utc_vc_set_server_dialog_p)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_set_server_dialog(TEST_APP_ID, TEST_CREDENTIAL), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_set_server_dialog(TEST_APP_ID, TEST_CREDENTIAL), VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_server_dialog(nullptr, TEST_CREDENTIAL), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_set_server_dialog_n
+ * @since_tizen 5.0
+ * @description Negative UTC for setting the server dialog (Invalid parameter)
+ */
+TEST_F(VCTestInReadyState, utc_vc_set_server_dialog_n)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_set_server_dialog(TEST_APP_ID, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_set_server_dialog(TEST_APP_ID, nullptr), VC_ERROR_INVALID_PARAMETER);
+}
+
+/**
+ * @testcase utc_vc_set_server_dialog_n2
+ * @since_tizen 5.0
+ * @description Negative UTC for setting the server dialog (Invalid state)
+ */
+TEST_F(VCTestInNoneState, utc_vc_set_server_dialog_n2)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_set_server_dialog(TEST_APP_ID, TEST_CREDENTIAL), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_set_server_dialog(TEST_APP_ID, TEST_CREDENTIAL), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_set_server_dialog(TEST_APP_ID, TEST_CREDENTIAL), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_unset_server_dialog_p
+ * @since_tizen 5.0
+ * @description Positive UTC for setting the server dialog
+ */
+TEST_F(VCTestInReadyState, utc_vc_unset_server_dialog_p)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_unset_server_dialog(TEST_APP_ID), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_unset_server_dialog(TEST_APP_ID), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_unset_server_dialog_n
+ * @since_tizen 5.0
+ * @description Negative UTC for setting the server dialog (Invalid state)
+ */
+TEST_F(VCTestInNoneState, utc_vc_unset_server_dialog_n)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_unset_server_dialog(TEST_APP_ID), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_unset_server_dialog(TEST_APP_ID), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_unset_server_dialog(TEST_APP_ID), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
* @testcase utc_vc_request_dialog_p
* @since_tizen 3.0
* @description Positive UTC for requesting the dialog
}
/**
- * @testcase utc_vc_cmd_list_create_p
- * @since_tizen 2.4
- * @description Positive UTC for create command list handle
+ * @testcase utc_vc_tts_set_streaming_cb_p
+ * @since_tizen 5.5
+ * @description Positive UTC for setting tts streaming callback
*/
-TEST_F(VCTest, vc_cmd_list_create_p)
+TEST_F(VCTest, utc_vc_tts_set_streaming_cb_p)
{
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_cmd_list_create(&list);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_cmd_list_create(&list);
- EXPECT_EQ(ret, VC_ERROR_NONE);
-
- vc_cmd_list_destroy(list, false);
+ EXPECT_EQ(vc_tts_set_streaming_cb(__vc_tts_streaming_cb, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
}
+
+ EXPECT_EQ(vc_tts_set_streaming_cb(__vc_tts_streaming_cb, nullptr), VC_ERROR_NONE);
}
/**
- * @testcase utc_vc_cmd_list_create_n
- * @since_tizen 2.4
- * @description Negative UTC for create command list handle (Invalid parameter)
+ * @testcase utc_vc_tts_set_streaming_cb_n
+ * @since_tizen 5.5
+ * @description Negative UTC for setting tts streaming callback (Invalid parameter)
*/
-TEST_F(VCTest, vc_cmd_list_create_n)
+TEST_F(VCTest, utc_vc_tts_set_streaming_cb_n)
{
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_tts_set_streaming_cb(nullptr, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_set_streaming_cb(nullptr, nullptr), VC_ERROR_INVALID_PARAMETER);
+}
+
+/**
+ * @testcase utc_vc_tts_set_streaming_cb_n2
+ * @since_tizen 5.5
+ * @description Negative UTC for setting tts streaming callback (Invalid state)
+ */
+TEST_F(VCTestInNoneState, utc_vc_tts_set_streaming_cb_n2)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_tts_set_streaming_cb(__vc_tts_streaming_cb, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_set_streaming_cb(__vc_tts_streaming_cb, nullptr), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_tts_set_streaming_cb(__vc_tts_streaming_cb, nullptr), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_tts_unset_streaming_cb_p
+ * @since_tizen 5.5
+ * @description Positive UTC for unsetting tts streaming callback
+ */
+TEST_F(VCTest, utc_vc_tts_unset_streaming_cb_p)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_tts_unset_streaming_cb(), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_unset_streaming_cb(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_tts_unset_streaming_cb_n
+ * @since_tizen 5.5
+ * @description Negative UTC for unsetting tts streaming callback (Invalid state)
+ */
+TEST_F(VCTestInNoneState, utc_vc_tts_unset_streaming_cb_n)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_tts_unset_streaming_cb(), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_unset_streaming_cb(), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_tts_unset_streaming_cb(), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_tts_set_utterance_status_cb_p
+ * @since_tizen 5.5
+ * @description Positive UTC for setting tts utterance status callback
+ */
+TEST_F(VCTest, utc_vc_tts_set_utterance_status_cb_p)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_tts_set_utterance_status_cb(__vc_tts_utterance_status_cb, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_set_utterance_status_cb(__vc_tts_utterance_status_cb, nullptr), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_tts_set_utterance_status_cb_n
+ * @since_tizen 5.5
+ * @description Negative UTC for setting tts utterance status callback (Invalid parameter)
+ */
+TEST_F(VCTest, utc_vc_tts_set_utterance_status_cb_n)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_tts_set_utterance_status_cb(nullptr, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_set_utterance_status_cb(nullptr, nullptr), VC_ERROR_INVALID_PARAMETER);
+}
+
+/**
+ * @testcase utc_vc_tts_set_utterance_status_cb_n2
+ * @since_tizen 5.5
+ * @description Negative UTC for setting tts utterance status callback (Invalid state)
+ */
+TEST_F(VCTestInNoneState, utc_vc_tts_set_utterance_status_cb_n2)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_tts_set_utterance_status_cb(__vc_tts_utterance_status_cb, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_set_utterance_status_cb(__vc_tts_utterance_status_cb, nullptr), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_tts_set_utterance_status_cb(__vc_tts_utterance_status_cb, nullptr), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_tts_unset_utterance_status_cb_p
+ * @since_tizen 5.5
+ * @description Positive UTC for unsetting tts utterance status callback
+ */
+TEST_F(VCTest, utc_vc_tts_unset_utterance_status_cb_p)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_tts_unset_utterance_status_cb(), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_unset_utterance_status_cb(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_tts_unset_utterance_status_cb_n
+ * @since_tizen 5.5
+ * @description Negative UTC for unsetting tts utterance status callback (Invalid state)
+ */
+TEST_F(VCTestInNoneState, utc_vc_tts_unset_utterance_status_cb_n)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_tts_unset_utterance_status_cb(), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_tts_unset_utterance_status_cb(), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_initialize(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_prepare_sync(), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_tts_unset_utterance_status_cb(), VC_ERROR_INVALID_STATE);
+
+ EXPECT_EQ(vc_unprepare(), VC_ERROR_NONE);
+ EXPECT_EQ(vc_deinitialize(), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_list_create_p
+ * @since_tizen 2.4
+ * @description Positive UTC for create command list handle
+ */
+TEST_F(VCTest, vc_cmd_list_create_p)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(g_vc_init, false);
int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_create(NULL);
+ vc_cmd_list_h list = NULL;
+ ret = vc_cmd_list_create(&list);
EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
} else {
EXPECT_EQ(g_vc_init, true);
int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_create(NULL);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
+ vc_cmd_list_h list = NULL;
+ ret = vc_cmd_list_create(&list);
+ EXPECT_EQ(ret, VC_ERROR_NONE);
+
+ vc_cmd_list_destroy(list, false);
}
}
/**
- * @testcase utc_vc_cmd_list_destroy_p
+ * @testcase utc_vc_cmd_list_create_n
* @since_tizen 2.4
- * @description Positive UTC for destroy command list handle
+ * @description Negative UTC for create command list handle (Invalid parameter)
*/
-TEST_F(VCTest, vc_cmd_list_destroy_p)
+TEST_F(VCTest, vc_cmd_list_create_n)
{
if (false == g_vc_supported) {
EXPECT_EQ(g_vc_init, false);
int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_cmd_list_destroy(list, false);
+ ret = vc_cmd_list_create(NULL);
EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
} else {
EXPECT_EQ(g_vc_init, true);
int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_cmd_list_create(&list);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ ret = vc_cmd_list_create(NULL);
+ EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
+ }
+}
- ret = vc_cmd_list_destroy(list, false);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+/**
+ * @testcase utc_vc_cmd_list_destroy_p
+ * @since_tizen 2.4
+ * @description Positive UTC for destroy command list handle
+ */
+TEST_F(VCTest, vc_cmd_list_destroy_p)
+{
+ vc_cmd_list_h list = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_destroy(list, false), VC_ERROR_NOT_SUPPORTED);
+ return;
}
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_destroy(list, false), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
}
/**
*/
TEST_F(VCTest, vc_cmd_list_get_count_p)
{
+ vc_cmd_list_h list = nullptr;
+ int cnt = -1;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- int cnt = -1;
- ret = vc_cmd_list_get_count(list, &cnt);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- vc_cmd_list_h list = NULL;
- ret = vc_cmd_list_create(&list);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NONE);
+ EXPECT_EQ(cnt, 0);
- int cnt = -1;
- ret = vc_cmd_list_get_count(list, &cnt);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ vc_cmd_h command = nullptr;
+ EXPECT_EQ(vc_cmd_create(&command), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_add(list, command), VC_ERROR_NONE);
- vc_cmd_list_destroy(list, false);
- }
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NONE);
+ EXPECT_EQ(cnt, 1);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
}
/**
*/
TEST_F(VCTest, vc_cmd_list_get_count_n)
{
+ vc_cmd_list_h list = nullptr;
+ int cnt = 0;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_list_get_count(nullptr, &cnt), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_get_count(list, nullptr), VC_ERROR_NOT_SUPPORTED);
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_get_count(NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_get_count(NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
- }
+ EXPECT_EQ(vc_cmd_list_get_count(nullptr, &cnt), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_get_count(list, nullptr), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, false), VC_ERROR_NONE);
}
/**
*/
TEST_F(VCTest, vc_cmd_list_add_n)
{
+ vc_cmd_list_h list = nullptr;
+ vc_cmd_h cmd = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_list_add(list, nullptr), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_add(nullptr, cmd), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_add(NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_add(NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
- }
+ EXPECT_EQ(vc_cmd_list_add(list, nullptr), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_add(nullptr, cmd), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
}
/**
*/
TEST_F(VCTest, vc_cmd_list_remove_n)
{
+ vc_cmd_list_h list = nullptr;
+ vc_cmd_h cmd = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_list_remove(list, nullptr), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_remove(nullptr, cmd), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_remove(list, cmd), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_remove(NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_remove(NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_remove(list, nullptr), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_remove(nullptr, cmd), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_remove(list, cmd), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, false), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_list_remove_all_p
+ * @since_tizen 2.4
+ * @description Positive UTC for destroy command list handle
+ */
+TEST_F(VCTest, utc_vc_cmd_list_remove_all_p)
+{
+ vc_cmd_list_h list = nullptr;
+ vc_cmd_h cmd = nullptr;
+ int cnt = -1;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_remove_all(list, false), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_remove_all(list, true), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_list_add(list, cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NONE);
+ EXPECT_EQ(cnt, 1);
+
+ EXPECT_EQ(vc_cmd_list_remove_all(list, false), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NONE);
+ EXPECT_EQ(cnt, 0);
+
+ EXPECT_EQ(vc_cmd_list_add(list, cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NONE);
+ EXPECT_EQ(cnt, 1);
+
+ EXPECT_EQ(vc_cmd_list_remove_all(list, true), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NONE);
+ EXPECT_EQ(cnt, 0);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, false), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_list_remove_all_n
+ * @since_tizen 2.4
+ * @description Negative UTC for destroy command list handle (invalid parameter)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_remove_all_n)
+{
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_remove_all(nullptr, false), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_remove_all(nullptr, true), VC_ERROR_NOT_SUPPORTED);
+ return;
}
+
+ EXPECT_EQ(vc_cmd_list_remove_all(nullptr, false), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_remove_all(nullptr, true), VC_ERROR_INVALID_PARAMETER);
}
/**
*/
TEST_F(VCTest, vc_cmd_list_foreach_commands_n)
{
+ vc_cmd_list_h list = nullptr;
+ vc_cmd_h cmd = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_list_foreach_commands(list, nullptr, nullptr), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_foreach_commands(nullptr, __vc_cmd_list_cb, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_foreach_commands(NULL, NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_add(list, cmd), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_foreach_commands(NULL, NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_foreach_commands(list, nullptr, nullptr), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_foreach_commands(nullptr, __vc_cmd_list_cb, nullptr), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_list_filter_by_type_p
+ * @since_tizen 3.0
+ * @description Positive UTC for get filtered command list by type
+ */
+TEST_F(VCTest, utc_vc_cmd_list_filter_by_type_p)
+{
+ vc_cmd_list_h list = nullptr;
+ int cnt = -1;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_filter_by_type(g_test_commands, VC_COMMAND_TYPE_FOREGROUND, &list), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_filter_by_type(g_test_commands, VC_COMMAND_TYPE_BACKGROUND, &list), VC_ERROR_NOT_SUPPORTED);
+ return;
}
+
+ EXPECT_EQ(vc_cmd_list_filter_by_type(g_test_commands, VC_COMMAND_TYPE_FOREGROUND, &list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NONE);
+ EXPECT_EQ(cnt, 1);
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+ list = nullptr;
+
+ EXPECT_EQ(vc_cmd_list_filter_by_type(g_test_commands, VC_COMMAND_TYPE_BACKGROUND, &list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_get_count(list, &cnt), VC_ERROR_NONE);
+ EXPECT_EQ(cnt, 0);
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+ list = nullptr;
+}
+
+/**
+ * @testcase utc_vc_cmd_list_filter_by_type_n
+ * @since_tizen 3.0
+ * @description Negative UTC for get filtered command list by type (invalid parameter)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_filter_by_type_n)
+{
+ vc_cmd_list_h list = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_filter_by_type(nullptr, VC_COMMAND_TYPE_FOREGROUND, &list), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_filter_by_type(g_test_commands, -1, &list), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_filter_by_type(g_test_commands, VC_COMMAND_TYPE_FOREGROUND, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_list_filter_by_type(nullptr, VC_COMMAND_TYPE_FOREGROUND, &list), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_filter_by_type(g_test_commands, -1, &list), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_filter_by_type(g_test_commands, VC_COMMAND_TYPE_FOREGROUND, nullptr), VC_ERROR_INVALID_PARAMETER);
}
/**
}
/**
+ * @testcase utc_vc_cmd_list_first_n2
+ * @since_tizen 2.4
+ * @description Negative UTC for move pointer to the first of command list (Empty list)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_first_n2)
+{
+ vc_cmd_list_h list = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_first(list), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_first(list), VC_ERROR_EMPTY);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+}
+
+/**
* @testcase utc_vc_cmd_list_last_p
* @since_tizen 2.4
* @description Positive UTC for move pointer to the last of command list
}
/**
+ * @testcase utc_vc_cmd_list_last_n2
+ * @since_tizen 2.4
+ * @description Negative UTC for move pointer to the last of command list (Empty list)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_last_n2)
+{
+ vc_cmd_list_h list = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_last(list), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_last(list), VC_ERROR_EMPTY);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+}
+
+/**
* @testcase utc_vc_cmd_list_next_p
* @since_tizen 2.4
* @description Positive UTC for move pointer to next command in command list
}
/**
+ * @testcase utc_vc_cmd_list_next_n2
+ * @since_tizen 2.4
+ * @description Negative UTC for move pointer to next command in command list (Empty list)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_next_n2)
+{
+ vc_cmd_list_h list = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_last(list), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_next(list), VC_ERROR_EMPTY);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_list_next_n3
+ * @since_tizen 2.4
+ * @description Negative UTC for move pointer to next command in command list (Iteration end)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_next_n3)
+{
+ vc_cmd_list_h list = nullptr;
+ vc_cmd_h cmd = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_next(list), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_add(list, cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_list_next(list), VC_ERROR_ITERATION_END);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+}
+
+/**
* @testcase utc_vc_cmd_list_prev_p
* @since_tizen 2.4
* @description Positive UTC for move pointer to previous command in command list
}
/**
+ * @testcase utc_vc_cmd_list_prev_n2
+ * @since_tizen 2.4
+ * @description Negative UTC for move pointer to next command in command list (Empty list)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_prev_n2)
+{
+ vc_cmd_list_h list = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_prev(list), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_prev(list), VC_ERROR_EMPTY);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_list_prev_n3
+ * @since_tizen 2.4
+ * @description Negative UTC for move pointer to next command in command list (Iteration end)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_prev_n3)
+{
+ vc_cmd_list_h list = nullptr;
+ vc_cmd_h cmd = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_prev(list), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_add(list, cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_list_prev(list), VC_ERROR_ITERATION_END);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
+}
+
+/**
* @testcase utc_vc_cmd_list_get_current_p
* @since_tizen 2.4
* @description Positive UTC for get command handle of current pointer
*/
TEST_F(VCTest, vc_cmd_list_get_current_n)
{
+ vc_cmd_list_h list = nullptr;
+ vc_cmd_h cmd = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_list_get_current(list, &cmd), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_list_get_current(list, &cmd), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_get_current(NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_list_get_current(nullptr, &cmd), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_list_get_current(list, nullptr), VC_ERROR_INVALID_PARAMETER);
+}
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_list_get_current(NULL, NULL);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
+/**
+ * @testcase utc_vc_cmd_list_get_current_n2
+ * @since_tizen 2.4
+ * @description Negative UTC for get command handle of current pointer (Empty list)
+ */
+TEST_F(VCTest, utc_vc_cmd_list_get_current_n2)
+{
+ vc_cmd_list_h list = nullptr;
+ vc_cmd_h cmd = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_list_get_current(list, &cmd), VC_ERROR_NOT_SUPPORTED);
+ return;
}
+
+ EXPECT_EQ(vc_cmd_list_create(&list), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_list_get_current(list, &cmd), VC_ERROR_EMPTY);
+
+ EXPECT_EQ(vc_cmd_list_destroy(list, true), VC_ERROR_NONE);
}
/**
* @since_tizen 2.4
* @description Negative UTC for destroy command handle (Invalid parameter)
*/
-TEST_F(VCTest, vc_cmd_destroy_n)
+TEST_F(VCTest, utc_vc_cmd_destroy_n)
{
+ vc_cmd_h cmd = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_destroy(nullptr), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_destroy(NULL);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_destroy(nullptr), VC_ERROR_INVALID_PARAMETER);
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_destroy(NULL);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
- }
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_INVALID_PARAMETER);
}
/**
ret = vc_cmd_set_command(cmd, "voice");
EXPECT_EQ(ret, VC_ERROR_NONE);
+ ret = vc_cmd_set_command(cmd, "voice");
+ EXPECT_EQ(ret, VC_ERROR_NONE);
+
vc_cmd_destroy(cmd);
}
}
* @since_tizen 2.4
* @description Positive UTC for get command text in handle
*/
-TEST_F(VCTest, vc_cmd_get_command_p)
+TEST_F(VCTest, utc_vc_cmd_get_command_p)
{
+ const char *command_text = "voice";
+ vc_cmd_h cmd = nullptr;
+ char *text = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_h cmd = NULL;
- char *text = NULL;
- ret = vc_cmd_get_command(cmd, &text);
- if (NULL != text) {
- free(text);
- text = NULL;
- }
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_get_command(cmd, &text), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- vc_cmd_h cmd = NULL;
- ret = vc_cmd_create(&cmd);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_command(cmd, &text), VC_ERROR_NONE);
+ EXPECT_EQ(text, nullptr);
- ret = vc_cmd_set_command(cmd, "voice");
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_command(cmd, command_text), VC_ERROR_NONE);
- char *text = NULL;
- ret = vc_cmd_get_command(cmd, &text);
- if (NULL != text) {
- free(text);
- text = NULL;
- }
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_command(cmd, &text), VC_ERROR_NONE);
+ EXPECT_STREQ(text, command_text);
+ free(text);
- vc_cmd_destroy(cmd);
- }
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
}
/**
}
/**
+ * @testcase utc_vc_cmd_set_unfixed_command_p
+ * @since_tizen 2.4
+ * @description Positive UTC for setting the unfixed command text in handle
+ */
+TEST_F(VCTest, utc_vc_cmd_set_unfixed_command_p)
+{
+ const char *command_text = "voice";
+ vc_cmd_h cmd = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_set_unfixed_command(cmd, command_text), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_unfixed_command(cmd, command_text), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_unfixed_command(cmd, command_text), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_set_unfixed_command_n
+ * @since_tizen 2.4
+ * @description Negative UTC for setting the unfixed command text in handle (Invalid parameter)
+ */
+TEST_F(VCTest, utc_vc_cmd_set_unfixed_command_n)
+{
+ const char *command_text = "voice";
+ vc_cmd_h cmd = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_set_unfixed_command(nullptr, command_text), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_set_unfixed_command(cmd, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_set_unfixed_command(nullptr, command_text), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_set_unfixed_command(cmd, nullptr), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
* @testcase utc_vc_cmd_get_unfixed_command_p
* @since_tizen 3.0
* @description Positive UTC for getting the unfixed command text in handle
*/
TEST_F(VCTest, vc_cmd_get_unfixed_command_p)
{
+ const char *command_text = "voice";
+ vc_cmd_h cmd = nullptr;
+ char *text = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_h cmd = NULL;
- char *text = NULL;
- ret = vc_cmd_create(&cmd);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_get_unfixed_command(cmd, &text), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- ret = vc_cmd_get_unfixed_command(cmd, &text);
- if (NULL != text) {
- free(text);
- text = NULL;
- }
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_unfixed_command(cmd, &text), VC_ERROR_NONE);
+ EXPECT_EQ(text, nullptr);
- int ret = VC_ERROR_NONE;
- vc_cmd_h cmd = NULL;
- ret = vc_cmd_create(&cmd);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_unfixed_command(cmd, command_text), VC_ERROR_NONE);
- char *text = NULL;
- ret = vc_cmd_get_unfixed_command(cmd, &text);
- if (NULL != text) {
- free(text);
- text = NULL;
- }
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_unfixed_command(cmd, &text), VC_ERROR_NONE);
+ EXPECT_STREQ(text, command_text);
+ free(text);
- vc_cmd_destroy(cmd);
- }
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
}
/**
* @since_tizen 2.4
* @description Negative UTC for set command type in handle (Invalid parameter)
*/
-TEST_F(VCTest, vc_cmd_set_type_n)
+TEST_F(VCTest, utc_vc_cmd_set_type_n)
{
+ vc_cmd_h cmd = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_set_type(nullptr, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_set_type(cmd, -1), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_set_type(NULL, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_set_type(NULL, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
- }
+ EXPECT_EQ(vc_cmd_set_type(nullptr, VC_COMMAND_TYPE_FOREGROUND), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_set_type(cmd, -1), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
}
/**
* @since_tizen 2.4
* @description Positive UTC for get command type in handle
*/
-TEST_F(VCTest, vc_cmd_get_type_p)
+TEST_F(VCTest, utc_vc_cmd_get_type_p)
{
+ vc_cmd_h cmd = nullptr;
+ int type = -1;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_h cmd = NULL;
- int type;
- ret = vc_cmd_get_type(cmd, &type);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_h cmd = NULL;
- ret = vc_cmd_create(&cmd);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_type(cmd, &type), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- ret = vc_cmd_set_type(cmd, VC_COMMAND_TYPE_BACKGROUND);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
- int type;
- ret = vc_cmd_get_type(cmd, &type);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_type(cmd, VC_COMMAND_TYPE_BACKGROUND), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_type(cmd, &type), VC_ERROR_NONE);
+ EXPECT_EQ(type, VC_COMMAND_TYPE_BACKGROUND);
- vc_cmd_destroy(cmd);
- }
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
}
/**
* @since_tizen 3.0
* @description Negative UTC for setting command format in handle (Invalid parameter)
*/
-TEST_F(VCTest, vc_cmd_set_format_n)
+TEST_F(VCTest, utc_vc_cmd_set_format_n)
{
+ vc_cmd_h cmd = nullptr;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
+ EXPECT_EQ(vc_cmd_set_format(nullptr, VC_COMMAND_FORMAT_FIXED), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_set_format(cmd, -1), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_set_format(NULL, VC_COMMAND_FORMAT_FIXED);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
- int ret = VC_ERROR_NONE;
- ret = vc_cmd_set_format(NULL, VC_COMMAND_FORMAT_FIXED);
- EXPECT_EQ(ret, VC_ERROR_INVALID_PARAMETER);
- }
+ EXPECT_EQ(vc_cmd_set_format(nullptr, VC_COMMAND_FORMAT_FIXED), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_set_format(cmd, -1), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
}
/**
* @since_tizen 3.0
* @description Positive UTC for getting command format in handle
*/
-TEST_F(VCTest, vc_cmd_get_format_p)
+TEST_F(VCTest, utc_vc_cmd_get_format_p)
{
+ vc_cmd_h cmd = nullptr;
+ int type = -1;
if (false == g_vc_supported) {
- EXPECT_EQ(g_vc_init, false);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_h cmd = NULL;
- int format;
- ret = vc_cmd_get_format(cmd, &format);
- EXPECT_EQ(ret, VC_ERROR_NOT_SUPPORTED);
- } else {
- EXPECT_EQ(g_vc_init, true);
-
- int ret = VC_ERROR_NONE;
- vc_cmd_h cmd = NULL;
- ret = vc_cmd_create(&cmd);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_format(cmd, &type), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
- ret = vc_cmd_set_format(cmd, VC_COMMAND_FORMAT_FIXED);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
- int format;
- ret = vc_cmd_get_format(cmd, &format);
- EXPECT_EQ(ret, VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_set_format(cmd, VC_CMD_FORMAT_FIXED_AND_NONFIXED), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_format(cmd, &type), VC_ERROR_NONE);
+ EXPECT_EQ(type, VC_CMD_FORMAT_FIXED_AND_NONFIXED);
- vc_cmd_destroy(cmd);
- }
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
}
/**
}
}
+/**
+ * @testcase utc_vc_cmd_set_pid_p
+ * @since_tizen 3.0
+ * @description Positive UTC for setting pid in handle
+ */
+TEST_F(VCTest, utc_vc_cmd_set_pid_p)
+{
+ vc_cmd_h cmd = nullptr;
+ int pid = getpid();
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_set_pid(cmd, pid), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_set_pid(cmd, pid), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_set_pid_n
+ * @since_tizen 3.0
+ * @description Negative UTC for setting pid in handle (Invalid handle)
+ */
+TEST_F(VCTest, utc_vc_cmd_set_pid_n)
+{
+ vc_cmd_h cmd = nullptr;
+ int pid = getpid();
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_set_pid(nullptr, pid), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_set_pid(cmd, -1), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_set_pid(nullptr, pid), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_set_pid(cmd, -1), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_get_pid_p
+ * @since_tizen 3.0
+ * @description Positive UTC for getting pid format in handle
+ */
+TEST_F(VCTest, utc_vc_cmd_get_pid_p)
+{
+ vc_cmd_h cmd = nullptr;
+ int pid = -1;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_get_pid(cmd, &pid), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_set_pid(cmd, getpid()), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_pid(cmd, &pid), VC_ERROR_NONE);
+ EXPECT_EQ(pid, getpid());
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_get_pid_n
+ * @since_tizen 3.0
+ * @description Positive UTC for getting pid format in handle
+ */
+TEST_F(VCTest, utc_vc_cmd_get_pid_n)
+{
+ vc_cmd_h cmd = nullptr;
+ int pid = -1;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_get_pid(nullptr, &pid), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_get_pid(cmd, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_get_pid(nullptr, &pid), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_get_pid(cmd, nullptr), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_set_domain_p
+ * @since_tizen 3.0
+ * @description Positive UTC for setting command domain in handle
+ */
+TEST_F(VCTest, utc_vc_cmd_set_domain_p)
+{
+ vc_cmd_h cmd = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_set_domain(cmd, 1), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_set_domain(cmd, 1), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_set_domain_n
+ * @since_tizen 3.0
+ * @description Negative UTC for setting command domain in handle (Invalid parameter)
+ */
+TEST_F(VCTest, utc_vc_cmd_set_domain_n)
+{
+ vc_cmd_h cmd = nullptr;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_set_domain(nullptr, 1), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_set_domain(nullptr, 1), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_get_domain_p
+ * @since_tizen 3.0
+ * @description Positive UTC for getting command domain in handle
+ */
+TEST_F(VCTest, utc_vc_cmd_get_domain_p)
+{
+ vc_cmd_h cmd = nullptr;
+ int domain = -1;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_get_domain(cmd, &domain), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_set_domain(cmd, 1), VC_ERROR_NONE);
+ EXPECT_EQ(vc_cmd_get_domain(cmd, &domain), VC_ERROR_NONE);
+ EXPECT_EQ(domain, 1);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
+/**
+ * @testcase utc_vc_cmd_get_domain_n
+ * @since_tizen 3.0
+ * @description Negative UTC for getting command domain in handle (Invalid parameter)
+ */
+TEST_F(VCTest, utc_vc_cmd_get_domain_n)
+{
+ vc_cmd_h cmd = nullptr;
+ int domain = -1;
+ if (false == g_vc_supported) {
+ EXPECT_EQ(vc_cmd_get_domain(nullptr, &domain), VC_ERROR_NOT_SUPPORTED);
+ EXPECT_EQ(vc_cmd_get_domain(cmd, nullptr), VC_ERROR_NOT_SUPPORTED);
+ return;
+ }
+
+ EXPECT_EQ(vc_cmd_create(&cmd), VC_ERROR_NONE);
+
+ EXPECT_EQ(vc_cmd_get_domain(nullptr, &domain), VC_ERROR_INVALID_PARAMETER);
+ EXPECT_EQ(vc_cmd_get_domain(cmd, nullptr), VC_ERROR_INVALID_PARAMETER);
+
+ EXPECT_EQ(vc_cmd_destroy(cmd), VC_ERROR_NONE);
+}
+
} // namespace