mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-09 12:50:05 +00:00
Apply coding conventions
This commit is contained in:
parent
4939d67a83
commit
8e6b2541a6
@ -627,12 +627,10 @@ TEST(chrono_test, locale) {
|
||||
using dms = std::chrono::duration<double, std::milli>;
|
||||
|
||||
TEST(chrono_test, format_default_fp) {
|
||||
typedef std::chrono::duration<float> fs;
|
||||
EXPECT_EQ(fmt::format("{}", fs(1.234)), "1.234s");
|
||||
typedef std::chrono::duration<float, std::milli> fms;
|
||||
EXPECT_EQ(fmt::format("{}", fms(1.234)), "1.234ms");
|
||||
typedef std::chrono::duration<double> ds;
|
||||
EXPECT_EQ(fmt::format("{}", ds(1.234)), "1.234s");
|
||||
EXPECT_EQ(fmt::format("{}", std::chrono::duration<float>(1.234)), "1.234s");
|
||||
EXPECT_EQ(fmt::format("{}", std::chrono::duration<float, std::milli>(1.234)),
|
||||
"1.234ms");
|
||||
EXPECT_EQ(fmt::format("{}", std::chrono::duration<double>(1.234)), "1.234s");
|
||||
EXPECT_EQ(fmt::format("{}", dms(1.234)), "1.234ms");
|
||||
}
|
||||
|
||||
@ -667,12 +665,13 @@ TEST(chrono_test, format_full_specs) {
|
||||
}
|
||||
|
||||
TEST(chrono_test, format_simple_q) {
|
||||
typedef std::chrono::duration<float> fs;
|
||||
EXPECT_EQ(fmt::format("{:%Q %q}", fs(1.234)), "1.234 s");
|
||||
typedef std::chrono::duration<float, std::milli> fms;
|
||||
EXPECT_EQ(fmt::format("{:%Q %q}", fms(1.234)), "1.234 ms");
|
||||
typedef std::chrono::duration<double> ds;
|
||||
EXPECT_EQ(fmt::format("{:%Q %q}", ds(1.234)), "1.234 s");
|
||||
EXPECT_EQ(fmt::format("{:%Q %q}", std::chrono::duration<float>(1.234)),
|
||||
"1.234 s");
|
||||
EXPECT_EQ(
|
||||
fmt::format("{:%Q %q}", std::chrono::duration<float, std::milli>(1.234)),
|
||||
"1.234 ms");
|
||||
EXPECT_EQ(fmt::format("{:%Q %q}", std::chrono::duration<double>(1.234)),
|
||||
"1.234 s");
|
||||
EXPECT_EQ(fmt::format("{:%Q %q}", dms(1.234)), "1.234 ms");
|
||||
}
|
||||
|
||||
|
@ -353,9 +353,9 @@ TEST(memory_buffer_test, move_assignment) {
|
||||
}
|
||||
|
||||
TEST(memory_buffer_test, grow) {
|
||||
typedef allocator_ref<mock_allocator<int>> Allocator;
|
||||
using allocator = allocator_ref<mock_allocator<int>>;
|
||||
mock_allocator<int> alloc;
|
||||
basic_memory_buffer<int, 10, Allocator> buffer((Allocator(&alloc)));
|
||||
basic_memory_buffer<int, 10, allocator> buffer((allocator(&alloc)));
|
||||
buffer.resize(7);
|
||||
using fmt::detail::to_unsigned;
|
||||
for (int i = 0; i < 7; ++i) buffer[to_unsigned(i)] = i * i;
|
||||
|
@ -30,13 +30,13 @@ namespace test {
|
||||
|
||||
#ifndef _MSC_VER
|
||||
// Size type for read and write.
|
||||
typedef size_t size_t;
|
||||
typedef ssize_t ssize_t;
|
||||
using size_t = size_t;
|
||||
using ssize_t = ssize_t;
|
||||
int open(const char* path, int oflag, int mode);
|
||||
int fstat(int fd, struct stat* buf);
|
||||
#else
|
||||
typedef unsigned size_t;
|
||||
typedef int ssize_t;
|
||||
using size_t = unsigned;
|
||||
using ssize_t = int;
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
|
@ -310,10 +310,10 @@ TEST(printf_test, dynamic_precision) {
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T> struct make_signed { typedef T type; };
|
||||
template <typename T> struct make_signed { using type = T; };
|
||||
|
||||
#define SPECIALIZE_MAKE_SIGNED(T, S) \
|
||||
template <> struct make_signed<T> { typedef S type; }
|
||||
template <> struct make_signed<T> { using type = S; }
|
||||
|
||||
SPECIALIZE_MAKE_SIGNED(char, signed char);
|
||||
SPECIALIZE_MAKE_SIGNED(unsigned char, signed char);
|
||||
|
Loading…
Reference in New Issue
Block a user