[UTC][calendar-service][ACR-1057][Add calendar feature]
authorJeesun Kim <iamjs.kim@samsung.com>
Mon, 28 Aug 2017 05:35:32 +0000 (14:35 +0900)
committerJihun Park <jihun87.park@samsung.com>
Tue, 17 Oct 2017 02:13:50 +0000 (02:13 +0000)
Change-Id: Ib9bb225d316bd7d822392c942349f81352ea4f6e

src/utc/calendar-service2/utc-calendar-db.c
src/utc/calendar-service2/utc-calendar-filter.c
src/utc/calendar-service2/utc-calendar-list.c
src/utc/calendar-service2/utc-calendar-query.c
src/utc/calendar-service2/utc-calendar-record.c
src/utc/calendar-service2/utc-calendar-recurrence.c
src/utc/calendar-service2/utc-calendar-reminder.c
src/utc/calendar-service2/utc-calendar-service.c
src/utc/calendar-service2/utc-calendar-util.c
src/utc/calendar-service2/utc-calendar-util.h
src/utc/calendar-service2/utc-calendar-vcalendar.c

index 50ebe82..292f25f 100755 (executable)
@@ -35,8 +35,13 @@ void utc_calendar_db_startup(void)
 {
        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();
 }
@@ -61,6 +66,13 @@ void utc_calendar_db_cleanup(void)
 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);
@@ -111,6 +123,13 @@ int utc_calendar_db_insert_record_p(void)
 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();
@@ -150,6 +169,13 @@ int utc_calendar_db_insert_record_n(void)
 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);
@@ -200,6 +226,13 @@ int utc_calendar_db_get_record_p(void)
 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();
@@ -239,6 +272,13 @@ int utc_calendar_db_get_record_n(void)
 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);
@@ -289,6 +329,13 @@ int utc_calendar_db_update_record_p(void)
 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();
@@ -328,6 +375,13 @@ int utc_calendar_db_update_record_n(void)
 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();
@@ -367,6 +421,13 @@ int utc_calendar_db_delete_record_p(void)
 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();
@@ -406,6 +467,13 @@ int utc_calendar_db_delete_record_n(void)
 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);
@@ -456,6 +524,13 @@ int utc_calendar_db_get_all_records_p(void)
 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();
@@ -495,6 +570,13 @@ int utc_calendar_db_get_all_records_n(void)
 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);
@@ -545,6 +627,13 @@ int utc_calendar_db_get_records_with_query_p(void)
 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();
@@ -584,6 +673,13 @@ int utc_calendar_db_get_records_with_query_n(void)
 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);
@@ -634,6 +730,13 @@ int utc_calendar_db_get_count_p(void)
 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();
@@ -673,6 +776,13 @@ int utc_calendar_db_get_count_n(void)
 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);
@@ -725,6 +835,13 @@ int utc_calendar_db_get_count_with_query_p(void)
 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();
@@ -764,6 +881,13 @@ int utc_calendar_db_get_count_with_query_n(void)
 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);
@@ -814,6 +938,13 @@ int utc_calendar_db_insert_records_p(void)
 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();
@@ -853,6 +984,13 @@ int utc_calendar_db_insert_records_n(void)
 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);
@@ -903,6 +1041,13 @@ int utc_calendar_db_update_records_p(void)
 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();
@@ -942,6 +1087,13 @@ int utc_calendar_db_update_records_n(void)
 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();
@@ -981,6 +1133,13 @@ int utc_calendar_db_delete_records_p(void)
 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();
@@ -1020,6 +1179,13 @@ int utc_calendar_db_delete_records_n(void)
 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();
@@ -1059,6 +1225,13 @@ int utc_calendar_db_get_current_version_p(void)
 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();
@@ -1098,6 +1271,13 @@ int utc_calendar_db_get_current_version_n(void)
 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();
@@ -1137,6 +1317,13 @@ int utc_calendar_db_add_changed_cb_p(void)
 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();
@@ -1176,6 +1363,13 @@ int utc_calendar_db_add_changed_cb_n(void)
 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();
@@ -1215,6 +1409,13 @@ int utc_calendar_db_remove_changed_cb_p(void)
 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();
@@ -1254,6 +1455,13 @@ int utc_calendar_db_remove_changed_cb_n(void)
 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();
