pr251-qualify-format.patch 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. --- contrib/libs/cctz/test/time_zone_format_test.cc (index)
  2. +++ contrib/libs/cctz/test/time_zone_format_test.cc (working tree)
  3. @@ -56,10 +56,10 @@ const char RFC1123_no_wday[] = "%d %b %Y %H:%M:%S %z";
  4. template <typename D>
  5. void TestFormatSpecifier(time_point<D> tp, time_zone tz, const std::string& fmt,
  6. const std::string& ans) {
  7. - EXPECT_EQ(ans, format(fmt, tp, tz)) << fmt;
  8. - EXPECT_EQ("xxx " + ans, format("xxx " + fmt, tp, tz));
  9. - EXPECT_EQ(ans + " yyy", format(fmt + " yyy", tp, tz));
  10. - EXPECT_EQ("xxx " + ans + " yyy", format("xxx " + fmt + " yyy", tp, tz));
  11. + EXPECT_EQ(ans, cctz::format(fmt, tp, tz)) << fmt;
  12. + EXPECT_EQ("xxx " + ans, cctz::format("xxx " + fmt, tp, tz));
  13. + EXPECT_EQ(ans + " yyy", cctz::format(fmt + " yyy", tp, tz));
  14. + EXPECT_EQ("xxx " + ans + " yyy", cctz::format("xxx " + fmt + " yyy", tp, tz));
  15. }
  16. } // namespace
  17. @@ -77,21 +77,21 @@ TEST(Format, TimePointResolution) {
  18. chrono::nanoseconds(789);
  19. EXPECT_EQ(
  20. "03:04:05.123456789",
  21. - format(kFmt, chrono::time_point_cast<chrono::nanoseconds>(t0), utc));
  22. + cctz::format(kFmt, chrono::time_point_cast<chrono::nanoseconds>(t0), utc));
  23. EXPECT_EQ(
  24. "03:04:05.123456",
  25. - format(kFmt, chrono::time_point_cast<chrono::microseconds>(t0), utc));
  26. + cctz::format(kFmt, chrono::time_point_cast<chrono::microseconds>(t0), utc));
  27. EXPECT_EQ(
  28. "03:04:05.123",
  29. - format(kFmt, chrono::time_point_cast<chrono::milliseconds>(t0), utc));
  30. + cctz::format(kFmt, chrono::time_point_cast<chrono::milliseconds>(t0), utc));
  31. EXPECT_EQ("03:04:05",
  32. - format(kFmt, chrono::time_point_cast<chrono::seconds>(t0), utc));
  33. + cctz::format(kFmt, chrono::time_point_cast<chrono::seconds>(t0), utc));
  34. EXPECT_EQ("03:04:05",
  35. - format(kFmt, chrono::time_point_cast<cctz::seconds>(t0), utc));
  36. + cctz::format(kFmt, chrono::time_point_cast<cctz::seconds>(t0), utc));
  37. EXPECT_EQ("03:04:00",
  38. - format(kFmt, chrono::time_point_cast<chrono::minutes>(t0), utc));
  39. + cctz::format(kFmt, chrono::time_point_cast<chrono::minutes>(t0), utc));
  40. EXPECT_EQ("03:00:00",
  41. - format(kFmt, chrono::time_point_cast<chrono::hours>(t0), utc));
  42. + cctz::format(kFmt, chrono::time_point_cast<chrono::hours>(t0), utc));
  43. }
  44. TEST(Format, TimePointExtendedResolution) {
  45. @@ -128,24 +128,24 @@ TEST(Format, Basics) {
  46. time_point<chrono::nanoseconds> tp = chrono::system_clock::from_time_t(0);
  47. // Starts with a couple basic edge cases.
  48. - EXPECT_EQ("", format("", tp, tz));
  49. - EXPECT_EQ(" ", format(" ", tp, tz));
  50. - EXPECT_EQ(" ", format(" ", tp, tz));
  51. - EXPECT_EQ("xxx", format("xxx", tp, tz));
  52. + EXPECT_EQ("", cctz::format("", tp, tz));
  53. + EXPECT_EQ(" ", cctz::format(" ", tp, tz));
  54. + EXPECT_EQ(" ", cctz::format(" ", tp, tz));
  55. + EXPECT_EQ("xxx", cctz::format("xxx", tp, tz));
  56. std::string big(128, 'x');
  57. - EXPECT_EQ(big, format(big, tp, tz));
  58. + EXPECT_EQ(big, cctz::format(big, tp, tz));
  59. // Cause the 1024-byte buffer to grow.
  60. std::string bigger(100000, 'x');
  61. - EXPECT_EQ(bigger, format(bigger, tp, tz));
  62. + EXPECT_EQ(bigger, cctz::format(bigger, tp, tz));
  63. tp += chrono::hours(13) + chrono::minutes(4) + chrono::seconds(5);
  64. tp += chrono::milliseconds(6) + chrono::microseconds(7) +
  65. chrono::nanoseconds(8);
  66. - EXPECT_EQ("1970-01-01", format("%Y-%m-%d", tp, tz));
  67. - EXPECT_EQ("13:04:05", format("%H:%M:%S", tp, tz));
  68. - EXPECT_EQ("13:04:05.006", format("%H:%M:%E3S", tp, tz));
  69. - EXPECT_EQ("13:04:05.006007", format("%H:%M:%E6S", tp, tz));
  70. - EXPECT_EQ("13:04:05.006007008", format("%H:%M:%E9S", tp, tz));
  71. + EXPECT_EQ("1970-01-01", cctz::format("%Y-%m-%d", tp, tz));
  72. + EXPECT_EQ("13:04:05", cctz::format("%H:%M:%S", tp, tz));
  73. + EXPECT_EQ("13:04:05.006", cctz::format("%H:%M:%E3S", tp, tz));
  74. + EXPECT_EQ("13:04:05.006007", cctz::format("%H:%M:%E6S", tp, tz));
  75. + EXPECT_EQ("13:04:05.006007008", cctz::format("%H:%M:%E9S", tp, tz));
  76. }
  77. TEST(Format, PosixConversions) {
  78. @@ -198,7 +198,7 @@ TEST(Format, LocaleSpecific) {
  79. TestFormatSpecifier(tp, tz, "%B", "January");
  80. // %c should at least produce the numeric year and time-of-day.
  81. - const std::string s = format("%c", tp, utc_time_zone());
  82. + const std::string s = cctz::format("%c", tp, utc_time_zone());
  83. EXPECT_THAT(s, testing::HasSubstr("1970"));
  84. EXPECT_THAT(s, testing::HasSubstr("00:00:00"));
  85. @@ -262,49 +262,49 @@ TEST(Format, ExtendedSeconds) {
  86. // No subseconds.
  87. time_point<chrono::nanoseconds> tp = chrono::system_clock::from_time_t(0);
  88. tp += chrono::seconds(5);
  89. - EXPECT_EQ("05", format("%E*S", tp, tz));
  90. - EXPECT_EQ("05", format("%E0S", tp, tz));
  91. - EXPECT_EQ("05.0", format("%E1S", tp, tz));
  92. - EXPECT_EQ("05.00", format("%E2S", tp, tz));
  93. - EXPECT_EQ("05.000", format("%E3S", tp, tz));
  94. - EXPECT_EQ("05.0000", format("%E4S", tp, tz));
  95. - EXPECT_EQ("05.00000", format("%E5S", tp, tz));
  96. - EXPECT_EQ("05.000000", format("%E6S", tp, tz));
  97. - EXPECT_EQ("05.0000000", format("%E7S", tp, tz));
  98. - EXPECT_EQ("05.00000000", format("%E8S", tp, tz));
  99. - EXPECT_EQ("05.000000000", format("%E9S", tp, tz));
  100. - EXPECT_EQ("05.0000000000", format("%E10S", tp, tz));
  101. - EXPECT_EQ("05.00000000000", format("%E11S", tp, tz));
  102. - EXPECT_EQ("05.000000000000", format("%E12S", tp, tz));
  103. - EXPECT_EQ("05.0000000000000", format("%E13S", tp, tz));
  104. - EXPECT_EQ("05.00000000000000", format("%E14S", tp, tz));
  105. - EXPECT_EQ("05.000000000000000", format("%E15S", tp, tz));
  106. + EXPECT_EQ("05", cctz::format("%E*S", tp, tz));
  107. + EXPECT_EQ("05", cctz::format("%E0S", tp, tz));
  108. + EXPECT_EQ("05.0", cctz::format("%E1S", tp, tz));
  109. + EXPECT_EQ("05.00", cctz::format("%E2S", tp, tz));
  110. + EXPECT_EQ("05.000", cctz::format("%E3S", tp, tz));
  111. + EXPECT_EQ("05.0000", cctz::format("%E4S", tp, tz));
  112. + EXPECT_EQ("05.00000", cctz::format("%E5S", tp, tz));
  113. + EXPECT_EQ("05.000000", cctz::format("%E6S", tp, tz));
  114. + EXPECT_EQ("05.0000000", cctz::format("%E7S", tp, tz));
  115. + EXPECT_EQ("05.00000000", cctz::format("%E8S", tp, tz));
  116. + EXPECT_EQ("05.000000000", cctz::format("%E9S", tp, tz));
  117. + EXPECT_EQ("05.0000000000", cctz::format("%E10S", tp, tz));
  118. + EXPECT_EQ("05.00000000000", cctz::format("%E11S", tp, tz));
  119. + EXPECT_EQ("05.000000000000", cctz::format("%E12S", tp, tz));
  120. + EXPECT_EQ("05.0000000000000", cctz::format("%E13S", tp, tz));
  121. + EXPECT_EQ("05.00000000000000", cctz::format("%E14S", tp, tz));
  122. + EXPECT_EQ("05.000000000000000", cctz::format("%E15S", tp, tz));
  123. // With subseconds.
  124. tp += chrono::milliseconds(6) + chrono::microseconds(7) +
  125. chrono::nanoseconds(8);
  126. - EXPECT_EQ("05.006007008", format("%E*S", tp, tz));
  127. - EXPECT_EQ("05", format("%E0S", tp, tz));
  128. - EXPECT_EQ("05.0", format("%E1S", tp, tz));
  129. - EXPECT_EQ("05.00", format("%E2S", tp, tz));
  130. - EXPECT_EQ("05.006", format("%E3S", tp, tz));
  131. - EXPECT_EQ("05.0060", format("%E4S", tp, tz));
  132. - EXPECT_EQ("05.00600", format("%E5S", tp, tz));
  133. - EXPECT_EQ("05.006007", format("%E6S", tp, tz));
  134. - EXPECT_EQ("05.0060070", format("%E7S", tp, tz));
  135. - EXPECT_EQ("05.00600700", format("%E8S", tp, tz));
  136. - EXPECT_EQ("05.006007008", format("%E9S", tp, tz));
  137. - EXPECT_EQ("05.0060070080", format("%E10S", tp, tz));
  138. - EXPECT_EQ("05.00600700800", format("%E11S", tp, tz));
  139. - EXPECT_EQ("05.006007008000", format("%E12S", tp, tz));
  140. - EXPECT_EQ("05.0060070080000", format("%E13S", tp, tz));
  141. - EXPECT_EQ("05.00600700800000", format("%E14S", tp, tz));
  142. - EXPECT_EQ("05.006007008000000", format("%E15S", tp, tz));
  143. + EXPECT_EQ("05.006007008", cctz::format("%E*S", tp, tz));
  144. + EXPECT_EQ("05", cctz::format("%E0S", tp, tz));
  145. + EXPECT_EQ("05.0", cctz::format("%E1S", tp, tz));
  146. + EXPECT_EQ("05.00", cctz::format("%E2S", tp, tz));
  147. + EXPECT_EQ("05.006", cctz::format("%E3S", tp, tz));
  148. + EXPECT_EQ("05.0060", cctz::format("%E4S", tp, tz));
  149. + EXPECT_EQ("05.00600", cctz::format("%E5S", tp, tz));
  150. + EXPECT_EQ("05.006007", cctz::format("%E6S", tp, tz));
  151. + EXPECT_EQ("05.0060070", cctz::format("%E7S", tp, tz));
  152. + EXPECT_EQ("05.00600700", cctz::format("%E8S", tp, tz));
  153. + EXPECT_EQ("05.006007008", cctz::format("%E9S", tp, tz));
  154. + EXPECT_EQ("05.0060070080", cctz::format("%E10S", tp, tz));
  155. + EXPECT_EQ("05.00600700800", cctz::format("%E11S", tp, tz));
  156. + EXPECT_EQ("05.006007008000", cctz::format("%E12S", tp, tz));
  157. + EXPECT_EQ("05.0060070080000", cctz::format("%E13S", tp, tz));
  158. + EXPECT_EQ("05.00600700800000", cctz::format("%E14S", tp, tz));
  159. + EXPECT_EQ("05.006007008000000", cctz::format("%E15S", tp, tz));
  160. // Times before the Unix epoch.
  161. tp = chrono::system_clock::from_time_t(0) + chrono::microseconds(-1);
  162. EXPECT_EQ("1969-12-31 23:59:59.999999",
  163. - format("%Y-%m-%d %H:%M:%E*S", tp, tz));
  164. + cctz::format("%Y-%m-%d %H:%M:%E*S", tp, tz));
  165. // Here is a "%E*S" case we got wrong for a while. While the first
  166. // instant below is correctly rendered as "...:07.333304", the second
  167. @@ -312,10 +312,10 @@ TEST(Format, ExtendedSeconds) {
  168. tp = chrono::system_clock::from_time_t(0) +
  169. chrono::microseconds(1395024427333304);
  170. EXPECT_EQ("2014-03-17 02:47:07.333304",
  171. - format("%Y-%m-%d %H:%M:%E*S", tp, tz));
  172. + cctz::format("%Y-%m-%d %H:%M:%E*S", tp, tz));
  173. tp += chrono::microseconds(1);
  174. EXPECT_EQ("2014-03-17 02:47:07.333305",
  175. - format("%Y-%m-%d %H:%M:%E*S", tp, tz));
  176. + cctz::format("%Y-%m-%d %H:%M:%E*S", tp, tz));
  177. }
  178. TEST(Format, ExtendedSubeconds) {
  179. @@ -324,49 +324,49 @@ TEST(Format, ExtendedSubeconds) {
  180. // No subseconds.
  181. time_point<chrono::nanoseconds> tp = chrono::system_clock::from_time_t(0);
  182. tp += chrono::seconds(5);
  183. - EXPECT_EQ("0", format("%E*f", tp, tz));
  184. - EXPECT_EQ("", format("%E0f", tp, tz));
  185. - EXPECT_EQ("0", format("%E1f", tp, tz));
  186. - EXPECT_EQ("00", format("%E2f", tp, tz));
  187. - EXPECT_EQ("000", format("%E3f", tp, tz));
  188. - EXPECT_EQ("0000", format("%E4f", tp, tz));
  189. - EXPECT_EQ("00000", format("%E5f", tp, tz));
  190. - EXPECT_EQ("000000", format("%E6f", tp, tz));
  191. - EXPECT_EQ("0000000", format("%E7f", tp, tz));
  192. - EXPECT_EQ("00000000", format("%E8f", tp, tz));
  193. - EXPECT_EQ("000000000", format("%E9f", tp, tz));
  194. - EXPECT_EQ("0000000000", format("%E10f", tp, tz));
  195. - EXPECT_EQ("00000000000", format("%E11f", tp, tz));
  196. - EXPECT_EQ("000000000000", format("%E12f", tp, tz));
  197. - EXPECT_EQ("0000000000000", format("%E13f", tp, tz));
  198. - EXPECT_EQ("00000000000000", format("%E14f", tp, tz));
  199. - EXPECT_EQ("000000000000000", format("%E15f", tp, tz));
  200. + EXPECT_EQ("0", cctz::format("%E*f", tp, tz));
  201. + EXPECT_EQ("", cctz::format("%E0f", tp, tz));
  202. + EXPECT_EQ("0", cctz::format("%E1f", tp, tz));
  203. + EXPECT_EQ("00", cctz::format("%E2f", tp, tz));
  204. + EXPECT_EQ("000", cctz::format("%E3f", tp, tz));
  205. + EXPECT_EQ("0000", cctz::format("%E4f", tp, tz));
  206. + EXPECT_EQ("00000", cctz::format("%E5f", tp, tz));
  207. + EXPECT_EQ("000000", cctz::format("%E6f", tp, tz));
  208. + EXPECT_EQ("0000000", cctz::format("%E7f", tp, tz));
  209. + EXPECT_EQ("00000000", cctz::format("%E8f", tp, tz));
  210. + EXPECT_EQ("000000000", cctz::format("%E9f", tp, tz));
  211. + EXPECT_EQ("0000000000", cctz::format("%E10f", tp, tz));
  212. + EXPECT_EQ("00000000000", cctz::format("%E11f", tp, tz));
  213. + EXPECT_EQ("000000000000", cctz::format("%E12f", tp, tz));
  214. + EXPECT_EQ("0000000000000", cctz::format("%E13f", tp, tz));
  215. + EXPECT_EQ("00000000000000", cctz::format("%E14f", tp, tz));
  216. + EXPECT_EQ("000000000000000", cctz::format("%E15f", tp, tz));
  217. // With subseconds.
  218. tp += chrono::milliseconds(6) + chrono::microseconds(7) +
  219. chrono::nanoseconds(8);
  220. - EXPECT_EQ("006007008", format("%E*f", tp, tz));
  221. - EXPECT_EQ("", format("%E0f", tp, tz));
  222. - EXPECT_EQ("0", format("%E1f", tp, tz));
  223. - EXPECT_EQ("00", format("%E2f", tp, tz));
  224. - EXPECT_EQ("006", format("%E3f", tp, tz));
  225. - EXPECT_EQ("0060", format("%E4f", tp, tz));
  226. - EXPECT_EQ("00600", format("%E5f", tp, tz));
  227. - EXPECT_EQ("006007", format("%E6f", tp, tz));
  228. - EXPECT_EQ("0060070", format("%E7f", tp, tz));
  229. - EXPECT_EQ("00600700", format("%E8f", tp, tz));
  230. - EXPECT_EQ("006007008", format("%E9f", tp, tz));
  231. - EXPECT_EQ("0060070080", format("%E10f", tp, tz));
  232. - EXPECT_EQ("00600700800", format("%E11f", tp, tz));
  233. - EXPECT_EQ("006007008000", format("%E12f", tp, tz));
  234. - EXPECT_EQ("0060070080000", format("%E13f", tp, tz));
  235. - EXPECT_EQ("00600700800000", format("%E14f", tp, tz));
  236. - EXPECT_EQ("006007008000000", format("%E15f", tp, tz));
  237. + EXPECT_EQ("006007008", cctz::format("%E*f", tp, tz));
  238. + EXPECT_EQ("", cctz::format("%E0f", tp, tz));
  239. + EXPECT_EQ("0", cctz::format("%E1f", tp, tz));
  240. + EXPECT_EQ("00", cctz::format("%E2f", tp, tz));
  241. + EXPECT_EQ("006", cctz::format("%E3f", tp, tz));
  242. + EXPECT_EQ("0060", cctz::format("%E4f", tp, tz));
  243. + EXPECT_EQ("00600", cctz::format("%E5f", tp, tz));
  244. + EXPECT_EQ("006007", cctz::format("%E6f", tp, tz));
  245. + EXPECT_EQ("0060070", cctz::format("%E7f", tp, tz));
  246. + EXPECT_EQ("00600700", cctz::format("%E8f", tp, tz));
  247. + EXPECT_EQ("006007008", cctz::format("%E9f", tp, tz));
  248. + EXPECT_EQ("0060070080", cctz::format("%E10f", tp, tz));
  249. + EXPECT_EQ("00600700800", cctz::format("%E11f", tp, tz));
  250. + EXPECT_EQ("006007008000", cctz::format("%E12f", tp, tz));
  251. + EXPECT_EQ("0060070080000", cctz::format("%E13f", tp, tz));
  252. + EXPECT_EQ("00600700800000", cctz::format("%E14f", tp, tz));
  253. + EXPECT_EQ("006007008000000", cctz::format("%E15f", tp, tz));
  254. // Times before the Unix epoch.
  255. tp = chrono::system_clock::from_time_t(0) + chrono::microseconds(-1);
  256. EXPECT_EQ("1969-12-31 23:59:59.999999",
  257. - format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
  258. + cctz::format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
  259. // Here is a "%E*S" case we got wrong for a while. While the first
  260. // instant below is correctly rendered as "...:07.333304", the second
  261. @@ -374,10 +374,10 @@ TEST(Format, ExtendedSubeconds) {
  262. tp = chrono::system_clock::from_time_t(0) +
  263. chrono::microseconds(1395024427333304);
  264. EXPECT_EQ("2014-03-17 02:47:07.333304",
  265. - format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
  266. + cctz::format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
  267. tp += chrono::microseconds(1);
  268. EXPECT_EQ("2014-03-17 02:47:07.333305",
  269. - format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
  270. + cctz::format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
  271. }
  272. TEST(Format, CompareExtendSecondsVsSubseconds) {
  273. @@ -393,15 +393,15 @@ TEST(Format, CompareExtendSecondsVsSubseconds) {
  274. time_point<chrono::nanoseconds> tp = chrono::system_clock::from_time_t(0);
  275. tp += chrono::seconds(5);
  276. // ... %E*S and %S.%E*f are different.
  277. - EXPECT_EQ("05", format(fmt_A("*"), tp, tz));
  278. - EXPECT_EQ("05.0", format(fmt_B("*"), tp, tz));
  279. + EXPECT_EQ("05", cctz::format(fmt_A("*"), tp, tz));
  280. + EXPECT_EQ("05.0", cctz::format(fmt_B("*"), tp, tz));
  281. // ... %E0S and %S.%E0f are different.
  282. - EXPECT_EQ("05", format(fmt_A("0"), tp, tz));
  283. - EXPECT_EQ("05.", format(fmt_B("0"), tp, tz));
  284. + EXPECT_EQ("05", cctz::format(fmt_A("0"), tp, tz));
  285. + EXPECT_EQ("05.", cctz::format(fmt_B("0"), tp, tz));
  286. // ... %E<prec>S and %S.%E<prec>f are the same for prec in [1:15].
  287. for (int prec = 1; prec <= 15; ++prec) {
  288. - const std::string a = format(fmt_A(std::to_string(prec)), tp, tz);
  289. - const std::string b = format(fmt_B(std::to_string(prec)), tp, tz);
  290. + const std::string a = cctz::format(fmt_A(std::to_string(prec)), tp, tz);
  291. + const std::string b = cctz::format(fmt_B(std::to_string(prec)), tp, tz);
  292. EXPECT_EQ(a, b) << "prec=" << prec;
  293. }
  294. @@ -409,15 +409,15 @@ TEST(Format, CompareExtendSecondsVsSubseconds) {
  295. // ... %E*S and %S.%E*f are the same.
  296. tp += chrono::milliseconds(6) + chrono::microseconds(7) +
  297. chrono::nanoseconds(8);
  298. - EXPECT_EQ("05.006007008", format(fmt_A("*"), tp, tz));
  299. - EXPECT_EQ("05.006007008", format(fmt_B("*"), tp, tz));
  300. + EXPECT_EQ("05.006007008", cctz::format(fmt_A("*"), tp, tz));
  301. + EXPECT_EQ("05.006007008", cctz::format(fmt_B("*"), tp, tz));
  302. // ... %E0S and %S.%E0f are different.
  303. - EXPECT_EQ("05", format(fmt_A("0"), tp, tz));
  304. - EXPECT_EQ("05.", format(fmt_B("0"), tp, tz));
  305. + EXPECT_EQ("05", cctz::format(fmt_A("0"), tp, tz));
  306. + EXPECT_EQ("05.", cctz::format(fmt_B("0"), tp, tz));
  307. // ... %E<prec>S and %S.%E<prec>f are the same for prec in [1:15].
  308. for (int prec = 1; prec <= 15; ++prec) {
  309. - const std::string a = format(fmt_A(std::to_string(prec)), tp, tz);
  310. - const std::string b = format(fmt_B(std::to_string(prec)), tp, tz);
  311. + const std::string a = cctz::format(fmt_A(std::to_string(prec)), tp, tz);
  312. + const std::string b = cctz::format(fmt_B(std::to_string(prec)), tp, tz);
  313. EXPECT_EQ(a, b) << "prec=" << prec;
  314. }
  315. }
  316. @@ -590,31 +590,31 @@ TEST(Format, ExtendedYears) {
  317. // %E4Y zero-pads the year to produce at least 4 chars, including the sign.
  318. auto tp = convert(civil_second(-999, 11, 27, 0, 0, 0), utc);
  319. - EXPECT_EQ("-9991127", format(e4y_fmt, tp, utc));
  320. + EXPECT_EQ("-9991127", cctz::format(e4y_fmt, tp, utc));
  321. tp = convert(civil_second(-99, 11, 27, 0, 0, 0), utc);
  322. - EXPECT_EQ("-0991127", format(e4y_fmt, tp, utc));
  323. + EXPECT_EQ("-0991127", cctz::format(e4y_fmt, tp, utc));
  324. tp = convert(civil_second(-9, 11, 27, 0, 0, 0), utc);
  325. - EXPECT_EQ("-0091127", format(e4y_fmt, tp, utc));
  326. + EXPECT_EQ("-0091127", cctz::format(e4y_fmt, tp, utc));
  327. tp = convert(civil_second(-1, 11, 27, 0, 0, 0), utc);
  328. - EXPECT_EQ("-0011127", format(e4y_fmt, tp, utc));
  329. + EXPECT_EQ("-0011127", cctz::format(e4y_fmt, tp, utc));
  330. tp = convert(civil_second(0, 11, 27, 0, 0, 0), utc);
  331. - EXPECT_EQ("00001127", format(e4y_fmt, tp, utc));
  332. + EXPECT_EQ("00001127", cctz::format(e4y_fmt, tp, utc));
  333. tp = convert(civil_second(1, 11, 27, 0, 0, 0), utc);
  334. - EXPECT_EQ("00011127", format(e4y_fmt, tp, utc));
  335. + EXPECT_EQ("00011127", cctz::format(e4y_fmt, tp, utc));
  336. tp = convert(civil_second(9, 11, 27, 0, 0, 0), utc);
  337. - EXPECT_EQ("00091127", format(e4y_fmt, tp, utc));
  338. + EXPECT_EQ("00091127", cctz::format(e4y_fmt, tp, utc));
  339. tp = convert(civil_second(99, 11, 27, 0, 0, 0), utc);
  340. - EXPECT_EQ("00991127", format(e4y_fmt, tp, utc));
  341. + EXPECT_EQ("00991127", cctz::format(e4y_fmt, tp, utc));
  342. tp = convert(civil_second(999, 11, 27, 0, 0, 0), utc);
  343. - EXPECT_EQ("09991127", format(e4y_fmt, tp, utc));
  344. + EXPECT_EQ("09991127", cctz::format(e4y_fmt, tp, utc));
  345. tp = convert(civil_second(9999, 11, 27, 0, 0, 0), utc);
  346. - EXPECT_EQ("99991127", format(e4y_fmt, tp, utc));
  347. + EXPECT_EQ("99991127", cctz::format(e4y_fmt, tp, utc));
  348. // When the year is outside [-999:9999], more than 4 chars are produced.
  349. tp = convert(civil_second(-1000, 11, 27, 0, 0, 0), utc);
  350. - EXPECT_EQ("-10001127", format(e4y_fmt, tp, utc));
  351. + EXPECT_EQ("-10001127", cctz::format(e4y_fmt, tp, utc));
  352. tp = convert(civil_second(10000, 11, 27, 0, 0, 0), utc);
  353. - EXPECT_EQ("100001127", format(e4y_fmt, tp, utc));
  354. + EXPECT_EQ("100001127", cctz::format(e4y_fmt, tp, utc));
  355. }
  356. TEST(Format, RFC3339Format) {
  357. @@ -623,45 +623,45 @@ TEST(Format, RFC3339Format) {
  358. time_point<chrono::nanoseconds> tp =
  359. convert(civil_second(1977, 6, 28, 9, 8, 7), tz);
  360. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_full, tp, tz));
  361. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  362. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_full, tp, tz));
  363. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  364. tp += chrono::milliseconds(100);
  365. - EXPECT_EQ("1977-06-28T09:08:07.1-07:00", format(RFC3339_full, tp, tz));
  366. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  367. + EXPECT_EQ("1977-06-28T09:08:07.1-07:00", cctz::format(RFC3339_full, tp, tz));
  368. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  369. tp += chrono::milliseconds(20);
  370. - EXPECT_EQ("1977-06-28T09:08:07.12-07:00", format(RFC3339_full, tp, tz));
  371. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  372. + EXPECT_EQ("1977-06-28T09:08:07.12-07:00", cctz::format(RFC3339_full, tp, tz));
  373. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  374. tp += chrono::milliseconds(3);
  375. - EXPECT_EQ("1977-06-28T09:08:07.123-07:00", format(RFC3339_full, tp, tz));
  376. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  377. + EXPECT_EQ("1977-06-28T09:08:07.123-07:00", cctz::format(RFC3339_full, tp, tz));
  378. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  379. tp += chrono::microseconds(400);
  380. - EXPECT_EQ("1977-06-28T09:08:07.1234-07:00", format(RFC3339_full, tp, tz));
  381. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  382. + EXPECT_EQ("1977-06-28T09:08:07.1234-07:00", cctz::format(RFC3339_full, tp, tz));
  383. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  384. tp += chrono::microseconds(50);
  385. - EXPECT_EQ("1977-06-28T09:08:07.12345-07:00", format(RFC3339_full, tp, tz));
  386. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  387. + EXPECT_EQ("1977-06-28T09:08:07.12345-07:00", cctz::format(RFC3339_full, tp, tz));
  388. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  389. tp += chrono::microseconds(6);
  390. - EXPECT_EQ("1977-06-28T09:08:07.123456-07:00", format(RFC3339_full, tp, tz));
  391. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  392. + EXPECT_EQ("1977-06-28T09:08:07.123456-07:00", cctz::format(RFC3339_full, tp, tz));
  393. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  394. tp += chrono::nanoseconds(700);
  395. - EXPECT_EQ("1977-06-28T09:08:07.1234567-07:00", format(RFC3339_full, tp, tz));
  396. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  397. + EXPECT_EQ("1977-06-28T09:08:07.1234567-07:00", cctz::format(RFC3339_full, tp, tz));
  398. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  399. tp += chrono::nanoseconds(80);
  400. - EXPECT_EQ("1977-06-28T09:08:07.12345678-07:00", format(RFC3339_full, tp, tz));
  401. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  402. + EXPECT_EQ("1977-06-28T09:08:07.12345678-07:00", cctz::format(RFC3339_full, tp, tz));
  403. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  404. tp += chrono::nanoseconds(9);
  405. EXPECT_EQ("1977-06-28T09:08:07.123456789-07:00",
  406. - format(RFC3339_full, tp, tz));
  407. - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
  408. + cctz::format(RFC3339_full, tp, tz));
  409. + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
  410. }
  411. TEST(Format, RFC1123Format) { // locale specific
  412. @@ -669,36 +669,36 @@ TEST(Format, RFC1123Format) { // locale specific
  413. EXPECT_TRUE(load_time_zone("America/Los_Angeles", &tz));
  414. auto tp = convert(civil_second(1977, 6, 28, 9, 8, 7), tz);
  415. - EXPECT_EQ("Tue, 28 Jun 1977 09:08:07 -0700", format(RFC1123_full, tp, tz));
  416. - EXPECT_EQ("28 Jun 1977 09:08:07 -0700", format(RFC1123_no_wday, tp, tz));
  417. + EXPECT_EQ("Tue, 28 Jun 1977 09:08:07 -0700", cctz::format(RFC1123_full, tp, tz));
  418. + EXPECT_EQ("28 Jun 1977 09:08:07 -0700", cctz::format(RFC1123_no_wday, tp, tz));
  419. }
  420. TEST(Format, Week) {
  421. const time_zone utc = utc_time_zone();
  422. auto tp = convert(civil_second(2017, 1, 1, 0, 0, 0), utc);
  423. - EXPECT_EQ("2017-01-7", format("%Y-%U-%u", tp, utc));
  424. - EXPECT_EQ("2017-00-0", format("%Y-%W-%w", tp, utc));
  425. + EXPECT_EQ("2017-01-7", cctz::format("%Y-%U-%u", tp, utc));
  426. + EXPECT_EQ("2017-00-0", cctz::format("%Y-%W-%w", tp, utc));
  427. tp = convert(civil_second(2017, 12, 31, 0, 0, 0), utc);
  428. - EXPECT_EQ("2017-53-7", format("%Y-%U-%u", tp, utc));
  429. - EXPECT_EQ("2017-52-0", format("%Y-%W-%w", tp, utc));
  430. + EXPECT_EQ("2017-53-7", cctz::format("%Y-%U-%u", tp, utc));
  431. + EXPECT_EQ("2017-52-0", cctz::format("%Y-%W-%w", tp, utc));
  432. tp = convert(civil_second(2018, 1, 1, 0, 0, 0), utc);
  433. - EXPECT_EQ("2018-00-1", format("%Y-%U-%u", tp, utc));
  434. - EXPECT_EQ("2018-01-1", format("%Y-%W-%w", tp, utc));
  435. + EXPECT_EQ("2018-00-1", cctz::format("%Y-%U-%u", tp, utc));
  436. + EXPECT_EQ("2018-01-1", cctz::format("%Y-%W-%w", tp, utc));
  437. tp = convert(civil_second(2018, 12, 31, 0, 0, 0), utc);
  438. - EXPECT_EQ("2018-52-1", format("%Y-%U-%u", tp, utc));
  439. - EXPECT_EQ("2018-53-1", format("%Y-%W-%w", tp, utc));
  440. + EXPECT_EQ("2018-52-1", cctz::format("%Y-%U-%u", tp, utc));
  441. + EXPECT_EQ("2018-53-1", cctz::format("%Y-%W-%w", tp, utc));
  442. tp = convert(civil_second(2019, 1, 1, 0, 0, 0), utc);
  443. - EXPECT_EQ("2019-00-2", format("%Y-%U-%u", tp, utc));
  444. - EXPECT_EQ("2019-00-2", format("%Y-%W-%w", tp, utc));
  445. + EXPECT_EQ("2019-00-2", cctz::format("%Y-%U-%u", tp, utc));
  446. + EXPECT_EQ("2019-00-2", cctz::format("%Y-%W-%w", tp, utc));
  447. tp = convert(civil_second(2019, 12, 31, 0, 0, 0), utc);
  448. - EXPECT_EQ("2019-52-2", format("%Y-%U-%u", tp, utc));
  449. - EXPECT_EQ("2019-52-2", format("%Y-%W-%w", tp, utc));
  450. + EXPECT_EQ("2019-52-2", cctz::format("%Y-%U-%u", tp, utc));
  451. + EXPECT_EQ("2019-52-2", cctz::format("%Y-%W-%w", tp, utc));
  452. }
  453. //
  454. @@ -711,39 +711,39 @@ TEST(Parse, TimePointResolution) {
  455. time_point<chrono::nanoseconds> tp_ns;
  456. EXPECT_TRUE(parse(kFmt, "03:04:05.123456789", utc, &tp_ns));
  457. - EXPECT_EQ("03:04:05.123456789", format(kFmt, tp_ns, utc));
  458. + EXPECT_EQ("03:04:05.123456789", cctz::format(kFmt, tp_ns, utc));
  459. EXPECT_TRUE(parse(kFmt, "03:04:05.123456", utc, &tp_ns));
  460. - EXPECT_EQ("03:04:05.123456", format(kFmt, tp_ns, utc));
  461. + EXPECT_EQ("03:04:05.123456", cctz::format(kFmt, tp_ns, utc));
  462. time_point<chrono::microseconds> tp_us;
  463. EXPECT_TRUE(parse(kFmt, "03:04:05.123456789", utc, &tp_us));
  464. - EXPECT_EQ("03:04:05.123456", format(kFmt, tp_us, utc));
  465. + EXPECT_EQ("03:04:05.123456", cctz::format(kFmt, tp_us, utc));
  466. EXPECT_TRUE(parse(kFmt, "03:04:05.123456", utc, &tp_us));
  467. - EXPECT_EQ("03:04:05.123456", format(kFmt, tp_us, utc));
  468. + EXPECT_EQ("03:04:05.123456", cctz::format(kFmt, tp_us, utc));
  469. EXPECT_TRUE(parse(kFmt, "03:04:05.123", utc, &tp_us));
  470. - EXPECT_EQ("03:04:05.123", format(kFmt, tp_us, utc));
  471. + EXPECT_EQ("03:04:05.123", cctz::format(kFmt, tp_us, utc));
  472. time_point<chrono::milliseconds> tp_ms;
  473. EXPECT_TRUE(parse(kFmt, "03:04:05.123456", utc, &tp_ms));
  474. - EXPECT_EQ("03:04:05.123", format(kFmt, tp_ms, utc));
  475. + EXPECT_EQ("03:04:05.123", cctz::format(kFmt, tp_ms, utc));
  476. EXPECT_TRUE(parse(kFmt, "03:04:05.123", utc, &tp_ms));
  477. - EXPECT_EQ("03:04:05.123", format(kFmt, tp_ms, utc));
  478. + EXPECT_EQ("03:04:05.123", cctz::format(kFmt, tp_ms, utc));
  479. EXPECT_TRUE(parse(kFmt, "03:04:05", utc, &tp_ms));
  480. - EXPECT_EQ("03:04:05", format(kFmt, tp_ms, utc));
  481. + EXPECT_EQ("03:04:05", cctz::format(kFmt, tp_ms, utc));
  482. time_point<chrono::seconds> tp_s;
  483. EXPECT_TRUE(parse(kFmt, "03:04:05.123", utc, &tp_s));
  484. - EXPECT_EQ("03:04:05", format(kFmt, tp_s, utc));
  485. + EXPECT_EQ("03:04:05", cctz::format(kFmt, tp_s, utc));
  486. EXPECT_TRUE(parse(kFmt, "03:04:05", utc, &tp_s));
  487. - EXPECT_EQ("03:04:05", format(kFmt, tp_s, utc));
  488. + EXPECT_EQ("03:04:05", cctz::format(kFmt, tp_s, utc));
  489. time_point<chrono::minutes> tp_m;
  490. EXPECT_TRUE(parse(kFmt, "03:04:05", utc, &tp_m));
  491. - EXPECT_EQ("03:04:00", format(kFmt, tp_m, utc));
  492. + EXPECT_EQ("03:04:00", cctz::format(kFmt, tp_m, utc));
  493. time_point<chrono::hours> tp_h;
  494. EXPECT_TRUE(parse(kFmt, "03:04:05", utc, &tp_h));
  495. - EXPECT_EQ("03:00:00", format(kFmt, tp_h, utc));
  496. + EXPECT_EQ("03:00:00", cctz::format(kFmt, tp_h, utc));
  497. }
  498. TEST(Parse, TimePointExtendedResolution) {
  499. @@ -1538,7 +1538,7 @@ TEST(FormatParse, RoundTrip) {
  500. // RFC3339, which renders subseconds.
  501. {
  502. time_point<chrono::nanoseconds> out;
  503. - const std::string s = format(RFC3339_full, in + subseconds, lax);
  504. + const std::string s = cctz::format(RFC3339_full, in + subseconds, lax);
  505. EXPECT_TRUE(parse(RFC3339_full, s, lax, &out)) << s;
  506. EXPECT_EQ(in + subseconds, out); // RFC3339_full includes %Ez
  507. }
  508. @@ -1546,7 +1546,7 @@ TEST(FormatParse, RoundTrip) {
  509. // RFC1123, which only does whole seconds.
  510. {
  511. time_point<chrono::nanoseconds> out;
  512. - const std::string s = format(RFC1123_full, in, lax);
  513. + const std::string s = cctz::format(RFC1123_full, in, lax);
  514. EXPECT_TRUE(parse(RFC1123_full, s, lax, &out)) << s;
  515. EXPECT_EQ(in, out); // RFC1123_full includes %z
  516. }
  517. @@ -1560,7 +1560,7 @@ TEST(FormatParse, RoundTrip) {
  518. {
  519. time_point<chrono::nanoseconds> out;
  520. time_zone utc = utc_time_zone();
  521. - const std::string s = format("%c", in, utc);
  522. + const std::string s = cctz::format("%c", in, utc);
  523. EXPECT_TRUE(parse("%c", s, utc, &out)) << s;
  524. EXPECT_EQ(in, out);
  525. }
  526. @@ -1570,7 +1570,7 @@ TEST(FormatParse, RoundTrip) {
  527. TEST(FormatParse, RoundTripDistantFuture) {
  528. const time_zone utc = utc_time_zone();
  529. const time_point<cctz::seconds> in = time_point<cctz::seconds>::max();
  530. - const std::string s = format(RFC3339_full, in, utc);
  531. + const std::string s = cctz::format(RFC3339_full, in, utc);
  532. time_point<cctz::seconds> out;
  533. EXPECT_TRUE(parse(RFC3339_full, s, utc, &out)) << s;
  534. EXPECT_EQ(in, out);
  535. @@ -1579,7 +1579,7 @@ TEST(FormatParse, RoundTripDistantFuture) {
  536. TEST(FormatParse, RoundTripDistantPast) {
  537. const time_zone utc = utc_time_zone();
  538. const time_point<cctz::seconds> in = time_point<cctz::seconds>::min();
  539. - const std::string s = format(RFC3339_full, in, utc);
  540. + const std::string s = cctz::format(RFC3339_full, in, utc);
  541. time_point<cctz::seconds> out;
  542. EXPECT_TRUE(parse(RFC3339_full, s, utc, &out)) << s;
  543. EXPECT_EQ(in, out);
  544. --- contrib/libs/cctz/test/time_zone_lookup_test.cc (index)
  545. +++ contrib/libs/cctz/test/time_zone_lookup_test.cc (working tree)
  546. @@ -899,19 +899,19 @@ TEST(MakeTime, TimePointResolution) {
  547. const time_zone utc = utc_time_zone();
  548. const time_point<chrono::nanoseconds> tp_ns =
  549. convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
  550. - EXPECT_EQ("04:05", format("%M:%E*S", tp_ns, utc));
  551. + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_ns, utc));
  552. const time_point<chrono::microseconds> tp_us =
  553. convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
  554. - EXPECT_EQ("04:05", format("%M:%E*S", tp_us, utc));
  555. + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_us, utc));
  556. const time_point<chrono::milliseconds> tp_ms =
  557. convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
  558. - EXPECT_EQ("04:05", format("%M:%E*S", tp_ms, utc));
  559. + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_ms, utc));
  560. const time_point<chrono::seconds> tp_s =
  561. convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
  562. - EXPECT_EQ("04:05", format("%M:%E*S", tp_s, utc));
  563. + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_s, utc));
  564. const time_point<cctz::seconds> tp_s64 =
  565. convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
  566. - EXPECT_EQ("04:05", format("%M:%E*S", tp_s64, utc));
  567. + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_s64, utc));
  568. // These next two require chrono::time_point_cast because the conversion
  569. // from a resolution of seconds (the return value of convert()) to a
  570. @@ -919,11 +919,11 @@ TEST(MakeTime, TimePointResolution) {
  571. const time_point<chrono::minutes> tp_m =
  572. chrono::time_point_cast<chrono::minutes>(
  573. convert(civil_second(2015, 1, 2, 3, 4, 5), utc));
  574. - EXPECT_EQ("04:00", format("%M:%E*S", tp_m, utc));
  575. + EXPECT_EQ("04:00", cctz::format("%M:%E*S", tp_m, utc));
  576. const time_point<chrono::hours> tp_h =
  577. chrono::time_point_cast<chrono::hours>(
  578. convert(civil_second(2015, 1, 2, 3, 4, 5), utc));
  579. - EXPECT_EQ("00:00", format("%M:%E*S", tp_h, utc));
  580. + EXPECT_EQ("00:00", cctz::format("%M:%E*S", tp_h, utc));
  581. }
  582. TEST(MakeTime, Normalization) {
  583. @@ -949,9 +949,9 @@ TEST(MakeTime, SysSecondsLimits) {
  584. // Approach the maximal time_point<cctz::seconds> value from below.
  585. tp = convert(civil_second(292277026596, 12, 4, 15, 30, 6), utc);
  586. - EXPECT_EQ("292277026596-12-04T15:30:06+00:00", format(RFC3339, tp, utc));
  587. + EXPECT_EQ("292277026596-12-04T15:30:06+00:00", cctz::format(RFC3339, tp, utc));
  588. tp = convert(civil_second(292277026596, 12, 4, 15, 30, 7), utc);
  589. - EXPECT_EQ("292277026596-12-04T15:30:07+00:00", format(RFC3339, tp, utc));
  590. + EXPECT_EQ("292277026596-12-04T15:30:07+00:00", cctz::format(RFC3339, tp, utc));
  591. EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
  592. tp = convert(civil_second(292277026596, 12, 4, 15, 30, 8), utc);
  593. EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
  594. @@ -960,7 +960,7 @@ TEST(MakeTime, SysSecondsLimits) {
  595. // Checks that we can also get the maximal value for a far-east zone.
  596. tp = convert(civil_second(292277026596, 12, 5, 5, 30, 7), east);
  597. - EXPECT_EQ("292277026596-12-05T05:30:07+14:00", format(RFC3339, tp, east));
  598. + EXPECT_EQ("292277026596-12-05T05:30:07+14:00", cctz::format(RFC3339, tp, east));
  599. EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
  600. tp = convert(civil_second(292277026596, 12, 5, 5, 30, 8), east);
  601. EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
  602. @@ -969,7 +969,7 @@ TEST(MakeTime, SysSecondsLimits) {
  603. // Checks that we can also get the maximal value for a far-west zone.
  604. tp = convert(civil_second(292277026596, 12, 4, 1, 30, 7), west);
  605. - EXPECT_EQ("292277026596-12-04T01:30:07-14:00", format(RFC3339, tp, west));
  606. + EXPECT_EQ("292277026596-12-04T01:30:07-14:00", cctz::format(RFC3339, tp, west));
  607. EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
  608. tp = convert(civil_second(292277026596, 12, 4, 7, 30, 8), west);
  609. EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
  610. @@ -978,9 +978,9 @@ TEST(MakeTime, SysSecondsLimits) {
  611. // Approach the minimal time_point<cctz::seconds> value from above.
  612. tp = convert(civil_second(-292277022657, 1, 27, 8, 29, 53), utc);
  613. - EXPECT_EQ("-292277022657-01-27T08:29:53+00:00", format(RFC3339, tp, utc));
  614. + EXPECT_EQ("-292277022657-01-27T08:29:53+00:00", cctz::format(RFC3339, tp, utc));
  615. tp = convert(civil_second(-292277022657, 1, 27, 8, 29, 52), utc);
  616. - EXPECT_EQ("-292277022657-01-27T08:29:52+00:00", format(RFC3339, tp, utc));
  617. + EXPECT_EQ("-292277022657-01-27T08:29:52+00:00", cctz::format(RFC3339, tp, utc));
  618. EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
  619. tp = convert(civil_second(-292277022657, 1, 27, 8, 29, 51), utc);
  620. EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
  621. @@ -989,7 +989,7 @@ TEST(MakeTime, SysSecondsLimits) {
  622. // Checks that we can also get the minimal value for a far-east zone.
  623. tp = convert(civil_second(-292277022657, 1, 27, 22, 29, 52), east);
  624. - EXPECT_EQ("-292277022657-01-27T22:29:52+14:00", format(RFC3339, tp, east));
  625. + EXPECT_EQ("-292277022657-01-27T22:29:52+14:00", cctz::format(RFC3339, tp, east));
  626. EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
  627. tp = convert(civil_second(-292277022657, 1, 27, 22, 29, 51), east);
  628. EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
  629. @@ -998,7 +998,7 @@ TEST(MakeTime, SysSecondsLimits) {
  630. // Checks that we can also get the minimal value for a far-west zone.
  631. tp = convert(civil_second(-292277022657, 1, 26, 18, 29, 52), west);
  632. - EXPECT_EQ("-292277022657-01-26T18:29:52-14:00", format(RFC3339, tp, west));
  633. + EXPECT_EQ("-292277022657-01-26T18:29:52-14:00", cctz::format(RFC3339, tp, west));
  634. EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
  635. tp = convert(civil_second(-292277022657, 1, 26, 18, 29, 51), west);
  636. EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
  637. @@ -1018,11 +1018,11 @@ TEST(MakeTime, SysSecondsLimits) {
  638. #if defined(__FreeBSD__) || defined(__OpenBSD__)
  639. // The BSD gmtime_r() fails on extreme positive tm_year values.
  640. #else
  641. - EXPECT_EQ("2147485547-12-31T23:59:59+00:00", format(RFC3339, tp, cut));
  642. + EXPECT_EQ("2147485547-12-31T23:59:59+00:00", cctz::format(RFC3339, tp, cut));
  643. #endif
  644. const year_t min_tm_year = year_t{std::numeric_limits<int>::min()} + 1900;
  645. tp = convert(civil_second(min_tm_year, 1, 1, 0, 0, 0), cut);
  646. - EXPECT_EQ("-2147481748-01-01T00:00:00+00:00", format(RFC3339, tp, cut));
  647. + EXPECT_EQ("-2147481748-01-01T00:00:00+00:00", cctz::format(RFC3339, tp, cut));
  648. #endif
  649. }
  650. }