Skip to content

Commit

Permalink
time: fix unix in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Aug 7, 2024
1 parent b2a8226 commit ea88d42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/time/time.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typedef struct {

typedef struct {
int year, month, day, hour, min, sec, nsec, offset_sec;
int64_t unix;
int64_t epoch;
} DateTest;

static DateTest date_tests[] = {
Expand Down Expand Up @@ -80,7 +80,7 @@ static void test_date(void) {
DateTest test = date_tests[i];
Time t = time_date(test.year, test.month, test.day, test.hour, test.min, test.sec,
test.nsec, test.offset_sec);
assert(time_to_unix(t) == test.unix);
assert(time_to_unix(t) == test.epoch);
}
printf("OK\n");
}
Expand Down Expand Up @@ -116,7 +116,7 @@ static void test_get_part(void) {
}
for (size_t i = 0; i < 8; i++) {
DateTest test = date_tests[i];
Time t = time_unix(test.unix, 0);
Time t = time_unix(test.epoch, 0);
assert(time_get_year(t) == test.year);
assert(time_get_month(t) == test.month);
assert(time_get_day(t) == test.day);
Expand Down

0 comments on commit ea88d42

Please sign in to comment.