ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, daily");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, daily");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, daily");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, weekly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, weekly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, weekly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */
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--;
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, monthly");
now_t = time(NULL);
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--;
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, monthly");
now_t = time(NULL);
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--;
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, monthly");
now_t = time(NULL);
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--;
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, yearly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, yearly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, yearly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, once");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, once");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, once");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, daily");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, daily");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, daily");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */
struct tm now_s = {0};
/* localtime weekly */
+ DBG("add 1 min, weekly");
now_t = time(NULL);
now_t += 5;
now_t += 60; /* add 1 min */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, weekly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, weekly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, weekly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */
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--;
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, monthly");
now_t = time(NULL);
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--;
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, monthly");
now_t = time(NULL);
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--;
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, monthly");
now_t = time(NULL);
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--;
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 hour, yearly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60); /* add 1 hour */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 day, yearly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24); /* add 1 day */
ret = _delete_event(event_id);
assert_eq(ret, CALENDAR_ERROR_NONE);
+ DBG("add 1 week, yearly");
now_t = time(NULL);
now_t += 5;
now_t += (60 * 60 * 24 * 7); /* add 1 week */