{
g_startup_err = calendar_connect();
if (g_startup_err != CALENDAR_ERROR_NONE) {
- fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
- fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ if (CALENDAR_ERROR_NOT_SUPPORTED == g_startup_err
+ && false == _is_feature_supported()) {
+ g_startup_err = CALENDAR_ERROR_NONE;
+ } else {
+ fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+ fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ }
}
_clean_db();
}
int utc_calendar_db_insert_record_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_insert_record(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_insert_record_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_insert_record_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_insert_record(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_insert_record_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_insert_record_n_event();
int utc_calendar_db_get_record_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_record(NULL, 1, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_get_record_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_get_record_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_record(NULL, 1, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_record_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_record_n_event();
int utc_calendar_db_update_record_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_update_record(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_update_record_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_update_record_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_update_record(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_update_record_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_update_record_n_event();
int utc_calendar_db_delete_record_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_delete_record(NULL, 1);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_delete_record_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_delete_record_p_event();
int utc_calendar_db_delete_record_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_delete_record(NULL, 1);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_delete_record_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_delete_record_n_event();
int utc_calendar_db_get_all_records_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_all_records(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_get_all_records_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_get_all_records_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_all_records(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_all_records_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_all_records_n_event();
int utc_calendar_db_get_records_with_query_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_records_with_query(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_get_records_with_query_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_get_records_with_query_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_records_with_query(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_records_with_query_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_records_with_query_n_event();
int utc_calendar_db_get_count_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_count(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_get_count_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_get_count_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_count(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_count_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_count_n_event();
int utc_calendar_db_get_count_with_query_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_count_with_query(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_get_count_with_query_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_get_count_with_query_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_count_with_query(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_count_with_query_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_count_with_query_n_event();
int utc_calendar_db_insert_records_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_insert_records(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_insert_records_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_insert_records_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_insert_records(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_insert_records_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_insert_records_n_event();
int utc_calendar_db_update_records_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_update_records(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_update_records_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_update_records_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_update_records(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_update_records_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_update_records_n_event();
int utc_calendar_db_delete_records_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_delete_records(NULL, NULL, 1);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_delete_records_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_delete_records_p_event();
int utc_calendar_db_delete_records_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_delete_records(NULL, NULL, 1);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_delete_records_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_delete_records_n_event();
int utc_calendar_db_get_current_version_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_current_version(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_current_version_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_current_version_p_event();
int utc_calendar_db_get_current_version_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_current_version(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_current_version_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_current_version_n_event();
int utc_calendar_db_add_changed_cb_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_add_changed_cb(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_add_changed_cb_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_add_changed_cb_p_event();
int utc_calendar_db_add_changed_cb_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_add_changed_cb(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_add_changed_cb_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_add_changed_cb_n_event();
int utc_calendar_db_remove_changed_cb_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_remove_changed_cb(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_remove_changed_cb_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_remove_changed_cb_p_event();
int utc_calendar_db_remove_changed_cb_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_remove_changed_cb(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_remove_changed_cb_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_remove_changed_cb_n_event();
int utc_calendar_db_get_changes_by_version_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_changes_by_version(NULL, 0, 0, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_changes_by_version_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_changes_by_version_p_event();
int utc_calendar_db_get_changes_by_version_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_changes_by_version(NULL, 0, 0, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_changes_by_version_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_changes_by_version_n_event();
int utc_calendar_db_insert_vcalendars_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_insert_vcalendars(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_insert_vcalendars_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_insert_vcalendars_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_insert_vcalendars(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_insert_vcalendars_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_insert_vcalendars_n_event();
int utc_calendar_db_replace_vcalendars_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_replace_vcalendars(NULL, NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_replace_vcalendars_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_replace_vcalendars_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_replace_vcalendars(NULL, NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_replace_vcalendars_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_replace_vcalendars_n_event();
int utc_calendar_db_replace_record_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_replace_record(NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_replace_record_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_replace_record_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_replace_record(NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_replace_record_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_replace_record_n_event();
int utc_calendar_db_replace_records_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_replace_records(NULL, NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_clean_db();
ret = utc_calendar_db_replace_records_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_db_replace_records_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_replace_records(NULL, NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_replace_records_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_replace_records_n_event();
int utc_calendar_db_get_last_change_version_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_last_change_version(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_last_change_version_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_last_change_version_p_event();
int utc_calendar_db_get_last_change_version_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_last_change_version(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_last_change_version_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_last_change_version_n_event();
int utc_calendar_db_get_changes_exception_by_version_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_changes_exception_by_version(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_changes_exception_by_version_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_changes_exception_by_version_p_event();
int utc_calendar_db_get_changes_exception_by_version_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_get_changes_exception_by_version(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_get_changes_exception_by_version_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_get_changes_exception_by_version_n_event();
int utc_calendar_db_clean_after_sync_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_clean_after_sync(0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_clean_after_sync_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_clean_after_sync_p_event();
int utc_calendar_db_clean_after_sync_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_db_clean_after_sync(0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_db_clean_after_sync_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_db_clean_after_sync_n_event();
{
int ret = 0;
ret = utc_calendar_db_link_record_p_event();
- assert_eq(ret, CALENDAR_ERROR_NONE);
+ if (false == _is_feature_supported()) {
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ } else {
+ assert_eq(ret, CALENDAR_ERROR_NONE);
+ }
return 0;
}
{
int ret = 0;
ret = utc_calendar_db_link_record_n_event();
- assert_eq(ret, CALENDAR_ERROR_NONE);
+ if (false == _is_feature_supported()) {
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ } else {
+ assert_eq(ret, CALENDAR_ERROR_NONE);
+ }
return 0;
}
{
int ret = 0;
ret = utc_calendar_db_unlink_record_p_event();
- assert_eq(ret, CALENDAR_ERROR_NONE);
+ if (false == _is_feature_supported()) {
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ } else {
+ assert_eq(ret, CALENDAR_ERROR_NONE);
+ }
return 0;
}
{
int ret = 0;
ret = utc_calendar_db_unlink_record_n_event();
- assert_eq(ret, CALENDAR_ERROR_NONE);
+ if (false == _is_feature_supported()) {
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ } else {
+ assert_eq(ret, CALENDAR_ERROR_NONE);
+ }
return 0;
}
{
g_startup_err = calendar_connect();
if(g_startup_err != CALENDAR_ERROR_NONE) {
- fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
- fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ if (CALENDAR_ERROR_NOT_SUPPORTED == g_startup_err
+ && false == _is_feature_supported()) {
+ g_startup_err = CALENDAR_ERROR_NONE;
+ } else {
+ fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+ fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ }
}
}
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_create(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_filter_h filter = NULL;
ret = calendar_filter_create(_calendar_event._uri, &filter);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_create(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_filter_h filter = NULL;
// case 1
ret = calendar_filter_create(NULL, &filter);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_destroy(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_filter_h filter = NULL;
ret = calendar_filter_create(_calendar_event._uri, &filter);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_destroy(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_filter_destroy(NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_str(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
ret = calendar_record_create(_calendar_event._uri, &event);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_str(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
ret = calendar_filter_add_str(NULL, _calendar_event.summary, CALENDAR_MATCH_CONTAINS, UTC_STR_NEW_SUMMARY);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_int(NULL, 0, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
ret = calendar_record_create(_calendar_event._uri, &event);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_int(NULL, 0, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
ret = calendar_filter_add_int(NULL, _calendar_event.calendar_book_id, CALENDAR_MATCH_GREATER_THAN, DEFAULT_EVENT_CALENDAR_BOOK_ID);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_double(NULL, 0, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
ret = calendar_record_create(_calendar_event._uri, &event);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_double(NULL, 0, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
ret = calendar_filter_add_double(NULL, _calendar_event.latitude, CALENDAR_MATCH_CONTAINS, UTC_DOUBLE_NEW_LATITUDE);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_lli(NULL, 0, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
ret = calendar_record_create(_calendar_event._uri, &event);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_lli(NULL, 0, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
ret = calendar_filter_add_lli(NULL, _calendar_event.created_time, CALENDAR_MATCH_GREATER_THAN, 0);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ calendar_time_s t;
+ ret = calendar_filter_add_caltime(NULL, 0, 0, t);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
ret = calendar_record_create(_calendar_event._uri, &event);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ calendar_time_s t;
+ ret = calendar_filter_add_caltime(NULL, 0, 0, t);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
calendar_time_s st = {0};
ret = calendar_filter_add_caltime(NULL, _calendar_event.start_time, CALENDAR_MATCH_GREATER_THAN, st);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_filter(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_filter_h filter = NULL;
ret = calendar_filter_create(_calendar_event._uri, &filter);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_filter(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_filter_h filter = NULL;
// case 1
ret = calendar_filter_add_filter(NULL, filter);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_operator(NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_filter_h filter = NULL;
ret = calendar_filter_create(_calendar_event._uri, &filter);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_filter_add_operator(NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
ret = calendar_filter_add_operator(NULL, CALENDAR_FILTER_OPERATOR_AND);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
{
g_startup_err = calendar_connect();
if(g_startup_err != CALENDAR_ERROR_NONE) {
- fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
- fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ if (CALENDAR_ERROR_NOT_SUPPORTED == g_startup_err
+ && false == _is_feature_supported()) {
+ g_startup_err = CALENDAR_ERROR_NONE;
+ } else {
+ fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+ fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ }
}
}
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_create(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_list_h list = NULL;
ret = calendar_list_create(&list);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_create(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_list_create(NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_destroy(NULL, true);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_list_h list = NULL;
ret = calendar_list_create(&list);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_destroy(NULL, true);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_list_destroy(NULL, true);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_get_count(NULL, true);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
calendar_record_create(_calendar_event._uri, &event);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_get_count(NULL, true);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
int count = 0;
ret = calendar_list_get_count(NULL, &count);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_add(NULL, true);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
calendar_record_create(_calendar_event._uri, &event);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_add(NULL, true);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
calendar_record_h record = NULL;
ret = calendar_list_add(NULL, record);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_remove(NULL, true);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
calendar_record_create(_calendar_event._uri, &event);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_remove(NULL, true);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
calendar_record_h record = NULL;
ret = calendar_list_remove(NULL, record);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_get_current_record_p(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_record_h event = NULL;
ret = calendar_record_create(_calendar_event._uri, &event);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_get_current_record_p(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
calendar_record_h event = NULL;
ret = calendar_list_get_current_record_p(NULL, &event);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_prev(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_list_h list = NULL;
ret = calendar_list_create(&list);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_prev(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_list_prev(NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_next(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_list_h list = NULL;
ret = calendar_list_create(&list);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_next(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_list_next(NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_first(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_list_h list = NULL;
ret = calendar_list_create(&list);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_first(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_list_first(NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_last(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_list_h list = NULL;
ret = calendar_list_create(&list);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_list_last(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_list_last(NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
{
g_startup_err = calendar_connect();
if (g_startup_err != CALENDAR_ERROR_NONE) {
- fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
- fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ if (CALENDAR_ERROR_NOT_SUPPORTED == g_startup_err
+ && false == _is_feature_supported()) {
+ g_startup_err = CALENDAR_ERROR_NONE;
+ } else {
+ fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+ fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ }
}
}
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_create(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_query_h query = NULL;
ret = calendar_query_create(_calendar_event._uri, &query);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_create(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_query_h query = NULL;
// case 1
ret = calendar_query_create(NULL, &query);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_destroy(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_query_h query = NULL;
ret = calendar_query_create(_calendar_event._uri, &query);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_destroy(NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_query_destroy(NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_set_projection(NULL, NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = _set_projection_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = _set_projection_p_event();
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_set_projection(NULL, NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_query_h query = NULL;
unsigned int projection[] = {
_calendar_event.summary,
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_set_distinct(NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_query_h query = NULL;
ret = calendar_query_create(_calendar_event._uri, &query);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_set_distinct(NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_query_set_distinct(NULL, true);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_set_filter(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_query_h query = NULL;
ret = calendar_query_create(_calendar_event._uri, &query);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_set_filter(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
calendar_filter_h filter = NULL;
ret = calendar_query_set_filter(NULL, filter);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_set_sort(NULL, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
calendar_query_h query = NULL;
ret = calendar_query_create(_calendar_event._uri, &query);
assert_eq(ret, CALENDAR_ERROR_NONE);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_query_set_sort(NULL, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_query_set_sort(NULL, _calendar_event.start_time, true);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
{
g_startup_err = calendar_connect();
if(g_startup_err != CALENDAR_ERROR_NONE) {
- fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
- fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ if (CALENDAR_ERROR_NOT_SUPPORTED == g_startup_err
+ && false == _is_feature_supported()) {
+ g_startup_err = CALENDAR_ERROR_NONE;
+ } else {
+ fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+ fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ }
}
}
{
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_create(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_create_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_create_p_event();
{
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_create(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_create_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_create_n_event();
{
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_destroy(NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_destroy_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_destroy_p_event();
{
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_destroy(NULL, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_destroy_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_destroy_n_event();
int utc_calendar_record_clone_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_destroy(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_clone_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_clone_p_event();
int utc_calendar_record_clone_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_destroy(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_clone_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_clone_n_event();
int utc_calendar_record_get_uri_p_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_uri_p(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_uri_p_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_uri_p_p_event();
int utc_calendar_record_get_uri_p_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_uri_p(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_uri_p_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_uri_p_n_event();
int utc_calendar_record_get_str_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_str(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_str_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_str_p_event();
int utc_calendar_record_get_str_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_str(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_str_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_str_n_event();
int utc_calendar_record_get_str_p_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_str_p(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_str_p_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_str_p_p_event();
int utc_calendar_record_get_str_p_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_str_p(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_str_p_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_str_p_n_event();
int utc_calendar_record_get_int_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_int(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_int_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_int_p_event();
int utc_calendar_record_get_int_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_int(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_int_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_int_n_event();
int utc_calendar_record_get_double_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_double(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_double_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_double_p_event();
int utc_calendar_record_get_double_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_double(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_double_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_double_n_event();
int utc_calendar_record_get_lli_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_lli(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_lli_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_lli_p_event();
int utc_calendar_record_get_lli_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_lli(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_lli_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_lli_n_event();
int utc_calendar_record_get_caltime_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_caltime(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_caltime_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_caltime_p_event();
int utc_calendar_record_get_caltime_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_caltime(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_caltime_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_caltime_n_event();
int utc_calendar_record_set_str_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_set_str(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_str_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_str_p_event();
int utc_calendar_record_set_str_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_set_str(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_str_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_str_n_event();
int utc_calendar_record_set_int_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_set_int(NULL, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_int_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_int_p_event();
int utc_calendar_record_set_int_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_set_int(NULL, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_int_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_int_n_event();
int utc_calendar_record_set_double_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_set_double(NULL, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_double_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_double_p_event();
int utc_calendar_record_set_double_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_set_double(NULL, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_double_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_double_n_event();
int utc_calendar_record_set_lli_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_set_lli(NULL, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_lli_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_lli_p_event();
int utc_calendar_record_set_lli_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_set_lli(NULL, 0, 0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_lli_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_lli_n_event();
int utc_calendar_record_set_caltime_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ calendar_time_s t;
+ ret = calendar_record_set_caltime(NULL, 0, t);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_caltime_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_caltime_p_event();
int utc_calendar_record_set_caltime_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ calendar_time_s t;
+ ret = calendar_record_set_caltime(NULL, 0, t);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_set_caltime_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_set_caltime_n_event();
int utc_calendar_record_add_child_record_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_add_child_record(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_add_child_record_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_add_child_record_p_event();
int utc_calendar_record_add_child_record_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_add_child_record(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_add_child_record_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_add_child_record_n_event();
int utc_calendar_record_remove_child_record_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_remove_child_record(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_remove_child_record_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_remove_child_record_p_event();
int utc_calendar_record_remove_child_record_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_remove_child_record(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_remove_child_record_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_remove_child_record_n_event();
int utc_calendar_record_get_child_record_count_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_child_record_count(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_child_record_count_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_child_record_count_p_event();
int utc_calendar_record_get_child_record_count_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_child_record_count(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_child_record_count_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_child_record_count_n_event();
int utc_calendar_record_get_child_record_at_p_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_child_record_at_p(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_child_record_at_p_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_child_record_at_p_p_event();
int utc_calendar_record_get_child_record_at_p_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_get_child_record_at_p(NULL, 0, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_get_child_record_at_p_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_get_child_record_at_p_n_event();
int utc_calendar_record_clone_child_record_list_p(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_clone_child_record_list(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_clone_child_record_list_p_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_clone_child_record_list_p_event();
int utc_calendar_record_clone_child_record_list_n(void)
{
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_record_clone_child_record_list(NULL, 0, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = utc_calendar_record_clone_child_record_list_n_book();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = utc_calendar_record_clone_child_record_list_n_event();
{
g_startup_err = calendar_connect();
if (g_startup_err != CALENDAR_ERROR_NONE) {
- fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
- fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ if (CALENDAR_ERROR_NOT_SUPPORTED == g_startup_err
+ && false == _is_feature_supported()) {
+ g_startup_err = CALENDAR_ERROR_NONE;
+ } else {
+ fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+ fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ }
}
_clean_db();
}
int ret = 0;
int event_id = 0;
calendar_record_h event = NULL;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_connect();
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
_create_event(&event);
ret = calendar_db_insert_record(event, &event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
{
g_startup_err = calendar_connect();
if(g_startup_err != CALENDAR_ERROR_NONE) {
- fprintf(stderr, "Startup error at %s:%d", __FILE__, __LINE__);
- fprintf(stderr, "calendar_connect failed (code: %d)", g_startup_err);
+ if (CALENDAR_ERROR_NOT_SUPPORTED == g_startup_err
+ && false == _is_feature_supported()) {
+ g_startup_err = CALENDAR_ERROR_NONE;
+ } else {
+ fprintf(stderr, "Startup error at %s:%d", __FILE__, __LINE__);
+ fprintf(stderr, "calendar_connect failed (code: %d)", g_startup_err);
+ }
}
_clean_db();
}
int event_id = 0;
time_t now_t = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
now_t = time(NULL);
now_t += 5;
now_t += 60; /* add 1 min */
int event_id = 0;
time_t now_t = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
DBG("add 1 min, daily");
now_t = time(NULL);
now_t += 5;
int event_id = 0;
time_t now_t = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
DBG("add 1 min, weekly");
now_t = time(NULL);
now_t += 5;
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
DBG("add 1 min, monthly");
now_t = time(NULL);
now_t += 5;
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
DBG("add 1 min, yearly");
now_t = time(NULL);
now_t += 5;
int event_id = 0;
time_t now_t = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
now_t = time(NULL);
now_t += 5; /* add 5 secs */
ret = _add_reminder_utime_in_event((int64_t)now_t, CALENDAR_ALARM_TIME_UNIT_SPECIFIC,
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
DBG("add 1 hour, once");
now_t = time(NULL);
now_t += 5;
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
DBG("add 1 min, daily");
now_t = time(NULL);
now_t += 5;
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
/* localtime weekly */
DBG("add 1 min, weekly");
now_t = time(NULL);
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
DBG("add 1 min, monthly");
now_t = time(NULL);
now_t += 5;
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
DBG("add 1 min, yearly");
now_t = time(NULL);
now_t += 5;
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
now_t = time(NULL);
now_t += 5; /* add 5 secs */
localtime_r(&now_t, &now_s);
int todo_id = 0;
time_t now_t = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
now_t = time(NULL);
now_t += 5;
now_t += 60; /* add 1 min */
time_t now_t = 0;
struct tm now_s = {0};
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
now_t = time(NULL);
now_t += 5;
now_t += 60; /* add 1 hour */
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_add_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_reminder_add_cb(NULL, NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return CALENDAR_ERROR_NONE;
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_remove_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_reminder_add_cb(_reminder_cb, NULL);
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = calendar_reminder_remove_cb(_reminder_cb, NULL);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_reminder_remove_cb(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_reminder_remove_cb(NULL, NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);
return 0;
*/
int utc_calendar_connect_p(void)
{
+ int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_connect();
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// nomal case
- int ret = calendar_connect();
+ ret = calendar_connect();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = calendar_disconnect();
*/
int utc_calendar_disconnect_p(void)
{
- int ret = calendar_connect();
+ int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_disconnect();
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ ret = calendar_connect();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = calendar_disconnect();
*/
int utc_calendar_connect_on_thread_p(void)
{
+ int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_connect_on_thread();
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// normal case
- int ret = calendar_connect_on_thread();
+ ret = calendar_connect_on_thread();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = calendar_disconnect_on_thread();
*/
int utc_calendar_disconnect_on_thread_p(void)
{
- int ret = calendar_connect_on_thread();
+ int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_disconnect_on_thread();
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ ret = calendar_connect_on_thread();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = calendar_disconnect_on_thread();
*/
int utc_calendar_connect_with_flags_p(void)
{
- int ret = calendar_connect_with_flags(CALENDAR_CONNECT_FLAG_RETRY);
+ int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_connect_with_flags(0);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ ret = calendar_connect_with_flags(CALENDAR_CONNECT_FLAG_RETRY);
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = calendar_disconnect();
#include <calendar.h>
#include "utc-calendar-util.h"
+#include "utc-calendar-debug.h"
void _clean_db_book(void)
{
memset(ct, 0x0, sizeof(calendar_time_s));
return ret;
}
+
+bool _is_feature_supported(void)
+{
+ int ret = 0;
+ static bool has_feature = false;
+
+ ret = system_info_get_platform_bool(UTC_CALENDAR_FEATURE, &has_feature);
+ if (SYSTEM_INFO_ERROR_NONE != ret)
+ return false;
+ if (false == has_feature) {
+ DBG("feature is not supported");
+ }
+
+ return has_feature;
+}
#include <dlog.h>
#define UTC_HIDDEN __attribute__ ((visibility("hidden")))
-
+#define UTC_CALENDAR_FEATURE "http://tizen.org/feature/calendar"
#define UTC_CALENDAR_INSERT_COUNT 1
int _check_double(double *d, const double value);
int _check_lli(long long int *l, const long long int value);
int _check_caltime(calendar_time_s *ct, calendar_time_s value);
+bool _is_feature_supported(void);
#endif /* __UTC_CALENDAR_UTIL_H__ */
{
g_startup_err = calendar_connect();
if(g_startup_err != CALENDAR_ERROR_NONE) {
- fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
- fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ if (CALENDAR_ERROR_NOT_SUPPORTED == g_startup_err
+ && false == _is_feature_supported()) {
+ g_startup_err = CALENDAR_ERROR_NONE;
+ } else {
+ fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__);
+ fprintf(stderr, "calendar_connect failed (code: %d)\n", g_startup_err);
+ }
}
_clean_db();
int ret = 0;
char *stream = NULL;
+ if (false == _is_feature_supported()) {
+ ret = calendar_vcalendar_make_from_records(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
/* 1st make */
ret = _make_stream_01(&stream);
assert_eq(ret, 0);
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_vcalendar_make_from_records(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
calendar_list_h list = NULL;
ret = calendar_list_create(&list);
int utc_calendar_vcalendar_parse_to_calendar_p(void)
{
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
-
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_vcalendar_parse_to_calendar(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = _parse_ver10_alarm_fields();
assert_eq(ret, CALENDAR_ERROR_NONE);
ret = _parse_ver10_extention_fields();
int utc_calendar_vcalendar_parse_to_calendar_n(void)
{
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
-
int ret = 0;
+
+ if (false == _is_feature_supported()) {
+ ret = calendar_vcalendar_parse_to_calendar(NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
const char *stream = "BEGIN:VCALENDAR\r\n"
"VERSION:2.0\r\n"
"PRODID:-//hacksw/handcal//NONSGML v1.0//EN\r\n"
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_vcalendar_parse_to_calendar_foreach(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
ret = calendar_vcalendar_parse_to_calendar_foreach(ics_path, __utc_calendar_service2_vcalendar_cb, NULL);
assert_eq(ret, CALENDAR_ERROR_NONE);
int utc_calendar_vcalendar_parse_to_calendar_foreach_n(void)
{
assert_eq(g_startup_err, CALENDAR_ERROR_NONE);
-
int ret = 0;
+ if (false == _is_feature_supported()) {
+ ret = calendar_vcalendar_parse_to_calendar_foreach(NULL, NULL, NULL);
+ assert_eq(ret, CALENDAR_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
// case 1
ret = calendar_vcalendar_parse_to_calendar_foreach(ics_path, NULL, NULL);
assert_eq(ret, CALENDAR_ERROR_INVALID_PARAMETER);