time/tst-strftime2.c: Make the file easier to maintain
authorTAMUKI Shoichi <tamuki@linet.gr.jp>
Tue, 2 Apr 2019 07:37:03 +0000 (16:37 +0900)
committerTAMUKI Shoichi <tamuki@linet.gr.jp>
Tue, 2 Apr 2019 07:37:03 +0000 (16:37 +0900)
commit2f1d61552d429c4e1cbcec115f3cc3dcaf91400d
treeaa7b397ab3612822e64c453c58f1336bbb83c85f
parent2c7e704b7e590e9895155529f1480e2cdea5424f
time/tst-strftime2.c: Make the file easier to maintain

Express the years as full Gregorian years (e.g., 1988 instead of 88)
and months with natural numbers (1-12 rather than 0-11).

Compare actual dates rather than indexes when selecting the era name.

Declare the local variable era as a string character pointer rather
than an array of chars where the actual string is copied which might
lead to potential buffer overflows in future.

Co-authored-by: Rafal Luzynski <digitalfreak@lingonborough.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
ChangeLog:

* time/tst-strftime2.c (date_t): Explicitly define the type.
(dates): Use natural month and year numbers to express a date.
(is_before): New function to compare dates.
(mkreftable): Minor improvements to simplify maintenance.
(do_test): Reflect the changes in dates array.
ChangeLog
time/tst-strftime2.c