@@ -1293,6 +1501,13 @@ int utc_calendar_db_get_changes_by_version_p(void)
 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();
@@ -1332,6 +1547,13 @@ int utc_calendar_db_get_changes_by_version_n(void)
 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);
@@ -1382,6 +1604,13 @@ int utc_calendar_db_insert_vcalendars_p(void)
 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();
@@ -1421,6 +1650,13 @@ int utc_calendar_db_insert_vcalendars_n(void)
 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);
@@ -1471,6 +1707,13 @@ int utc_calendar_db_replace_vcalendars_p(void)
 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();
@@ -1510,6 +1753,13 @@ int utc_calendar_db_replace_vcalendars_n(void)
 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);
@@ -1560,6 +1810,13 @@ int utc_calendar_db_replace_record_p(void)
 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();
@@ -1599,6 +1856,13 @@ int utc_calendar_db_replace_record_n(void)
 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);
@@ -1649,6 +1913,13 @@ int utc_calendar_db_replace_records_p(void)
 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();
@@ -1688,6 +1959,13 @@ int utc_calendar_db_replace_records_n(void)
 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();
@@ -1727,6 +2005,13 @@ int utc_calendar_db_get_last_change_version_p(void)
 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();
@@ -1767,6 +2052,13 @@ int utc_calendar_db_get_last_change_version_n(void)
 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();
@@ -1806,6 +2098,13 @@ int utc_calendar_db_get_changes_exception_by_version_p(void)
 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();
@@ -1845,6 +2144,13 @@ int utc_calendar_db_get_changes_exception_by_version_n(void)
 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();
@@ -1884,6 +2190,13 @@ int utc_calendar_db_clean_after_sync_p(void)
 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();
@@ -1924,7 +2237,11 @@ int utc_calendar_db_link_record_p(void)
 {
        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;
 }
 
@@ -1937,7 +2254,11 @@ int utc_calendar_db_link_record_n(void)
 {
        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;
 }
 
@@ -1950,7 +2271,11 @@ int utc_calendar_db_unlink_record_p(void)
 {
        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;
 }
 
@@ -1963,7 +2288,11 @@ int utc_calendar_db_unlink_record_n(void)
 {
        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;
 }
 
index 0a288a1..5339ac1 100755 (executable)
@@ -35,8 +35,13 @@ void utc_calendar_filter_startup(void)
 {
     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);
+               }
     }
 }
 
@@ -61,6 +66,12 @@ int utc_calendar_filter_create_p(void)
        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);
@@ -83,6 +94,12 @@ int utc_calendar_filter_create_n(void)
        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);
@@ -104,6 +121,12 @@ int utc_calendar_filter_destroy_p(void)
        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);
@@ -123,6 +146,12 @@ int utc_calendar_filter_destroy_n(void)
        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;
@@ -138,6 +167,12 @@ int utc_calendar_filter_add_str_p(void)
     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);
@@ -286,6 +321,12 @@ int utc_calendar_filter_add_str_n(void)
        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);
@@ -318,6 +359,12 @@ int utc_calendar_filter_add_int_p(void)
     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);
@@ -478,6 +525,12 @@ int utc_calendar_filter_add_int_n(void)
        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);
@@ -506,6 +559,12 @@ int utc_calendar_filter_add_double_p(void)
     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);
@@ -669,6 +728,12 @@ int utc_calendar_filter_add_double_n(void)
        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);
@@ -696,6 +761,12 @@ int utc_calendar_filter_add_lli_p(void)
     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);
@@ -859,6 +930,12 @@ int utc_calendar_filter_add_lli_n(void)
        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);
@@ -887,6 +964,13 @@ int utc_calendar_filter_add_caltime_p(void)
     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);
@@ -1052,6 +1136,13 @@ int utc_calendar_filter_add_caltime_n(void)
        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);
@@ -1081,6 +1172,12 @@ int utc_calendar_filter_add_filter_p(void)
        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);
@@ -1114,6 +1211,12 @@ int utc_calendar_filter_add_filter_n(void)
        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);
@@ -1136,6 +1239,12 @@ int utc_calendar_filter_add_operator_p(void)
        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);
@@ -1166,6 +1275,12 @@ int utc_calendar_filter_add_operator_n(void)
        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);
