Test building all headers with wxNO_IMPLICIT_WXSTRING_ENCODING
Check that all our public headers compile with this macro defined and that using a char string without specifying its expected encoding results in the expected compilation failure in this case.
This commit is contained in:
		
				
					committed by
					
						
						Vadim Zeitlin
					
				
			
			
				
	
			
			
			
						parent
						
							d16787e1af
						
					
				
				
					commit
					40d1a3da35
				
			
							
								
								
									
										30
									
								
								tests/allheaders.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								tests/allheaders.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
// Name:        tests/allheaders.cpp
 | 
			
		||||
// Purpose:     Compilation test for all headers
 | 
			
		||||
// Author:      Vadim Zeitlin, Arrigo Marchiori
 | 
			
		||||
// Created:     2020-04-20
 | 
			
		||||
// Copyright:   (c) 2010,2020 Vadim Zeitlin, Wlodzimierz Skiba, Arrigo Marchiori
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
// ----------------------------------------------------------------------------
 | 
			
		||||
// headers
 | 
			
		||||
// ----------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
#include "testprec.h"
 | 
			
		||||
 | 
			
		||||
#ifdef __BORLANDC__
 | 
			
		||||
    #pragma hdrstop
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "allheaders.h"
 | 
			
		||||
 | 
			
		||||
TEST_CASE("wxNO_IMPLICIT_WXSTRING_ENCODING", "[string]")
 | 
			
		||||
{
 | 
			
		||||
    wxString s = wxASCII_STR("Hello, ASCII");
 | 
			
		||||
    REQUIRE(s == L"Hello, ASCII");
 | 
			
		||||
#ifdef TEST_IMPLICIT_WXSTRING_ENCODING
 | 
			
		||||
    // Compilation of this should fail, because the macro
 | 
			
		||||
    // wxNO_IMPLICIT_WXSTRING_ENCODING must be set
 | 
			
		||||
    s = "Hello, implicit encoding";
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user