Apply coding conventions

This commit is contained in:
Victor Zverovich 2023-12-30 16:07:35 -08:00
parent 4939d67a83
commit 8e6b2541a6
4 changed files with 19 additions and 20 deletions

View File

@ -627,12 +627,10 @@ TEST(chrono_test, locale) {
using dms = std::chrono::duration<double, std::milli>; using dms = std::chrono::duration<double, std::milli>;
TEST(chrono_test, format_default_fp) { TEST(chrono_test, format_default_fp) {
typedef std::chrono::duration<float> fs; EXPECT_EQ(fmt::format("{}", std::chrono::duration<float>(1.234)), "1.234s");
EXPECT_EQ(fmt::format("{}", fs(1.234)), "1.234s"); EXPECT_EQ(fmt::format("{}", std::chrono::duration<float, std::milli>(1.234)),
typedef std::chrono::duration<float, std::milli> fms; "1.234ms");
EXPECT_EQ(fmt::format("{}", fms(1.234)), "1.234ms"); EXPECT_EQ(fmt::format("{}", std::chrono::duration<double>(1.234)), "1.234s");
typedef std::chrono::duration<double> ds;
EXPECT_EQ(fmt::format("{}", ds(1.234)), "1.234s");
EXPECT_EQ(fmt::format("{}", dms(1.234)), "1.234ms"); 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) { TEST(chrono_test, format_simple_q) {
typedef std::chrono::duration<float> fs; EXPECT_EQ(fmt::format("{:%Q %q}", std::chrono::duration<float>(1.234)),
EXPECT_EQ(fmt::format("{:%Q %q}", fs(1.234)), "1.234 s"); "1.234 s");
typedef std::chrono::duration<float, std::milli> fms; EXPECT_EQ(
EXPECT_EQ(fmt::format("{:%Q %q}", fms(1.234)), "1.234 ms"); fmt::format("{:%Q %q}", std::chrono::duration<float, std::milli>(1.234)),
typedef std::chrono::duration<double> ds; "1.234 ms");
EXPECT_EQ(fmt::format("{:%Q %q}", ds(1.234)), "1.234 s"); 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"); EXPECT_EQ(fmt::format("{:%Q %q}", dms(1.234)), "1.234 ms");
} }

View File

@ -353,9 +353,9 @@ TEST(memory_buffer_test, move_assignment) {
} }
TEST(memory_buffer_test, grow) { TEST(memory_buffer_test, grow) {
typedef allocator_ref<mock_allocator<int>> Allocator; using allocator = allocator_ref<mock_allocator<int>>;
mock_allocator<int> alloc; 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); buffer.resize(7);
using fmt::detail::to_unsigned; using fmt::detail::to_unsigned;
for (int i = 0; i < 7; ++i) buffer[to_unsigned(i)] = i * i; for (int i = 0; i < 7; ++i) buffer[to_unsigned(i)] = i * i;

View File

@ -30,13 +30,13 @@ namespace test {
#ifndef _MSC_VER #ifndef _MSC_VER
// Size type for read and write. // Size type for read and write.
typedef size_t size_t; using size_t = size_t;
typedef ssize_t ssize_t; using ssize_t = ssize_t;
int open(const char* path, int oflag, int mode); int open(const char* path, int oflag, int mode);
int fstat(int fd, struct stat* buf); int fstat(int fd, struct stat* buf);
#else #else
typedef unsigned size_t; using size_t = unsigned;
typedef int ssize_t; using ssize_t = int;
#endif #endif
#ifndef _WIN32 #ifndef _WIN32

View File

@ -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) \ #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(char, signed char);
SPECIALIZE_MAKE_SIGNED(unsigned char, signed char); SPECIALIZE_MAKE_SIGNED(unsigned char, signed char);