[Internal: API change] When profile gets, input param changed.
[platform/core/system/sync-agent.git] / test / client / oma-ds / oma_ds_client.c
index 77a2151..0022ceb 100755 (executable)
@@ -395,8 +395,10 @@ static gboolean __test_get_profile()
 
        ds_profile_h profile_h = NULL;
 
-       char *profileDirName = "Sync1";
-       char *profileName = NULL;
+       //char *profileDirName = "Sync1";
+       int profile_id = 1;
+       char *profile_dir_name = NULL;
+       char *profile_name = NULL;
        sync_agent_ds_server_info server_info = { NULL };
        sync_agent_ds_sync_info sync_info = { 0, };
        GList *category_list = NULL;
@@ -407,7 +409,7 @@ static gboolean __test_get_profile()
        int lastSessionStatus = 0, lastSessionTime = 0;
 
        // get profile information
-       result = sync_agent_ds_get_profile(profileDirName, &profile_h);
+       result = sync_agent_ds_get_profile(profile_id, &profile_h);
 
        _DEBUG_VERBOSE("----------------------------------");
        _DEBUG_VERBOSE("getting profile\n");
@@ -421,13 +423,23 @@ static gboolean __test_get_profile()
        }
 
        // 1. get profile dir/name
-       result = sync_agent_ds_get_profile_name(profile_h, &profileName);
+       result = sync_agent_ds_get_profile_dir_name(profile_h, &profile_dir_name);
+       if (result == SYNC_AGENT_DS_SUCCESS) {
+               _DEBUG_VERBOSE("Success to get profile_dir_name!");
+               _DEBUG_VERBOSE("profile_dir_name = %s", profile_dir_name);
+               is_test_successful = TRUE;
+       } else {
+               _DEBUG_VERBOSE("Failed to get profile_dir_name!!");
+               is_test_successful = FALSE;
+       }
+
+       result = sync_agent_ds_get_profile_name(profile_h, &profile_name);
        if (result == SYNC_AGENT_DS_SUCCESS) {
-               _DEBUG_VERBOSE("Success to get profile name!");
-               _DEBUG_VERBOSE("get_profileName = %s", profileName);
+               _DEBUG_VERBOSE("Success to get profile_name!");
+               _DEBUG_VERBOSE("profile_name = %s", profile_name);
                is_test_successful = TRUE;
        } else {
-               _DEBUG_VERBOSE("Failed to get profile name!");
+               _DEBUG_VERBOSE("Failed to get profile_name!");
                is_test_successful = FALSE;
        }
 
@@ -491,7 +503,8 @@ static gboolean __test_get_profile()
        }
 
        // free profile information
-       g_free(profileName);
+       g_free(profile_dir_name);
+       g_free(profile_name);
 
        g_free(server_info.addr);
        g_free(server_info.id);
@@ -516,7 +529,9 @@ static gboolean __test_get_all_profiles()
        GList *iter = NULL;
        ds_profile_h profile_h = NULL;
 
-       char *profileName = NULL;
+       int profile_id = -1;
+       char *profile_dir_name = NULL;
+       char *profile_name = NULL;
        sync_agent_ds_server_info server_info = { NULL };
        sync_agent_ds_sync_info sync_info = { 0, };
        GList *category_list = NULL;
@@ -543,14 +558,34 @@ static gboolean __test_get_all_profiles()
        for (iter = profile_list; iter != NULL; iter = g_list_next(iter)) {
                profile_h = (ds_profile_h) iter->data;
 
-               // 1. get profile dir/name
-               result = sync_agent_ds_get_profile_name(profile_h, &profileName);
+               // 1. get profile id / dir_name /name
+               result = sync_agent_ds_get_profile_id(profile_h, &profile_id);
                if (result == SYNC_AGENT_DS_SUCCESS) {
-                       _DEBUG_VERBOSE("Success to get profile name!");
-                       _DEBUG_VERBOSE("get_profileName = %s", profileName);
+                       _DEBUG_VERBOSE("Success to get profile_id!");
+                       _DEBUG_VERBOSE("profile_id = %d", profile_id);
                        is_test_successful = TRUE;
                } else {
-                       _DEBUG_VERBOSE("Failed to get profile name!");
+                       _DEBUG_VERBOSE("Failed to get profile_id!");
+                       is_test_successful = FALSE;
+               }
+
+               result = sync_agent_ds_get_profile_dir_name(profile_h, &profile_dir_name);
+               if (result == SYNC_AGENT_DS_SUCCESS) {
+                       _DEBUG_VERBOSE("Success to get profile_dir_name!");
+                       _DEBUG_VERBOSE("profile_dir_name = %s", profile_dir_name);
+                       is_test_successful = TRUE;
+               } else {
+                       _DEBUG_VERBOSE("Failed to get profile_dir_name!");
+                       is_test_successful = FALSE;
+               }
+
+               result = sync_agent_ds_get_profile_name(profile_h, &profile_name);
+               if (result == SYNC_AGENT_DS_SUCCESS) {
+                       _DEBUG_VERBOSE("Success to get profile_name!");
+                       _DEBUG_VERBOSE("profile_name = %s", profile_name);
+                       is_test_successful = TRUE;
+               } else {
+                       _DEBUG_VERBOSE("Failed to get profile_name!");
                        is_test_successful = FALSE;
                }
 
@@ -615,8 +650,8 @@ static gboolean __test_get_all_profiles()
                }
 
                // free profile information
-               g_free(profileName);
-
+               g_free(profile_dir_name);
+               g_free(profile_name);
                g_free(server_info.addr);
                g_free(server_info.id);
                g_free(server_info.password);
@@ -646,13 +681,13 @@ static gboolean __test_get_sync_statistics()
 
        GList *statistics_list = NULL;
 
-       char *profileDirName = "Sync1";
+       int profile_id = 1;
 
        int category_count = 0;
        int i = 0;
 
        // get profile information
-       result = sync_agent_ds_get_profile(profileDirName, &profile_h);
+       result = sync_agent_ds_get_profile(profile_id, &profile_h);
 
        _DEBUG_VERBOSE("----------------------------------");
        _DEBUG_VERBOSE("getting profile\n");
@@ -709,10 +744,10 @@ static gboolean __test_start_sync()
 
        ds_profile_h profile_h = NULL;
 
-       char *profileDirName = "Sync1";
+       int profile_id = 1;
 
        // get profile information
-       result = sync_agent_ds_get_profile(profileDirName, &profile_h);
+       result = sync_agent_ds_get_profile(profile_id, &profile_h);
 
        _DEBUG_VERBOSE("----------------------------------");
        _DEBUG_VERBOSE("getting profile\n");
@@ -750,10 +785,10 @@ static gboolean __test_stop_sync()
 
        ds_profile_h profile_h = NULL;
 
-       char *profileDirName = "Sync1";
+       int profile_id = 1;
 
        // get profile information
-       result = sync_agent_ds_get_profile(profileDirName, &profile_h);
+       result = sync_agent_ds_get_profile(profile_id, &profile_h);
 
        _DEBUG_VERBOSE("----------------------------------");
        _DEBUG_VERBOSE("getting profile\n");