added first unit test
This commit is contained in:
parent
ad344b03ac
commit
c4fc332419
10
unit-tests/README.md
Normal file
10
unit-tests/README.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
For unit test `test_parse_ics.c`.
|
||||||
|
|
||||||
|
compilation command:
|
||||||
|
```
|
||||||
|
gcc -Wall test_parse_ics.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
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
./a.out
|
||||||
|
```
|
BIN
unit-tests/a.out
Executable file
BIN
unit-tests/a.out
Executable file
Binary file not shown.
12
unit-tests/test_parse_ics.c
Normal file
12
unit-tests/test_parse_ics.c
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#include "../src/list_handling.h"
|
||||||
|
#include "../src/parse_ics.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
// initialize empty list
|
||||||
|
struct event *head = NULL;
|
||||||
|
|
||||||
|
parse_ics_file("../tests/calendar.ics", &head);
|
||||||
|
|
||||||
|
print_list(head);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user