{"utc_sound_pool_stream_stop_p", utc_sound_pool_stream_stop_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_stop_n", utc_sound_pool_stream_stop_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_stop_n2", utc_sound_pool_stream_stop_n2, utc_sound_pool_startup, utc_sound_pool_cleanup},
- {"utc_sound_pool_stream_set_volume_p", utc_sound_pool_set_volume_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
- {"utc_sound_pool_stream_set_volume_n", utc_sound_pool_set_volume_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
- {"utc_sound_pool_stream_get_volume_p", utc_sound_pool_get_volume_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
- {"utc_sound_pool_stream_get_volume_n", utc_sound_pool_get_volume_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
+ {"utc_sound_pool_stream_set_volume_p", utc_sound_pool_stream_set_volume_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
+ {"utc_sound_pool_stream_set_volume_n", utc_sound_pool_stream_set_volume_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
+ {"utc_sound_pool_stream_get_volume_p", utc_sound_pool_stream_get_volume_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
+ {"utc_sound_pool_stream_get_volume_n", utc_sound_pool_stream_get_volume_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_set_priority_p", utc_sound_pool_stream_set_priority_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_set_priority_n", utc_sound_pool_stream_set_priority_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_get_priority_p", utc_sound_pool_stream_get_priority_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_stop_p", utc_sound_pool_stream_stop_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_stop_n", utc_sound_pool_stream_stop_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_stop_n2", utc_sound_pool_stream_stop_n2, utc_sound_pool_startup, utc_sound_pool_cleanup},
- {"utc_sound_pool_stream_set_volume_p", utc_sound_pool_set_volume_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
- {"utc_sound_pool_stream_set_volume_n", utc_sound_pool_set_volume_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
- {"utc_sound_pool_stream_get_volume_p", utc_sound_pool_get_volume_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
- {"utc_sound_pool_stream_get_volume_n", utc_sound_pool_get_volume_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
+ {"utc_sound_pool_stream_set_volume_p", utc_sound_pool_stream_set_volume_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
+ {"utc_sound_pool_stream_set_volume_n", utc_sound_pool_stream_set_volume_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
+ {"utc_sound_pool_stream_get_volume_p", utc_sound_pool_stream_get_volume_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
+ {"utc_sound_pool_stream_get_volume_n", utc_sound_pool_stream_get_volume_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_set_priority_p", utc_sound_pool_stream_set_priority_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_set_priority_n", utc_sound_pool_stream_set_priority_n, utc_sound_pool_startup, utc_sound_pool_cleanup},
{"utc_sound_pool_stream_get_priority_p", utc_sound_pool_stream_get_priority_p, utc_sound_pool_startup, utc_sound_pool_cleanup},
unsigned int size_of_path;
if (true == GetValueForTCTSetting("DEVICE_SUITE_TARGET_30", pzs_value, API_NAMESPACE )) {
- PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pzs_value);
+ PRINT_UTC_LOG("\\n [Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s \\n", __LINE__, API_NAMESPACE, pzs_value);
size_of_path = strlen(pzs_value) + strlen(testfile_name) + 10;
file_path = (char*)malloc(size_of_path);
snprintf(file_path, size_of_path, "%s/res/res/%s", pzs_value, testfile_name);
} else {
- PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
+ PRINT_UTC_LOG("\\n [Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30' \\n", __LINE__, API_NAMESPACE);
}
}
/**
/**
* @function _sound_pool_stream_prepare_to_play
- * @description sound pool creation, load the source and activate pool.
+ * @description Load the default source to the pool and activate it. Called in other test cases when ever steam play is needed.
* @parameter NA
* @return NA
*/
}
/**
- * @brief Creates sound stream state change callback function for testing purposes
- * @since_tizen 4.0
- * @description Creates callback function to check sound stream
- * state change functions.
- * @return Current sound pool state
+ * @function _stream_state_changed_cb
+ * @description It is a callback function needs to registered with sound_pool_stream_play. It will be called when ever the stream state change happens.
+ * @return NA
*/
-void static _sp_cb(sound_pool_h pool, sound_pool_state_e prev_state,
+void static _stream_state_changed_cb(sound_pool_h pool, unsigned id, sound_pool_stream_state_e prev_state,
+ sound_pool_stream_state_e cur_state, void *data)
+{
+
+ PRINT_UTC_LOG("\\n [%s]: pool(%p), id(%d), data(%p), prev_state(%d), cur_state(%d) \\n", __FUNCTION__, pool, id, data, prev_state, cur_state);
+
+ return;
+}
+
+/**
+ * @function _sound_pool_state_changed_cb
+ * @description It is a callback function needs to registered with sound_pool_set_state_changed_cb.
+ * It is used in sound pool state chage test cases. This callback function will be called when ever pool state changes.
+ * @return NA
+ */
+void static _sound_pool_state_changed_cb(sound_pool_h pool, sound_pool_state_e prev_state,
sound_pool_state_e cur_state, void *data)
{
+
sound_pool_state_e *state = (sound_pool_state_e *)data;
*state = cur_state;
+
+ return;
}
+
/**
* @brief Positive test case of sound_pool_create()
* @testcase utc_sound_pool_create_p
ret = sound_pool_activate(g_test_pool);
assert_eq(ret, SOUND_POOL_ERROR_NONE);
- ret = sound_pool_set_state_changed_cb(g_test_pool, _sp_cb, &data);
+ ret = sound_pool_set_state_changed_cb(g_test_pool, _sound_pool_state_changed_cb, &data);
assert_eq(ret, SOUND_POOL_ERROR_NONE);
ret = sound_pool_deactivate(g_test_pool);
ret = sound_pool_activate(g_test_pool);
assert_eq(ret, SOUND_POOL_ERROR_NONE);
- ret = sound_pool_set_state_changed_cb(NULL, _sp_cb, &data);
+ ret = sound_pool_set_state_changed_cb(NULL, _sound_pool_state_changed_cb, &data);
assert_eq(ret, SOUND_POOL_ERROR_INVALID_PARAMETER);
ret = sound_pool_set_state_changed_cb(g_test_pool, NULL, &data);
ret = sound_pool_activate(g_test_pool);
assert_eq(ret, SOUND_POOL_ERROR_NONE);
- ret = sound_pool_set_state_changed_cb(g_test_pool, _sp_cb, &data);
+ ret = sound_pool_set_state_changed_cb(g_test_pool, _sound_pool_state_changed_cb, &data);
assert_eq(ret, SOUND_POOL_ERROR_NONE);
ret = sound_pool_deactivate(g_test_pool);
unsigned int loop = 1;
float volume = 0.5;
unsigned int priority = DEFAULT_PRIORITY;
- sound_pool_stream_state_changed_cb callback = NULL;
void *data = NULL;
unsigned int id = 100;
sound_pool_stream_state_e state = SOUND_POOL_STREAM_STATE_NONE;
_sound_pool_stream_prepare_to_play();
ret = sound_pool_stream_play(g_test_pool, DEFAULT_SAMPLE_TAG,
- loop, volume, priority, priority_policy, callback,
+ loop, volume, priority, priority_policy, _stream_state_changed_cb,
data, &id);
assert_eq(ret, SOUND_POOL_ERROR_NONE);
assert_neq(id, 100);
priority = INT_MAX;
ret = sound_pool_stream_play(g_test_pool, DEFAULT_SAMPLE_TAG,
- loop, volume, priority, priority_policy, callback,
+ loop, volume, priority, priority_policy, _stream_state_changed_cb,
data, &id);
assert_eq(ret, SOUND_POOL_ERROR_NONE);
assert_neq(id, 100);
loop = INT_MAX;
ret = sound_pool_stream_play(g_test_pool, DEFAULT_SAMPLE_TAG,
- loop, volume, priority, priority_policy, callback,
+ loop, volume, priority, priority_policy, _stream_state_changed_cb,
data, &id);
assert_eq(ret, SOUND_POOL_ERROR_NONE);
assert_neq(id, 100);