Skip to content

Commit 652b4c9

Browse files
committed
fix build & test issues
1 parent 861e1fe commit 652b4c9

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

Diff for: include/fmt/chrono.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -2088,17 +2088,17 @@ class year {
20882088

20892089
class year_month_day {
20902090
private:
2091-
year year_;
2092-
month month_;
2093-
day day_;
2091+
fmt::year year_;
2092+
fmt::month month_;
2093+
fmt::day day_;
20942094

20952095
public:
20962096
year_month_day() = default;
20972097
constexpr year_month_day(const year& y, const month& m, const day& d) noexcept
20982098
: year_(y), month_(m), day_(d) {}
2099-
constexpr year year() const noexcept { return year_; }
2100-
constexpr month month() const noexcept { return month_; }
2101-
constexpr day day() const noexcept { return day_; }
2099+
constexpr fmt::year year() const noexcept { return year_; }
2100+
constexpr fmt::month month() const noexcept { return month_; }
2101+
constexpr fmt::day day() const noexcept { return day_; }
21022102
};
21032103
#endif
21042104

Diff for: test/chrono-test.cc

+4-6
Original file line numberDiff line numberDiff line change
@@ -749,15 +749,14 @@ TEST(chrono_test, unsigned_duration) {
749749
}
750750

751751
TEST(chrono_test, weekday) {
752-
auto loc = get_locale("en_US.UTF-8");
753-
std::locale::global(loc);
752+
std::locale::global(std::locale::classic());
754753
auto sat = fmt::weekday(6);
755754

756755
EXPECT_EQ(fmt::format("{}", sat), "Sat");
757756
EXPECT_EQ(fmt::format("{:%a}", sat), "Sat");
758757
EXPECT_EQ(fmt::format("{:%A}", sat), "Saturday");
759758

760-
loc = get_locale("es_ES.UTF-8");
759+
auto loc = get_locale("es_ES.UTF-8");
761760
std::locale::global(loc);
762761
if (loc != std::locale::classic()) {
763762
auto saturdays = std::vector<std::string>{"sáb", "sá."};
@@ -1013,8 +1012,7 @@ TEST(chrono_test, out_of_range) {
10131012
}
10141013

10151014
TEST(chrono_test, year_month_day) {
1016-
auto loc = get_locale("en_US.UTF-8");
1017-
std::locale::global(loc);
1015+
std::locale::global(std::locale::classic());
10181016

10191017
auto year = fmt::year(2024);
10201018
auto month = fmt::month(1);
@@ -1038,7 +1036,7 @@ TEST(chrono_test, year_month_day) {
10381036
EXPECT_EQ(fmt::format("{:%Y-%b-%d}", ymd), "2024-Jan-01");
10391037
EXPECT_EQ(fmt::format("{:%Y-%B-%d}", ymd), "2024-January-01");
10401038

1041-
loc = get_locale("es_ES.UTF-8");
1039+
auto loc = get_locale("es_ES.UTF-8");
10421040
std::locale::global(loc);
10431041
if (loc != std::locale::classic()) {
10441042
EXPECT_EQ(fmt::format(loc, "{:%b}", month), "ene.");

0 commit comments

Comments
 (0)