index a9e6d63..3a59b69 100755 (executable)
@@ -35,8 +35,13 @@ void utc_calendar_list_startup(void)
 {
     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);
+               }
     }
 }
 
@@ -61,6 +66,12 @@ int utc_calendar_list_create_p(void)
     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);
@@ -83,6 +94,12 @@ int utc_calendar_list_create_n(void)
     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;
@@ -98,6 +115,12 @@ int utc_calendar_list_destroy_p(void)
     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);
@@ -117,6 +140,12 @@ int utc_calendar_list_destroy_n(void)
     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;
@@ -132,6 +161,12 @@ int utc_calendar_list_get_count_p(void)
     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);
 
@@ -174,6 +209,12 @@ int utc_calendar_list_get_count_n(void)
     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);
@@ -196,6 +237,12 @@ int utc_calendar_list_add_p(void)
     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);
 
@@ -239,6 +286,12 @@ int utc_calendar_list_add_n(void)
     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);
@@ -261,6 +314,12 @@ int utc_calendar_list_remove_p(void)
     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);
 
@@ -309,6 +368,12 @@ int utc_calendar_list_remove_n(void)
     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);
@@ -331,6 +396,12 @@ int utc_calendar_list_get_current_record_p_p(void)
     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);
@@ -381,6 +452,12 @@ int utc_calendar_list_get_current_record_p_n(void)
     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);
@@ -403,6 +480,12 @@ int utc_calendar_list_prev_p(void)
     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);
@@ -489,6 +572,12 @@ int utc_calendar_list_prev_n(void)
     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;
@@ -504,6 +593,12 @@ int utc_calendar_list_next_p(void)
     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);
@@ -590,6 +685,12 @@ int utc_calendar_list_next_n(void)
     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;
@@ -605,6 +706,12 @@ int utc_calendar_list_first_p(void)
     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);
@@ -684,6 +791,12 @@ int utc_calendar_list_first_n(void)
     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;
@@ -699,6 +812,12 @@ int utc_calendar_list_last_p(void)
     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);
@@ -778,6 +897,12 @@ int utc_calendar_list_last_n(void)
     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;
index ba57db3..612c725 100755 (executable)
@@ -41,8 +41,13 @@ void utc_calendar_query_startup(void)
 {
     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);
+               }
     }
 }
 
@@ -67,6 +72,12 @@ int utc_calendar_query_create_p(void)
        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);
@@ -89,6 +100,12 @@ int utc_calendar_query_create_n(void)
        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);
@@ -110,6 +127,12 @@ int utc_calendar_query_destroy_p(void)
        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);
@@ -129,6 +152,12 @@ int utc_calendar_query_destroy_n(void)
        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;
@@ -983,6 +1012,12 @@ int utc_calendar_query_set_projection_p(void)
        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();
@@ -1023,6 +1058,12 @@ int utc_calendar_query_set_projection_n(void)
        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,
@@ -1053,6 +1094,12 @@ int utc_calendar_query_set_distinct_p(void)
        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);
@@ -1074,6 +1121,12 @@ int utc_calendar_query_set_distinct_n(void)
        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;
@@ -1089,6 +1142,12 @@ int utc_calendar_query_set_filter_p(void)
        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);
@@ -1129,6 +1188,12 @@ int utc_calendar_query_set_filter_n(void)
        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);
@@ -1151,6 +1216,12 @@ int utc_calendar_query_set_sort_p(void)
        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);
@@ -1198,6 +1269,12 @@ int utc_calendar_query_set_sort_n(void)
        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;
index b5b8bc4..37d46ef 100755 (executable)
@@ -50,8 +50,13 @@ void utc_calendar_record_startup(void)
 {
     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);
+               }
     }
 }
 
