*/
void ITs_context_history_startup(void)
{
+ g_bHistoryMismatch = false;
+ g_bHistoryNotSupported = false;
+
struct stat stBuff;
if ( stat(ERR_LOG, &stBuff) == 0 )
{
FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Context_p\\n", __LINE__, API_NAMESPACE);
#endif
TCT_CheckInstalledApp(2, TEST_TESTAPPLICATION_APPID, TEST_HELLOWORLD_APPID);
+
+ g_bIsHistoryFeatureSupported = TCTCheckSystemInfoFeatureSupported(HISTORY_FEATURE, API_NAMESPACE);
+
+ bool bSupported;
+ int nRet = context_history_is_supported(CONTEXT_HISTORY_RECENTLY_USED_APP, &bSupported);
+ if (!g_bIsHistoryFeatureSupported)
+ {
+ if (nRet == CONTEXT_HISTORY_ERROR_NOT_SUPPORTED) {
+ g_bHistoryNotSupported = true;
+ } else {
+ g_bHistoryMismatch = true;
+ }
+ }
}
/**
*/
int ITc_context_history_create_destroy_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
//Target API
int nRet = context_history_create(&g_Handle);
*/
int ITc_context_history_filter_create_destroy_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
//Target API
int nRet = context_history_filter_create(&g_filter);
*/
int ITc_context_history_filter_set_int_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
int nRet = context_history_filter_create(&g_filter);
PRINT_RESULT(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_create", ContextHistoryGetError(nRet));
*/
int ITc_context_history_filter_set_string_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
int nRet = context_history_filter_create(&g_filter);
PRINT_RESULT(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_create", ContextHistoryGetError(nRet));
-
+#ifdef MOBILE
//Target API
nRet = context_history_filter_set_string(g_filter, CONTEXT_HISTORY_FILTER_APP_ID, TEST_TESTAPPLICATION_APPID);
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_set_string", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter));
-
+#endif //MOBILE
nRet = context_history_filter_destroy(g_filter);
PRINT_RESULT(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_destroy", ContextHistoryGetError(nRet));
*/
int ITc_context_history_get_list_destroy_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
int nRet = context_history_create(&g_Handle);
PRINT_RESULT(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_create", ContextHistoryGetError(nRet));
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_set_int", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
//Target API
- nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_RARELY_USED_APP, g_filter, &g_history_list);
+ nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_BATTERY_USAGE, g_filter, &g_history_list);
+ if (nRet == CONTEXT_HISTORY_ERROR_NO_DATA)
+ {
+ FPRINTF("[Line : %d][%s] Skip context_history_get_list() for CONTEXT_HISTORY_BATTERY_USAGE. Data not exist.\\n", __LINE__, API_NAMESPACE);
+ context_history_filter_destroy(g_filter);
+ context_history_destroy(g_Handle);
+ return 0;
+ }
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_get_list", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
//Target API
*/
int ITc_context_history_list_get_count_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
int nListCount;
nRet = context_history_filter_set_int(g_filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, INT_VAL2);
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_set_int", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
- nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_RARELY_USED_APP, g_filter, &g_history_list);
+ nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_BATTERY_USAGE, g_filter, &g_history_list);
+ if (nRet == CONTEXT_HISTORY_ERROR_NO_DATA)
+ {
+ FPRINTF("[Line : %d][%s] Skip context_history_get_list() for CONTEXT_HISTORY_BATTERY_USAGE. Data not exist.\\n", __LINE__, API_NAMESPACE);
+ context_history_filter_destroy(g_filter);
+ context_history_destroy(g_Handle);
+ return 0;
+ }
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_get_list", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
//Target API
*/
int ITc_context_history_list_get_current_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
int nRet;
nRet = context_history_filter_set_int(g_filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, INT_VAL2);
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_set_int", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
- nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_RARELY_USED_APP, g_filter, &g_history_list);
+ nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_BATTERY_USAGE, g_filter, &g_history_list);
+ if (nRet == CONTEXT_HISTORY_ERROR_NO_DATA)
+ {
+ FPRINTF("[Line : %d][%s] Skip context_history_get_list() for CONTEXT_HISTORY_BATTERY_USAGE. Data not exist.\\n", __LINE__, API_NAMESPACE);
+ context_history_filter_destroy(g_filter);
+ context_history_destroy(g_Handle);
+ return 0;
+ }
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_get_list", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
//Target API
*/
int ITc_context_history_list_move_first_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
int nRet = context_history_create(&g_Handle);
PRINT_RESULT(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_create", ContextHistoryGetError(nRet));
nRet = context_history_filter_set_int(g_filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, INT_VAL2);
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_set_int", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
- nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_RARELY_USED_APP, g_filter, &g_history_list);
+ nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_BATTERY_USAGE, g_filter, &g_history_list);
+ if (nRet == CONTEXT_HISTORY_ERROR_NO_DATA)
+ {
+ FPRINTF("[Line : %d][%s] Skip context_history_get_list() for CONTEXT_HISTORY_BATTERY_USAGE. Data not exist.\\n", __LINE__, API_NAMESPACE);
+ context_history_filter_destroy(g_filter);
+ context_history_destroy(g_Handle);
+ return 0;
+ }
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_get_list", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
//Target API
*/
int ITc_context_history_list_move_next_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
int nRet = context_history_create(&g_Handle);
PRINT_RESULT(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_create", ContextHistoryGetError(nRet));
nRet = context_history_filter_set_int(g_filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, INT_VAL2);
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_filter_set_int", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
- nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_RARELY_USED_APP, g_filter, &g_history_list);
+ nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_BATTERY_USAGE, g_filter, &g_history_list);
+ if (nRet == CONTEXT_HISTORY_ERROR_NO_DATA)
+ {
+ FPRINTF("[Line : %d][%s] Skip context_history_get_list() for CONTEXT_HISTORY_BATTERY_USAGE. Data not exist.\\n", __LINE__, API_NAMESPACE);
+ context_history_filter_destroy(g_filter);
+ context_history_destroy(g_Handle);
+ return 0;
+ }
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_get_list", ContextHistoryGetError(nRet), context_history_filter_destroy(g_filter);context_history_destroy(g_Handle));
//Target API
*/
int ITc_context_history_record_get_int_string_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
int nValue = -1;
char *sValue = NULL;
int nRet = context_history_create(&g_Handle);
PRINT_RESULT(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_create", ContextHistoryGetError(nRet));
- nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_RARELY_USED_APP, NULL, &g_history_list);
+ nRet = context_history_get_list(g_Handle, CONTEXT_HISTORY_RECENTLY_USED_APP, NULL, &g_history_list);
+ if (nRet == CONTEXT_HISTORY_ERROR_NO_DATA)
+ {
+ FPRINTF("[Line : %d][%s] Skip context_history_get_list() for CONTEXT_HISTORY_RECENTLY_USED_APP. Data not exist.\\n", __LINE__, API_NAMESPACE);
+ context_history_destroy(g_Handle);
+ return 0;
+ }
PRINT_RESULT_CLEANUP(CONTEXT_HISTORY_ERROR_NONE, nRet, "context_history_get_list", ContextHistoryGetError(nRet), context_history_destroy(g_Handle));
nRet = context_history_list_get_current(g_history_list, &g_history_record);
*/
int ITc_context_history_record_get_double_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
double nValue;
*/
int ITc_context_history_get_list_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
context_history_data_e eContextHistory[]={
CONTEXT_HISTORY_RECENTLY_USED_APP,
*/
int ITc_context_history_is_supported_p(void)
{
- START_TEST;
+ START_TEST_HISTORY;
context_history_data_e eContextHistory[]={
CONTEXT_HISTORY_RECENTLY_USED_APP,
#include "testcase.h"
#include "tct_common.h"
-extern void utc_context_trigger_startup(void);
-extern void utc_context_trigger_cleanup(void);
extern void utc_context_history_startup(void);
extern void utc_context_history_cleanup(void);
-extern int utc_context_trigger_add_rule_p(void);
-extern int utc_context_trigger_add_rule_n(void);
-extern int utc_context_trigger_remove_rule_p(void);
-extern int utc_context_trigger_remove_rule_n(void);
-extern int utc_context_trigger_enable_rule_p(void);
-extern int utc_context_trigger_enable_rule_n(void);
-extern int utc_context_trigger_disable_rule_p(void);
-extern int utc_context_trigger_disable_rule_n(void);
-extern int utc_context_trigger_get_own_rule_ids_p(void);
-extern int utc_context_trigger_get_own_rule_ids_n(void);
-extern int utc_context_trigger_get_rule_by_id_p(void);
-extern int utc_context_trigger_get_rule_by_id_n(void);
-extern int utc_context_trigger_rule_create_p(void);
-extern int utc_context_trigger_rule_create_n(void);
-extern int utc_context_trigger_rule_destroy_p(void);
-extern int utc_context_trigger_rule_destroy_n(void);
-extern int utc_context_trigger_rule_add_entry_p(void);
-extern int utc_context_trigger_rule_add_entry_n1(void);
-extern int utc_context_trigger_rule_add_entry_n2(void);
-extern int utc_context_trigger_rule_set_action_app_control_p(void);
-extern int utc_context_trigger_rule_set_action_app_control_n(void);
-extern int utc_context_trigger_rule_set_action_notification_p(void);
-extern int utc_context_trigger_rule_set_action_notification_n(void);
-extern int utc_context_trigger_rule_set_description_p(void);
-extern int utc_context_trigger_rule_set_description_n(void);
-extern int utc_context_trigger_rule_get_description_p(void);
-extern int utc_context_trigger_rule_get_description_n(void);
-extern int utc_context_trigger_rule_event_create_p(void);
-extern int utc_context_trigger_rule_event_create_n(void);
-extern int utc_context_trigger_rule_event_is_supported_p(void);
-extern int utc_context_trigger_rule_event_is_supported_n(void);
-extern int utc_context_trigger_rule_condition_create_p(void);
-extern int utc_context_trigger_rule_condition_create_n(void);
-extern int utc_context_trigger_rule_condition_is_supported_p(void);
-extern int utc_context_trigger_rule_condition_is_supported_n(void);
-extern int utc_context_trigger_rule_entry_destroy_p(void);
-extern int utc_context_trigger_rule_entry_destroy_n(void);
-extern int utc_context_trigger_rule_entry_add_key_p(void);
-extern int utc_context_trigger_rule_entry_add_key_n(void);
-extern int utc_context_trigger_rule_entry_add_comparison_int_p(void);
-extern int utc_context_trigger_rule_entry_add_comparison_int_n(void);
-extern int utc_context_trigger_rule_entry_add_comparison_string_p(void);
-extern int utc_context_trigger_rule_entry_add_comparison_string_n(void);
-extern int utc_context_trigger_rule_entry_add_comparison_p1(void);
-extern int utc_context_trigger_rule_entry_add_comparison_p2(void);
-extern int utc_context_trigger_rule_entry_add_comparison_n(void);
-extern int utc_context_trigger_rule_entry_add_option_int_p(void);
-extern int utc_context_trigger_rule_entry_add_option_int_n(void);
-extern int utc_context_trigger_rule_entry_add_option_string_p(void);
-extern int utc_context_trigger_rule_entry_add_option_string_n(void);
-extern int utc_context_trigger_rule_entry_add_option_p1(void);
-extern int utc_context_trigger_rule_entry_add_option_p2(void);
-extern int utc_context_trigger_rule_entry_add_option_p3(void);
-extern int utc_context_trigger_rule_entry_add_option_n(void);
-extern int utc_context_trigger_custom_register_p(void);
-extern int utc_context_trigger_custom_register_n(void);
-extern int utc_context_trigger_custom_unregister_p(void);
-extern int utc_context_trigger_custom_unregister_n(void);
-extern int utc_context_trigger_custom_publish_p(void);
-extern int utc_context_trigger_custom_publish_n(void);
-extern int utc_context_trigger_rule_custom_event_create_p(void);
-extern int utc_context_trigger_rule_custom_event_create_n(void);
-extern int utc_context_trigger_rule_custom_condition_create_p(void);
-extern int utc_context_trigger_rule_custom_condition_create_n(void);
extern int utc_context_history_create_p(void);
extern int utc_context_history_create_n(void);
extern int utc_context_history_destroy_p(void);
extern int utc_context_history_filter_destroy_n(void);
extern int utc_context_history_filter_set_int_p(void);
extern int utc_context_history_filter_set_int_n(void);
-extern int utc_context_history_filter_set_string_p(void);
-extern int utc_context_history_filter_set_string_n(void);
extern int utc_context_history_get_list_p(void);
extern int utc_context_history_get_list_n(void);
extern int utc_context_history_list_get_count_p(void);
extern int utc_context_history_record_destroy_n(void);
testcase tc_array[] = {
- {"utc_context_trigger_add_rule_p",utc_context_trigger_add_rule_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_add_rule_n",utc_context_trigger_add_rule_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_remove_rule_p",utc_context_trigger_remove_rule_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_remove_rule_n",utc_context_trigger_remove_rule_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_enable_rule_p",utc_context_trigger_enable_rule_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_enable_rule_n",utc_context_trigger_enable_rule_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_disable_rule_p",utc_context_trigger_disable_rule_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_disable_rule_n",utc_context_trigger_disable_rule_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_get_own_rule_ids_p",utc_context_trigger_get_own_rule_ids_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_get_own_rule_ids_n",utc_context_trigger_get_own_rule_ids_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_get_rule_by_id_p",utc_context_trigger_get_rule_by_id_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_get_rule_by_id_n",utc_context_trigger_get_rule_by_id_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_create_p",utc_context_trigger_rule_create_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_create_n",utc_context_trigger_rule_create_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_destroy_p",utc_context_trigger_rule_destroy_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_destroy_n",utc_context_trigger_rule_destroy_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_add_entry_p",utc_context_trigger_rule_add_entry_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_add_entry_n1",utc_context_trigger_rule_add_entry_n1,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_add_entry_n2",utc_context_trigger_rule_add_entry_n2,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_set_action_app_control_p",utc_context_trigger_rule_set_action_app_control_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_set_action_app_control_n",utc_context_trigger_rule_set_action_app_control_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_set_action_notification_p",utc_context_trigger_rule_set_action_notification_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_set_action_notification_n",utc_context_trigger_rule_set_action_notification_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_set_description_p",utc_context_trigger_rule_set_description_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_set_description_n",utc_context_trigger_rule_set_description_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_get_description_p",utc_context_trigger_rule_get_description_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_get_description_n",utc_context_trigger_rule_get_description_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_event_create_p",utc_context_trigger_rule_event_create_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_event_create_n",utc_context_trigger_rule_event_create_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_event_is_supported_p",utc_context_trigger_rule_event_is_supported_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_event_is_supported_n",utc_context_trigger_rule_event_is_supported_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_condition_create_p",utc_context_trigger_rule_condition_create_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_condition_create_n",utc_context_trigger_rule_condition_create_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_condition_is_supported_p",utc_context_trigger_rule_condition_is_supported_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_condition_is_supported_n",utc_context_trigger_rule_condition_is_supported_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_destroy_p",utc_context_trigger_rule_entry_destroy_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_destroy_n",utc_context_trigger_rule_entry_destroy_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_key_p",utc_context_trigger_rule_entry_add_key_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_key_n",utc_context_trigger_rule_entry_add_key_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_comparison_int_p",utc_context_trigger_rule_entry_add_comparison_int_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_comparison_int_n",utc_context_trigger_rule_entry_add_comparison_int_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_comparison_string_p",utc_context_trigger_rule_entry_add_comparison_string_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_comparison_string_n",utc_context_trigger_rule_entry_add_comparison_string_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_comparison_p1",utc_context_trigger_rule_entry_add_comparison_p1,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_comparison_p2",utc_context_trigger_rule_entry_add_comparison_p2,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_comparison_n",utc_context_trigger_rule_entry_add_comparison_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_option_int_p",utc_context_trigger_rule_entry_add_option_int_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_option_int_n",utc_context_trigger_rule_entry_add_option_int_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_option_string_p",utc_context_trigger_rule_entry_add_option_string_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_option_string_n",utc_context_trigger_rule_entry_add_option_string_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_option_p1",utc_context_trigger_rule_entry_add_option_p1,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_option_p2",utc_context_trigger_rule_entry_add_option_p2,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_option_p3",utc_context_trigger_rule_entry_add_option_p3,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_entry_add_option_n",utc_context_trigger_rule_entry_add_option_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_custom_register_p",utc_context_trigger_custom_register_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_custom_register_n",utc_context_trigger_custom_register_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_custom_unregister_p",utc_context_trigger_custom_unregister_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_custom_unregister_n",utc_context_trigger_custom_unregister_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_custom_publish_p",utc_context_trigger_custom_publish_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_custom_publish_n",utc_context_trigger_custom_publish_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_custom_event_create_p",utc_context_trigger_rule_custom_event_create_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_custom_event_create_n",utc_context_trigger_rule_custom_event_create_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_custom_condition_create_p",utc_context_trigger_rule_custom_condition_create_p,utc_context_trigger_startup,utc_context_trigger_cleanup},
- {"utc_context_trigger_rule_custom_condition_create_n",utc_context_trigger_rule_custom_condition_create_n,utc_context_trigger_startup,utc_context_trigger_cleanup},
{"utc_context_history_create_p",utc_context_history_create_p,utc_context_history_startup,utc_context_history_cleanup},
{"utc_context_history_create_n",utc_context_history_create_n,utc_context_history_startup,utc_context_history_cleanup},
{"utc_context_history_destroy_p",utc_context_history_destroy_p,utc_context_history_startup,utc_context_history_cleanup},
{"utc_context_history_filter_destroy_n",utc_context_history_filter_destroy_n,utc_context_history_startup,utc_context_history_cleanup},
{"utc_context_history_filter_set_int_p",utc_context_history_filter_set_int_p,utc_context_history_startup,utc_context_history_cleanup},
{"utc_context_history_filter_set_int_n",utc_context_history_filter_set_int_n,utc_context_history_startup,utc_context_history_cleanup},
- {"utc_context_history_filter_set_string_p",utc_context_history_filter_set_string_p,utc_context_history_startup,utc_context_history_cleanup},
- {"utc_context_history_filter_set_string_n",utc_context_history_filter_set_string_n,utc_context_history_startup,utc_context_history_cleanup},
{"utc_context_history_get_list_p",utc_context_history_get_list_p,utc_context_history_startup,utc_context_history_cleanup},
{"utc_context_history_get_list_n",utc_context_history_get_list_n,utc_context_history_startup,utc_context_history_cleanup},
{"utc_context_history_list_get_count_p",utc_context_history_list_get_count_p,utc_context_history_startup,utc_context_history_cleanup},
#include "tct_app_common.h"
//& set: Context - History
+#define HISTORY_FEATURE "http://tizen.org/feature/app_history"
#ifdef MOBILE
#define NUM_HISTORY_DATA_TYPE 12
#endif //MOBILE
-#ifdef TV
-#define NUM_HISTORY_DATA_TYPE 9
-#endif //TV
+#ifdef WEARABLE
+#define NUM_HISTORY_DATA_TYPE 4
+#endif //WEARABLE
static context_history_h handle = NULL;
+bool history_checked = false;
+bool is_history_supported = false;
+
static context_history_data_e history_data_enum[NUM_HISTORY_DATA_TYPE] = {
+#ifdef MOBILE
CONTEXT_HISTORY_RECENTLY_USED_APP,
CONTEXT_HISTORY_FREQUENTLY_USED_APP,
+ CONTEXT_HISTORY_BATTERY_USAGE,
+ CONTEXT_HISTORY_RECENT_BATTERY_USAGE,
CONTEXT_HISTORY_RARELY_USED_APP,
CONTEXT_HISTORY_PEAK_TIME_FOR_APP,
CONTEXT_HISTORY_PEAK_TIME_FOR_MUSIC,
CONTEXT_HISTORY_PEAK_TIME_FOR_VIDEO,
CONTEXT_HISTORY_COMMON_SETTING_FOR_APP,
CONTEXT_HISTORY_COMMON_SETTING_FOR_MUSIC,
-#ifdef MOBILE
CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO,
- CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS,
+ CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS};
+#endif //MOBILE
+#ifdef WEARABLE
+ CONTEXT_HISTORY_RECENTLY_USED_APP,
+ CONTEXT_HISTORY_FREQUENTLY_USED_APP,
CONTEXT_HISTORY_BATTERY_USAGE,
CONTEXT_HISTORY_RECENT_BATTERY_USAGE};
-#endif //MOBILE
-#ifdef TV
- CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO};
-#endif //TV
+#endif //WEARABLE
static const char *history_data_name[NUM_HISTORY_DATA_TYPE] = {
+#ifdef MOBILE
"CONTEXT_HISTORY_RECENTLY_USED_APP",
"CONTEXT_HISTORY_FREQUENTLY_USED_APP",
+ "CONTEXT_HISTORY_BATTERY_USAGE",
+ "CONTEXT_HISTORY_RECENT_BATTERY_USAGE",
"CONTEXT_HISTORY_RARELY_USED_APP",
"CONTEXT_HISTORY_PEAK_TIME_FOR_APP",
"CONTEXT_HISTORY_PEAK_TIME_FOR_MUSIC",
"CONTEXT_HISTORY_PEAK_TIME_FOR_VIDEO",
"CONTEXT_HISTORY_COMMON_SETTING_FOR_APP",
"CONTEXT_HISTORY_COMMON_SETTING_FOR_MUSIC",
-#ifdef MOBILE
"CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO",
- "CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS",
+ "CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS"};
+#endif //MOBILE
+#ifdef WEARABLE
+ "CONTEXT_HISTORY_RECENTLY_USED_APP",
+ "CONTEXT_HISTORY_FREQUENTLY_USED_APP",
"CONTEXT_HISTORY_BATTERY_USAGE",
"CONTEXT_HISTORY_RECENT_BATTERY_USAGE"};
-#endif //MOBILE
-#ifdef TV
- "CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO"};
-#endif //TV
+#endif //WEARABLE
#define SKIP_TEST_CONTINUE(Error, CaseIdx, MaxIdx, DataName) {\
- if (Error == CONTEXT_HISTORY_ERROR_NOT_SUPPORTED) {\
+ if (is_history_supported && Error == CONTEXT_HISTORY_ERROR_NOT_SUPPORTED) {\
PRINT_INFO("(%d/%d) Skipping this test for %s. Not supported",\
CaseIdx, MaxIdx, DataName);\
continue;\
- } else if (Error == CONTEXT_HISTORY_ERROR_NO_DATA) {\
+ } else if (is_history_supported && Error == CONTEXT_HISTORY_ERROR_NO_DATA) {\
PRINT_INFO("(%d/%d) Skipping this test for %s. Data not exist",\
CaseIdx, MaxIdx, DataName);\
continue;\
}
#define SKIP_TEST(Error, CaseIdx, MaxIdx, DataName) \
- if (Error == CONTEXT_HISTORY_ERROR_NOT_SUPPORTED) {\
+ if (is_history_supported && Error == CONTEXT_HISTORY_ERROR_NOT_SUPPORTED) {\
PRINT_INFO("(%d/%d) Skipping this test for %s. Not supported",\
CaseIdx, MaxIdx, DataName);\
- } else if (Error == CONTEXT_HISTORY_ERROR_NO_DATA) {\
+ } else if (is_history_supported && Error == CONTEXT_HISTORY_ERROR_NO_DATA) {\
PRINT_INFO("(%d/%d) Skipping this test for %s. Data not exist",\
CaseIdx, MaxIdx, DataName);\
}
TCT_UTCCheckInstalledApp(2, "org.tizen.testapplication", "org.tizen.helloworld");
context_history_create(&handle);
+
+ if (!history_checked) {
+ system_info_get_platform_bool(HISTORY_FEATURE, &is_history_supported);
+ history_checked = true;
+ }
+
+ if (!is_history_supported)
+ PRINT_INFO("Feature(%s) is not supported", HISTORY_FEATURE);
}
/**
error = context_history_create(&history_h);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_destroy(history_h);
return 0;
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_create(NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}
context_history_create(&history_h);
error = context_history_destroy(history_h);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
return 0;
}
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_destroy(NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}
context_history_filter_h filter = NULL;
error = context_history_filter_create(&filter);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_filter_destroy(filter);
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_filter_create(NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}
context_history_filter_create(&filter);
error = context_history_filter_destroy(filter);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
return 0;
}
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_filter_destroy(NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}
context_history_filter_create(&filter);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 10);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
-
- error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_DAY_OF_WEEK, CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_WEEKDAYS);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_START_TIME, 1433116800); // 2015.06.01 00:00:00
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_END_TIME, 1433548800); // 2015.06.06. 00:00:00
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+
+#ifdef MOBILE
+ error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_DAY_OF_WEEK, CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_WEEKDAYS);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_AUDIO_JACK, CONTEXT_HISTORY_FILTER_AUDIO_JACK_CONNECTED);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE, CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE_CALL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+#endif //MOBILE
context_history_filter_destroy(filter);
context_history_filter_create(&filter);
error = context_history_filter_set_int(NULL, CONTEXT_HISTORY_FILTER_TIME_SPAN, 10);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#ifdef MOBILE
// Invalid filter data type
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_APP_ID, 0);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#endif //MOBILE
// Invalid filter data
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, -1);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, -1);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-
- error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_DAY_OF_WEEK, -1);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_START_TIME, -1);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_END_TIME, -1);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+
+#ifdef MOBILE
+ error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_DAY_OF_WEEK, -1);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_AUDIO_JACK, -1);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE, -1);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#endif //MOBILE
context_history_filter_destroy(filter);
return 0;
}
+#ifdef MOBILE
/**
* @testcase utc_context_history_filter_set_string_p
* @since_tizen 2.4
context_history_filter_create(&filter);
error = context_history_filter_set_string(filter, CONTEXT_HISTORY_FILTER_APP_ID, "org.tizen.testapplication");
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
error = context_history_filter_set_string(filter, CONTEXT_HISTORY_FILTER_WIFI_BSSID, "office");
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_filter_destroy(filter);
context_history_filter_create(&filter);
error = context_history_filter_set_string(NULL, CONTEXT_HISTORY_FILTER_APP_ID, "org.tizen.testapplication");
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
// Invalid filter data type
error = context_history_filter_set_string(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, "10");
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
// Invalid filter data
error = context_history_filter_set_string(filter, CONTEXT_HISTORY_FILTER_APP_ID, NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
error = context_history_filter_set_string(filter, CONTEXT_HISTORY_FILTER_WIFI_BSSID, NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
context_history_filter_destroy(filter);
return 0;
}
+#endif //MOBILE
/**
* @testcase utc_context_history_is_supported_p
for (i = 0; i < NUM_HISTORY_DATA_TYPE; ++i) {
error = context_history_is_supported(history_data_enum[i], &supported);
- if (!supported)
+ if (is_history_supported && !supported)
PRINT_INFO("(%d/%d) %s is not supported.", i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
}
return 0;
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_is_supported(history_data_enum[0], NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}
error = context_history_get_list(handle, history_data_enum[i], NULL, &list);
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert(list);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_IF_SUPPORTED(is_history_supported, list);
context_history_list_destroy(list);
}
context_history_filter_h filter = NULL;
context_history_list_h list = NULL;
- error = context_history_get_list(NULL, CONTEXT_HISTORY_RARELY_USED_APP, NULL, &list);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ error = context_history_get_list(NULL, CONTEXT_HISTORY_FREQUENTLY_USED_APP, NULL, &list);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
- error = context_history_get_list(handle, CONTEXT_HISTORY_RARELY_USED_APP, NULL, NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ error = context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, NULL, NULL);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#ifdef MOBILE
// Invalid filter
context_history_filter_create(&filter);
context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_DAY_OF_WEEK, CONTEXT_HISTORY_FILTER_DAY_OF_WEEK_WEEKDAYS);
- error = context_history_get_list(handle, CONTEXT_HISTORY_RARELY_USED_APP, filter, &list);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ error = context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#endif //MOBILE
context_history_list_destroy(list);
context_history_filter_destroy(filter);
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
error = context_history_list_get_count(list, &count);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(count, 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, count, 0);
context_history_list_destroy(list);
}
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
error = context_history_list_get_count(list, NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
context_history_list_destroy(list);
}
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
error = context_history_list_get_current(list, &record);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert(record);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_IF_SUPPORTED(is_history_supported, record);
context_history_list_destroy(list);
context_history_record_destroy(record);
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
error = context_history_list_get_current(list, NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
context_history_list_destroy(list);
context_history_record_destroy(record);
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
error = context_history_list_move_first(list);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_destroy(list);
}
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_list_move_first(NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
error = context_history_list_get_count(list, &count);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- if (count < 2) {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ if (is_history_supported && count < 2) {
PRINT_INFO("(%d/%d) Skipping this test for %s. The number of records is %d.",
i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i], count);
context_history_list_destroy(list);
}
error = context_history_list_move_next(list);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_destroy(list);
}
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_list_move_next(NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}
error = context_history_get_list(handle, history_data_enum[i], NULL, &list);
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert(list);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_IF_SUPPORTED(is_history_supported, list);
error = context_history_list_destroy(list);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
}
return 0;
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_list_destroy(NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}
context_history_filter_create(&filter);
context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
+ error = context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
+ SKIP_TEST(error, 1, 4, history_data_name[1]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ context_history_list_get_current(list, &record);
+
+ value = -1;
+ error = context_history_record_get_int(record, CONTEXT_HISTORY_TOTAL_COUNT, &value);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
+
+ value = -1;
+ error = context_history_record_get_int(record, CONTEXT_HISTORY_TOTAL_DURATION, &value);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
+
+ value = -3;
+ error = context_history_record_get_int(record, CONTEXT_HISTORY_LAST_TIME, &value);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, -1);
+
+ context_history_record_destroy(record);
+ context_history_list_destroy(list);
+ }
+
+#ifdef MOBILE
error = context_history_get_list(handle, CONTEXT_HISTORY_RARELY_USED_APP, filter, &list);
- SKIP_TEST(error, 1, 3, history_data_name[2]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ SKIP_TEST(error, 2, 4, history_data_name[4]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_get_current(list, &record);
value = -1;
error = context_history_record_get_int(record, CONTEXT_HISTORY_TOTAL_COUNT, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(value, 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
value = -1;
error = context_history_record_get_int(record, CONTEXT_HISTORY_TOTAL_DURATION, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(value, 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
value = -3;
error = context_history_record_get_int(record, CONTEXT_HISTORY_LAST_TIME, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(value, -1);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, -1);
context_history_record_destroy(record);
context_history_list_destroy(list);
}
error = context_history_get_list(handle, CONTEXT_HISTORY_COMMON_SETTING_FOR_APP, filter, &list);
- SKIP_TEST(error, 2, 3, history_data_name[6]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ SKIP_TEST(error, 3, 4, history_data_name[8]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
error = context_history_list_get_current(list, &record);
value = -1;
error = context_history_record_get_int(record, CONTEXT_HISTORY_AUDIO_JACK, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(value, 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
value = -1;
error = context_history_record_get_int(record, CONTEXT_HISTORY_SYSTEM_VOLUME, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(value, 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
value = -1;
error = context_history_record_get_int(record, CONTEXT_HISTORY_MEDIA_VOLUME, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(value, 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
context_history_record_destroy(record);
context_history_list_destroy(list);
}
error = context_history_get_list(handle, CONTEXT_HISTORY_PEAK_TIME_FOR_APP, filter, &list);
- SKIP_TEST(error, 3, 3, history_data_name[3]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ SKIP_TEST(error, 4, 4, history_data_name[5]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_get_current(list, &record);
value = -1;
error = context_history_record_get_int(record, CONTEXT_HISTORY_HOUR_OF_DAY, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(value, 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
context_history_record_destroy(record);
context_history_list_destroy(list);
}
+#endif //MOBILE
context_history_filter_destroy(filter);
context_history_list_h list = NULL;
context_history_record_h record = NULL;
- error = context_history_get_list(handle, CONTEXT_HISTORY_RARELY_USED_APP, NULL, &list);
- SKIP_TEST(error, 1, 1, history_data_name[2]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ error = context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, NULL, &list);
+ SKIP_TEST(error, 1, 1, history_data_name[1]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_get_current(list, &record);
error = context_history_record_get_int(record, CONTEXT_HISTORY_TOTAL_COUNT, NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
// Invalid record data type
error = context_history_record_get_int(record, CONTEXT_HISTORY_APP_ID, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#ifdef MOBILE
// Invalid record key
error = context_history_record_get_int(record, CONTEXT_HISTORY_HOUR_OF_DAY, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#endif //MOBILE
context_history_record_destroy(record);
context_history_list_destroy(list);
context_history_filter_create(&filter);
context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
- error = context_history_get_list(handle, CONTEXT_HISTORY_RARELY_USED_APP, filter, &list);
- SKIP_TEST(error, 1, 2, history_data_name[2]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ error = context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
+ SKIP_TEST(error, 1, 3, history_data_name[1]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_get_current(list, &record);
value = NULL;
error = context_history_record_get_string(record, CONTEXT_HISTORY_APP_ID, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert(strlen(value) > 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_IF_SUPPORTED(is_history_supported, strlen(value) > 0);
free(value);
context_history_record_destroy(record);
}
#ifdef MOBILE
+ error = context_history_get_list(handle, CONTEXT_HISTORY_RARELY_USED_APP, filter, &list);
+ SKIP_TEST(error, 2, 3, history_data_name[4]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ context_history_list_get_current(list, &record);
+
+ value = NULL;
+ error = context_history_record_get_string(record, CONTEXT_HISTORY_APP_ID, &value);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_IF_SUPPORTED(is_history_supported, strlen(value) > 0);
+
+ free(value);
+ context_history_record_destroy(record);
+ context_history_list_destroy(list);
+ }
+
error = context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS, filter, &list);
- SKIP_TEST(error, 2, 2, history_data_name[9]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ SKIP_TEST(error, 3, 3, history_data_name[11]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_get_current(list, &record);
value = NULL;
error = context_history_record_get_string(record, CONTEXT_HISTORY_ADDRESS, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert(strlen(value) > 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_IF_SUPPORTED(is_history_supported, strlen(value) > 0);
free(value);
context_history_record_destroy(record);
context_history_list_h list = NULL;
context_history_record_h record = NULL;
- error = context_history_get_list(handle, CONTEXT_HISTORY_RARELY_USED_APP, NULL, &list);
+ error = context_history_get_list(handle, CONTEXT_HISTORY_BATTERY_USAGE, NULL, &list);
SKIP_TEST(error, 1, 1, history_data_name[2]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_get_current(list, &record);
error = context_history_record_get_string(record, CONTEXT_HISTORY_APP_ID, NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
// Invalid record data type
- error = context_history_record_get_string(record, CONTEXT_HISTORY_TOTAL_COUNT, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ error = context_history_record_get_string(record, CONTEXT_HISTORY_TOTAL_AMOUNT, &value);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#ifdef MOBILE
// Invalid record key
error = context_history_record_get_string(record, CONTEXT_HISTORY_ADDRESS, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#endif //MOBILE
context_history_record_destroy(record);
context_history_list_destroy(list);
context_history_filter_create(&filter);
context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-#ifdef MOBILE
error = context_history_get_list(handle, CONTEXT_HISTORY_BATTERY_USAGE, filter, &list);
- SKIP_TEST(error, 1, 1, history_data_name[10]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ SKIP_TEST(error, 1, 1, history_data_name[2]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_get_current(list, &record);
value = -1;
error = context_history_record_get_double(record, CONTEXT_HISTORY_TOTAL_AMOUNT, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert_geq(value, 0);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_GEQ_IF_SUPPORTED(is_history_supported, value, 0);
context_history_record_destroy(record);
context_history_list_destroy(list);
}
-#endif //MOBILE
context_history_filter_destroy(filter);
context_history_list_h list = NULL;
context_history_record_h record = NULL;
-#ifdef MOBILE
error = context_history_get_list(handle, CONTEXT_HISTORY_BATTERY_USAGE, NULL, &list);
- SKIP_TEST(error, 1, 1, history_data_name[11]) else {
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ SKIP_TEST(error, 1, 1, history_data_name[2]) else {
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_get_current(list, &record);
error = context_history_record_get_double(record, CONTEXT_HISTORY_TOTAL_AMOUNT, NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
// Invalid record data type
error = context_history_record_get_double(record, CONTEXT_HISTORY_APP_ID, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#ifdef MOBILE
// Invalid record key
error = context_history_record_get_double(record, CONTEXT_HISTORY_HOUR_OF_DAY, &value);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+#endif //MOBILE
context_history_record_destroy(record);
context_history_list_destroy(list);
}
-#endif //MOBILE
return 0;
}
SKIP_TEST_CONTINUE(error, i + 1, NUM_HISTORY_DATA_TYPE, history_data_name[i]);
error = context_history_list_get_current(list, &record);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
- assert(record);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_IF_SUPPORTED(is_history_supported, record);
error = context_history_record_destroy(record);
- assert_eq(error, CONTEXT_HISTORY_ERROR_NONE);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_NONE);
context_history_list_destroy(list);
}
int error = CONTEXT_HISTORY_ERROR_NONE;
error = context_history_record_destroy(NULL);
- assert_eq(error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
+ HISTORY_ASSERT_EQ_WITH_CHECK_SUPPORTED(is_history_supported, error, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
return 0;
}