EXPECT_EQ(vc_mgr_deinitialize(), VC_ERROR_NONE);
}
+static bool __is_vc_supported()
+{
+ bool is_vc_supported = false;
+ bool is_mic_supported = false;
+ if (0 != system_info_get_platform_bool("http://tizen.org/feature/speech.control", &is_vc_supported))
+ {
+ is_vc_supported = false;
+ }
+
+ if (0 != system_info_get_platform_bool("http://tizen.org/feature/microphone", &is_mic_supported))
+ {
+ is_mic_supported = false;
+ }
+
+ return (is_vc_supported && is_mic_supported);
+}
+
namespace {
class VCTest : public testing::Test {
ecore_init();
ecore_main_loop_glib_integrate();
- cynara_check_set_result(CYNARA_API_ACCESS_ALLOWED);
+ g_vc_supported = __is_vc_supported();
- g_vc_supported = false;
- bool mic_supported = false;
- bool vc_supported = false;
- if (0 == system_info_get_platform_bool("http://tizen.org/feature/speech.control", &vc_supported))
- {
- if (0 == system_info_get_platform_bool("http://tizen.org/feature/microphone", &mic_supported))
- {
- if (true == vc_supported && true == mic_supported)
- {
- g_vc_supported = true;
- }
- }
+ if (false == g_vc_supported) {
+ g_vc_init = false;
+ return;
}
- g_vc_init = false;
- if (true == g_vc_supported)
- {
- int ret = VC_ERROR_NONE;
- ret = vc_initialize();
- if (VC_ERROR_NONE == ret)
- {
- ret = vc_set_state_changed_cb(__vc_state_changed_cb, NULL);
- if (VC_ERROR_NONE != ret)
- {
- g_vc_init = false;
- }
- else
- {
- g_vc_init = true;
- }
- }
- else
- {
- g_vc_init = false;
- }
- }
+ g_vc_init = true;
+ vc_initialize();
+ vc_set_state_changed_cb(__vc_state_changed_cb, NULL);
}
virtual void TearDown()
if (true == g_vc_supported)
{
vc_unset_state_changed_cb();
-
vc_deinitialize();
}
- g_vc_init = false;
-
ecore_shutdown();
}
};