Skip to content

Commit 46126bd

Browse files
committed
Ignore MSVC conversion warnings
1 parent c04b484 commit 46126bd

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

test/test_format.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,20 @@ void test_cohort_preservation()
228228
BOOST_TEST_CSTR_EQ(std::format("{:a}", decimals[i]).c_str(), result_strings[i]);
229229

230230
std::string s {result_strings[i]};
231+
232+
#ifdef _MSC_VER
233+
# pragma warning(push)
234+
# pragma warning(disable : 4244)
235+
#endif
236+
231237
std::transform(s.begin(), s.end(), s.begin(),
232238
[](unsigned char c)
233239
{ return std::toupper(c); });
234240

241+
#ifdef _MSC_VER
242+
# pragma warning(pop)
243+
#endif
244+
235245
BOOST_TEST_CSTR_EQ(std::format("{:A}", decimals[i]).c_str(), s.c_str());
236246
}
237247
}

test/test_format_fmtlib.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,20 @@ void test_cohort_preservation()
252252
{
253253
BOOST_TEST_CSTR_EQ(fmt::format("{:a}", decimals[i]).c_str(), result_strings[i]);
254254

255+
#ifdef _MSC_VER
256+
# pragma warning(push)
257+
# pragma warning(disable : 4244)
258+
#endif
259+
255260
std::string s {result_strings[i]};
256261
std::transform(s.begin(), s.end(), s.begin(),
257262
[](unsigned char c)
258263
{ return std::toupper(c); });
259264

265+
#ifdef _MSC_VER
266+
# pragma warning(pop)
267+
#endif
268+
260269
BOOST_TEST_CSTR_EQ(fmt::format("{:A}", decimals[i]).c_str(), s.c_str());
261270
}
262271
}

0 commit comments

Comments
 (0)