leapc
Loading...
Searching...
No Matches
leap_from_test.c
1#include "leap.h"
2
3#include <assert.h>
4#include <stdlib.h>
5
6int leap_from_test(int argc, char **argv) {
7 (void)argc;
8 (void)argv;
9
10 assert(equal_leap_date((struct leap_date){2024, 1, 1}, leap_date_from_off(leap_from(2024, 1, 1))));
11 assert(equal_leap_date((struct leap_date){2023, 12, 1}, leap_date_from_off(leap_from(2024, 0, 1))));
12 assert(equal_leap_date((struct leap_date){2023, 11, 30}, leap_date_from_off(leap_from(2024, 0, 0))));
13
14 return EXIT_SUCCESS;
15}
Leap year function prototypes.
struct leap_off leap_from(int year, int month, int day)
Day from year, month and day of month.
Definition leap.c:129
static struct leap_date leap_date_from_off(struct leap_off off)
Date from leap offset.
Definition leap.h:218
static bool equal_leap_date(struct leap_date lhs, struct leap_date rhs)
Compares two leap_date structures for equality.
Definition leap.h:193
Leap year date structure.
Definition leap.h:163