diff options
author | Petr Mladek <pmladek@suse.com> | 2020-06-01 10:15:43 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2020-06-01 10:15:43 +0200 |
commit | 8b390ab725fddc443bb0082a6c67e82e25bfba7e (patch) | |
tree | 8e036c8c4ff5b039686be37cf9dafcbfe0341b84 /lib/test_printf.c | |
parent | d053cf0d771f6547cb0537759a9af63cf402908d (diff) | |
parent | 5f1fcf8c0adc94a334832a7fdf925801b8c339b4 (diff) | |
download | linux-8b390ab725fddc443bb0082a6c67e82e25bfba7e.tar.gz linux-8b390ab725fddc443bb0082a6c67e82e25bfba7e.tar.bz2 linux-8b390ab725fddc443bb0082a6c67e82e25bfba7e.zip |
Merge branch 'for-5.8-printf-time64_t' into for-linus
Diffstat (limited to 'lib/test_printf.c')
-rw-r--r-- | lib/test_printf.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/test_printf.c b/lib/test_printf.c index 2d9f520d2f27..6dc0a6c33b8c 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c @@ -478,7 +478,7 @@ struct_va_format(void) } static void __init -struct_rtc_time(void) +time_and_date(void) { /* 1543210543 */ const struct rtc_time tm = { @@ -489,14 +489,21 @@ struct_rtc_time(void) .tm_mon = 10, .tm_year = 118, }; + /* 2019-01-04T15:32:23 */ + time64_t t = 1546615943; - test("(%ptR?)", "%pt", &tm); + test("(%pt?)", "%pt", &tm); test("2018-11-26T05:35:43", "%ptR", &tm); test("0118-10-26T05:35:43", "%ptRr", &tm); test("05:35:43|2018-11-26", "%ptRt|%ptRd", &tm, &tm); test("05:35:43|0118-10-26", "%ptRtr|%ptRdr", &tm, &tm); test("05:35:43|2018-11-26", "%ptRttr|%ptRdtr", &tm, &tm); test("05:35:43 tr|2018-11-26 tr", "%ptRt tr|%ptRd tr", &tm, &tm); + + test("2019-01-04T15:32:23", "%ptT", &t); + test("0119-00-04T15:32:23", "%ptTr", &t); + test("15:32:23|2019-01-04", "%ptTt|%ptTd", &t, &t); + test("15:32:23|0119-00-04", "%ptTtr|%ptTdr", &t, &t); } static void __init @@ -661,7 +668,7 @@ test_pointer(void) uuid(); dentry(); struct_va_format(); - struct_rtc_time(); + time_and_date(); struct_clk(); bitmap(); netdev_features(); |