Merge MaartenBent/cmake-and-build-fixes

CMake improvements and fixes for warnings in the samples.

See https://github.com/wxWidgets/wxWidgets/pull/862
This commit is contained in:
VZ 2018-07-30 00:09:10 +02:00 committed by GitHub
commit 158c5d8471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
95 changed files with 561 additions and 427 deletions

View File

@ -3,7 +3,7 @@
# See the cotire manual for usage hints.
#
#=============================================================================
# Copyright 2012-2017 Sascha Kratky
# Copyright 2012-2018 Sascha Kratky
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
@ -43,7 +43,7 @@ if (NOT CMAKE_SCRIPT_MODE_FILE)
endif()
set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
set (COTIRE_CMAKE_MODULE_VERSION "1.7.10")
set (COTIRE_CMAKE_MODULE_VERSION "1.8.0")
# activate select policies
if (POLICY CMP0025)
@ -239,7 +239,13 @@ function (cotire_filter_language_source_files _language _target _sourceFilesVar
# add to excluded sources, if file has custom compile flags
list (APPEND _excludedSourceFiles "${_sourceFile}")
else()
list (APPEND _sourceFiles "${_sourceFile}")
get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS)
if (_sourceCompileOptions)
# add to excluded sources, if file has list of custom compile options
list (APPEND _excludedSourceFiles "${_sourceFile}")
else()
list (APPEND _sourceFiles "${_sourceFile}")
endif()
endif()
endif()
endforeach()
@ -721,7 +727,7 @@ function (cotire_get_target_compile_definitions _config _language _target _defin
endif()
endforeach()
# parse additional compile definitions from target compile flags
# and don't look at directory compile definitions, which we already handled
# and do not look at directory compile definitions, which we already handled
set (_targetFlags "")
cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
cotire_filter_compile_flags("${_language}" "D" _definitions _ignore ${_targetFlags})
@ -889,6 +895,9 @@ function (cotire_init_compile_cmd _cmdVar _language _compilerLauncher _compilerE
if (NOT _compilerArg1)
set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
endif()
if (WIN32)
file (TO_NATIVE_PATH "${_compilerExe}" _compilerExe)
endif()
string (STRIP "${_compilerArg1}" _compilerArg1)
if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
# compiler launcher is only supported for Makefile and Ninja
@ -1083,12 +1092,11 @@ endmacro()
macro (cotire_parse_line _line _headerFileVar _headerDepthVar)
if (MSVC)
# cl.exe /showIncludes output looks different depending on the language pack used, e.g.:
# cl.exe /showIncludes produces different output, depending on the language pack used, e.g.:
# English: "Note: including file: C:\directory\file"
# German: "Hinweis: Einlesen der Datei: C:\directory\file"
# We use a very general regular expression, relying on the presence of the : characters
if (_line MATCHES "( +)([a-zA-Z]:[^:]+)$")
# Visual Studio compiler output
string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" ABSOLUTE)
else()
@ -1246,11 +1254,19 @@ function (cotire_scan_includes _includesVar)
set (${_includesVar} "" PARENT_SCOPE)
return()
endif()
list (APPEND _cmd ${_existingSourceFiles})
# add source files to be scanned
if (WIN32)
foreach (_sourceFile ${_existingSourceFiles})
file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative)
list (APPEND _cmd "${_sourceFileNative}")
endforeach()
else()
list (APPEND _cmd ${_existingSourceFiles})
endif()
if (COTIRE_VERBOSE)
message (STATUS "execute_process: ${_cmd}")
endif()
if (_option_COMPILER_ID MATCHES "MSVC")
if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT})
endif()
@ -1486,11 +1502,16 @@ function (cotire_generate_prefix_header _prefixFile)
if (_unparsedLines)
if (COTIRE_VERBOSE OR _scanResult OR NOT _selectedHeaders)
list (LENGTH _unparsedLines _skippedLineCount)
message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesFile}")
if (WIN32)
file (TO_NATIVE_PATH "${_unparsedLinesFile}" _unparsedLinesLogPath)
else()
set (_unparsedLinesLogPath "${_unparsedLinesFile}")
endif()
message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesLogPath}")
endif()
string (REPLACE ";" "\n" _unparsedLines "${_unparsedLines}")
endif()
file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}")
file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}\n")
endfunction()
function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flagsVar)
@ -1520,7 +1541,7 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags
# append to list
list (APPEND _flags -H -E)
if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
list (APPEND _flags "-fdirectives-only")
list (APPEND _flags -fdirectives-only)
endif()
else()
# return as a flag string
@ -1530,16 +1551,36 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags
endif()
endif()
elseif (_compilerID MATCHES "Clang")
# Clang options used
# -H print the name of each header file used
# -E invoke preprocessor
# -fno-color-diagnostics don't prints diagnostics in color
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics)
else()
# return as a flag string
set (_flags "-H -E -fno-color-diagnostics")
if (UNIX)
# Clang options used
# -H print the name of each header file used
# -E invoke preprocessor
# -fno-color-diagnostics do not print diagnostics in color
# -Eonly just run preprocessor, no output
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
else()
# return as a flag string
set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly")
endif()
elseif (WIN32)
# Clang-cl.exe options used
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
# /EP preprocess to stdout without #line directives
# -H print the name of each header file used
# -fno-color-diagnostics do not print diagnostics in color
# -Eonly just run preprocessor, no output
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}" /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly)
else()
# return as a flag string
set (_flags "${_sourceFileType${_language}} /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly")
endif()
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
@ -1613,8 +1654,8 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
endif()
endif()
elseif (_compilerID MATCHES "GNU|Clang")
# GCC / Clang options used
elseif (_compilerID MATCHES "GNU")
# GCC options used
# -x specify the source language
# -c compile but do not link
# -o place output in file
@ -1624,11 +1665,52 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
set (_xLanguage_CXX "c++-header")
if (_flags)
# append to list
list (APPEND _flags "-x" "${_xLanguage_${_language}}" "-c" "${_prefixFile}" -o "${_pchFile}")
list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
else()
# return as a flag string
set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -x specify the source language
# -c compile but do not link
# -o place output in file
# -fno-pch-timestamp disable inclusion of timestamp in precompiled headers (clang 4.0.0+)
set (_xLanguage_C "c-header")
set (_xLanguage_CXX "c++-header")
if (_flags)
# append to list
list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
list (APPEND _flags -Xclang -fno-pch-timestamp)
endif()
else()
# return as a flag string
set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
set (_flags "${_flags} -Xclang -fno-pch-timestamp")
endif()
endif()
elseif (WIN32)
# Clang-cl.exe options used
# /Yc creates a precompiled header file
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
# /Zs syntax check only
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}"
"/Yc${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}" /Zs "${_hostFile}")
else()
# return as a flag string
set (_flags "/Yc\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
endif()
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
@ -1679,10 +1761,10 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
if ("${_language}" STREQUAL "CXX")
list (APPEND _flags -Kc++)
endif()
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}")
list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-create "${_pchName}" -fsyntax-only "${_hostFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
list (APPEND _flags "-Wpch-messages")
list (APPEND _flags -Wpch-messages)
endif()
endif()
else()
@ -1742,23 +1824,46 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags "-Winvalid-pch" "-include" "${_prefixFile}")
list (APPEND _flags -Winvalid-pch -include "${_prefixFile}")
else()
# return as a flag string
set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
endif()
elseif (_compilerID MATCHES "Clang")
# Clang options used
# -include process include file as the first line of the primary source file
# -include-pch include precompiled header file
# -Qunused-arguments don't emit warning for unused driver arguments
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags "-Qunused-arguments" "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-Qunused-arguments -include \"${_prefixFile}\"")
if (UNIX)
# Clang options used
# -include process include file as the first line of the primary source file
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}")
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\"")
endif()
elseif (WIN32)
# Clang-cl.exe options used
# /Yu uses a precompiled header file during build
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
if (_pchFile)
if (_flags)
# append to list
list (APPEND _flags "/Yu${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}")
else()
# return as a flag string
set (_flags "/Yu\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
endif()
else()
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
list (APPEND _flags "/FI${_prefixFile}")
else()
# return as a flag string
set (_flags "/FI\"${_prefixFile}\"")
endif()
endif()
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
@ -1808,10 +1913,10 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
endif()
if (_flags)
# append to list
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}")
list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-use "${_pchName}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
list (APPEND _flags "-Wpch-messages")
list (APPEND _flags -Wpch-messages)
endif()
endif()
else()
@ -1827,7 +1932,7 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
list (APPEND _flags "-include" "${_prefixFile}")
list (APPEND _flags -include "${_prefixFile}")
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\"")
@ -1865,13 +1970,13 @@ function (cotire_precompile_prefix_header _prefixFile _pchFile _hostFile)
if (COTIRE_VERBOSE)
message (STATUS "execute_process: ${_cmd}")
endif()
if (_option_COMPILER_ID MATCHES "MSVC")
if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT})
elseif (_option_COMPILER_ID MATCHES "GNU|Clang")
elseif (_option_COMPILER_ID MATCHES "Clang" AND _option_COMPILER_VERSION VERSION_LESS "4.0.0")
if (_option_COMPILER_LAUNCHER MATCHES "ccache" OR
_option_COMPILER_EXECUTABLE MATCHES "ccache")
# Newer versions of Clang and GCC seem to embed a compilation timestamp into the precompiled header binary,
# Newer versions of Clang embed a compilation timestamp into the precompiled header binary,
# which results in "file has been modified since the precompiled header was built" errors if ccache is used.
# We work around the problem by disabling ccache upon pre-compiling the prefix header.
set (ENV{CCACHE_DISABLE} "true")
@ -1890,7 +1995,7 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
set (_unsupportedCompiler
"Precompiled headers not supported for ${_language} compiler ${CMAKE_${_language}_COMPILER_ID}")
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
# supported since Visual Studio C++ 6.0
# PCH supported since Visual Studio C++ 6.0
# and CMake does not support an earlier version
set (${_msgVar} "" PARENT_SCOPE)
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
@ -1901,8 +2006,16 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
set (${_msgVar} "" PARENT_SCOPE)
endif()
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
# all Clang versions have PCH support
set (${_msgVar} "" PARENT_SCOPE)
if (UNIX)
# all Unix Clang versions have PCH support
set (${_msgVar} "" PARENT_SCOPE)
elseif (WIN32)
# only clang-cl is supported under Windows
get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE)
if (NOT _compilerName MATCHES "cl$")
set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE)
endif()
endif()
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
# Intel PCH support requires version >= 8.0.0
if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
@ -1913,19 +2026,25 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
else()
set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
endif()
# check if ccache is used as a compiler launcher
get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" REALPATH)
if (_realCompilerExe MATCHES "ccache" OR _launcher MATCHES "ccache")
# verify that ccache configuration is compatible with precompiled headers
# always check environment variable CCACHE_SLOPPINESS, because earlier versions of ccache
# do not report the "sloppiness" setting correctly upon printing ccache configuration
if (DEFINED ENV{CCACHE_SLOPPINESS})
if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR
NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
set (${_msgVar}
"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
PARENT_SCOPE)
endif()
else()
if (_launcher MATCHES "ccache")
get_filename_component(_ccacheExe "${_launcher}" REALPATH)
if (_realCompilerExe MATCHES "ccache")
set (_ccacheExe "${_realCompilerExe}")
else()
get_filename_component(_ccacheExe "${CMAKE_${_language}_COMPILER}" REALPATH)
set (_ccacheExe "${_launcher}")
endif()
execute_process(
COMMAND "${_ccacheExe}" "--print-config"
@ -1933,9 +2052,10 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
RESULT_VARIABLE _result
OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if (_result OR NOT
_ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR NOT
_ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
if (_result)
set (${_msgVar} "ccache configuration cannot be determined." PARENT_SCOPE)
elseif (NOT _ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR
NOT _ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
set (${_msgVar}
"ccache requires configuration setting \"sloppiness\" to be set to \"pch_defines,time_macros\"."
PARENT_SCOPE)
@ -2261,8 +2381,9 @@ endfunction()
function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
set (_sourceFiles ${ARGN})
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# for Visual Studio and Intel, we attach the precompiled header compilation to the host file
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
if (_sourceFiles)
set (_flags "")
@ -2307,8 +2428,9 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
endfunction()
function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# for Visual Studio and Intel, we include the precompiled header in all but the host file
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
set (_sourceFiles ${ARGN})
list (LENGTH _sourceFiles _numberOfSourceFiles)
@ -2454,9 +2576,10 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
# if this is a single-language target without any excluded files
if (_wholeTarget)
set (_language "${_languages}")
# for Visual Studio and Intel, precompiled header inclusion is always done on the source file level
# for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
# see cotire_setup_pch_file_inclusion
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
if (_prefixFile)
get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
@ -2491,7 +2614,8 @@ function (cotire_setup_unity_generation_commands _language _target _targetScript
set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_objectDependsPaths})
endif()
if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# unity file compilation results in potentially huge object file, thus use /bigobj by default unter MSVC and Windows Intel
# unity file compilation results in potentially huge object file,
# thus use /bigobj by default unter cl.exe and Windows Intel
set_property (SOURCE "${_unityFile}" APPEND_STRING PROPERTY COMPILE_FLAGS "/bigobj")
endif()
cotire_set_cmd_to_prologue(_unityCmd)
@ -2697,6 +2821,9 @@ function (cotire_make_target_message _target _languages _disableMsg _targetMsgVa
else()
set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build.")
endif()
if (_disableMsg)
set (_targetMsg "${_targetMsg} ${_disableMsg}")
endif()
else()
if (_excludedStr)
set (_targetMsg "${_languagesStr} target ${_target} cotired ${_excludedStr}.")
@ -2786,6 +2913,20 @@ function (cotire_choose_target_languages _target _targetLanguagesVar _wholeTarge
set (_targetUsePCH FALSE)
endif()
endif()
if (_targetAddSCU)
# disable unity builds if automatic Qt processing is used
get_target_property(_targetAutoMoc ${_target} AUTOMOC)
get_target_property(_targetAutoUic ${_target} AUTOUIC)
get_target_property(_targetAutoRcc ${_target} AUTORCC)
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
if (_disableMsg)
set (_disableMsg "${_disableMsg} Target uses automatic CMake Qt processing.")
else()
set (_disableMsg "Target uses automatic CMake Qt processing.")
endif()
set (_targetAddSCU FALSE)
endif()
endif()
set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER ${_targetUsePCH})
set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD ${_targetAddSCU})
cotire_make_target_message(${_target} "${_targetLanguages}" "${_disableMsg}" _targetMsg ${_allExcludedSourceFiles})
@ -2813,7 +2954,11 @@ function (cotire_compute_unity_max_number_of_includes _target _maxIncludesVar)
set (_sourceFiles ${ARGN})
get_target_property(_maxIncludes ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
if (_maxIncludes MATCHES "(-j|--parallel|--jobs) ?([0-9]*)")
set (_numberOfThreads "${CMAKE_MATCH_2}")
if (DEFINED CMAKE_MATCH_2)
set (_numberOfThreads "${CMAKE_MATCH_2}")
else()
set (_numberOfThreads "")
endif()
if (NOT _numberOfThreads)
# use all available cores
ProcessorCount(_numberOfThreads)
@ -2926,8 +3071,9 @@ function (cotire_setup_pch_target _languages _configurations _target)
set (_dependsFiles "")
foreach (_language ${_languages})
set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE)
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# Visual Studio and Intel only create precompiled header as a side effect
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# MSVC, Intel and clang-cl only create precompiled header as a side effect
list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER)
endif()
cotire_get_first_set_property_value(_dependsFile TARGET ${_target} ${_props})
@ -2975,6 +3121,7 @@ function (cotire_collect_unity_target_sources _target _languages _unityTargetSou
list (APPEND _unityTargetSources ${_unityFiles})
endif()
endforeach()
# handle object libraries which are part of the target's sources
get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$")
cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles})
@ -3019,21 +3166,6 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
# determine unity target sources
set (_unityTargetSources "")
cotire_collect_unity_target_sources(${_target} "${_languages}" _unityTargetSources)
# handle automatic Qt processing
get_target_property(_targetAutoMoc ${_target} AUTOMOC)
get_target_property(_targetAutoUic ${_target} AUTOUIC)
get_target_property(_targetAutoRcc ${_target} AUTORCC)
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# if the original target sources are subject to CMake's automatic Qt processing,
# also include implicitly generated <targetname>_automoc.cpp file
if (CMAKE_VERSION VERSION_LESS "3.8.0")
list (APPEND _unityTargetSources "${_target}_automoc.cpp")
set_property (SOURCE "${_target}_automoc.cpp" PROPERTY GENERATED TRUE)
else()
list (APPEND _unityTargetSources "${_target}_autogen/moc_compilation.cpp")
set_property (SOURCE "${_target}_autogen/moc_compilation.cpp" PROPERTY GENERATED TRUE)
endif()
endif()
# prevent AUTOMOC, AUTOUIC and AUTORCC properties from being set when the unity target is created
set (CMAKE_AUTOMOC OFF)
set (CMAKE_AUTOUIC OFF)
@ -3047,21 +3179,6 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
else()
add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
endif()
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
# depend on original target's automoc target, if it exists
if (TARGET ${_target}_automoc)
add_dependencies(${_unityTargetName} ${_target}_automoc)
endif()
else()
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# depend on the original target's implicity generated <targetname>_automoc target
if (CMAKE_VERSION VERSION_LESS "3.8.0")
add_dependencies(${_unityTargetName} ${_target}_automoc)
else()
add_dependencies(${_unityTargetName} ${_target}_autogen)
endif()
endif()
endif()
# copy output location properties
set (_outputDirProperties
ARCHIVE_OUTPUT_DIRECTORY ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
@ -3132,7 +3249,8 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
INTERFACE_AUTOUIC_OPTIONS NO_SYSTEM_FROM_IMPORTED)
# copy link stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUILD_WITH_INSTALL_RPATH INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
BUILD_WITH_INSTALL_RPATH BUILD_WITH_INSTALL_NAME_DIR
INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED
LINK_FLAGS LINK_FLAGS_<CONFIG>
LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_<CONFIG>
@ -3174,6 +3292,10 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES
ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH
ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE)
# copy CUDA platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
CUDA_PTX_COMPILATION CUDA_SEPARABLE_COMPILATION CUDA_RESOLVE_DEVICE_SYMBOLS
CUDA_EXTENSIONS CUDA_STANDARD CUDA_STANDARD_REQUIRED)
# use output name from original target
get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
if (NOT _targetOutputName)
@ -3187,6 +3309,13 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
set_property(TARGET ${_unityTargetName} PROPERTY ENABLE_EXPORTS TRUE)
endif()
endif()
# enable parallel compilation for MSVC
if (MSVC AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
list (LENGTH _unityTargetSources _numberOfUnityTargetSources)
if (_numberOfUnityTargetSources GREATER 1)
set_property(TARGET ${_unityTargetName} APPEND PROPERTY COMPILE_OPTIONS "/MP")
endif()
endif()
cotire_init_target(${_unityTargetName})
cotire_add_to_unity_all_target(${_unityTargetName})
set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_TARGET_NAME "${_unityTargetName}")
@ -3345,6 +3474,13 @@ function (cotire_target_link_libraries _target)
message (STATUS "unity target ${_unityTargetName} interface link libraries: ${_unityLinkInterfaceLibraries}")
endif()
endif()
get_target_property(_manualDependencies ${_target} MANUALLY_ADDED_DEPENDENCIES)
if (_manualDependencies)
cotire_map_libraries("${_linkLibrariesStrategy}" _unityManualDependencies ${_manualDependencies})
if (_unityManualDependencies)
add_dependencies("${_unityTargetName}" ${_unityManualDependencies})
endif()
endif()
endif()
endif()
endfunction(cotire_target_link_libraries)
@ -3641,7 +3777,7 @@ else()
set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING
"Ignore sources with the listed file extensions from the generated unity source.")
set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "3" CACHE STRING
set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "2" CACHE STRING
"Minimum number of sources in target required to enable use of precompiled header.")
if (NOT DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT)
@ -3740,7 +3876,7 @@ else()
FULL_DOCS
"The variable can be set to an integer > 0."
"If a target contains less than that number of source files, cotire will not enable the use of the precompiled header for the target."
"If not defined, defaults to 3."
"If not defined, defaults to 2."
)
define_property(

View File

@ -43,7 +43,7 @@ endif()
# STL options
wx_option(wxUSE_STL "use standard C++ classes for everything" OFF)
wx_dependent_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" OFF "wxUSE_STL" OFF)
wx_dependent_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" ON "wxUSE_STL" OFF)
wx_option(wxUSE_UNICODE "compile with Unicode support (NOT RECOMMENDED to be turned off)")
if(NOT WIN32)

View File

@ -56,7 +56,6 @@ set(TEST_SRC
regex/wxregextest.cpp
scopeguard/scopeguardtest.cpp
strings/iostream.cpp
strings/hexconv.cpp
strings/numformatter.cpp
strings/strings.cpp
strings/stdstrings.cpp
@ -66,12 +65,14 @@ set(TEST_SRC
strings/vararg.cpp
strings/crt.cpp
strings/vsnprintf.cpp
strings/hexconv.cpp
streams/datastreamtest.cpp
streams/ffilestream.cpp
streams/fileback.cpp
streams/filestream.cpp
streams/iostreams.cpp
streams/largefile.cpp
streams/lzmastream.cpp
streams/memstream.cpp
streams/socketstream.cpp
streams/sstream.cpp

View File

@ -23,6 +23,7 @@ set(TEST_GUI_SRC
graphics/boundingbox.cpp
graphics/clippingbox.cpp
graphics/graphmatrix.cpp
graphics/graphpath.cpp
config/config.cpp
controls/bitmapcomboboxtest.cpp
controls/bitmaptogglebuttontest.cpp
@ -86,6 +87,7 @@ set(TEST_GUI_SRC
image/rawbmp.cpp
html/htmlparser.cpp
html/htmlwindow.cpp
html/htmprint.cpp
menu/accelentry.cpp
menu/menu.cpp
misc/guifuncs.cpp
@ -97,6 +99,8 @@ set(TEST_GUI_SRC
# non-GUI test) as sockets behave differently in console and GUI
# applications.
net/socket.cpp
persistence/tlw.cpp
persistence/dataview.cpp
sizers/boxsizer.cpp
sizers/gridsizer.cpp
sizers/wrapsizer.cpp

View File

@ -44,9 +44,10 @@ exit /b 0
:cmake
if "%CONFIGURATION%"=="" set CONFIGURATION=Release
cd build_cmake
ctest -V -C %CONFIGURATION% --interactive-debug-mode 0 .
if errorlevel 1 goto error
cd ..\build_cmake
ctest -V -C %CONFIGURATION% -R "test_[base|gui]" --interactive-debug-mode 0 .
if errorlevel 1 goto :error
goto :eof
:error
echo.

View File

@ -39,7 +39,7 @@ namespace
const TCHAR *MAIN_WIN_CLASS_NAME = _TEXT("my_exe_main_win_class");
const int IDB_RUN_GUI_FROM_DLL = 100;
const INT_PTR IDB_RUN_GUI_FROM_DLL = 100;
// ----------------------------------------------------------------------------
// globals
@ -65,7 +65,7 @@ OnCommand(HWND /* hwnd */, int id, HWND /* hwndCtl */, UINT /* codeNotify */)
}
}
void OnDestroy(HWND hwnd)
void OnDestroy(HWND /* hwnd */)
{
wx_dll_cleanup();

View File

@ -25,7 +25,7 @@ using std::string;
///////////////////////////////////////////////////////////////////////////////
// Tar suite
// Tar suite
class tartest : public ArchiveTestSuite
{
@ -38,7 +38,7 @@ protected:
CppUnit::Test *makeTest(string descr, int options,
bool genericInterface,
const wxString& archiver,
const wxString& unarchiver);
const wxString& unarchiver) wxOVERRIDE;
};
tartest::tartest()

View File

@ -43,13 +43,13 @@ public:
protected:
void OnCreateArchive(wxZipOutputStream& zip);
void OnArchiveExtracted(wxZipInputStream& zip, int expectedTotal);
void OnCreateEntry(wxZipOutputStream& zip,
TestEntry& testEntry,
wxZipEntry *entry);
void OnEntryExtracted(wxZipEntry& entry,
const TestEntry& testEntry,
wxZipInputStream *arc);
@ -206,7 +206,7 @@ void ZipPipeTestCase::runTest()
///////////////////////////////////////////////////////////////////////////////
// Zip suite
// Zip suite
class ziptest : public ArchiveTestSuite
{
@ -218,7 +218,7 @@ public:
protected:
CppUnit::Test *makeTest(string descr, int options,
bool genericInterface, const wxString& archiver,
const wxString& unarchiver);
const wxString& unarchiver) wxOVERRIDE;
};
ziptest::ziptest()

View File

@ -34,17 +34,17 @@ class BitmapComboBoxTestCase : public TextEntryTestCase,
public:
BitmapComboBoxTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxTextEntry *GetTestEntry() const { return m_combo; }
virtual wxWindow *GetTestWindow() const { return m_combo; }
virtual wxTextEntry *GetTestEntry() const wxOVERRIDE { return m_combo; }
virtual wxWindow *GetTestWindow() const wxOVERRIDE { return m_combo; }
virtual wxItemContainer *GetContainer() const { return m_combo; }
virtual wxWindow *GetContainerWindow() const { return m_combo; }
virtual wxItemContainer *GetContainer() const wxOVERRIDE { return m_combo; }
virtual wxWindow *GetContainerWindow() const wxOVERRIDE { return m_combo; }
virtual void CheckStringSelection(const char * WXUNUSED(sel))
virtual void CheckStringSelection(const char * WXUNUSED(sel)) wxOVERRIDE
{
// do nothing here, as explained in TextEntryTestCase comment, our
// GetStringSelection() is the wxChoice, not wxTextEntry, one and there

View File

@ -31,8 +31,8 @@ class BitmapToggleButtonTestCase : public CppUnit::TestCase
public:
BitmapToggleButtonTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( BitmapToggleButtonTestCase );

View File

@ -32,8 +32,8 @@ class ButtonTestCase : public CppUnit::TestCase
public:
ButtonTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( ButtonTestCase );
@ -164,7 +164,7 @@ void ButtonTestCase::Bitmap()
CPPUNIT_ASSERT(!m_button->GetBitmap().IsOk());
m_button->SetBitmap(wxArtProvider::GetIcon(wxART_INFORMATION,
m_button->SetBitmap(wxArtProvider::GetIcon(wxART_INFORMATION,
wxART_OTHER,
wxSize(32, 32)));

View File

@ -26,8 +26,8 @@ class CheckBoxTestCase : public CppUnit::TestCase
public:
CheckBoxTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( CheckBoxTestCase );

View File

@ -27,12 +27,12 @@ class CheckListBoxTestCase : public ItemContainerTestCase, public CppUnit::TestC
public:
CheckListBoxTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxItemContainer *GetContainer() const { return m_check; }
virtual wxWindow *GetContainerWindow() const { return m_check; }
virtual wxItemContainer *GetContainer() const wxOVERRIDE { return m_check; }
virtual wxWindow *GetContainerWindow() const wxOVERRIDE { return m_check; }
CPPUNIT_TEST_SUITE( CheckListBoxTestCase );
wxITEM_CONTAINER_TESTS();

View File

@ -27,16 +27,16 @@ class ChoicebookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase
public:
ChoicebookTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxBookCtrlBase *GetBase() const { return m_choicebook; }
virtual wxBookCtrlBase *GetBase() const wxOVERRIDE { return m_choicebook; }
virtual wxEventType GetChangedEvent() const
virtual wxEventType GetChangedEvent() const wxOVERRIDE
{ return wxEVT_CHOICEBOOK_PAGE_CHANGED; }
virtual wxEventType GetChangingEvent() const
virtual wxEventType GetChangingEvent() const wxOVERRIDE
{ return wxEVT_CHOICEBOOK_PAGE_CHANGING; }
CPPUNIT_TEST_SUITE( ChoicebookTestCase );

View File

@ -26,12 +26,12 @@ class ChoiceTestCase : public ItemContainerTestCase, public CppUnit::TestCase
public:
ChoiceTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxItemContainer *GetContainer() const { return m_choice; }
virtual wxWindow *GetContainerWindow() const { return m_choice; }
virtual wxItemContainer *GetContainer() const wxOVERRIDE { return m_choice; }
virtual wxWindow *GetContainerWindow() const wxOVERRIDE { return m_choice; }
CPPUNIT_TEST_SUITE( ChoiceTestCase );
wxITEM_CONTAINER_TESTS();

View File

@ -37,17 +37,17 @@ class ComboBoxTestCase : public TextEntryTestCase, public ItemContainerTestCase,
public:
ComboBoxTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxTextEntry *GetTestEntry() const { return m_combo; }
virtual wxWindow *GetTestWindow() const { return m_combo; }
virtual wxTextEntry *GetTestEntry() const wxOVERRIDE { return m_combo; }
virtual wxWindow *GetTestWindow() const wxOVERRIDE { return m_combo; }
virtual wxItemContainer *GetContainer() const { return m_combo; }
virtual wxWindow *GetContainerWindow() const { return m_combo; }
virtual wxItemContainer *GetContainer() const wxOVERRIDE { return m_combo; }
virtual wxWindow *GetContainerWindow() const wxOVERRIDE { return m_combo; }
virtual void CheckStringSelection(const char * WXUNUSED(sel))
virtual void CheckStringSelection(const char * WXUNUSED(sel)) wxOVERRIDE
{
// do nothing here, as explained in TextEntryTestCase comment, our
// GetStringSelection() is the wxChoice, not wxTextEntry, one and there
@ -64,7 +64,7 @@ private:
// TODO on OS X only works interactively
// WXUISIM_TEST( Editable );
CPPUNIT_TEST( Hint );
CPPUNIT_TEST( CopyPaste );
CPPUNIT_TEST( CopyPaste );
CPPUNIT_TEST( UndoRedo );
#else
wxTEXT_ENTRY_TESTS();

View File

@ -32,8 +32,8 @@ class DataViewCtrlTestCase : public CppUnit::TestCase
public:
DataViewCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( DataViewCtrlTestCase );

View File

@ -30,8 +30,8 @@ class DatePickerCtrlTestCase : public CppUnit::TestCase
public:
DatePickerCtrlTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( DatePickerCtrlTestCase );

View File

@ -24,8 +24,8 @@ class FrameTestCase : public CppUnit::TestCase
public:
FrameTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( FrameTestCase );

View File

@ -24,8 +24,8 @@ class GaugeTestCase : public CppUnit::TestCase
public:
GaugeTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( GaugeTestCase );

View File

@ -42,8 +42,8 @@ class GridTestCase : public CppUnit::TestCase
public:
GridTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( GridTestCase );

View File

@ -31,8 +31,8 @@ class HeaderCtrlTestCase : public CppUnit::TestCase
public:
HeaderCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( HeaderCtrlTestCase );

View File

@ -25,12 +25,12 @@ class HtmlListBoxTestCase : public ItemContainerTestCase,
public:
HtmlListBoxTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxItemContainer *GetContainer() const { return m_htmllbox; }
virtual wxWindow *GetContainerWindow() const { return m_htmllbox; }
virtual wxItemContainer *GetContainer() const wxOVERRIDE { return m_htmllbox; }
virtual wxWindow *GetContainerWindow() const wxOVERRIDE { return m_htmllbox; }
CPPUNIT_TEST_SUITE( HtmlListBoxTestCase );
wxITEM_CONTAINER_TESTS();

View File

@ -28,8 +28,8 @@ class HyperlinkCtrlTestCase : public CppUnit::TestCase
public:
HyperlinkCtrlTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( HyperlinkCtrlTestCase );

View File

@ -33,8 +33,8 @@ class LabelTestCase : public CppUnit::TestCase
public:
LabelTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( LabelTestCase );

View File

@ -179,7 +179,7 @@ void ListBaseTestCase::ChangeMode()
void ListBaseTestCase::ItemClick()
{
#if wxUSE_UIACTIONSIMULATOR
#if wxUSE_UIACTIONSIMULATOR
#ifdef __WXMSW__
// FIXME: This test fails on MSW buildbot slaves although works fine on
@ -226,7 +226,7 @@ void ListBaseTestCase::ItemClick()
// when the first item was selected the focus changes to it, but not
// on subsequent clicks
// FIXME: This test fail under wxGTK & wxOSX because we get 3 FOCUSED events and
// 2 SELECTED ones instead of the one of each we expect for some
// reason, this needs to be debugged as it may indicate a bug in the

View File

@ -28,16 +28,16 @@ class ListbookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase
public:
ListbookTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxBookCtrlBase *GetBase() const { return m_listbook; }
virtual wxBookCtrlBase *GetBase() const wxOVERRIDE { return m_listbook; }
virtual wxEventType GetChangedEvent() const
virtual wxEventType GetChangedEvent() const wxOVERRIDE
{ return wxEVT_LISTBOOK_PAGE_CHANGED; }
virtual wxEventType GetChangingEvent() const
virtual wxEventType GetChangingEvent() const wxOVERRIDE
{ return wxEVT_LISTBOOK_PAGE_CHANGING; }
CPPUNIT_TEST_SUITE( ListbookTestCase );

View File

@ -28,12 +28,12 @@ class ListBoxTestCase : public ItemContainerTestCase, public CppUnit::TestCase
public:
ListBoxTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxItemContainer *GetContainer() const { return m_list; }
virtual wxWindow *GetContainerWindow() const { return m_list; }
virtual wxItemContainer *GetContainer() const wxOVERRIDE { return m_list; }
virtual wxWindow *GetContainerWindow() const wxOVERRIDE { return m_list; }
CPPUNIT_TEST_SUITE( ListBoxTestCase );
wxITEM_CONTAINER_TESTS();

View File

@ -37,10 +37,10 @@ class ListCtrlTestCase : public ListBaseTestCase, public CppUnit::TestCase
public:
ListCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
virtual wxListCtrl *GetList() const { return m_list; }
virtual wxListCtrl *GetList() const wxOVERRIDE { return m_list; }
private:
CPPUNIT_TEST_SUITE( ListCtrlTestCase );

View File

@ -24,10 +24,10 @@ class ListViewTestCase : public ListBaseTestCase, public CppUnit::TestCase
public:
ListViewTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
virtual wxListCtrl *GetList() const { return m_list; }
virtual wxListCtrl *GetList() const wxOVERRIDE { return m_list; }
private:
CPPUNIT_TEST_SUITE( ListViewTestCase );

View File

@ -27,16 +27,16 @@ class NotebookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase
public:
NotebookTestCase() { m_notebook = NULL; m_numPageChanges = 0; }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxBookCtrlBase *GetBase() const { return m_notebook; }
virtual wxBookCtrlBase *GetBase() const wxOVERRIDE { return m_notebook; }
virtual wxEventType GetChangedEvent() const
virtual wxEventType GetChangedEvent() const wxOVERRIDE
{ return wxEVT_NOTEBOOK_PAGE_CHANGED; }
virtual wxEventType GetChangingEvent() const
virtual wxEventType GetChangingEvent() const wxOVERRIDE
{ return wxEVT_NOTEBOOK_PAGE_CHANGING; }

View File

@ -39,17 +39,17 @@ class OwnerDrawnComboBoxTestCase : public TextEntryTestCase,
public:
OwnerDrawnComboBoxTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxTextEntry *GetTestEntry() const { return m_combo; }
virtual wxWindow *GetTestWindow() const { return m_combo; }
virtual wxTextEntry *GetTestEntry() const wxOVERRIDE { return m_combo; }
virtual wxWindow *GetTestWindow() const wxOVERRIDE { return m_combo; }
virtual wxItemContainer *GetContainer() const { return m_combo; }
virtual wxWindow *GetContainerWindow() const { return m_combo; }
virtual wxItemContainer *GetContainer() const wxOVERRIDE { return m_combo; }
virtual wxWindow *GetContainerWindow() const wxOVERRIDE { return m_combo; }
virtual void CheckStringSelection(const char * WXUNUSED(sel))
virtual void CheckStringSelection(const char * WXUNUSED(sel)) wxOVERRIDE
{
// do nothing here, as explained in TextEntryTestCase comment, our
// GetStringSelection() is the wxChoice, not wxTextEntry, one and there

View File

@ -30,11 +30,11 @@ class ColourPickerCtrlTestCase : public PickerBaseTestCase,
public:
ColourPickerCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxPickerBase *GetBase() const { return m_colour; }
virtual wxPickerBase *GetBase() const wxOVERRIDE { return m_colour; }
CPPUNIT_TEST_SUITE( ColourPickerCtrlTestCase );
wxPICKER_BASE_TESTS();
@ -74,11 +74,11 @@ class DirPickerCtrlTestCase : public PickerBaseTestCase,
public:
DirPickerCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxPickerBase *GetBase() const { return m_dir; }
virtual wxPickerBase *GetBase() const wxOVERRIDE { return m_dir; }
CPPUNIT_TEST_SUITE( DirPickerCtrlTestCase );
wxPICKER_BASE_TESTS();
@ -119,11 +119,11 @@ class FilePickerCtrlTestCase : public PickerBaseTestCase,
public:
FilePickerCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxPickerBase *GetBase() const { return m_file; }
virtual wxPickerBase *GetBase() const wxOVERRIDE { return m_file; }
CPPUNIT_TEST_SUITE( FilePickerCtrlTestCase );
wxPICKER_BASE_TESTS();
@ -165,11 +165,11 @@ class FontPickerCtrlTestCase : public PickerBaseTestCase,
public:
FontPickerCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxPickerBase *GetBase() const { return m_font; }
virtual wxPickerBase *GetBase() const wxOVERRIDE { return m_font; }
CPPUNIT_TEST_SUITE( FontPickerCtrlTestCase );
wxPICKER_BASE_TESTS();

View File

@ -26,8 +26,8 @@ class RadioBoxTestCase : public CppUnit::TestCase
public:
RadioBoxTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( RadioBoxTestCase );

View File

@ -27,8 +27,8 @@ class RadioButtonTestCase : public CppUnit::TestCase
public:
RadioButtonTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( RadioButtonTestCase );

View File

@ -25,12 +25,12 @@ class RearrangeListTestCase : public ItemContainerTestCase, public CppUnit::Test
public:
RearrangeListTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxItemContainer *GetContainer() const { return m_rearrange; }
virtual wxWindow *GetContainerWindow() const { return m_rearrange; }
virtual wxItemContainer *GetContainer() const wxOVERRIDE { return m_rearrange; }
virtual wxWindow *GetContainerWindow() const wxOVERRIDE { return m_rearrange; }
CPPUNIT_TEST_SUITE( RearrangeListTestCase );
wxITEM_CONTAINER_TESTS();

View File

@ -29,8 +29,8 @@ class RichTextCtrlTestCase : public CppUnit::TestCase
public:
RichTextCtrlTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( RichTextCtrlTestCase );

View File

@ -27,16 +27,16 @@ class SimplebookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase
public:
SimplebookTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxBookCtrlBase *GetBase() const { return m_simplebook; }
virtual wxBookCtrlBase *GetBase() const wxOVERRIDE { return m_simplebook; }
virtual wxEventType GetChangedEvent() const
virtual wxEventType GetChangedEvent() const wxOVERRIDE
{ return wxEVT_BOOKCTRL_PAGE_CHANGED; }
virtual wxEventType GetChangingEvent() const
virtual wxEventType GetChangingEvent() const wxOVERRIDE
{ return wxEVT_BOOKCTRL_PAGE_CHANGING; }
CPPUNIT_TEST_SUITE( SimplebookTestCase );

View File

@ -27,8 +27,8 @@ class SliderTestCase : public CppUnit::TestCase
public:
SliderTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( SliderTestCase );

View File

@ -25,8 +25,8 @@ class SpinCtrlDoubleTestCase : public CppUnit::TestCase
public:
SpinCtrlDoubleTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( SpinCtrlDoubleTestCase );

View File

@ -27,8 +27,8 @@ class SpinCtrlTestCase : public CppUnit::TestCase
public:
SpinCtrlTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( SpinCtrlTestCase );

View File

@ -41,12 +41,12 @@ class TextCtrlTestCase : public TextEntryTestCase, public CppUnit::TestCase
public:
TextCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxTextEntry *GetTestEntry() const { return m_text; }
virtual wxWindow *GetTestWindow() const { return m_text; }
virtual wxTextEntry *GetTestEntry() const wxOVERRIDE { return m_text; }
virtual wxWindow *GetTestWindow() const wxOVERRIDE { return m_text; }
#define SINGLE_AND_MULTI_TESTS() \
WXUISIM_TEST( ReadOnly ); \
@ -223,7 +223,7 @@ void TextCtrlTestCase::ReadOnly()
// SetEditable() is supposed to override wxTE_READONLY
m_text->SetEditable(true);
#if defined(__WXOSX__) || defined(__WXUNIVERSAL__)
// a ready only text field might not have been focusable at all
m_text->SetFocus();

View File

@ -27,8 +27,8 @@ class ToggleButtonTestCase : public CppUnit::TestCase
public:
ToggleButtonTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( ToggleButtonTestCase );

View File

@ -28,19 +28,19 @@ class ToolbookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase
public:
ToolbookTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxBookCtrlBase *GetBase() const { return m_toolbook; }
virtual wxBookCtrlBase *GetBase() const wxOVERRIDE { return m_toolbook; }
virtual wxEventType GetChangedEvent() const
virtual wxEventType GetChangedEvent() const wxOVERRIDE
{ return wxEVT_TOOLBOOK_PAGE_CHANGED; }
virtual wxEventType GetChangingEvent() const
virtual wxEventType GetChangingEvent() const wxOVERRIDE
{ return wxEVT_TOOLBOOK_PAGE_CHANGING; }
virtual void Realize() { m_toolbook->GetToolBar()->Realize(); }
virtual void Realize() wxOVERRIDE { m_toolbook->GetToolBar()->Realize(); }
CPPUNIT_TEST_SUITE( ToolbookTestCase );
wxBOOK_CTRL_BASE_TESTS();

View File

@ -27,16 +27,16 @@ class TreebookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase
public:
TreebookTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
virtual wxBookCtrlBase *GetBase() const { return m_treebook; }
virtual wxBookCtrlBase *GetBase() const wxOVERRIDE { return m_treebook; }
virtual wxEventType GetChangedEvent() const
virtual wxEventType GetChangedEvent() const wxOVERRIDE
{ return wxEVT_TREEBOOK_PAGE_CHANGED; }
virtual wxEventType GetChangingEvent() const
virtual wxEventType GetChangingEvent() const wxOVERRIDE
{ return wxEVT_TREEBOOK_PAGE_CHANGING; }
CPPUNIT_TEST_SUITE( TreebookTestCase );

View File

@ -38,8 +38,8 @@ class TreeCtrlTestCase : public CppUnit::TestCase
public:
TreeCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( TreeCtrlTestCase );

View File

@ -31,8 +31,8 @@ class TreeListCtrlTestCase : public CppUnit::TestCase
public:
TreeListCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( TreeListCtrlTestCase );

View File

@ -33,8 +33,8 @@ class VirtListCtrlTestCase : public CppUnit::TestCase
public:
VirtListCtrlTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( VirtListCtrlTestCase );

View File

@ -31,8 +31,8 @@ class WebTestCase : public CppUnit::TestCase
public:
WebTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( WebTestCase );

View File

@ -31,8 +31,8 @@ class WindowTestCase : public CppUnit::TestCase
public:
WindowTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( WindowTestCase );

View File

@ -55,14 +55,14 @@ void EventCloneTestCase::CheckAll()
for (; ci; ci = ci->GetNext())
{
wxString cn = wxString(ci->GetClassName());
// is this class derived from wxEvent?
if ( !ci->IsKindOf(CLASSINFO(wxEvent)) ||
cn == "wxEvent" )
continue;
const std::string
msg = std::string("Event class \"") +
msg = std::string("Event class \"") +
std::string(cn.c_str()) + "\"";
CPPUNIT_ASSERT_MESSAGE( msg, ci->IsDynamic() );

View File

@ -197,8 +197,8 @@ class KeyboardEventTestCase : public CppUnit::TestCase
public:
KeyboardEventTestCase() {}
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( KeyboardEventTestCase );

View File

@ -234,8 +234,8 @@ class EventPropagationTestCase : public CppUnit::TestCase
public:
EventPropagationTestCase() {}
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( EventPropagationTestCase );

View File

@ -32,8 +32,8 @@ class DirTestCase : public CppUnit::TestCase
public:
DirTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( DirTestCase );
@ -181,7 +181,7 @@ void DirTestCase::DirExists()
{
const char *dirname;
bool shouldExist;
} testData[] =
} testData[] =
{
{ ".", true },
{ "..", true },

View File

@ -33,8 +33,8 @@ class FileFunctionsTestCase : public CppUnit::TestCase
{
public:
FileFunctionsTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( FileFunctionsTestCase );
@ -453,7 +453,7 @@ void FileFunctionsTestCase::FileEof()
bool failed = true;
try
{
file.Eof();
file.Eof();
failed = false;
}
catch (...)

View File

@ -73,7 +73,7 @@ class FileKindTestCase : public CppUnit::TestCase
};
// test a wxFFile and wxFFileInput/OutputStreams of a known type
//
//
void FileKindTestCase::TestFILE(wxFFile& file, bool expected)
{
CPPUNIT_ASSERT(file.IsOpened());
@ -191,7 +191,7 @@ void FileKindTestCase::MemoryStream()
}
// Stdin will usually be a terminal, if so then test it
//
//
void FileKindTestCase::Stdin()
{
if (isatty(0))

View File

@ -665,7 +665,7 @@ void FileNameTestCase::TestCreateTempFileName()
if (testData[n].shouldSucceed)
{
errDesc += "; path is " + path.ToStdString();
// test the place where the temp file has been created
wxString expected = testData[n].expectedFolder;
expected.Replace("$SYSTEM_TEMP", wxStandardPaths::Get().GetTempDir());
@ -688,7 +688,7 @@ void FileNameTestCase::TestGetTimes()
wxDateTime dtAccess, dtMod, dtCreate;
CPPUNIT_ASSERT( fn.GetTimes(&dtAccess, &dtMod, &dtCreate) );
// make sure all retrieved dates are equal to the current date&time
// make sure all retrieved dates are equal to the current date&time
// with an accuracy up to 1 minute
CPPUNIT_ASSERT(dtCreate.IsEqualUpTo(wxDateTime::Now(), wxTimeSpan(0,1)));
CPPUNIT_ASSERT(dtMod.IsEqualUpTo(wxDateTime::Now(), wxTimeSpan(0,1)));

View File

@ -438,8 +438,8 @@ class FileSystemWatcherTestCase : public CppUnit::TestCase
public:
FileSystemWatcherTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
protected:
wxEventLoopBase* m_loop;

View File

@ -121,7 +121,7 @@ public:
{
}
virtual void setUp()
virtual void setUp() wxOVERRIDE
{
m_bmpOrig = wxBitmap(m_imgOrig);
m_bmpUsingMatrix.Create(m_bmpOrig.GetSize(), m_bmpOrig.GetDepth());

View File

@ -37,8 +37,8 @@ class BitmapTestCase : public CppUnit::TestCase
public:
BitmapTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( BitmapTestCase );

View File

@ -47,7 +47,7 @@ public:
m_bmp = wxNullBitmap;
}
virtual void setUp()
virtual void setUp() wxOVERRIDE
{
m_gcdc->ResetBoundingBox();
}

View File

@ -127,7 +127,7 @@ public:
{
}
virtual void setUp() { wxASSERT( m_dc ); }
virtual void setUp() wxOVERRIDE { wxASSERT( m_dc ); }
virtual wxDC* GetDC(wxMemoryDC* dc) = 0;
protected:

View File

@ -385,7 +385,6 @@ static void TestCurrentPoint(wxGraphicsContext* gc)
const wxDouble y = 140;
const wxDouble r = 20;
path.AddCircle(x, y, r);
wxPoint2DDouble cp0 = path.GetCurrentPoint();
path.AddPath(path2);
wxPoint2DDouble cp = path.GetCurrentPoint();
WX_CHECK_POINT(cp, cp2, 1E-3);

View File

@ -35,8 +35,8 @@ class HtmlWindowTestCase : public CppUnit::TestCase
public:
HtmlWindowTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( HtmlWindowTestCase );

View File

@ -95,7 +95,7 @@ void InteractiveInputTestCase::TestDiskInfo()
// kill the last '\n'
pathname[wxStrlen(pathname) - 1] = 0;
if (pathname[0] == '\0' || wxStrcmp(pathname, "quit") == 0)
break;
@ -107,11 +107,11 @@ void InteractiveInputTestCase::TestDiskInfo()
else
{
wxPrintf(wxT("%sKb total, %sKb free on '%s'.\n"),
(total / 1024).ToString().c_str(),
(free / 1024).ToString().c_str(),
(total / 1024).ToString(),
(free / 1024).ToString(),
pathname);
}
wxPuts("\n");
}
@ -128,7 +128,7 @@ void InteractiveInputTestCase::TestDiskInfo()
void InteractiveInputTestCase::TestRegExInteractive()
{
#ifdef TEST_REGEX
#ifdef TEST_REGEX
wxPuts(wxT("*** Testing RE interactively ***"));
for ( ;; )
@ -143,7 +143,7 @@ void InteractiveInputTestCase::TestRegExInteractive()
if (pattern[0] == '\0' || wxStrcmp(pattern, "quit") == 0)
break;
wxRegEx re;
if ( !re.Compile(pattern) )
{
@ -166,7 +166,7 @@ void InteractiveInputTestCase::TestRegExInteractive()
}
else
{
wxPrintf(wxT("Pattern matches at '%s'\n"), re.GetMatch(text).c_str());
wxPrintf(wxT("Pattern matches at '%s'\n"), re.GetMatch(text));
size_t start, len;
for ( size_t n = 1; ; n++ )
@ -176,12 +176,12 @@ void InteractiveInputTestCase::TestRegExInteractive()
break;
}
wxPrintf(wxT("Subexpr %u matched '%s'\n"),
n, wxString(text + start, len).c_str());
wxPrintf(wxT("Subexpr %zu matched '%s'\n"),
n, wxString(text + start, len));
}
}
}
wxPuts("\n");
}
#endif // TEST_REGEX
@ -235,9 +235,9 @@ void InteractiveInputTestCase::TestFtpInteractive()
else
{
wxPrintf(wxT("--- Connected to %s, current directory is '%s'\n"),
hostname, ftp.Pwd().c_str());
hostname, ftp.Pwd());
}
wxChar buf[128];
for ( ;; )
{
@ -250,7 +250,7 @@ void InteractiveInputTestCase::TestFtpInteractive()
if (buf[0] == '\0' || wxStrcmp(buf, "quit") == 0)
break;
// special handling of LIST and NLST as they require data connection
wxString start(buf, 4);
start.MakeUpper();
@ -263,16 +263,16 @@ void InteractiveInputTestCase::TestFtpInteractive()
wxArrayString files;
if ( !ftp.GetList(files, wildcard, start == wxT("LIST")) )
{
wxPrintf(wxT("ERROR: failed to get %s of files\n"), start.c_str());
wxPrintf(wxT("ERROR: failed to get %s of files\n"), start);
}
else
{
wxPrintf(wxT("--- %s of '%s' under '%s':\n"),
start.c_str(), wildcard.c_str(), ftp.Pwd().c_str());
start, wildcard, ftp.Pwd());
size_t count = files.GetCount();
for ( size_t n = 0; n < count; n++ )
{
wxPrintf(wxT("\t%s\n"), files[n].c_str());
wxPrintf(wxT("\t%s\n"), files[n]);
}
wxPuts(wxT("--- End of the file list"));
}
@ -286,7 +286,7 @@ void InteractiveInputTestCase::TestFtpInteractive()
wxPrintf(wxT(" (return code %c)"), ch);
}
wxPrintf(wxT(", server reply:\n%s\n\n"), ftp.GetLastResult().c_str());
wxPrintf(wxT(", server reply:\n%s\n\n"), ftp.GetLastResult());
}
}
@ -316,7 +316,7 @@ void InteractiveInputTestCase::TestDateTimeInteractive()
// kill the last '\n'
buf[wxStrlen(buf) - 1] = 0;
if ( buf[0] == '\0' || wxStrcmp(buf, "quit") == 0 )
break;
@ -334,13 +334,13 @@ void InteractiveInputTestCase::TestDateTimeInteractive()
}
wxPrintf(wxT("%s: day %u, week of month %u/%u, week of year %u\n"),
dt.Format(wxT("%b %d, %Y")).c_str(),
dt.Format(wxT("%b %d, %Y")),
dt.GetDayOfYear(),
dt.GetWeekOfMonth(wxDateTime::Monday_First),
dt.GetWeekOfMonth(wxDateTime::Sunday_First),
dt.GetWeekOfYear(wxDateTime::Monday_First));
}
wxPuts("\n");
#endif // TEST_DATETIME
}
@ -375,7 +375,7 @@ void InteractiveInputTestCase::TestSingleIstance()
{
wxPrintf(wxT("Failed to init wxSingleInstanceChecker.\n"));
}
wxPuts("\n");
#endif // defined(TEST_SNGLINST)
}

