app_control_destroy(hAppControl);
return 1;
}
-
+
if(g_bUserDataMismatch_alarm)
{
FPRINTF("[Line : %d][%s] User data in callback is not same which is passed through caller function.\\n", __LINE__, API_NAMESPACE);
//Target API
int nRet = alarm_get_current_time(&stdate);
PRINT_RESULT(ALARM_ERROR_NONE, nRet, "alarm_get_current_time", AlarmGetError(nRet));
-
+
if(stdate.tm_sec < 0)
{
FPRINTF("[Line : %d][%s] alarm_get_current_time returned invalid time\\n", __LINE__, API_NAMESPACE);
}
//& type: auto
-//& purpose:Sets and Gets global flag in the alarm.
+//& purpose:Sets and Gets global flag in the alarm.
/**
* @testcase ITc_alarm_set_get_global_p
* @since_tizen 3.0
nRet = app_control_set_app_id(hAppControl, pszPackage);
PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_app_id", AppControlGetError(nRet), app_control_destroy(hAppControl));
- int nAlarmID;
+ int nAlarmID;
int nDelay = 1;
nRet = alarm_schedule_after_delay(hAppControl, nDelay,nDelay, &nAlarmID);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_once_after_delay", AlarmGetError(nRet), app_control_destroy(hAppControl));
return 1;
}
- nRet = alarm_set_global(nAlarmID, bSetGlobal);
+ nRet = alarm_set_global(nAlarmID, bSetGlobal);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_set_global", AlarmGetError(nRet), alarm_cancel(nAlarmID);app_control_destroy(hAppControl));
-
- nRet = alarm_get_global(nAlarmID, &bGetGlobal);
+
+ nRet = alarm_get_global(nAlarmID, &bGetGlobal);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_get_global", AlarmGetError(nRet), alarm_cancel(nAlarmID);app_control_destroy(hAppControl));
-
+
if(bSetGlobal != bGetGlobal)
{
FPRINTF("[Line : %d][%s] value mismatch\\n", __LINE__, API_NAMESPACE);
app_control_destroy(hAppControl);
return 1;
}
-
+
nRet = alarm_cancel(nAlarmID);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_cancel", AlarmGetError(nRet), app_control_destroy(hAppControl));
nRet = app_control_destroy(hAppControl);
PRINT_RESULT_NORETURN(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet));
-
+
return 0;
}
time_t t;
notification_h hNoti = NULL;
int alarmId = -1;
-
+
time(&t);
t += 10;
localtime_r(&t, &stdate);
-
+
hNoti = notification_create(NOTIFICATION_TYPE_NOTI);
CHECK_HANDLE(hNoti,"notification_create");
-
+
int nRet = notification_set_text(hNoti, NOTIFICATION_TEXT_TYPE_TITLE, "notification alarm", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
PRINT_RESULT_CLEANUP(NOTIFICATION_ERROR_NONE, nRet, "notification_set_text", AlarmGetError(nRet), notification_free(hNoti));
-
+
//Target API
nRet = alarm_schedule_noti_once_at_date(hNoti, &stdate, &alarmId);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_noti_once_at_date", AlarmGetError(nRet), notification_free(hNoti));
-
+
if(stdate.tm_sec < 0 || alarmId < 0)
{
FPRINTF("[Line : %d][%s] alarm_schedule_noti_once_at_date returned invalid output parameter\\n", __LINE__, API_NAMESPACE);
notification_free(hNoti);
alarm_cancel_all();
-
+
return 0;
}
int alarmId = -1;
int nDelay = 1;
int nPeriod = 1;
-
+
hNoti = notification_create(NOTIFICATION_TYPE_NOTI);
CHECK_HANDLE(hNoti,"notification_create");
-
+
int nRet = notification_set_text(hNoti, NOTIFICATION_TEXT_TYPE_TITLE, "notification alarm", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
PRINT_RESULT_CLEANUP(NOTIFICATION_ERROR_NONE, nRet, "notification_set_text", AlarmGetError(nRet), notification_free(hNoti));
-
+
//Target API
nRet = alarm_schedule_noti_after_delay(hNoti, nDelay, nPeriod, &alarmId);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_noti_after_delay", AlarmGetError(nRet), notification_free(hNoti));
-
+
if(alarmId < 0)
{
FPRINTF("[Line : %d][%s] alarm_schedule_noti_after_delay returned invalid output parameter\\n", __LINE__, API_NAMESPACE);
notification_free(hNoti);
alarm_cancel_all();
-
+
return 0;
}
notification_h hNoti = NULL;
int alarmId = -1;
int nDelay = 1;
-
+
hNoti = notification_create(NOTIFICATION_TYPE_NOTI);
CHECK_HANDLE(hNoti,"notification_create");
-
+
int nRet = notification_set_text(hNoti, NOTIFICATION_TEXT_TYPE_TITLE, "notification alarm", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
PRINT_RESULT_CLEANUP(NOTIFICATION_ERROR_NONE, nRet, "notification_set_text", AlarmGetError(nRet), notification_free(hNoti));
-
+
//Target API
nRet = alarm_schedule_noti_once_after_delay(hNoti, nDelay, &alarmId);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_noti_once_after_delay", AlarmGetError(nRet), notification_free(hNoti));
-
+
if(alarmId < 0)
{
FPRINTF("[Line : %d][%s] alarm_schedule_noti_once_after_delay returned invalid output parameter\\n", __LINE__, API_NAMESPACE);
notification_free(hNoti);
alarm_cancel_all();
-
+
return 0;
}
time_t t;
notification_h hNoti = NULL;
int alarmId = -1;
-
+
time(&t);
localtime_r(&t, &stdate);
stdate.tm_sec += 5;
-
+
hNoti = notification_create(NOTIFICATION_TYPE_NOTI);
CHECK_HANDLE(hNoti,"notification_create");
-
+
int nRet = notification_set_text(hNoti, NOTIFICATION_TEXT_TYPE_TITLE, "notification alarm", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
PRINT_RESULT_CLEANUP(NOTIFICATION_ERROR_NONE, nRet, "notification_set_text", AlarmGetError(nRet), notification_free(hNoti));
-
+
//Target API
nRet = alarm_schedule_noti_with_recurrence_week_flag(hNoti, &stdate, ALARM_WEEK_FLAG_TUESDAY, &alarmId);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_noti_with_recurrence_week_flag", AlarmGetError(nRet), notification_free(hNoti));
-
+
if( alarmId < 0)
{
FPRINTF("[Line : %d][%s] alarm_schedule_noti_with_recurrence_week_flag returned invalid output parameter\\n", __LINE__, API_NAMESPACE);
notification_free(hNoti);
alarm_cancel_all();
-
+
return 0;
}
int nDelay = 1;
int nPeriod = 1;
char *pszText = NULL;
-
+
hNoti = notification_create(NOTIFICATION_TYPE_NOTI);
CHECK_HANDLE(hNoti,"notification_create");
-
+
int nRet = notification_set_text(hNoti, NOTIFICATION_TEXT_TYPE_TITLE, "notification alarm", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
PRINT_RESULT_CLEANUP(NOTIFICATION_ERROR_NONE, nRet, "notification_set_text", AlarmGetError(nRet), notification_free(hNoti));
-
+
//Target API
nRet = alarm_schedule_noti_after_delay(hNoti, nDelay, nPeriod, &alarmId);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_noti_after_delay", AlarmGetError(nRet), notification_free(hNoti));
-
+
if(alarmId < 0)
{
FPRINTF("[Line : %d][%s] alarm_schedule_noti_after_delay returned invalid output parameter\\n", __LINE__, API_NAMESPACE);
nRet = alarm_get_notification(alarmId, &hNotiRet);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_get_notification", AlarmGetError(nRet), notification_free(hNoti));
CHECK_HANDLE(hNotiRet,"alarm_get_notification");
-
+
nRet = notification_get_text(hNotiRet, NOTIFICATION_TEXT_TYPE_TITLE, &pszText);
PRINT_RESULT_CLEANUP(NOTIFICATION_ERROR_NONE, nRet, "notification_get_text", AlarmGetError(nRet), notification_free(hNoti));
if(strcmp(pszText, "notification alarm") != 0)
notification_free(hNoti);
return 1;
}
-
+
notification_free(hNoti);
alarm_cancel_all();
-
+
return 0;
}
nRet = alarm_update_delay(nAlarmID, nPeriod);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_update_delay", AlarmGetError(nRet), alarm_cancel(nAlarmID);app_control_destroy(hAppControl));
-
+
nRet = alarm_cancel(nAlarmID);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_cancel", AlarmGetError(nRet), app_control_destroy(hAppControl));
nRet = app_control_destroy(hAppControl);
PRINT_RESULT_NORETURN(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet));
-
+
return 0;
}
localtime_r(&tNow, &stDate1);
tNow += 10;
localtime_r(&tNow, &stDate2);
-
+
nRet = app_control_create(&hAppControl);
PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet));
nRet = app_control_destroy(hAppControl);
PRINT_RESULT_NORETURN(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet));
-
+
return 0;
}
nRet = app_control_destroy(hAppControl);
PRINT_RESULT_NORETURN(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet));
-
+
return 0;
}
nRet = alarm_update_week_flag(nAlarmID, ALARM_WEEK_FLAG_TUESDAY);
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_update_week_flag", AlarmGetError(nRet), alarm_cancel(nAlarmID);app_control_destroy(hAppControl));
-
+
nRet = alarm_cancel_all();
PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_cancel_all", AlarmGetError(nRet), app_control_destroy(hAppControl));
nRet = app_control_destroy(hAppControl);
PRINT_RESULT_NORETURN(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet));
-
+
return 0;
}