@@ -75,6 +80,12 @@ int utc_calendar_record_create_p(void)
 {
        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();
@@ -117,6 +128,12 @@ int utc_calendar_record_create_n(void)
 {
        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();
@@ -159,6 +176,12 @@ int utc_calendar_record_destroy_p(void)
 {
        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();
@@ -201,6 +224,12 @@ int utc_calendar_record_destroy_n(void)
 {
        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();
@@ -242,6 +271,13 @@ int utc_calendar_record_destroy_n(void)
 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();
@@ -283,6 +319,13 @@ int utc_calendar_record_clone_p(void)
 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();
@@ -324,6 +367,13 @@ int utc_calendar_record_clone_n(void)
 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();
@@ -363,6 +413,13 @@ int utc_calendar_record_get_uri_p_p(void)
 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();
@@ -402,6 +459,13 @@ int utc_calendar_record_get_uri_p_n(void)
 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();
@@ -441,6 +505,13 @@ int utc_calendar_record_get_str_p(void)
 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();
@@ -480,6 +551,13 @@ int utc_calendar_record_get_str_n(void)
 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();
@@ -519,6 +597,13 @@ int utc_calendar_record_get_str_p_p(void)
 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();
@@ -558,6 +643,13 @@ int utc_calendar_record_get_str_p_n(void)
 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();
@@ -599,6 +691,13 @@ int utc_calendar_record_get_int_p(void)
 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();
@@ -640,6 +739,13 @@ int utc_calendar_record_get_int_n(void)
 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();
@@ -679,6 +785,13 @@ int utc_calendar_record_get_double_p(void)
 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();
@@ -718,6 +831,13 @@ int utc_calendar_record_get_double_n(void)
 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();
@@ -757,6 +877,13 @@ int utc_calendar_record_get_lli_p(void)
 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();
@@ -796,6 +923,13 @@ int utc_calendar_record_get_lli_n(void)
 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();
@@ -835,6 +969,13 @@ int utc_calendar_record_get_caltime_p(void)
 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();
@@ -874,6 +1015,13 @@ int utc_calendar_record_get_caltime_n(void)
 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();
@@ -913,6 +1061,13 @@ int utc_calendar_record_set_str_p(void)
 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();
@@ -952,6 +1107,13 @@ int utc_calendar_record_set_str_n(void)
 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();
@@ -991,6 +1153,13 @@ int utc_calendar_record_set_int_p(void)
 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();
@@ -1030,6 +1199,13 @@ int utc_calendar_record_set_int_n(void)
 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();
@@ -1069,6 +1245,13 @@ int utc_calendar_record_set_double_p(void)
 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();
@@ -1108,6 +1291,13 @@ int utc_calendar_record_set_double_n(void)
 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();
@@ -1147,6 +1337,13 @@ int utc_calendar_record_set_lli_p(void)
 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();
@@ -1186,6 +1383,14 @@ int utc_calendar_record_set_lli_n(void)
 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();
@@ -1225,6 +1430,14 @@ int utc_calendar_record_set_caltime_p(void)
 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();
@@ -1264,6 +1477,13 @@ int utc_calendar_record_set_caltime_n(void)
 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();
@@ -1303,6 +1523,13 @@ int utc_calendar_record_add_child_record_p(void)
 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();
@@ -1342,6 +1569,13 @@ int utc_calendar_record_add_child_record_n(void)
 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();
@@ -1381,6 +1615,13 @@ int utc_calendar_record_remove_child_record_p(void)
 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();
@@ -1420,6 +1661,13 @@ int utc_calendar_record_remove_child_record_n(void)
 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();
@@ -1459,6 +1707,13 @@ int utc_calendar_record_get_child_record_count_p(void)
 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();
@@ -1498,6 +1753,13 @@ int utc_calendar_record_get_child_record_count_n(void)
 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();
@@ -1537,6 +1799,13 @@ int utc_calendar_record_get_child_record_at_p_p(void)
 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();
@@ -1576,6 +1845,13 @@ int utc_calendar_record_get_child_record_at_p_n(void)
 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();
@@ -1615,6 +1891,13 @@ int utc_calendar_record_clone_child_record_list_p(void)
 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();
index a61e21e..6c2dd97 100755 (executable)
@@ -36,8 +36,13 @@ void utc_calendar_recurrence_startup(void)
 {
        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();
 }
@@ -264,6 +269,13 @@ int utc_calendar_recurrence_p(void)
        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);
index f7f63b4..1bdd122 100755 (executable)
@@ -38,8 +38,13 @@ void utc_calendar_reminder_startup(void)
 {
        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();
 }
@@ -398,6 +403,12 @@ int utc_calendar_reminder_add_cb_utime_once_p(void)
        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 */
@@ -451,6 +462,12 @@ int utc_calendar_reminder_add_cb_utime_daily_p(void)
        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;
@@ -512,6 +529,12 @@ int utc_calendar_reminder_add_cb_utime_weekly_p(void)
        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;
@@ -574,6 +597,12 @@ int utc_calendar_reminder_add_cb_utime_monthly_p(void)
        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;
@@ -672,6 +701,12 @@ int utc_calendar_reminder_add_cb_utime_yearly_p(void)
        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;
@@ -741,6 +776,12 @@ int utc_calendar_reminder_add_cb_utime_specific_p(void)
        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,
@@ -767,6 +808,12 @@ int utc_calendar_reminder_add_cb_localtime_once_p(void)
        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;
@@ -829,6 +876,12 @@ int utc_calendar_reminder_add_cb_localtime_daily_p(void)
        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;
@@ -895,6 +948,12 @@ int utc_calendar_reminder_add_cb_localtime_weekly_p(void)
        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);
@@ -962,6 +1021,12 @@ int utc_calendar_reminder_add_cb_localtime_monthly_p(void)
        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;
@@ -1056,6 +1121,12 @@ int utc_calendar_reminder_add_cb_localtime_yearly_p(void)
        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;
@@ -1122,6 +1193,12 @@ int utc_calendar_reminder_add_cb_localtime_specific_p(void)
        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);
@@ -1148,6 +1225,12 @@ int utc_calendar_reminder_add_cb_todo_utime_once_p(void)
        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 */
@@ -1175,6 +1258,12 @@ int utc_calendar_reminder_add_cb_todo_localtime_once_p(void)
        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 */
@@ -1198,6 +1287,12 @@ int utc_calendar_reminder_add_cb_n(void)
        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;
@@ -1213,6 +1308,12 @@ int utc_calendar_reminder_remove_cb_p(void)
        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);
