aboutsummaryrefslogtreecommitdiff
path: root/test/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/util.h')
-rw-r--r--test/util.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/test/util.h b/test/util.h
index 9120e22e..803cdeea 100644
--- a/test/util.h
+++ b/test/util.h
@@ -29,9 +29,9 @@ void safe_sprintf(char (&buffer)[SIZE], const char* format, ...) {
extern const char* const file_content;
// Opens a buffered file for reading.
-fmt::buffered_file open_buffered_file(FILE** fp = nullptr);
+auto open_buffered_file(FILE** fp = nullptr) -> fmt::buffered_file;
-inline FILE* safe_fopen(const char* filename, const char* mode) {
+inline auto safe_fopen(const char* filename, const char* mode) -> FILE* {
#if defined(_WIN32) && !defined(__MINGW32__)
// Fix MSVC warning about "unsafe" fopen.
FILE* f = nullptr;
@@ -51,17 +51,17 @@ template <typename Char> class basic_test_string {
public:
explicit basic_test_string(const Char* value = empty) : value_(value) {}
- const std::basic_string<Char>& value() const { return value_; }
+ auto value() const -> const std::basic_string<Char>& { return value_; }
};
template <typename Char> const Char basic_test_string<Char>::empty[] = {0};
-typedef basic_test_string<char> test_string;
-typedef basic_test_string<wchar_t> test_wstring;
+using test_string = basic_test_string<char>;
+using test_wstring = basic_test_string<wchar_t>;
template <typename Char>
-std::basic_ostream<Char>& operator<<(std::basic_ostream<Char>& os,
- const basic_test_string<Char>& s) {
+auto operator<<(std::basic_ostream<Char>& os, const basic_test_string<Char>& s)
+ -> std::basic_ostream<Char>& {
os << s.value();
return os;
}
@@ -72,10 +72,12 @@ class date {
public:
date(int year, int month, int day) : year_(year), month_(month), day_(day) {}
- int year() const { return year_; }
- int month() const { return month_; }
- int day() const { return day_; }
+ auto year() const -> int { return year_; }
+ auto month() const -> int { return month_; }
+ auto day() const -> int { return day_; }
};
-// Returns a locale with the given name if available or classic locale otherwise.
-std::locale get_locale(const char* name, const char* alt_name = nullptr);
+// Returns a locale with the given name if available or classic locale
+// otherwise.
+auto get_locale(const char* name, const char* alt_name = nullptr)
+ -> std::locale;