Commit Graph
6 Commits
Author SHA1 Message Date
Zelda Ahmed dbb786d0e8 tests/range: Add bug base URL
Every other unit test included a link to calendar's bug reporting except
test-range.c, so lets include that

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/820>
2026-08-29 10:48:24 +01:00
Niklas Wimmer b83a89a2e7 tests/range: Validate the compare function
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/798>
2026-07-22 14:13:36 +00:00
Georges Basile Stavracas Neto 6234566874 core/range: Compute and use timestamps for comparison
Using GDateTime utilities is costly and shows up high in profiling.
That's because GDateTime has to run timezone offset checks for every
comparison. We can amortize this cost by converting these datetimes
to unix timestamps upfront, and using them for comparisons.

A complication is date-only ranges, for which unix timestamps wouldn't
work. For this, add a new kind of timestamp that only accounts for the
dates.

Add a new test case for date-only comparison.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/770>
2026-06-13 23:22:01 +02:00
Sebastian Keller 44e2420645 range: Handle zero-length ranges when calculating overlap
Zero length ranges, such as for events without a DTEND could be
considered to overlap a range if they were at exactly the end of the
range. The end of a range however is the first date that is supposed to
not overlap, so a zero-length range on exactly this point should not be
considered overlapping.

This fixes cases where all-day events from the next month could show up
on the same day of the current month if they did not have a DTEND.

This also adds tests for all possible cases of such zero-length events
overlapping.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/701
2021-04-21 13:59:26 +00:00
Clarissa Borges f1d20126dc event: Add more range test cases
More examples of possible dates for events were added to the test cases.
Superset, subset, intersection and no overlap cases are covered.
2020-04-14 17:56:12 -03:00
Georges Basile Stavracas Neto dbfebc85fa Introduce GcalRange
GcalRange is a new structure that represents a time range. It is
always inclusive at the start, and exclusive at the end.
2020-04-14 19:08:05 +00:00