[UTC][sound-pool][Non-ACR][Modified TC Array properly]
authoraravind.gara <aravind.gara@samsung.com>
Fri, 20 Oct 2017 10:52:19 +0000 (19:52 +0900)
committeraravind.gara <aravind.gara@samsung.com>
Fri, 20 Oct 2017 10:53:01 +0000 (19:53 +0900)
Earlier TC Array was not proper, updated now.

Change-Id: I29b55cea6ed61c6addc8d8ee9c4a87a6475d372d
Signed-off-by: aravind.gara <aravind.gara@samsung.com>
src/utc/sound-pool/tct-sound-pool-core_mobile.h
src/utc/sound-pool/tct-sound-pool-core_wearable.h
src/utc/sound-pool/utc-sound-pool.c

index 81045856981e194b5ba40506ae932f766d094a50..0d7a6cb1f15a91aa1c5815d718d55b47dfa1395e 100755 (executable)
@@ -108,10 +108,10 @@ testcase tc_array[] = {
     {"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},
index 81045856981e194b5ba40506ae932f766d094a50..0d7a6cb1f15a91aa1c5815d718d55b47dfa1395e 100755 (executable)
@@ -108,10 +108,10 @@ testcase tc_array[] = {
     {"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},
index 21dbbd3122b38ed86d595a6444054ff5fcd0ba55..b1cd11d76053138073ce4381eb93e788f85c97a8 100755 (executable)
@@ -48,12 +48,12 @@ void static _sound_pool_prepare_filepath(const char *testfile_name)
        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);
        }
 }
 /**
@@ -94,7 +94,7 @@ void utc_sound_pool_cleanup(void)
 
 /**
  * @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
  */
@@ -113,18 +113,35 @@ int static _sound_pool_stream_prepare_to_play(void)
 }
 
 /**
- * @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
@@ -608,7 +625,7 @@ int utc_sound_pool_set_state_changed_cb_p(void)
        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);
@@ -639,7 +656,7 @@ int utc_sound_pool_set_state_changed_cb_n(void)
        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);
@@ -664,7 +681,7 @@ int utc_sound_pool_unset_state_changed_cb_p(void)
        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);
@@ -712,7 +729,6 @@ int utc_sound_pool_stream_play_p(void)
        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;
@@ -721,7 +737,7 @@ int utc_sound_pool_stream_play_p(void)
        _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);
@@ -732,7 +748,7 @@ int utc_sound_pool_stream_play_p(void)
 
        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);
@@ -743,7 +759,7 @@ int utc_sound_pool_stream_play_p(void)
 
        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);