diff options
Diffstat (limited to 'src/test/regression.c')
-rw-r--r-- | src/test/regression.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/test/regression.c b/src/test/regression.c index 957b9c26..9bce2f63 100644 --- a/src/test/regression.c +++ b/src/test/regression.c @@ -4963,8 +4963,8 @@ static void test_comma_in_xproperty(void) icalcomponent_free(c); } -void test_icaltime_as_timet(void) { - +void test_icaltime_as_timet(void) +{ ok("icaltime_from_string translates 19020101T000000Z to -2145916800", icaltime_as_timet(icaltime_from_string("19020101T000000Z")) == -2145916800); ok("icaltime_from_string translates 19290519T000000Z to -1281916800", icaltime_as_timet(icaltime_from_string("19290519T000000Z")) == -1281916800); ok("icaltime_from_string translates 19561004T000000Z to -417916800", icaltime_as_timet(icaltime_from_string("19561004T000000Z")) == -417916800); @@ -4986,6 +4986,21 @@ void test_icaltime_as_timet(void) { #endif } +void test_icalcomponent_with_lastmodified(void) +{ + icalcomponent *comp; + struct icaltimetype lm = icaltime_from_timet_with_zone(1661280150, 0, NULL); + + comp = icalcomponent_vanew(ICAL_VCALENDAR_COMPONENT, + icalproperty_new_version("2.0"), + icalproperty_new_prodid("PROD-ABC"), + icalproperty_new_uid("1234abcd"), + icalproperty_new_lastmodified(lm), + icalproperty_new_name("name1"), + 0); + free(comp); +} + int main(int argc, char *argv[]) { #if !defined(HAVE_UNISTD_H) @@ -5130,6 +5145,7 @@ int main(int argc, char *argv[]) test_run("Test icalvalue resets timezone on set", test_icalvalue_resets_timezone_on_set, do_test, do_header); test_run("Test removing TZID from DUE with icalcomponent_set_due", test_remove_tzid_from_due, do_test, do_header); test_run("Test commas in x-property", test_comma_in_xproperty, do_test, do_header); + test_run("Test icalcomponent_vanew with lastmodified property", test_icalcomponent_with_lastmodified, do_test, do_header); /** OPTIONAL TESTS go here... **/ |