Lines Matching full:fmt
17 #include "fmt/printf.h"
27 using fmt::detail::bigint;
28 using fmt::detail::fp;
29 using fmt::detail::max_value;
35 EXPECT_EQ("", fmt::format("{}", bigint())); in TEST()
36 EXPECT_EQ("42", fmt::format("{}", bigint(0x42))); in TEST()
37 EXPECT_EQ("123456789abcedf0", fmt::format("{}", bigint(0x123456789abcedf0))); in TEST()
83 EXPECT_EQ("42", fmt::format("{}", n)); in TEST()
85 EXPECT_EQ("84", fmt::format("{}", n)); in TEST()
87 EXPECT_EQ("108000000", fmt::format("{}", n)); in TEST()
94 EXPECT_EQ("42", fmt::format("{}", n)); in TEST()
96 EXPECT_EQ("84", fmt::format("{}", n)); in TEST()
98 EXPECT_EQ("962fc95e0", fmt::format("{}", n)); in TEST()
101 EXPECT_EQ("fffffffe00000001", fmt::format("{}", bigmax)); in TEST()
104 EXPECT_EQ("fffffffffffffffe0000000000000001", fmt::format("{}", bigmax)); in TEST()
108 fmt::detail::accumulator acc; in TEST()
116 acc += fmt::detail::max_value<uint64_t>(); in TEST()
127 EXPECT_EQ("0", fmt::format("{}", n0)); in TEST()
130 EXPECT_EQ("10000", fmt::format("{}", n1)); in TEST()
133 EXPECT_EQ("ffffffffe000000001", fmt::format("{}", n2)); in TEST()
136 EXPECT_EQ("fffffffffffffffe0000000000000001", fmt::format("{}", n3)); in TEST()
139 EXPECT_EQ("2540be400", fmt::format("{}", n4)); in TEST()
162 fmt::format("{}", n1)); in TEST()
170 EXPECT_EQ("0", fmt::format("{}", n1)); in TEST()
176 fmt::format("{}", n1)); in TEST()
182 EXPECT_EQ("2a", fmt::format("{}", n2)); in TEST()
186 fmt::print("warning: double is not IEC559, skipping FP tests\n"); in run_double_tests()
218 auto fp = fmt::detail::get_cached_power(exp, dec_exp); in TEST()
228 auto exact_str = fmt::format("{}", exact); in TEST()
229 auto cache_str = fmt::format("{}", cache); in TEST()
243 auto exact_str = fmt::format("{}", exact); in TEST()
244 auto cache_str = fmt::format("{}", cache); in TEST()
252 using fmt::detail::dragonbox::floor_log10_pow2; in TEST()
253 using float_info = fmt::detail::dragonbox::float_info<float>; in TEST()
254 EXPECT_EQ(fmt::detail::const_check(float_info::max_k), in TEST()
257 using double_info = fmt::detail::dragonbox::float_info<double>; in TEST()
259 fmt::detail::const_check(double_info::max_k), in TEST()
265 using fmt::detail::get_round_direction; in TEST()
266 using fmt::detail::round_direction; in TEST()
289 struct handler : fmt::detail::fixed_handler { in TEST()
291 handler(int prec = 0) : fmt::detail::fixed_handler() { in TEST()
300 namespace digits = fmt::detail::digits; in TEST()
311 fmt::memory_buffer buf; in TEST()
312 format_float(0.42, -1, fmt::detail::float_specs(), buf); in TEST()
319 throw std::runtime_error(fmt::format("invalid type {}", typeid(U).name())); in operator ()()
324 FMT_NORETURN T operator()(fmt::detail::int128_t) { in operator ()()
328 FMT_NORETURN T operator()(fmt::detail::uint128_t) { in operator ()()
336 auto arg = fmt::detail::make_arg<fmt::format_context>(value); in TEST()
337 fmt::visit_format_arg( in TEST()
338 fmt::detail::arg_converter<long long, fmt::format_context>(arg, 'd'), in TEST()
340 EXPECT_EQ(value, fmt::visit_format_arg(value_extractor<long long>(), arg)); in TEST()
346 EXPECT_ASSERT(fmt::detail::safe_strerror(EDOM, message = nullptr, 0), in TEST()
348 EXPECT_ASSERT(fmt::detail::safe_strerror(EDOM, message = buffer, 0), in TEST()
360 fmt::detail::safe_strerror(error_code, message = buffer, BUFFER_SIZE); in TEST()
369 fmt::detail::safe_strerror(error_code, message = buffer, message_size); in TEST()
371 result = fmt::detail::safe_strerror(error_code, message = buffer, 1); in TEST()
381 fmt::memory_buffer buffer; in TEST()
383 fmt::detail::format_error_code(buffer, 42, "test"); in TEST()
387 fmt::memory_buffer buffer; in TEST()
388 std::string prefix(fmt::inline_buffer_size - msg.size() - sep.size() + 1, in TEST()
390 fmt::detail::format_error_code(buffer, 42, prefix); in TEST()
396 msg = fmt::format("error {}", codes[i]); in TEST()
397 fmt::memory_buffer buffer; in TEST()
398 std::string prefix(fmt::inline_buffer_size - msg.size() - sep.size(), 'x'); in TEST()
399 fmt::detail::format_error_code(buffer, codes[i], prefix); in TEST()
401 size_t size = fmt::inline_buffer_size; in TEST()
406 fmt::detail::format_error_code(buffer, codes[i], prefix); in TEST()
413 fmt::detail::count_code_points( in TEST()
414 fmt::basic_string_view<fmt::detail::char8_type>( in TEST()
415 reinterpret_cast<const fmt::detail::char8_type*>("ёжик")))); in TEST()
418 // Tests fmt::detail::count_digits for integer type Int.
420 for (Int i = 0; i < 10; ++i) EXPECT_EQ(1u, fmt::detail::count_digits(i)); in test_count_digits()
423 EXPECT_EQ(i, fmt::detail::count_digits(n - 1)); in test_count_digits()
424 EXPECT_EQ(i + 1, fmt::detail::count_digits(n)); in test_count_digits()
435 fmt::detail::write_ptr<char>( in TEST()
437 fmt::detail::fallback_uintptr(reinterpret_cast<void*>(0xface)), nullptr); in TEST()
443 decltype(WriteConsoleW)* p = fmt::detail::WriteConsoleW; in TEST()