summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2022-10-05 10:19:23 -0400
committerAllen Winter <allen.winter@kdab.com>2022-10-05 10:19:23 -0400
commit7f5098b903e76333ca9ad21b0510826e7b863d6c (patch)
tree8eae7e0cba8303eca3e3c99271e412660c34dec9
parentb390988d5fdbbca078fc4d944b5acbf8a43f55a0 (diff)
downloadlibical-git-7f5098b903e76333ca9ad21b0510826e7b863d6c.tar.gz
src/test/regression.c - test_icalcomponent_with_lastmodified
-rw-r--r--src/test/regression.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/test/regression.c b/src/test/regression.c
index 9bce2f63..130cdbfa 100644
--- a/src/test/regression.c
+++ b/src/test/regression.c
@@ -4988,9 +4988,11 @@ void test_icaltime_as_timet(void)
void test_icalcomponent_with_lastmodified(void)
{
+ /* for https://github.com/libical/libical/issues/585 */
+
icalcomponent *comp;
struct icaltimetype lm = icaltime_from_timet_with_zone(1661280150, 0, NULL);
-
+#if 1
comp = icalcomponent_vanew(ICAL_VCALENDAR_COMPONENT,
icalproperty_new_version("2.0"),
icalproperty_new_prodid("PROD-ABC"),
@@ -4998,7 +5000,16 @@ void test_icalcomponent_with_lastmodified(void)
icalproperty_new_lastmodified(lm),
icalproperty_new_name("name1"),
0);
- free(comp);
+ icalcomponent_free(comp);
+#else
+ comp = icalcomponent_new(ICAL_VCALENDAR_COMPONENT);
+ icalcomponent_add_property(comp, icalproperty_new_version("2.0"));
+ icalcomponent_add_property(comp, icalproperty_new_prodid("PROD-ABC"));
+ icalcomponent_add_property(comp, icalproperty_new_uid("1234abcd"));
+ icalcomponent_add_property(comp, icalproperty_new_lastmodified(lm));
+ icalcomponent_add_property(comp, icalproperty_new_name("name1"));
+ icalcomponent_free(comp);
+#endif
}
int main(int argc, char *argv[])