@@ -1230,6 +1331,12 @@ int utc_calendar_reminder_remove_cb_n(void)
        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;
index 5e7e16d..27292b9 100755 (executable)
  */
 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();
@@ -64,7 +72,15 @@ int utc_calendar_connect_p(void)
  */
 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();
@@ -80,8 +96,16 @@ int utc_calendar_disconnect_p(void)
  */
 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();
@@ -116,7 +140,15 @@ int utc_calendar_connect_on_thread_p(void)
  */
 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();
@@ -132,7 +164,15 @@ int utc_calendar_disconnect_on_thread_p(void)
  */
 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();
index defe8d4..29f4518 100755 (executable)
@@ -20,6 +20,7 @@
 #include <calendar.h>
 
 #include "utc-calendar-util.h"
+#include "utc-calendar-debug.h"
 
 void _clean_db_book(void)
 {
@@ -250,3 +251,18 @@ int _check_caltime(calendar_time_s *ct, calendar_time_s value)
        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;
+}
index 2242fad..98adc6c 100755 (executable)
@@ -20,7 +20,7 @@
 #include <dlog.h>
 
 #define UTC_HIDDEN __attribute__ ((visibility("hidden")))
-
+#define UTC_CALENDAR_FEATURE "http://tizen.org/feature/calendar"
 
 #define UTC_CALENDAR_INSERT_COUNT  1
 
@@ -258,6 +258,7 @@ int _check_int(int *i, const int value);
 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__ */
 
index 47252a7..3776d61 100755 (executable)
@@ -55,8 +55,13 @@ void utc_calendar_vcalendar_startup(void)
 {
        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();
 
@@ -476,6 +481,12 @@ int utc_calendar_vcalendar_make_from_records_p(void)
        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);
@@ -520,6 +531,12 @@ int utc_calendar_vcalendar_make_from_records_n(void)
        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);
@@ -1632,9 +1649,14 @@ static int _parse_ver20_yearly_byday(void)
 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();
@@ -1713,8 +1735,14 @@ int utc_calendar_vcalendar_parse_to_calendar_p(void)
 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"
@@ -1755,6 +1783,12 @@ int utc_calendar_vcalendar_parse_to_calendar_foreach_p(void)
 
        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);
 
@@ -1769,9 +1803,14 @@ int utc_calendar_vcalendar_parse_to_calendar_foreach_p(void)
 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);