aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src/test/recur.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@src.gnome.org>2001-01-24 03:20:44 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-01-24 03:20:44 +0800
commitfd279723663879e742e53d7b3503248f6af91791 (patch)
tree09233c88d6c42b5bb324be7c64a8f8c64ff02846 /libical/src/test/recur.c
parent34bcd381ce1985cc762a896f15d427e368af95e5 (diff)
downloadgsoc2013-evolution-fd279723663879e742e53d7b3503248f6af91791.tar
gsoc2013-evolution-fd279723663879e742e53d7b3503248f6af91791.tar.gz
gsoc2013-evolution-fd279723663879e742e53d7b3503248f6af91791.tar.bz2
gsoc2013-evolution-fd279723663879e742e53d7b3503248f6af91791.tar.lz
gsoc2013-evolution-fd279723663879e742e53d7b3503248f6af91791.tar.xz
gsoc2013-evolution-fd279723663879e742e53d7b3503248f6af91791.tar.zst
gsoc2013-evolution-fd279723663879e742e53d7b3503248f6af91791.zip
This commit was generated by cvs2svn to compensate for changes in r7747,
which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=7748
Diffstat (limited to 'libical/src/test/recur.c')
-rw-r--r--libical/src/test/recur.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/libical/src/test/recur.c b/libical/src/test/recur.c
index 2967ee7977..546cacb007 100644
--- a/libical/src/test/recur.c
+++ b/libical/src/test/recur.c
@@ -23,10 +23,6 @@
the License for the specific language governing rights and
limitations under the License.
- The original author is Eric Busboom
- The original code is usecases.c
-
-
======================================================================*/
#include "ical.h"
@@ -48,23 +44,39 @@ int main(int argc, char *argv[])
struct icalrecurrencetype recur;
icalrecur_iterator* ritr;
time_t tt;
+ char* file;
+
+ if (argc <= 1){
+ file = "../../test-data/recur.txt";
+ } else if (argc == 2){
+ file = argv[1];
+ } else {
+ fprintf(stderr,"usage: recur [input file]\n");
+ exit(1);
+ }
+
+ cin = icalfileset_new(file);
+
+ if(cin == 0){
+ fprintf(stderr,"recur: can't open file %s\n",file);
+ exit(1);
+ }
- cin = icalfileset_new(argv[1]);
- assert(cin != 0);
for (itr = icalfileset_get_first_component(cin);
itr != 0;
itr = icalfileset_get_next_component(cin)){
desc = icalcomponent_get_first_property(itr,ICAL_DESCRIPTION_PROPERTY);
- assert(desc !=0);
-
dtstart = icalcomponent_get_first_property(itr,ICAL_DTSTART_PROPERTY);
- assert(dtstart !=0);
-
rrule = icalcomponent_get_first_property(itr,ICAL_RRULE_PROPERTY);
- assert(rrule !=0);
+ if (desc == 0 || dtstart == 0 || rrule == 0){
+ printf("\n******** Error in input component ********\n");
+ printf("The following component is malformed:\n %s\n",
+ icalcomponent_as_ical_string(itr));
+ continue;
+ }
recur = icalproperty_get_rrule(rrule);
start = icalproperty_get_dtstart(dtstart);