Define wxNO_UNSAFE_WXSTRING_CONV if wxUSE_UNSAFE_WXSTRING_CONV==0

This doesn't really change anything, but allows to simplify the tests,
as we can now check only for wxNO_UNSAFE_WXSTRING_CONV and this covers
both the case of the library compiled without support for the unsafe
conversions at all and the case when the conversions are disabled by
explicitly defining wxNO_UNSAFE_WXSTRING_CONV when building the
application.
This commit is contained in:
Vadim Zeitlin
2023-04-16 01:03:51 +02:00
parent 5119d35d3b
commit 4913857ef7
3 changed files with 14 additions and 8 deletions

View File

@@ -614,7 +614,7 @@ TEST_CASE("StdString::Conversion", "[stdstring]")
wxString s4("hello");
#if wxUSE_STD_STRING_CONV_IN_WXSTRING && wxUSE_UNSAFE_WXSTRING_CONV
#if wxUSE_STD_STRING_CONV_IN_WXSTRING && !defined(wxNO_UNSAFE_WXSTRING_CONV)
std::string s5 = s4;
#else
std::string s5 = s4.ToStdString();
@@ -629,7 +629,7 @@ TEST_CASE("StdString::Conversion", "[stdstring]")
CHECK( s6 == L"hello" );
#if wxUSE_STD_STRING_CONV_IN_WXSTRING
#if wxUSE_UNSAFE_WXSTRING_CONV
#if !defined(wxNO_UNSAFE_WXSTRING_CONV)
std::string s7(s4);
CHECK( s7 == "hello" );
#endif