Commit Graph

970 Commits

Author SHA1 Message Date
Victor Zverovich
de5da50910 Fix formatting of extreme durations (#1154) 2019-05-11 08:42:02 -07:00
Victor Zverovich
ea2976e6d5 Move internal::uintptr_t test to format-impl-test (#1152) 2019-05-11 06:58:22 -07:00
Alex Alabuzhev
77d6036cd5 Fix unexpected trailing decimal point (#1153) 2019-05-11 06:34:47 -07:00
Victor Zverovich
e9bab6d028 Improve handling of large durations 2019-05-08 12:40:33 -07:00
denchat
3fd134be03 Move test_count_digits to format-impl-test and disable gtest warnings (#1147)
* This translation unit includes `gtest.h` in which using something like `strncpy`

Suppress MSVC warnings from `gtest.h` included.

Warning sample:
fmt-master\test\gtest\gtest.h(2873,10): warning: 'strncpy' is deprecated: This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]

* Moving `test_count_digits` to format-impl-test then count_digits<4>(internal::uintptr_t) shall not be exported

* retaining _CRT_SECURE_NO_WARNINGS always defined should be no harms.
2019-05-07 12:09:11 -07:00
Victor Zverovich
ca978b3d21 Fix handling of nan durations 2019-05-05 08:53:23 -07:00
Victor Zverovich
c1d430e61a Improve handling of negative durations 2019-05-04 17:52:20 -07:00
Victor Zverovich
38a85502ed Use the same rep type for seconds to prevent overflow 2019-05-04 09:22:09 -07:00
Paul Dreik
b3cc9c0567 Merge remote-tracking branch 'upstream/master' into invalidcolons
# Conflicts:
#	test/chrono-test.cc
2019-04-28 21:35:21 +02:00
Paul Dreik
2e3352fd05 provoke assertion
fmt/include/fmt/core.h:246:
typename std::make_unsigned<_Tp>::type fmt::v5::internal::to_unsigned(Int)
[with Int = long int;
 typename std::make_unsigned<_Tp>::type = long unsigned int]:
Assertion `(value >= 0) && "negative value"' failed.
2019-04-28 21:34:09 +02:00
Victor Zverovich
4c721e3a2f Fix chrono formatting with invalid argument id (#1132) 2019-04-28 07:08:41 -07:00
Victor Zverovich
8d8ea21c69 Partially implement Grisu3 2019-04-27 12:17:21 -07:00
Victor Zverovich
40a7975640 Remove trailing zeros 2019-04-27 07:42:27 -07:00
Victor Zverovich
cb46397dfb Fix typo 2019-04-27 07:13:35 -07:00
Victor Zverovich
134904c886 Re-enabled constexpr tests 2019-04-26 17:07:37 -07:00
Victor Zverovich
bd516e3429 Convert negative precision to zero in printf (#1127)
and remove redundant check in grisu2_prettify.
2019-04-21 07:44:04 -07:00
Victor Zverovich
5efb24dd2b Add specialization test 2019-04-19 17:15:46 -07:00
Victor Zverovich
946498cfbc Fix handling of zero precision 2019-04-19 15:10:12 -07:00
HE, Tao
6b20863918 fmt::ptr: support unique_ptr and shared_ptr. 2019-04-18 10:12:11 -07:00
Victor Zverovich
d306585a3f Don't inject internal names into std (#1120) 2019-04-17 13:25:31 -07:00
Victor Zverovich
dc94010fa5 Remove char_traits (#1117) 2019-04-16 17:08:24 -07:00
Victor Zverovich
397e8dd9d5 clang-format 2019-04-15 11:39:19 -07:00
ToolsDevler
2b415b7af7 Restructure printf_arg_formatter to make it customizable 2019-04-15 11:10:31 -07:00
Victor Zverovich
5d755d0a4e Fix handling of volatile char (#1115) 2019-04-14 12:34:56 -07:00
Victor Zverovich
41fbaeb3b1 Add <format> test 2019-04-13 11:37:52 -07:00
Victor Zverovich
8bc0adb9ba Get rid of obsolete cmake stuff 2019-04-13 11:37:52 -07:00
Bruce Mitchener
aeb5ad3ce1 Enable [[noreturn]] some. 2019-04-08 07:53:59 -07:00
Victor Zverovich
2808395481 basic_buffer -> buffer
This reduces symbol sizes and gets rid of shadowing warnings.
2019-04-07 20:32:28 -07:00
Victor Zverovich
07d5a86a7c Fix warnings 2019-04-06 22:10:10 -07:00
Victor Zverovich
f10a7e2e46 Test exotic pointer formatting 2019-04-06 09:04:44 -07:00
Victor Zverovich
bd8177177a Add support for platforms without uintptr_t 2019-04-06 08:11:03 -07:00
Victor Zverovich
018d8b57f6 Remove broken snprintf 2019-03-30 20:27:52 -07:00
Victor Zverovich
da0ea4161a Make compile-time checks work with fallback formatter (#1088) 2019-03-21 19:26:53 -07:00
mwinterb
7ad3015f5b Added missing typename to FMT_STRING. (#1089)
* Added missing typename to FMT_STRING.

This is so that FMT_STRING can be used in a template.
2019-03-20 20:37:00 -07:00
Victor Zverovich
294fd7df96 Remove isinf workaround 2019-03-17 14:49:19 -07:00
Victor Zverovich
76d326a2a2 Enable grisu for general format 2019-03-17 09:48:50 -07:00
Victor Zverovich
97619e27a2 More fixed precision tests 2019-03-15 10:20:20 -07:00
Victor Zverovich
dd6cc0e6ac Merge time-test into chrono-test 2019-03-14 18:10:56 -07:00
Victor Zverovich
a939c75956 Merge fmt/time.h into fmt/chrono.h 2019-03-14 18:07:42 -07:00
Victor Zverovich
a82b3680dc More tests and fixed precision fixes 2019-03-13 19:47:07 -07:00
Victor Zverovich
e28429ee73 Prevent overflow with zero precision 2019-03-13 10:46:25 -07:00
Victor Zverovich
1632f72cbe Test get_round_direction 2019-03-10 11:14:50 -07:00
Victor Zverovich
8129b9bc46 Test that the library can be compiled witout locales 2019-03-10 07:57:29 -07:00
Victor Zverovich
835087dd04 Add color-test 2019-03-10 07:57:29 -07:00
Victor Zverovich
8407f4cb24 Round close to zero fixed precision 2019-03-09 15:18:34 -08:00
Victor Zverovich
49d244c065 Don't emit more than precision digits (#1072) 2019-03-09 13:53:23 -08:00
Michael Winterberg
d8434baa03 Declare the size of RESET_COLOR.
This is so that the format with a text_tyle will compile even if
header-only mode isn't enabled. Addresses #1063.
2019-03-06 09:41:45 -10:00
Victor Zverovich
2e526a664a Fix handling of output iterator in ranges 2019-03-06 08:10:46 -08:00
gawain
79b79f329e Add support for '%' type to output floating point values as a
percentage.

This helps with compatibility with Python's format strings.
2019-03-05 17:36:20 -08:00
Alexander Bolz
287eaab3b2 Increment output iterator in basic_writer::write for character types (#1056) 2019-02-26 12:16:34 -10:00