[UTC][calendar-service2][Non-ACR][rules out monthly test when date is 1st]
authorJeesun Kim <iamjs.kim@samsung.com>
Tue, 1 Aug 2017 08:08:18 +0000 (17:08 +0900)
committerJihun Park <jihun87.park@samsung.com>
Wed, 2 Aug 2017 01:16:34 +0000 (01:16 +0000)
Signed-off-by: Jeesun Kim <iamjs.kim@samsung.com>
Change-Id: I9a6d6d20e0fc7b766fb979308dfe2e38e10bb2ed

src/utc/calendar-service2/utc-calendar-reminder.c

index d2eeaca..6141a9a 100755 (executable)
@@ -570,7 +570,7 @@ int utc_calendar_reminder_add_cb_utime_monthly_p(void)
        now_t += 5;
        now_t += 60;                                    /* add 1 min */
        localtime_r(&now_t, &now_s);
-       if (28 < now_s.tm_mday)                 /* if mday goes over 28, alarm needs more params */
+       if (now_s.tm_mday < 2 || 28 < now_s.tm_mday)                    /* if mday goes over 28, alarm needs more params */
                return 0;
        if (0 == now_s.tm_mon) { /* Jan */
                now_s.tm_year--;
@@ -589,7 +589,7 @@ int utc_calendar_reminder_add_cb_utime_monthly_p(void)
        now_t += 5;
        now_t += (60 * 60);                             /* add 1 hour */
        localtime_r(&now_t, &now_s);
-       if (28 < now_s.tm_mday)                 /* if mday goes over 28, alarm needs more params */
+       if (now_s.tm_mday < 2 || 28 < now_s.tm_mday)                    /* if mday goes over 28, alarm needs more params */
                return 0;
        if (0 == now_s.tm_mon) { /* Jan */
                now_s.tm_year--;
@@ -608,7 +608,7 @@ int utc_calendar_reminder_add_cb_utime_monthly_p(void)
        now_t += 5;
        now_t += (60 * 60 * 24);                /* add 1 day */
        localtime_r(&now_t, &now_s);
-       if (28 < now_s.tm_mday)                 /* if mday goes over 28, alarm needs more params */
+       if (now_s.tm_mday < 2 || 28 < now_s.tm_mday)                    /* if mday goes over 28, alarm needs more params */
                return 0;
        if (0 == now_s.tm_mon) { /* Jan */
                now_s.tm_year--;
@@ -627,7 +627,7 @@ int utc_calendar_reminder_add_cb_utime_monthly_p(void)
        now_t += 5;
        now_t += (60 * 60 * 24 * 7);    /* add 1 week */
        localtime_r(&now_t, &now_s);
-       if (28 < now_s.tm_mday)                 /* if mday goes over 28, alarm needs more params */
+       if (now_s.tm_mday < 2 || 28 < now_s.tm_mday)                    /* if mday goes over 28, alarm needs more params */
                return 0;
        if (0 == now_s.tm_mon) { /* Jan */
                now_s.tm_year--;
@@ -938,7 +938,7 @@ int utc_calendar_reminder_add_cb_localtime_monthly_p(void)
        now_t += 5;
        now_t += 60;                                    /* add 1 min */
        localtime_r(&now_t, &now_s);
-       if (28 < now_s.tm_mday)                 /* if mday goes over 28, alarm needs more params */
+       if (now_s.tm_mday < 2 || 28 < now_s.tm_mday)                    /* if mday goes over 28, alarm needs more params */
                return 0;
        if (0 == now_s.tm_mon) { /* Jan */
                now_s.tm_year--;
@@ -956,7 +956,7 @@ int utc_calendar_reminder_add_cb_localtime_monthly_p(void)
        now_t += 5;
        now_t += (60 * 60);                             /* add 1 hour */
        localtime_r(&now_t, &now_s);
-       if (28 < now_s.tm_mday)                 /* if mday goes over 28, alarm needs more params */
+       if (now_s.tm_mday < 2 || 28 < now_s.tm_mday)                    /* if mday goes over 28, alarm needs more params */
                return 0;
        if (0 == now_s.tm_mon) { /* Jan */
                now_s.tm_year--;
@@ -974,7 +974,7 @@ int utc_calendar_reminder_add_cb_localtime_monthly_p(void)
        now_t += 5;
        now_t += (60 * 60 * 24);                /* add 1 day */
        localtime_r(&now_t, &now_s);
-       if (28 < now_s.tm_mday)                 /* if mday goes over 28, alarm needs more params */
+       if (now_s.tm_mday < 2 || 28 < now_s.tm_mday)                    /* if mday goes over 28, alarm needs more params */
                return 0;
        if (0 == now_s.tm_mon) { /* Jan */
                now_s.tm_year--;
@@ -992,7 +992,7 @@ int utc_calendar_reminder_add_cb_localtime_monthly_p(void)
        now_t += 5;
        now_t += (60 * 60 * 24 * 7);    /* add 1 week */
        localtime_r(&now_t, &now_s);
-       if (28 < now_s.tm_mday)                 /* if mday goes over 28, alarm needs more params */
+       if (now_s.tm_mday < 2 || 28 < now_s.tm_mday)                    /* if mday goes over 28, alarm needs more params */
                return 0;
        if (0 == now_s.tm_mon) { /* Jan */
                now_s.tm_year--;