View File

@ -104,17 +104,16 @@ void InteractiveOutputTestCase::TestDllListLoaded()
for ( size_t n = 0; n < count; ++n )
{
const wxDynamicLibraryDetails& details = dlls[n];
printf("%-45s", (const char *)details.GetPath().mb_str());
wxPrintf("%-45s", details.GetPath());
void *addr wxDUMMY_INITIALIZE(NULL);
size_t len wxDUMMY_INITIALIZE(0);
if ( details.GetAddress(&addr, &len) )
{
printf(" %08lx:%08lx",
(unsigned long)addr, (unsigned long)((char *)addr + len));
wxPrintf(" %p:%p", addr, (void *)((char *)addr + len));
}
printf(" %s\n", (const char *)details.GetVersion().mb_str());
wxPrintf(" %s\n", details.GetVersion());
}
wxPuts(wxEmptyString);
@ -137,7 +136,7 @@ void InteractiveOutputTestCase::TestMimeEnum()
size_t count = wxTheMimeTypesManager->EnumAllFileTypes(mimetypes);
wxPrintf(wxT("*** All %lu known filetypes: ***\n"), static_cast<unsigned long>(count));
wxPrintf(wxT("*** All %zu known filetypes: ***\n"), count);
wxArrayString exts;
wxString desc;
@ -149,7 +148,7 @@ void InteractiveOutputTestCase::TestMimeEnum()
if ( !filetype )
{
wxPrintf(wxT(" nothing known about the filetype '%s'!\n"),
mimetypes[n].c_str());
mimetypes[n]);
continue;
}
@ -166,8 +165,7 @@ void InteractiveOutputTestCase::TestMimeEnum()
extsAll += exts[e];
}
wxPrintf(wxT(" %s: %s (%s)\n"),
mimetypes[n].c_str(), desc.c_str(), extsAll.c_str());
wxPrintf(wxT(" %s: %s (%s)\n"), mimetypes[n], desc, extsAll);
}
wxPuts(wxEmptyString);
@ -194,7 +192,7 @@ void InteractiveOutputTestCase::TestMimeFilename()
wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext);
if ( !ft )
{
wxPrintf(wxT("WARNING: extension '%s' is unknown.\n"), ext.c_str());
wxPrintf(wxT("WARNING: extension '%s' is unknown.\n"), ext);
}
else
{
@ -209,8 +207,7 @@ void InteractiveOutputTestCase::TestMimeFilename()
else
cmd = wxString(wxT('"')) + cmd + wxT('"');
wxPrintf(wxT("To open %s (%s) run:\n %s\n"),
fname.c_str(), desc.c_str(), cmd.c_str());
wxPrintf(wxT("To open %s (%s) run:\n %s\n"), fname, desc, cmd);
delete ft;
}
@ -261,12 +258,12 @@ void InteractiveOutputTestCase::TestOsInfo()
int major, minor;
wxGetOsVersion(&major, &minor);
wxPrintf(wxT("Running under: %s, version %d.%d\n"),
wxGetOsDescription().c_str(), major, minor);
wxGetOsDescription(), major, minor);
wxPrintf(wxT("%ld free bytes of memory left.\n"), wxGetFreeMemory().ToLong());
wxPrintf(wxT("%lld free bytes of memory left.\n"), wxGetFreeMemory());
wxPrintf(wxT("Host name is %s (%s).\n"),
wxGetHostName().c_str(), wxGetFullHostName().c_str());
wxGetHostName(), wxGetFullHostName());
wxPuts(wxEmptyString);
#endif // TEST_INFO_FUNCTIONS
@ -280,12 +277,12 @@ void InteractiveOutputTestCase::TestPlatformInfo()
// get this platform
wxPlatformInfo plat;
wxPrintf(wxT("Operating system family name is: %s\n"), plat.GetOperatingSystemFamilyName().c_str());
wxPrintf(wxT("Operating system name is: %s\n"), plat.GetOperatingSystemIdName().c_str());
wxPrintf(wxT("Port ID name is: %s\n"), plat.GetPortIdName().c_str());
wxPrintf(wxT("Port ID short name is: %s\n"), plat.GetPortIdShortName().c_str());
wxPrintf(wxT("Architecture is: %s\n"), plat.GetArchName().c_str());
wxPrintf(wxT("Endianness is: %s\n"), plat.GetEndiannessName().c_str());
wxPrintf(wxT("Operating system family name is: %s\n"), plat.GetOperatingSystemFamilyName());
wxPrintf(wxT("Operating system name is: %s\n"), plat.GetOperatingSystemIdName());
wxPrintf(wxT("Port ID name is: %s\n"), plat.GetPortIdName());
wxPrintf(wxT("Port ID short name is: %s\n"), plat.GetPortIdShortName());
wxPrintf(wxT("Architecture is: %s\n"), plat.GetArchName());
wxPrintf(wxT("Endianness is: %s\n"), plat.GetEndiannessName());
wxPuts(wxEmptyString);
#endif // TEST_INFO_FUNCTIONS
@ -296,10 +293,10 @@ void InteractiveOutputTestCase::TestUserInfo()
#ifdef TEST_INFO_FUNCTIONS
wxPuts(wxT("*** Testing user info functions ***\n"));
wxPrintf(wxT("User id is:\t%s\n"), wxGetUserId().c_str());
wxPrintf(wxT("User name is:\t%s\n"), wxGetUserName().c_str());
wxPrintf(wxT("Home dir is:\t%s\n"), wxGetHomeDir().c_str());
wxPrintf(wxT("Email address:\t%s\n"), wxGetEmailAddress().c_str());
wxPrintf(wxT("User id is:\t%s\n"), wxGetUserId());
wxPrintf(wxT("User name is:\t%s\n"), wxGetUserName());
wxPrintf(wxT("Home dir is:\t%s\n"), wxGetHomeDir());
wxPrintf(wxT("Email address:\t%s\n"), wxGetEmailAddress());
wxPuts(wxEmptyString);
#endif // TEST_INFO_FUNCTIONS
@ -332,23 +329,21 @@ public:
protected:
virtual void OnStackFrame(const wxStackFrame& frame)
{
printf("[%2d] ", (int) frame.GetLevel());
wxPrintf("[%2zu] ", frame.GetLevel());
wxString name = frame.GetName();
if ( !name.empty() )
{
printf("%-20.40s", (const char*)name.mb_str());
wxPrintf("%-20.40s", name);
}
else
{
printf("0x%08lx", (unsigned long)frame.GetAddress());
wxPrintf("0x%p", frame.GetAddress());
}
if ( frame.HasSourceLocation() )
{
printf("\t%s:%d",
(const char*)frame.GetFileName().mb_str(),
(int)frame.GetLine());
wxPrintf("\t%s:%zu", frame.GetFileName(), frame.GetLine());
}
puts("");
@ -356,9 +351,7 @@ protected:
wxString type, val;
for ( size_t n = 0; frame.GetParam(n, &type, &name, &val); n++ )
{
printf("\t%s %s = %s\n", (const char*)type.mb_str(),
(const char*)name.mb_str(),
(const char*)val.mb_str());
wxPrintf("\t%s %s = %s\n", type, name, val);
}
}
};
@ -395,30 +388,30 @@ void InteractiveOutputTestCase::TestStandardPaths()
wxTheApp->SetAppName(wxT("console"));
wxStandardPathsBase& stdp = wxStandardPaths::Get();
wxPrintf(wxT("Config dir (sys):\t%s\n"), stdp.GetConfigDir().c_str());
wxPrintf(wxT("Config dir (user):\t%s\n"), stdp.GetUserConfigDir().c_str());
wxPrintf(wxT("Data dir (sys):\t\t%s\n"), stdp.GetDataDir().c_str());
wxPrintf(wxT("Data dir (sys local):\t%s\n"), stdp.GetLocalDataDir().c_str());
wxPrintf(wxT("Data dir (user):\t%s\n"), stdp.GetUserDataDir().c_str());
wxPrintf(wxT("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir().c_str());
wxPrintf(wxT("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir().c_str());
wxPrintf(wxT("Cache dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Cache).c_str());
wxPrintf(wxT("Desktop dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Desktop).c_str());
wxPrintf(wxT("Downloads dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Downloads).c_str());
wxPrintf(wxT("Music dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Music).c_str());
wxPrintf(wxT("Pictures dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Pictures).c_str());
wxPrintf(wxT("Videos dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Videos).c_str());
wxPrintf(wxT("Executable path:\t%s\n"), stdp.GetExecutablePath().c_str());
wxPrintf(wxT("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir().c_str());
wxPrintf(wxT("Resources dir:\t\t%s\n"), stdp.GetResourcesDir().c_str());
wxPrintf(wxT("Config dir (sys):\t%s\n"), stdp.GetConfigDir());
wxPrintf(wxT("Config dir (user):\t%s\n"), stdp.GetUserConfigDir());
wxPrintf(wxT("Data dir (sys):\t\t%s\n"), stdp.GetDataDir());
wxPrintf(wxT("Data dir (sys local):\t%s\n"), stdp.GetLocalDataDir());
wxPrintf(wxT("Data dir (user):\t%s\n"), stdp.GetUserDataDir());
wxPrintf(wxT("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir());
wxPrintf(wxT("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir());
wxPrintf(wxT("Cache dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Cache));
wxPrintf(wxT("Desktop dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Desktop));
wxPrintf(wxT("Downloads dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Downloads));
wxPrintf(wxT("Music dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Music));
wxPrintf(wxT("Pictures dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Pictures));
wxPrintf(wxT("Videos dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Videos));
wxPrintf(wxT("Executable path:\t%s\n"), stdp.GetExecutablePath());
wxPrintf(wxT("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir());
wxPrintf(wxT("Resources dir:\t\t%s\n"), stdp.GetResourcesDir());
wxPrintf(wxT("Localized res. dir:\t%s\n"),
stdp.GetLocalizedResourcesDir(wxT("fr")).c_str());
stdp.GetLocalizedResourcesDir(wxT("fr")));
wxPrintf(wxT("Message catalogs dir:\t%s\n"),
stdp.GetLocalizedResourcesDir
(
wxT("fr"),
wxStandardPaths::ResourceCat_Messages
).c_str());
));
wxPuts("\n");
#endif // TEST_STDPATHS
@ -462,7 +455,7 @@ void InteractiveOutputTestCase::TestFSVolume()
return;
}
wxPrintf(wxT("%u mounted volumes found:\n"), count);
wxPrintf(wxT("%zu mounted volumes found:\n"), count);
for ( size_t n = 0; n < count; n++ )
{
@ -473,10 +466,10 @@ void InteractiveOutputTestCase::TestFSVolume()
continue;
}
wxPrintf(wxT("%u: %s (%s), %s, %s, %s\n"),
wxPrintf(wxT("%zu: %s (%s), %s, %s, %s\n"),
n + 1,
vol.GetDisplayName().c_str(),
vol.GetName().c_str(),
vol.GetDisplayName(),
vol.GetName(),
volumeKinds[vol.GetKind()],
vol.IsWritable() ? wxT("rw") : wxT("ro"),
vol.GetFlags() & wxFS_VOL_REMOVABLE ? wxT("removable")

View File

@ -33,8 +33,8 @@ class IntlTestCase : public CppUnit::TestCase
public:
IntlTestCase() { m_locale=NULL; }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( IntlTestCase );

View File

@ -159,8 +159,8 @@ class LogTestCase : public CppUnit::TestCase
public:
LogTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( LogTestCase );

View File

@ -77,8 +77,8 @@ class MenuTestCase : public CppUnit::TestCase
public:
MenuTestCase() {}
virtual void setUp() { CreateFrame(); }
virtual void tearDown() { m_frame->Destroy(); }
virtual void setUp() wxOVERRIDE { CreateFrame(); }
virtual void tearDown() wxOVERRIDE { m_frame->Destroy(); }
private:
CPPUNIT_TEST_SUITE( MenuTestCase );

View File

@ -77,7 +77,7 @@ void DynamicLibraryTestCase::Load()
typedef int (wxSTDCALL *wxStrlenType)(const char *);
wxStrlenType pfnStrlen = (wxStrlenType)lib.GetSymbol(FUNC_NAME);
wxString errMsg = wxString::Format("ERROR: function '%s' wasn't found in '%s'.\n",
FUNC_NAME, LIB_NAME);
CPPUNIT_ASSERT_MESSAGE( errMsg.ToStdString(), pfnStrlen );

View File

@ -68,7 +68,7 @@ void EnvTestCase::GetSet()
void EnvTestCase::Path()
{
wxString contents;
CPPUNIT_ASSERT(wxGetEnv(wxT("PATH"), &contents));
CPPUNIT_ASSERT(!contents.empty());
}

View File

@ -28,7 +28,7 @@ TEST_CASE("wxPathList::FindValidPath", "[file][path]")
wxPathList pathlist;
pathlist.AddEnvList(wxT("PATH"));
wxString path = pathlist.FindValidPath(CMD_IN_PATH);
INFO( CMD_IN_PATH " not found in " << wxGetenv("PATH") );
CHECK( !path.empty() );

View File

@ -27,13 +27,13 @@ class SelStoreTestCase : public CppUnit::TestCase
public:
SelStoreTestCase() { m_store = NULL; }
virtual void setUp()
virtual void setUp() wxOVERRIDE
{
m_store = new wxSelectionStore;
m_store->SetItemCount(NUM_ITEMS);
}
virtual void tearDown()
virtual void tearDown() wxOVERRIDE
{
delete m_store;
m_store = NULL;

View File

@ -42,7 +42,7 @@ private:
void GetColour();
void GetFont();
// not really wxSystemSettings stuff but still nice to test:
void GlobalColours();
void GlobalFonts();
@ -67,7 +67,7 @@ void SettingsTestCase::GetColour()
void SettingsTestCase::GetFont()
{
const wxSystemFont ids[] =
const wxSystemFont ids[] =
{
wxSYS_OEM_FIXED_FONT,
wxSYS_ANSI_FIXED_FONT,

View File

@ -33,8 +33,8 @@ class BoxSizerTestCase : public CppUnit::TestCase
public:
BoxSizerTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( BoxSizerTestCase );

View File

@ -33,8 +33,8 @@ class GridSizerTestCase : public CppUnit::TestCase
public:
GridSizerTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( GridSizerTestCase );

View File

@ -33,8 +33,8 @@ class WrapSizerTestCase : public CppUnit::TestCase
public:
WrapSizerTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( WrapSizerTestCase );

View File

@ -65,9 +65,9 @@ protected:
private:
// Implement base class functions.
virtual wxFFileInputStream *DoCreateInStream();
virtual wxFFileOutputStream *DoCreateOutStream();
virtual void DoDeleteOutStream();
virtual wxFFileInputStream *DoCreateInStream() wxOVERRIDE;
virtual wxFFileOutputStream *DoCreateOutStream() wxOVERRIDE;
virtual void DoDeleteOutStream() wxOVERRIDE;
private:
wxString GetInFileName() const;

View File

@ -65,9 +65,9 @@ protected:
private:
// Implement base class functions.
virtual wxFileInputStream *DoCreateInStream();
virtual wxFileOutputStream *DoCreateOutStream();
virtual void DoDeleteOutStream();
virtual wxFileInputStream *DoCreateInStream() wxOVERRIDE;
virtual wxFileOutputStream *DoCreateOutStream() wxOVERRIDE;
virtual void DoDeleteOutStream() wxOVERRIDE;
private:
wxString GetInFileName() const;

View File

@ -29,7 +29,7 @@ class IOStreamsTestCase : public CppUnit::TestCase
public:
IOStreamsTestCase() { }
virtual void tearDown()
virtual void tearDown() wxOVERRIDE
{
if ( !m_fnTemp.empty() )
{

View File

@ -70,8 +70,8 @@ private:
private:
// Implement base class functions.
virtual wxMemoryInputStream *DoCreateInStream();
virtual wxMemoryOutputStream *DoCreateOutStream();
virtual wxMemoryInputStream *DoCreateInStream() wxOVERRIDE;
virtual wxMemoryOutputStream *DoCreateOutStream() wxOVERRIDE;
private:
char m_DataBuffer[DATABUFFER_SIZE];

View File

@ -103,8 +103,8 @@ public:
socketStream();
virtual ~socketStream();
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
// repeat all socket tests several times with different socket flags, so we
// define this macro which is used several times in the test suite
@ -137,8 +137,8 @@ public:
private:
// Implement base class functions.
virtual wxSocketInputStream *DoCreateInStream();
virtual wxSocketOutputStream *DoCreateOutStream();
virtual wxSocketInputStream *DoCreateInStream() wxOVERRIDE;
virtual wxSocketOutputStream *DoCreateOutStream() wxOVERRIDE;
// socket thread functions
static void WriteSocket(wxSocketBase& socket)

View File

@ -63,8 +63,8 @@ protected:
private:
// Implement base class functions.
virtual wxStringInputStream *DoCreateInStream();
virtual wxStringOutputStream *DoCreateOutStream();
virtual wxStringInputStream *DoCreateInStream() wxOVERRIDE;
virtual wxStringOutputStream *DoCreateOutStream() wxOVERRIDE;
// output the given string to wxStringOutputStream and check that its
// contents is exactly the same string

View File

@ -119,10 +119,10 @@ private:
private:
// Implement base class functions.
virtual wxZlibInputStream *DoCreateInStream();
virtual wxZlibOutputStream *DoCreateOutStream();
virtual void DoDeleteInStream();
virtual void DoDeleteOutStream();
virtual wxZlibInputStream *DoCreateInStream() wxOVERRIDE;
virtual wxZlibOutputStream *DoCreateOutStream() wxOVERRIDE;
virtual void DoDeleteInStream() wxOVERRIDE;
virtual void DoDeleteOutStream() wxOVERRIDE;
// Helper that can be used to create new wx compatibility tests...
// Otherwise not used by the tests.

View File

@ -28,7 +28,7 @@ class NumFormatterTestCase : public CppUnit::TestCase
public:
NumFormatterTestCase() { m_locale = NULL; }
virtual void setUp()
virtual void setUp() wxOVERRIDE
{
// We need to use a locale with known decimal point and which uses the
// thousands separator for the tests to make sense.
@ -38,7 +38,7 @@ public:
tearDown();
}
virtual void tearDown()
virtual void tearDown() wxOVERRIDE
{
delete m_locale;
m_locale = NULL;

View File

@ -1156,4 +1156,4 @@ void UniCharTestCase::RefWideCharCompare()
wxUNICHARREF_TEST_INT_COMPARE
}
#endif
#endif

View File

@ -166,7 +166,7 @@ private:
#endif
void Unicode();
template<typename T>
template<typename T>
void DoBigToSmallBuffer(T *buffer, int size);
void BigToSmallBuffer();
@ -251,12 +251,12 @@ void VsnprintfTestCase::P()
CMP3i("0000ABCDEFABCDEF", "%p", (void*)0xABCDEFABCDEF);
CMP3("0000000000000000", "%p", (void*)NULL);
#endif
#elif defined(__MINGW32__)
#elif defined(__MINGW32__)
// mingw32 uses MSVC CRT in old versions but is own implementation now
// which is somewhere in the middle as it uses %8x, so to catch both cases
// we use case-insensitive comparison here.
CMP3("0xabcdef", "%p", (void*)0xABCDEF);
CMP3("0", "%p", (void*)NULL);
CMP3("0xabcdef", "%p", (void*)0xABCDEF);
CMP3("0", "%p", (void*)NULL);
#elif defined(__GNUG__)
// glibc prints pointers as %#x except for NULL pointers which are printed
// as '(nil)'.

View File

@ -359,9 +359,9 @@ extern bool IsNetworkAvailable()
// NOTE: we could use wxDialUpManager here if it was in wxNet; since it's in
// wxCore we use a simple rough test:
wxSocketBase::Initialize();
wxIPV4address addr;
if (!addr.Hostname("www.google.com") || !addr.Service("www"))
{
@ -372,9 +372,9 @@ extern bool IsNetworkAvailable()
wxSocketClient sock;
sock.SetTimeout(10); // 10 secs
bool online = sock.Connect(addr);
wxSocketBase::Shutdown();
return online;
}

View File

@ -40,7 +40,7 @@ public:
srand((unsigned)time(NULL));
}
virtual void tearDown() { unlink(GetTestFileName()); }
virtual void tearDown() wxOVERRIDE { unlink(GetTestFileName()); }
private:
CPPUNIT_TEST_SUITE( TextFileTestCase );

View File

@ -45,7 +45,7 @@ private:
wxThread::ExitCode MyJoinableThread::Entry()
{
unsigned long res = 1;
wxUIntPtr res = 1;
for ( size_t n = 1; n < m_n; n++ )
{
res *= n;
@ -244,9 +244,9 @@ void MiscThreadTestCase::TestJoinable()
// calc 10! in the background
MyJoinableThread thread(10);
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread.Run() );
CPPUNIT_ASSERT_EQUAL( 362880, (unsigned long)thread.Wait() );
CPPUNIT_ASSERT_EQUAL( 362880, (wxUIntPtr)thread.Wait() );
}
void MiscThreadTestCase::TestDetached()
{
static const size_t nThreads = 3;
@ -285,7 +285,7 @@ void MiscThreadTestCase::TestSemaphore()
for ( size_t n = 0; n < threads.GetCount(); n++ )
{
CPPUNIT_ASSERT_EQUAL( 0, (long)threads[n]->Wait() );
CPPUNIT_ASSERT_EQUAL( 0, (wxUIntPtr)threads[n]->Wait() );
delete threads[n];
}
}
@ -330,31 +330,31 @@ void MiscThreadTestCase::TestThreadDelete()
// terminated will lead to a crash!
MyDetachedThread *thread0 = new MyDetachedThread(30, 'W');
CPPUNIT_ASSERT_EQUAL( wxTHREAD_MISC_ERROR, thread0->Delete() );
CPPUNIT_ASSERT_EQUAL( wxTHREAD_MISC_ERROR, thread0->Delete() );
// delete a thread which didn't start to run yet.
MyDetachedThread *thread1 = new MyDetachedThread(30, 'Y');
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread1->Run() );
wxMilliSleep(300);
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread1->Delete() );
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread1->Delete() );
// delete a running thread
MyDetachedThread *thread2 = new MyDetachedThread(30, 'Z');
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread2->Run() );
wxMilliSleep(300);
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread2->Pause() );
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread2->Delete() );
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread2->Delete() );
// delete a sleeping thread
MyJoinableThread thread3(20);
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread3.Run() );
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread3.Delete() );
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread3.Delete() );
// delete a joinable running thread
MyJoinableThread thread4(2);
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread4.Run() );
wxMilliSleep(300);
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread4.Delete() );
CPPUNIT_ASSERT_EQUAL( wxTHREAD_NO_ERROR, thread4.Delete() );
// delete a joinable thread which already terminated
}

View File

@ -30,7 +30,7 @@
class URLTestCase : public CppUnit::TestCase
{
public:
URLTestCase();
URLTestCase();
~URLTestCase();
private:

View File

@ -30,8 +30,8 @@ class NumValidatorTestCase : public CppUnit::TestCase
public:
NumValidatorTestCase() { }
void setUp();
void tearDown();
void setUp() wxOVERRIDE;
void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( NumValidatorTestCase );

View File

@ -30,8 +30,8 @@ class ClientSizeTestCase : public CppUnit::TestCase
public:
ClientSizeTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( ClientSizeTestCase );

View File

@ -32,8 +32,8 @@ class SetSizeTestCase : public CppUnit::TestCase
public:
SetSizeTestCase() { }
virtual void setUp();
virtual void tearDown();
virtual void setUp() wxOVERRIDE;
virtual void tearDown() wxOVERRIDE;
private:
CPPUNIT_TEST_SUITE( SetSizeTestCase );

View File

@ -139,8 +139,8 @@ class XrcTestCase : public CppUnit::TestCase
public:
XrcTestCase() {}
virtual void setUp() { CreateXrc(); }
virtual void tearDown() { wxRemoveFile(TEST_XRC_FILE); }
virtual void setUp() wxOVERRIDE { CreateXrc(); }
virtual void tearDown() wxOVERRIDE { wxRemoveFile(TEST_XRC_FILE); }
private:
CPPUNIT_TEST_SUITE( XrcTestCase );