]> Pileus Git - lackey/commitdiff
Make testing code build time configurable
authorAndy Spencer <andy753421@gmail.com>
Sun, 16 Jun 2013 21:05:26 +0000 (21:05 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 16 Jun 2013 21:05:26 +0000 (21:05 +0000)
cals/ical.c
config.mk.example
src/cal.c
src/date.c
views/events.c

index 2862e725b0328f1fb16dd2e6b785c7597762f7a1..981d08dc3b29c6951c71c812f0a5e978722d193b 100644 (file)
@@ -372,8 +372,8 @@ void ical_test(void)
        icalarray_free(array);
 
        /* Print */
-       //ical_printr(comp, 0);
-       //print_events(events);
+       ical_printr(comp, 0);
+       print_events(events);
        print_todos(todos);
 
        (void)print_events;
index 1c23c708be11fc5fb42f696902c9f06d2f764fe6..72d298a0d1a30f3c6d62c146ddc1a15875651dcc 100644 (file)
@@ -1,5 +1,5 @@
 PREFIX  ?= /usr
-CFLAGS  ?= -g -Wall -Werror --std=c99
+CFLAGS  ?= -g -Wall -Werror --std=c99 -DDEBUG_CALS
 
 default: all run-lackey
 #default: all run-test
index 62b21ac8dd0d2c9426cfe9d2a4bb31c2e288ea82..565432c0571b78bceaa20cf40f938861ee60c515 100644 (file)
--- a/src/cal.c
+++ b/src/cal.c
@@ -112,6 +112,7 @@ void cal_init(void)
        cal_load(YEAR, MONTH, DAY, 1);
 
        /* Debug */
+#ifdef DEBUG_CALS
        for (event_t *e = EVENTS; e; e = e->next)
                debug("event: %04d-%02d-%02d %02d:%02d: %s - %s",
                                e->start.year, e->start.month, e->start.day,
@@ -120,6 +121,7 @@ void cal_init(void)
                debug("todo: %04d-%02d-%02d %02d:%02d: %s - %s",
                                e->start.year, e->start.month, e->start.day,
                                e->start.hour, e->start.min, e->name, e->desc);
+#endif
 }
 
 /* Load events and todos */
@@ -170,12 +172,14 @@ void cal_load(year_t year, month_t month, day_t day, int days)
                 ical_todos(start, end));
 
        /* Verify events and todos*/
-       //for (event_t *cur = EVENTS; cur; cur = cur->next)
-       //      if (!cur->cal)
-       //              error("Missing cal in event '%s'", cur->name);
-       //for (todo_t *cur = TODOS; cur; cur = cur->next)
-       //      if (!cur->cal)
-       //              error("Missing cal in todo '%s'", cur->name);
+#ifdef DEBUG_CALS
+       for (event_t *cur = EVENTS; cur; cur = cur->next)
+               if (!cur->cal)
+                       error("Missing cal in event '%s'", cur->name);
+       for (todo_t *cur = TODOS; cur; cur = cur->next)
+               if (!cur->cal)
+                       error("Missing cal in todo '%s'", cur->name);
+#endif
 }
 
 /* Config parser */
index 22104967bc7c214738794926ffa6214bdfd1a920..f1719289088a9d19d68190a9d9c4502395a8d08c 100644 (file)
@@ -36,11 +36,6 @@ void date_init(void)
        YEAR  = tm->tm_year+1900;
        MONTH = tm->tm_mon;
        DAY   = tm->tm_mday-1;
-
-       /* Testing */
-       //YEAR  = 2008;
-       //MONTH = OCT;
-       //DAY   = 21;
 }
 
 /* Time functions */
index e254ffbf6805b1e6003131d0f97de087f2efc732..56d6aab9c144ba4f26585887b2137d7a539d5fd4 100644 (file)
@@ -15,8 +15,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define DEBUG
-
 #include <ncurses.h>
 
 #include "util.h"