Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

const_casts to get rid of warnings in new wchar_t tests

Commit
4aaf67ff3105713ecb98fa1abbe13bdbc1be9082
Author
Phil Nash ·
Parents
7bc0b445979c

Files · Download .tar.gz

Changes

 projects/SelfTest/MiscTests.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp
index e425b64a..b229c766 100644
--- a/projects/SelfTest/MiscTests.cpp
+++ b/projects/SelfTest/MiscTests.cpp
@@ -370,13 +370,13 @@ TEST_CASE( "toString on const wchar_t pointer returns the string contents", "[to
 }
 
 TEST_CASE( "toString on wchar_t const pointer returns the string contents", "[toString]" ) {
-	wchar_t * const s = L"wide load";
+	wchar_t * const s = const_cast<wchar_t* const>( L"wide load" );
 	std::string result = Catch::toString( s );
 	CHECK( result == "\"wide load\"" );
 }
 
 TEST_CASE( "toString on wchar_t returns the string contents", "[toString]" ) {
-	wchar_t * s = L"wide load";
+	wchar_t * s = const_cast<wchar_t*>( L"wide load" );
 	std::string result = Catch::toString( s );
 	CHECK( result == "\"wide load\"" );
-}
\ No newline at end of file
+}