diff options
author | Corentin Noël <corentin.noel@collabora.com> | 2022-09-05 11:08:15 +0200 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2022-10-04 16:14:23 -0400 |
commit | 537642936828ec21c1fb5543dfe85d9898ed9232 (patch) | |
tree | ab3d213a494e2b13de278ed6585d861f30d8f54a | |
parent | 265348a09e1e04f6209e24d5667948779d61bf96 (diff) | |
download | libical-git-537642936828ec21c1fb5543dfe85d9898ed9232.tar.gz |
libical-glib/recurrence: Return arrays with the right computed size.
Consumers of this API are expecting the array to already have the right size.
Do the work for them and return a well-size array.
-rw-r--r-- | src/libical-glib/api/i-cal-recurrence.xml | 99 | ||||
-rw-r--r-- | src/test/libical-glib/recurrence.py | 61 |
2 files changed, 99 insertions, 61 deletions
diff --git a/src/libical-glib/api/i-cal-recurrence.xml b/src/libical-glib/api/i-cal-recurrence.xml index ce019dd4..70dfe838 100644 --- a/src/libical-glib/api/i-cal-recurrence.xml +++ b/src/libical-glib/api/i-cal-recurrence.xml @@ -191,11 +191,18 @@ <method name="i_cal_recurrence_get_by_second_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_second of #ICalRecurrence."/> - <comment>Gets the by_second array from #ICalRecurrence. The array size if I_CAL_BY_SECOND_SIZE.</comment> + <comment>Gets the by_second array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_SECOND_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); array = g_array_new (FALSE, TRUE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_second, I_CAL_BY_SECOND_SIZE); + for (size = 0; size < I_CAL_BY_SECOND_SIZE; size++) { + if (native_recurrence->by_second[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_second, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_second_array" corresponds="CUSTOM" kind="set" since="1.0"> @@ -238,11 +245,18 @@ <method name="i_cal_recurrence_get_by_minute_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_minute of #ICalRecurrence."/> - <comment>Gets the by_minute array from #ICalRecurrence. The array size is I_CAL_BY_MINUTE_SIZE.</comment> + <comment>Gets the by_minute array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_MINUTE_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); array = g_array_new (FALSE, FALSE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_minute, I_CAL_BY_MINUTE_SIZE); + for (size = 0; size < I_CAL_BY_MINUTE_SIZE; size++) { + if (native_recurrence->by_minute[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_minute, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_minute_array" corresponds="CUSTOM" kind="set" since="1.0"> @@ -285,11 +299,18 @@ <method name="i_cal_recurrence_get_by_hour_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_hour of #ICalRecurrence."/> - <comment>Gets the by_hour array from #ICalRecurrence. The array size is I_CAL_BY_HOUR_SIZE.</comment> + <comment>Gets the by_hour array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_HOUR_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); array = g_array_new (FALSE, FALSE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_hour, I_CAL_BY_HOUR_SIZE); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); + for (size = 0; size < I_CAL_BY_HOUR_SIZE; size++) { + if (native_recurrence->by_hour[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_hour, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_hour_array" corresponds="CUSTOM" kind="set" since="1.0"> @@ -332,11 +353,18 @@ <method name="i_cal_recurrence_get_by_day_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_day of #ICalRecurrence."/> - <comment>Gets the by_day array from #ICalRecurrence. The array size is I_CAL_BY_DAY_SIZE.</comment> + <comment>Gets the by_day array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_DAY_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); array = g_array_new (FALSE, FALSE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_day, I_CAL_BY_DAY_SIZE); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); + for (size = 0; size < I_CAL_BY_DAY_SIZE; size++) { + if (native_recurrence->by_day[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_day, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_day_array" corresponds="CUSTOM" kind="set" since="1.0"> @@ -379,11 +407,18 @@ <method name="i_cal_recurrence_get_by_month_day_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_month_day of #ICalRecurrence."/> - <comment>Gets the by_month_day array from #ICalRecurrence. The array size is I_CAL_BY_MONTHDAY_SIZE.</comment> + <comment>Gets the by_month_day array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_MONTHDAY_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); array = g_array_new (FALSE, FALSE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_month_day, I_CAL_BY_MONTHDAY_SIZE); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); + for (size = 0; size < I_CAL_BY_MONTHDAY_SIZE; size++) { + if (native_recurrence->by_month_day[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_month_day, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_month_day_array" corresponds="CUSTOM" kind="set" since="1.0"> @@ -426,11 +461,18 @@ <method name="i_cal_recurrence_get_by_year_day_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_year_day of #ICalRecurrence."/> - <comment>Gets the by_year_day array from #ICalRecurrence. The array size is I_CAL_BY_YEARDAY_SIZE.</comment> + <comment>Gets the by_year_day array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_YEARDAY_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); array = g_array_new (FALSE, FALSE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_year_day, I_CAL_BY_YEARDAY_SIZE); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); + for (size = 0; size < I_CAL_BY_YEARDAY_SIZE; size++) { + if (native_recurrence->by_year_day[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_year_day, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_year_day_array" corresponds="CUSTOM" kind="set" since="1.0"> @@ -473,11 +515,18 @@ <method name="i_cal_recurrence_get_by_week_no_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_week_no of #ICalRecurrence."/> - <comment>Gets the by_week_no array from #ICalRecurrence. The array size is I_CAL_BY_WEEKNO_SIZE.</comment> + <comment>Gets the by_week_no array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_WEEKNO_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); array = g_array_new (FALSE, FALSE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_week_no, I_CAL_BY_WEEKNO_SIZE); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); + for (size = 0; size < I_CAL_BY_WEEKNO_SIZE; size++) { + if (native_recurrence->by_week_no[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_week_no, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_week_no_array" corresponds="CUSTOM" kind="set" since="1.0"> @@ -520,11 +569,18 @@ <method name="i_cal_recurrence_get_by_month_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_month of #ICalRecurrence."/> - <comment>Gets the by_month array from #ICalRecurrence. The array size is I_CAL_BY_MONTH_SIZE.</comment> + <comment>Gets the by_month array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_MONTH_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); array = g_array_new (FALSE, FALSE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_month, I_CAL_BY_MONTH_SIZE); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); + for (size = 0; size < I_CAL_BY_MONTH_SIZE; size++) { + if (native_recurrence->by_month[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_month, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_month_array" corresponds="CUSTOM" kind="set" since="1.0"> @@ -567,11 +623,18 @@ <method name="i_cal_recurrence_get_by_set_pos_array" corresponds="CUSTOM" kind="get" since="1.0"> <parameter type="ICalRecurrence *" name="recur" comment="The #ICalRecurrence"/> <returns type="GArray *" annotation="transfer full, element-type gshort" comment="The by_set_pos of #ICalRecurrence."/> - <comment>Gets the by_set_pos array from #ICalRecurrence. The array size is I_CAL_BY_SETPOS_SIZE.</comment> + <comment>Gets the by_set_pos array from #ICalRecurrence. The array has a maximum size of I_CAL_BY_SETPOS_SIZE.</comment> <custom> GArray *array; + struct icalrecurrencetype *native_recurrence; + guint size; g_return_val_if_fail (recur != NULL && I_CAL_IS_RECURRENCE (recur), NULL); array = g_array_new (FALSE, FALSE, sizeof (gshort)); - g_array_append_vals (array, ((struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur))->by_set_pos, I_CAL_BY_SETPOS_SIZE); + native_recurrence = (struct icalrecurrencetype *)i_cal_object_get_native ((ICalObject *)recur); + for (size = 0; size < I_CAL_BY_SETPOS_SIZE; size++) { + if (native_recurrence->by_set_pos[size] == I_CAL_RECURRENCE_ARRAY_MAX) + break; + } + g_array_append_vals (array, native_recurrence->by_set_pos, size); return array;</custom> </method> <method name="i_cal_recurrence_set_by_set_pos_array" corresponds="CUSTOM" kind="set" since="1.0"> diff --git a/src/test/libical-glib/recurrence.py b/src/test/libical-glib/recurrence.py index 5c2f5480..1d8a121f 100644 --- a/src/test/libical-glib/recurrence.py +++ b/src/test/libical-glib/recurrence.py @@ -48,38 +48,13 @@ string = "COUNT=10;FREQ=DAILY" recurrence = ICalGLib.Recurrence.new_from_string(string) assert recurrence.to_string() == "FREQ=DAILY;COUNT=10" -by_second = recurrence.get_by_second_array() -# The value is dependent on the libical version. -assert len(by_second) == 61 or len(by_second) == 62 -by_minute = recurrence.get_by_minute_array() -assert len(by_minute) == 61 -by_hour = recurrence.get_by_hour_array() -assert len(by_hour) == 25 -by_day = recurrence.get_by_day_array() -# The value is dependent on the libical version. -assert len(by_day) == 364 or len(by_day) == 386 -by_month_day = recurrence.get_by_month_day_array() -assert len(by_month_day) == 32 -by_year_day = recurrence.get_by_year_day_array() -# The value is dependent on the libical version. -assert len(by_year_day) == 367 or len(by_year_day) == 386 -by_week_no = recurrence.get_by_week_no_array() -# The value is dependent on the libical version. -assert len(by_week_no) == 54 or len(by_week_no) == 56 -by_month = recurrence.get_by_month_array() -# The value is dependent on the libical version. -assert len(by_month) == 13 or len(by_month) == 14 -by_set_pos = recurrence.get_by_set_pos_array() -# The value is dependent on the libical version. -assert len(by_set_pos) == 367 or len(by_set_pos) == 386 - recurrence.set_by_second(0, 1) recurrence.set_by_second(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) assert recurrence.get_by_second(0) == 1 assert recurrence.get_by_second(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_second_array() assert array[0] == 1 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [100, 101] assert len(array) == 2 recurrence.set_by_second_array(array) @@ -89,7 +64,7 @@ assert recurrence.get_by_second(2) == ICalGLib.RecurrenceArrayMaxValues.RECURREN array = recurrence.get_by_second_array() assert array[0] == 100 assert array[1] == 101 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_minute(0, 2) recurrence.set_by_minute(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) @@ -97,7 +72,7 @@ assert recurrence.get_by_minute(0) == 2 assert recurrence.get_by_minute(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_minute_array() assert array[0] == 2 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [200, 201] assert len(array) == 2 recurrence.set_by_minute_array(array) @@ -107,7 +82,7 @@ assert recurrence.get_by_minute(2) == ICalGLib.RecurrenceArrayMaxValues.RECURREN array = recurrence.get_by_minute_array() assert array[0] == 200 assert array[1] == 201 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_hour(0, 3) recurrence.set_by_hour(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) @@ -115,7 +90,7 @@ assert recurrence.get_by_hour(0) == 3 assert recurrence.get_by_hour(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_hour_array() assert array[0] == 3 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [300, 301] assert len(array) == 2 recurrence.set_by_hour_array(array) @@ -125,7 +100,7 @@ assert recurrence.get_by_hour(2) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE array = recurrence.get_by_hour_array() assert array[0] == 300 assert array[1] == 301 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_day(0, 4) recurrence.set_by_day(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) @@ -133,7 +108,7 @@ assert recurrence.get_by_day(0) == 4 assert recurrence.get_by_day(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_day_array() assert array[0] == 4 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [400, 401] assert len(array) == 2 recurrence.set_by_day_array(array) @@ -143,7 +118,7 @@ assert recurrence.get_by_day(2) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ array = recurrence.get_by_day_array() assert array[0] == 400 assert array[1] == 401 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_month_day(0, 5) recurrence.set_by_month_day(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) @@ -151,7 +126,7 @@ assert recurrence.get_by_month_day(0) == 5 assert recurrence.get_by_month_day(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_month_day_array() assert array[0] == 5 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [500, 501] assert len(array) == 2 recurrence.set_by_month_day_array(array) @@ -161,7 +136,7 @@ assert recurrence.get_by_month_day(2) == ICalGLib.RecurrenceArrayMaxValues.RECUR array = recurrence.get_by_month_day_array() assert array[0] == 500 assert array[1] == 501 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_year_day(0, 6) recurrence.set_by_year_day(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) @@ -169,7 +144,7 @@ assert recurrence.get_by_year_day(0) == 6 assert recurrence.get_by_year_day(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_year_day_array() assert array[0] == 6 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [600, 601] assert len(array) == 2 recurrence.set_by_year_day_array(array) @@ -179,7 +154,7 @@ assert recurrence.get_by_year_day(2) == ICalGLib.RecurrenceArrayMaxValues.RECURR array = recurrence.get_by_year_day_array() assert array[0] == 600 assert array[1] == 601 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_week_no(0, 7) recurrence.set_by_week_no(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) @@ -187,7 +162,7 @@ assert recurrence.get_by_week_no(0) == 7 assert recurrence.get_by_week_no(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_week_no_array() assert array[0] == 7 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [700, 701] assert len(array) == 2 recurrence.set_by_week_no_array(array) @@ -197,7 +172,7 @@ assert recurrence.get_by_week_no(2) == ICalGLib.RecurrenceArrayMaxValues.RECURRE array = recurrence.get_by_week_no_array() assert array[0] == 700 assert array[1] == 701 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_month(0, 8) recurrence.set_by_month(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) @@ -205,7 +180,7 @@ assert recurrence.get_by_month(0) == 8 assert recurrence.get_by_month(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_month_array() assert array[0] == 8 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [800, 801] assert len(array) == 2 recurrence.set_by_month_array(array) @@ -215,7 +190,7 @@ assert recurrence.get_by_month(2) == ICalGLib.RecurrenceArrayMaxValues.RECURRENC array = recurrence.get_by_month_array() assert array[0] == 800 assert array[1] == 801 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_set_pos(0, 9) recurrence.set_by_set_pos(1, ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX) @@ -223,7 +198,7 @@ assert recurrence.get_by_set_pos(0) == 9 assert recurrence.get_by_set_pos(1) == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX array = recurrence.get_by_set_pos_array() assert array[0] == 9 -assert array[1] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 1 array = [900, 901] assert len(array) == 2 recurrence.set_by_set_pos_array(array) @@ -233,7 +208,7 @@ assert recurrence.get_by_set_pos(2) == ICalGLib.RecurrenceArrayMaxValues.RECURRE array = recurrence.get_by_set_pos_array() assert array[0] == 900 assert array[1] == 901 -assert array[2] == ICalGLib.RecurrenceArrayMaxValues.RECURRENCE_ARRAY_MAX +assert len(array) == 2 recurrence.set_by_second(0, 13) by_second = recurrence.get_by_second_array() |