added unit-test for print_upcoming()
This commit is contained in:
parent
9bba31490b
commit
33d9fed0cf
@ -5,6 +5,9 @@ test_parse_ics_file:
|
|||||||
$(CC) $(CFLAGS) test_parse_ics_file.c ../src/parse_ics.c ../src/string_handling.c ../src/list_handling.c ../src/date_time_handling.c ../src/read_until_string.c ../src/read_until_nl.c -o test_parse_ics_file.out
|
$(CC) $(CFLAGS) test_parse_ics_file.c ../src/parse_ics.c ../src/string_handling.c ../src/list_handling.c ../src/date_time_handling.c ../src/read_until_string.c ../src/read_until_nl.c -o test_parse_ics_file.out
|
||||||
./test_parse_ics_file.out
|
./test_parse_ics_file.out
|
||||||
|
|
||||||
|
test_print_upcoming:
|
||||||
|
$(CC) $(CFLAGS) test_print_upcoming.c ../src/parse_ics.c ../src/string_handling.c ../src/list_handling.c ../src/date_time_handling.c ../src/read_until_string.c ../src/read_until_nl.c -o test_print_upcoming.out
|
||||||
|
|
||||||
.PHONY:clean
|
.PHONY:clean
|
||||||
clean:
|
clean:
|
||||||
-rm -vf *.out
|
-rm -vf *.out
|
||||||
|
14
unit-tests/test_print_upcoming.c
Normal file
14
unit-tests/test_print_upcoming.c
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "../src/list_handling.h"
|
||||||
|
#include "../src/parse_ics.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
// initialize empty list
|
||||||
|
struct event *head = NULL;
|
||||||
|
|
||||||
|
char *current_date = "20240710T103000";
|
||||||
|
|
||||||
|
parse_ics_file("/home/bf/.local/share/evolution/calendar/system/calendar.ics", &head);
|
||||||
|
|
||||||
|
print_upcoming(head, current_date, 0);
|
||||||
|
}
|
Reference in New Issue
Block a user