diff -Nru cpputest-3.8/aclocal.m4 cpputest-4.0/aclocal.m4 --- cpputest-3.8/aclocal.m4 2016-05-25 05:42:33.000000000 +0000 +++ cpputest-4.0/aclocal.m4 2020-05-27 11:04:17.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.16.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.16.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ # AM_COND_IF -*- Autoconf -*- -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -147,7 +147,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -178,7 +178,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -369,13 +369,12 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -383,49 +382,43 @@ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -434,18 +427,17 @@ # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -532,8 +524,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -600,7 +592,7 @@ Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -642,7 +634,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -663,7 +655,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -684,7 +676,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -692,49 +684,42 @@ # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -773,7 +758,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -802,7 +787,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -849,7 +834,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -868,7 +853,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -949,7 +934,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1009,7 +994,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1037,7 +1022,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1056,7 +1041,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1193,4 +1178,6 @@ m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) +m4_include([m4/m4_ax_compiler_vendor.m4]) +m4_include([m4/m4_ax_compiler_version.m4]) m4_include([m4/m4_ax_prefix_config_h.m4]) diff -Nru cpputest-3.8/appveyor.yml cpputest-4.0/appveyor.yml --- cpputest-3.8/appveyor.yml 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/appveyor.yml 2020-05-26 11:24:07.000000000 +0000 @@ -2,6 +2,12 @@ image: Visual Studio 2015 +cache: + - C:\ProgramData\chocolatey\bin -> appveyor.yml + - C:\ProgramData\chocolatey\lib -> appveyor.yml + - C:\Tools\MinGW32 -> appveyor.yml + - C:\Tools\MinGW64 -> appveyor.yml + environment: Configuration: Release matrix: @@ -14,15 +20,25 @@ PlatformToolset: 5.3.0 - Platform: MinGW64 PlatformToolset: 5.3.0 + - Platform: MinGWClang64 + PlatformToolset: 5.3.0 + - Platform: MinGWClang32 + PlatformToolset: 5.3.0 - Platform: Win32 PlatformToolset: v90 - Platform: Win32 PlatformToolset: v100 - Platform: Win32 + PlatformToolset: v110 + - Platform: Win32 + PlatformToolset: v120 + - Platform: Win32 + PlatformToolset: v140 + - Platform: x64 PlatformToolset: v140 install: -- ps: if ($env:Platform -like 'MinGW*') { choco install mingw --version $env:PlatformToolset $( if ($env:Platform -like '*32') { Write-Output -forcex86 } ) | Out-Null } +- ps: if ($env:Platform -like 'MinGW*') { choco install mingw --version $env:PlatformToolset $( if ($env:Platform -like '*32') { Write-Output --forcex86 --params /exception:dwarf } ) } build_script: - ps: scripts\appveyor_ci_build.ps1 diff -Nru cpputest-3.8/build/bld.inf cpputest-4.0/build/bld.inf --- cpputest-3.8/build/bld.inf 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/build/bld.inf 2020-05-26 11:24:07.000000000 +0000 @@ -36,6 +36,7 @@ ..\include\CppUTest\Failure.h \epoc32\include\CppUTest\Failure.h ..\include\CppUTest\TestRegistry.h \epoc32\include\CppUTest\TestRegistry.h ..\include\CppUTest\SimpleString.h \epoc32\include\CppUTest\SimpleString.h +..\include\CppUTest\SimpleStringInternalCache.h \epoc32\include\CppUTest\SimpleStringInternalCache.h ..\include\CppUTest\MemoryLeakWarning.h \epoc32\include\CppUTest\MemoryLeakWarning.h ..\include\CppUTest\CommandLineTestRunner.h \epoc32\include\CppuTest\CommandLineTestRunner.h ..\include\CppUTest\TestOutput.h \epoc32\include\CppuTest\TestOutput.h diff -Nru cpputest-3.8/build/cmake_package_files/CppUTestConfig.cmake cpputest-4.0/build/cmake_package_files/CppUTestConfig.cmake --- cpputest-3.8/build/cmake_package_files/CppUTestConfig.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/build/cmake_package_files/CppUTestConfig.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,32 @@ + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was CppUTestConfig.cmake.install.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +#################################################################################### + +set_and_check(CppUTest_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include") +include("${CMAKE_CURRENT_LIST_DIR}/CppUTestTargets.cmake") +set(CppUTest_LIBRARIES CppUTest CppUTestExt) +include("${CMAKE_CURRENT_LIST_DIR}/Modules/CppUTestBuildTimeDiscoverTests.cmake") + +check_required_components(CppUTest) diff -Nru cpputest-3.8/build/cmake_package_files/CppUTestConfigVersion.cmake cpputest-4.0/build/cmake_package_files/CppUTestConfigVersion.cmake --- cpputest-3.8/build/cmake_package_files/CppUTestConfigVersion.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/build/cmake_package_files/CppUTestConfigVersion.cmake 2020-05-27 11:00:11.000000000 +0000 @@ -0,0 +1,37 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, +# but only if the requested major version is the same as the current one. +# The variable CVF_VERSION must be set before calling configure_file(). +set(PACKAGE_VERSION "4.0") +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + if("4.0" MATCHES "^([0-9]+)\\.") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + else() + set(CVF_VERSION_MAJOR "4.0") + endif() + if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff -Nru cpputest-3.8/build/cmake_package_files/CppUTestTargets.cmake cpputest-4.0/build/cmake_package_files/CppUTestTargets.cmake --- cpputest-3.8/build/cmake_package_files/CppUTestTargets.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/build/cmake_package_files/CppUTestTargets.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,101 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget CppUTest CppUTestExt) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + unset(_targetsDefined) + unset(_targetsNotDefined) + unset(_expectedTargets) + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target CppUTest +add_library(CppUTest STATIC IMPORTED) + +set_target_properties(CppUTest PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include/CppUTest" +) + +# Create imported target CppUTestExt +add_library(CppUTestExt STATIC IMPORTED) + +set_target_properties(CppUTestExt PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include/CppUTestExt" +) + +# Load information for each installed configuration. +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +file(GLOB CONFIG_FILES "${_DIR}/CppUTestTargets-*.cmake") +foreach(f ${CONFIG_FILES}) + include(${f}) +endforeach() + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "The imported target \"${target}\" references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES_FOR_${target}) +endforeach() +unset(_IMPORT_CHECK_TARGETS) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff -Nru cpputest-3.8/build/cmake_package_files/CppUTestTargets-relwithdebinfo.cmake cpputest-4.0/build/cmake_package_files/CppUTestTargets-relwithdebinfo.cmake --- cpputest-3.8/build/cmake_package_files/CppUTestTargets-relwithdebinfo.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/build/cmake_package_files/CppUTestTargets-relwithdebinfo.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,29 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "RelWithDebInfo". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "CppUTest" for configuration "RelWithDebInfo" +set_property(TARGET CppUTest APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO) +set_target_properties(CppUTest PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELWITHDEBINFO "CXX" + IMPORTED_LOCATION_RELWITHDEBINFO "${_IMPORT_PREFIX}/lib/libCppUTest.a" + ) + +list(APPEND _IMPORT_CHECK_TARGETS CppUTest ) +list(APPEND _IMPORT_CHECK_FILES_FOR_CppUTest "${_IMPORT_PREFIX}/lib/libCppUTest.a" ) + +# Import target "CppUTestExt" for configuration "RelWithDebInfo" +set_property(TARGET CppUTestExt APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO) +set_target_properties(CppUTestExt PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELWITHDEBINFO "CXX" + IMPORTED_LOCATION_RELWITHDEBINFO "${_IMPORT_PREFIX}/lib/libCppUTestExt.a" + ) + +list(APPEND _IMPORT_CHECK_TARGETS CppUTestExt ) +list(APPEND _IMPORT_CHECK_FILES_FOR_CppUTestExt "${_IMPORT_PREFIX}/lib/libCppUTestExt.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff -Nru cpputest-3.8/build/MakefileWorker.mk cpputest-4.0/build/MakefileWorker.mk --- cpputest-3.8/build/MakefileWorker.mk 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/build/MakefileWorker.mk 2020-05-26 11:24:07.000000000 +0000 @@ -195,11 +195,18 @@ # -Wno-weak-vtables -> The TEST_GROUP macro declares a class and will automatically inline its methods. Thats ok as they are only in one translation unit. Unfortunately, the warning can't detect that, so it must be disabled. # -Wno-old-style-casts -> We only use old style casts by decision # -Wno-c++11-long-long -> When it detects long long, then we can use it and no need for a warning about that - CPPUTEST_CXX_WARNINGFLAGS += -Weverything -Wno-disabled-macro-expansion -Wno-padded -Wno-global-constructors -Wno-exit-time-destructors -Wno-weak-vtables -Wno-old-style-cast -Wno-c++11-long-long +# -Wno-c++98-compat-pedantic -> Incompatibilities with C++98, these are happening through #define. +# -Wno-reserved-id-macro -> Macro uses __ in MINGW... can't change that. +# -Wno-keyword-macro -> new overload + CPPUTEST_CXX_WARNINGFLAGS += -Weverything -Wno-disabled-macro-expansion -Wno-padded -Wno-global-constructors -Wno-exit-time-destructors -Wno-weak-vtables -Wno-old-style-cast -Wno-c++11-long-long -Wno-c++98-compat-pedantic -Wno-reserved-id-macro -Wno-keyword-macro CPPUTEST_C_WARNINGFLAGS += -Weverything -Wno-padded -# Clang "7" (Xcode 7 command-line tools) introduced new warnings by default that don't exist on previous versions of clang and cause errors when present. -ifeq ($(findstring clang-7,$(CC_VERSION_OUTPUT)),clang-7) +# Clang "7" or newer (Xcode 7 or newer command-line tools) introduced new warnings by default that don't exist on previous versions of clang and cause errors when present. +CLANG_VERSION := $(shell echo $(CC_VERSION_OUTPUT) | grep -o 'clang-[0-9][0-9][0-9]*.') +CLANG_VERSION_NUM := $(subst .,,$(subst clang-,,$(CLANG_VERSION))) +CLANG_VERSION_NUM_GT_700 := $(shell [[ $(CLANG_VERSION_NUM) -ge 700 ]] && echo Y) + +ifeq ($(CLANG_VERSION_NUM_GT_700), Y) # -Wno-reserved-id-macro -> Many CppUTest macros start with __, which is a reserved namespace # -Wno-keyword-macro -> CppUTest redefines the 'new' keyword for memory leak tracking CPPUTEST_CXX_WARNINGFLAGS += -Wno-reserved-id-macro -Wno-keyword-macro @@ -516,7 +523,7 @@ clean: @echo Making clean $(SILENCE)$(RM) $(STUFF_TO_CLEAN) - $(SILENCE)rm -rf gcov $(CPPUTEST_OBJS_DIR) + $(SILENCE)rm -rf gcov $(CPPUTEST_OBJS_DIR) $(CPPUTEST_LIB_DIR) $(SILENCE)find . -name "*.gcno" | xargs rm -f $(SILENCE)find . -name "*.gcda" | xargs rm -f diff -Nru cpputest-3.8/ChangeLog cpputest-4.0/ChangeLog --- cpputest-3.8/ChangeLog 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/ChangeLog 2020-05-26 11:24:07.000000000 +0000 @@ -1,18 +1,4 @@ -Addition to Release 3.7 and Release 3.7.1: - -* -v and -ojunit together -* Better memory leak printing -* MEMCMP_EQUAL -* STRNCMP_EQUAL -* Memory Leak Detector multi-threading support -* Mock Output parameters -* Better Windows support -* Many Mock improvements -* Many small fixes and improvements -* Less platform specific dependencies -* More platforms supported - -For further changelog check the github page: +For changelog check the github page: https://github.com/cpputest/cpputest diff -Nru cpputest-3.8/cmake/clang+mingw-win32.toolchain.cmake cpputest-4.0/cmake/clang+mingw-win32.toolchain.cmake --- cpputest-3.8/cmake/clang+mingw-win32.toolchain.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/cmake/clang+mingw-win32.toolchain.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,6 @@ +# Toolchain to use Clang compiler with MinGW binutils (e.g. linker) in Windows to generate 32-bits executables + +set(CMAKE_C_COMPILER clang) +set(CMAKE_C_FLAGS "-target i686-w64-mingw32 -m32" CACHE STRING "" FORCE) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_CXX_FLAGS "-target i686-w64-mingw32 -m32" CACHE STRING "" FORCE) \ No newline at end of file diff -Nru cpputest-3.8/cmake/clang+mingw-win64.toolchain.cmake cpputest-4.0/cmake/clang+mingw-win64.toolchain.cmake --- cpputest-3.8/cmake/clang+mingw-win64.toolchain.cmake 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/cmake/clang+mingw-win64.toolchain.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,6 @@ +# Toolchain to use Clang compiler with MinGW binutils (e.g. linker) in Windows to generate 64-bits executables + +set(CMAKE_C_COMPILER clang) +set(CMAKE_C_FLAGS "-target x86_64-w64-mingw32" CACHE STRING "" FORCE) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_CXX_FLAGS "-target x86_64-w64-mingw32" CACHE STRING "" FORCE) \ No newline at end of file diff -Nru cpputest-3.8/cmake/Modules/CppUTestBuildTimeDiscoverTests.cmake cpputest-4.0/cmake/Modules/CppUTestBuildTimeDiscoverTests.cmake --- cpputest-3.8/cmake/Modules/CppUTestBuildTimeDiscoverTests.cmake 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/cmake/Modules/CppUTestBuildTimeDiscoverTests.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -1,9 +1,19 @@ # Create target to discover tests function (cpputest_buildtime_discover_tests EXECUTABLE) - add_custom_command (TARGET ${EXECUTABLE} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -DTESTS_DETAILED:BOOL=${TESTS_DETAILED} -DEXECUTABLE=${EXECUTABLE} -P ${PROJECT_SOURCE_DIR}/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Discovering Tests in ${EXECUTABLE}" - VERBATIM) + # The path to the discover script depends on execution mode: + # - internal (building CppUTest it self). + # - imported (installed, imported, and executed by a client of the CppUTest lib) + if (PROJECT_NAME STREQUAL "CppUTest") # internal - (path is relative to source dir) + SET(DISCOVER_SCRIPT ${PROJECT_SOURCE_DIR}/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake) + else (PROJECT_NAME STREQUAL "CppUTest") # Installed (path is relative to install directory) + SET(DISCOVER_SCRIPT ${CppUTest_DIR}/Scripts/CppUTestBuildTimeDiscoverTests.cmake) + endif (PROJECT_NAME STREQUAL "CppUTest") + + add_custom_command (TARGET ${EXECUTABLE} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -DTESTS_DETAILED:BOOL=${TESTS_DETAILED} -DEXECUTABLE=$ -P ${DISCOVER_SCRIPT} + VERBATIM + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Discovering Tests in ${EXECUTABLE}" + VERBATIM) endfunction () diff -Nru cpputest-3.8/cmake/Modules/CppUTestConfigurationOptions.cmake cpputest-4.0/cmake/Modules/CppUTestConfigurationOptions.cmake --- cpputest-3.8/cmake/Modules/CppUTestConfigurationOptions.cmake 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/cmake/Modules/CppUTestConfigurationOptions.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -6,7 +6,9 @@ ADD_DEFINITIONS(-DSTDC_WANT_SECURE_LIB) endif(STDC_WANT_SECURE_LIB) elseif (STD_C) - set(CPP_PLATFORM Gcc) + if(NOT CPP_PLATFORM) + set(CPP_PLATFORM Gcc) + endif(NOT CPP_PLATFORM) else (MSVC) set(STD_CPP False) set(MEMORY_LEAK_DETECTION False) @@ -43,19 +45,36 @@ endif (LONGLONG) if (MAP_FILE AND NOT MSVC) - set(CPPUTEST_LD_FLAGS "${CPPUTEST_LD_FLAGS} -Wl,-map,$<.map.txt") + set(CPPUTEST_LD_FLAGS "${CPPUTEST_LD_FLAGS} -Wl,-Map,$<.map.txt") endif (MAP_FILE AND NOT MSVC) if (COVERAGE AND NOT MSVC) set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} --coverage") set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} --coverage") set(CMAKE_BUILD_TYPE "Debug") -endif (COVERAGE AND NOT MSVC) + find_program(GCOVR gcovr DOC "gcovr executable") -if (C++11) + if (NOT GCOVR) + message(SEND_ERROR "gcovr not found") + endif() + + add_custom_target(coverage ${GCOVR} + --root ${PROJECT_SOURCE_DIR} + --output "${CMAKE_BINARY_DIR}/coverage/coverage.html" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMENT "Generate coverage data" + VERBATIM + ) +endif() + +if (CMAKE_CXX_STANDARD) + set(CMAKE_CXX_EXTENSIONS OFF) +elseif (C++11) find_package(CXX11 REQUIRED) set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} ${CXX11_FLAGS}") -endif (C++11) +else() + # No standard specified +endif () set(GMOCK_HOME $ENV{GMOCK_HOME}) if (DEFINED ENV{GMOCK_HOME}) @@ -64,7 +83,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1") include_directories(${GMOCK_HOME}/include ${GMOCK_HOME}/gtest ${GMOCK_HOME}/gtest/include) add_subdirectory(${GMOCK_HOME} "${CMAKE_CURRENT_BINARY_DIR}/gmock") - set(CPPUNIT_EXTERNAL_LIBRARIES ${CPPUNIT_EXTERNAL_LIBARIES} gmock gtest) set(CPPUTEST_C_WARNING_FLAGS "") set(CPPUTEST_CXX_WARNING_FLAGS "") diff -Nru cpputest-3.8/cmake/Modules/CppUTestWarningFlags.cmake cpputest-4.0/cmake/Modules/CppUTestWarningFlags.cmake --- cpputest-3.8/cmake/Modules/CppUTestWarningFlags.cmake 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/cmake/Modules/CppUTestWarningFlags.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -16,10 +16,11 @@ macro(check_and_append_cxx_warning_flags) foreach (flag ${ARGN}) - check_cxx_compiler_flag("-${flag}" WARNING_CXX_FLAG_TO_CHECK) - if (WARNING_CXX_FLAG_TO_CHECK) + string(REPLACE "++" "xx" WARNING_CXX_FLAG_VAR "WARNING_CXX_FLAG_${flag}") + check_cxx_compiler_flag("-${flag}" ${WARNING_CXX_FLAG_VAR}) + if (${WARNING_CXX_FLAG_VAR}) set(CPPUTEST_CXX_WARNING_FLAGS "${CPPUTEST_CXX_WARNING_FLAGS} -${flag}") - endif (WARNING_CXX_FLAG_TO_CHECK) + endif (${WARNING_CXX_FLAG_VAR}) endforeach (flag) endmacro(check_and_append_cxx_warning_flags) @@ -31,6 +32,7 @@ Weverything Wall Wextra + pedantic Wshadow Wswitch-default Wswitch-enum @@ -43,6 +45,11 @@ Wno-long-long ) + if (WERROR) + list(APPEND WARNING_C_FLAGS Werror) + endif (WERROR) + + set(WARNING_C_ONLY_FLAGS Wstrict-prototypes ) @@ -56,13 +63,15 @@ Wno-old-style-cast ) - if (C++11) + if (C++11 OR (DEFINED CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD EQUAL 98)) set(WARNING_CXX_FLAGS ${WARNING_CXX_FLAGS} Wno-c++98-compat Wno-c++98-compat-pedantic + Wno-c++14-compat + Wno-inconsistent-missing-destructor-override ) - endif (C++11) + endif () check_and_append_c_warning_flags(${WARNING_C_FLAGS}) check_and_append_c_warning_flags(${WARNING_C_ONLY_FLAGS}) diff -Nru cpputest-3.8/cmake/Modules/FindCXX11.cmake cpputest-4.0/cmake/Modules/FindCXX11.cmake --- cpputest-3.8/cmake/Modules/FindCXX11.cmake 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/cmake/Modules/FindCXX11.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -18,12 +18,17 @@ "-std=c++11" # Intel windows "/Qstd=c++0x" + "/Qstd=c++11" ) set(CXX11_TEST_SOURCE " -#if __cplusplus < 201103L -#error \"Can not compile with C++11\" +#if defined(_MSC_VER) + #if _MSC_VER < 1800 + #error \"Can not compile with C++11\" + #endif +#elif __cplusplus < 201103L + #error \"Can not compile with C++11\" #endif int main() diff -Nru cpputest-3.8/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake cpputest-4.0/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake --- cpputest-3.8/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake 2020-05-26 11:24:07.000000000 +0000 @@ -5,6 +5,13 @@ # # This script is to be called from ../Modules/CppUTestBuildTimeDiscoverTests.cmake # +# Notes on invocation and used variables: +# ${CMAKE_COMMAND} -DTESTS_DETAILED:BOOL= -DEXECUTABLE= -P +# +# TESTS_DETAILED c.f. top-level CMakeLists.txt +# FULLPATH-TO-EXECUTABLE - use $ or explicit +# The overwritten CTestTestfile.cmake is located in ${CMAKE_CURRENT_BINARY_DIR} +# # Steps to generate ADD_TEST() commands build time # - Read CTestTestfile.cmake # - Create update entries @@ -33,13 +40,13 @@ set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) endfunction() -function (buildtime_discover_tests EXECUTABLE_CMD DISCOVER_ARG OUTPUT) - execute_process(COMMAND ${EXECUTABLE_CMD} ${DISCOVER_ARG} +function (buildtime_discover_tests EXECUTABLE DISCOVER_ARG OUTPUT) + execute_process(COMMAND ${EXECUTABLE} ${DISCOVER_ARG} OUTPUT_VARIABLE _TMP_OUTPUT ERROR_VARIABLE DISCOVER_ERR RESULT_VARIABLE DISCOVER_ERR) if(NOT ${DISCOVER_ERR} EQUAL 0) - message(SEND_ERROR "Executable \"${EXECUTABLE_CMD} ${DISCOVER_ARG}\" failed with output:\n" + message(SEND_ERROR "Executable \"${EXECUTABLE} ${DISCOVER_ARG}\" failed with output:\n" "${DISCOVER_ERR}\n" "Please check that the excutable was added.") endif(NOT ${DISCOVER_ERR} EQUAL 0) @@ -54,11 +61,11 @@ set(CTESTFNAME "${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake") file(STRINGS ${CTESTFNAME} CTESTTESTS) -set(EXECUTABLE_CMD "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}") +get_filename_component(EXECUTABLE_SHORT_NAME ${EXECUTABLE} NAME_WE) if (TESTS_DETAILED) set(DISCOVER_ARG "-ln") - buildtime_discover_tests("${EXECUTABLE_CMD}" "${DISCOVER_ARG}" TestList_GroupsAndNames) + buildtime_discover_tests("${EXECUTABLE}" "${DISCOVER_ARG}" TestList_GroupsAndNames) set(lastgroup "") foreach(testfullname ${TestList_GroupsAndNames}) string(REGEX MATCH "^([^/.]+)" groupname ${testfullname}) @@ -68,14 +75,14 @@ set(lastgroup "${groupname}") endif (NOT ("${groupname}" STREQUAL "${lastgroup}")) message("... ${testname}") - buildtime_add_test(${EXECUTABLE}.${testfullname} ${EXECUTABLE_CMD} -sg ${groupname} -sn ${testname} -c) + buildtime_add_test(${EXECUTABLE_SHORT_NAME}.${testfullname} ${EXECUTABLE} -sg ${groupname} -sn ${testname}) endforeach() else (TESTS_DETAILED) set(DISCOVER_ARG "-lg") - buildtime_discover_tests("${EXECUTABLE_CMD}" "${DISCOVER_ARG}" TestList_Groups) + buildtime_discover_tests("${EXECUTABLE}" "${DISCOVER_ARG}" TestList_Groups) foreach(group ${TestList_Groups}) message("TestGroup: ${group}") - buildtime_add_test(${EXECUTABLE}.${group} "${EXECUTABLE_CMD}" -sg ${group} -c) + buildtime_add_test(${EXECUTABLE_SHORT_NAME}.${group} "${EXECUTABLE}" -sg ${group}) endforeach() endif (TESTS_DETAILED) diff -Nru cpputest-3.8/CMakeLists.txt cpputest-4.0/CMakeLists.txt --- cpputest-3.8/CMakeLists.txt 2016-05-25 05:41:34.000000000 +0000 +++ cpputest-4.0/CMakeLists.txt 2020-05-27 11:00:11.000000000 +0000 @@ -1,10 +1,20 @@ project(CppUTest) -set(CppUTest_version_major 3) -set(CppUTest_version_minor 8) +set(CppUTest_version_major 4) +set(CppUTest_version_minor 0) # 2.6.3 is needed for ctest support -cmake_minimum_required(VERSION 2.8.7) +# 3.1 is needed for target_sources +cmake_minimum_required(VERSION 3.1) + +############### +# Conan support +############### +if (EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") + include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + message(STATUS "conan_basic_setup()") + conan_basic_setup() +endif() # Check for functions before setting a lot of stuff include(CheckFunctionExists) @@ -14,27 +24,57 @@ add_definitions(-DCPPUTEST_HAVE_FORK) endif(HAVE_FORK) -# Apply workaround for MinGW timespec redefinition (pthread.h / time.h) +check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) +if(HAVE_GETTIMEOFDAY) + add_definitions(-DCPPUTEST_HAVE_GETTIMEOFDAY=1) +endif(HAVE_GETTIMEOFDAY) + +check_function_exists(pthread_mutex_lock HAVE_PTHREAD_MUTEX_LOCK) +if(HAVE_PTHREAD_MUTEX_LOCK) + add_definitions(-DCPPUTEST_HAVE_PTHREAD_MUTEX_LOCK=1) +endif(HAVE_PTHREAD_MUTEX_LOCK) + +check_function_exists(strdup HAVE_STRDUP) +if(HAVE_STRDUP) + add_definitions(-DCPPUTEST_HAVE_STRDUP=1) +endif(HAVE_STRDUP) + if (MINGW) + # Apply workaround for MinGW timespec redefinition (pthread.h / time.h) include(CheckStructHasMember) check_struct_has_member("struct timespec" tv_sec time.h HAVE_STRUCT_TIMESPEC) if (HAVE_STRUCT_TIMESPEC) add_definitions(-D_TIMESPEC_DEFINED=1) endif() + + if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # Apply workaround for static/shared libraries on MinGW C/C++ compiler + # Issue occurs with CMake >= 3.9.0, it doesn't filter out gcc,gcc_s,gcc_eh from + # the implicit library list anymore, so the C++ linker is getting passed the static + # gcc_eh library since that's what the C linker uses by default. Only solution appears + # to be to force static linkage. + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + endif() endif() option(STD_C "Use the standard C library" ON) option(STD_CPP "Use the standard C++ library" ON) option(CPPUTEST_FLAGS "Use the CFLAGS/CXXFLAGS/LDFLAGS set by CppUTest" ON) option(MEMORY_LEAK_DETECTION "Enable memory leak detection" ON) -option(EXTENSIONS "Use the CppUTest extenstion library" ON) +option(EXTENSIONS "Use the CppUTest extension library" ON) option(LONGLONG "Support long long" OFF) option(MAP_FILE "Enable the creation of a map file" OFF) option(COVERAGE "Enable running with coverage" OFF) option(C++11 "Compile with C++11 support" OFF) +option(WERROR "Compile with warnings as errors" OFF) option(TESTS "Compile and make tests for the code?" ON) option(TESTS_DETAILED "Run each test separately instead of grouped?" OFF) +option(TESTS_BUILD_DISCOVER "Build time test discover" ON) + +option(EXAMPLES "Compile and make exaples?" OFF) + +option(VERBOSE_CONFIG "Print configuration to stdout during generation" ON) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "What kind of build this is" FORCE) @@ -53,6 +93,9 @@ #include("${CppUTestRootDirectory}/cmake/Modules/CheckFunctionExists.cmake") include("${CppUTestRootDirectory}/cmake/Modules/CppUTestBuildTimeDiscoverTests.cmake") include("${CppUTestRootDirectory}/cmake/Modules/CppUTestNormalizeTestOutputLocation.cmake") +include(GNUInstallDirs) + +enable_testing() configure_file ( "${PROJECT_SOURCE_DIR}/config.h.cmake" @@ -69,11 +112,18 @@ endif (EXTENSIONS) if (TESTS) - add_subdirectory(tests) + add_subdirectory(tests/CppUTest) + if (EXTENSIONS) + add_subdirectory(tests/CppUTestExt) + endif (EXTENSIONS) endif (TESTS) -set (INCLUDE_INSTALL_DIR "include") -set (LIB_INSTALL_DIR "lib") +if (EXAMPLES) + add_subdirectory(examples) +endif(EXAMPLES) + +set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}") +set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") set (INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") # Pkg-config file. @@ -112,12 +162,21 @@ DESTINATION ${LIB_INSTALL_DIR}/CppUTest/cmake ) install(EXPORT CppUTestTargets DESTINATION ${LIB_INSTALL_DIR}/CppUTest/cmake) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake + DESTINATION ${LIB_INSTALL_DIR}/CppUTest/cmake/Scripts) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/CppUTestBuildTimeDiscoverTests.cmake + DESTINATION ${LIB_INSTALL_DIR}/CppUTest/cmake/Modules) configure_package_config_file(CppUTestConfig.cmake.build.in ${CMAKE_CURRENT_BINARY_DIR}/CppUTestConfig.cmake INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR} PATH_VARS INCLUDE_DIR CMAKE_CURRENT_BINARY_DIR) - export(TARGETS CppUTest CppUTestExt - FILE "${CMAKE_CURRENT_BINARY_DIR}/CppUTestTargets.cmake") + if (EXTENSIONS) + export(TARGETS CppUTest CppUTestExt + FILE "${CMAKE_CURRENT_BINARY_DIR}/CppUTestTargets.cmake") + else() + export(TARGETS CppUTest + FILE "${CMAKE_CURRENT_BINARY_DIR}/CppUTestTargets.cmake") + endif() write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/CppUTestConfigVersion.cmake VERSION ${CppUTest_version_major}.${CppUTest_version_minor} @@ -129,7 +188,8 @@ " or write generators for CppUTestConfig.cmake by yourself.") endif() -message(" +if(VERBOSE_CONFIG) + message(" ------------------------------------------------------- CppUTest Version ${CppUTest_version_major}.${CppUTest_version_minor} @@ -158,3 +218,4 @@ ------------------------------------------------------- ") +endif() diff -Nru cpputest-3.8/compile cpputest-4.0/compile --- cpputest-3.8/compile 2016-05-02 05:35:46.000000000 +0000 +++ cpputest-4.0/compile 2020-05-26 11:27:12.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,7 +255,8 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru cpputest-3.8/config.guess cpputest-4.0/config.guess --- cpputest-3.8/config.guess 2016-05-02 05:35:46.000000000 +0000 +++ cpputest-4.0/config.guess 2020-05-26 11:27:12.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2014-11-04' +timestamp='2020-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -39,7 +39,7 @@ Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,8 +84,6 @@ exit 1 fi -trap 'exit 1' 1 2 15 - # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -96,34 +94,40 @@ # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi @@ -132,14 +136,14 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +153,20 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -168,21 +179,31 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -197,43 +218,72 @@ os=netbsd ;; esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Twizzler:*:*) + echo "$UNAME_MACHINE"-unknown-twizzler + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in @@ -251,63 +301,54 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -319,7 +360,7 @@ echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -346,38 +387,38 @@ sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + set_cc_for_build + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -386,25 +427,25 @@ ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -415,44 +456,44 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -461,23 +502,23 @@ #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -503,17 +544,17 @@ AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -530,7 +571,7 @@ echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -542,14 +583,14 @@ if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -560,7 +601,7 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -574,7 +615,7 @@ exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -583,18 +624,18 @@ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -609,28 +650,28 @@ echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -663,13 +704,13 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -680,23 +721,23 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -721,11 +762,11 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -734,7 +775,7 @@ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -742,9 +783,9 @@ exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -769,130 +810,123 @@ echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin + echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -902,129 +936,169 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1038,34 +1112,34 @@ # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1075,12 +1149,12 @@ *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1090,9 +1164,9 @@ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1100,7 +1174,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1112,9 +1186,9 @@ exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1134,9 +1208,9 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1145,28 +1219,28 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1177,7 +1251,7 @@ *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1197,23 +1271,23 @@ exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1232,77 +1306,94 @@ echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1311,18 +1402,19 @@ echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + # shellcheck disable=SC2154 + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1343,14 +1435,14 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1359,34 +1451,188 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + exit ;; +esac + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1405,16 +1651,16 @@ /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff -Nru cpputest-3.8/config.h.in cpputest-4.0/config.h.in --- cpputest-3.8/config.h.in 2016-05-25 05:42:44.000000000 +0000 +++ cpputest-4.0/config.h.in 2020-05-27 11:05:26.000000000 +0000 @@ -24,6 +24,9 @@ /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD +/* Define to 1 if you have the `pthread_mutex_lock' function. */ +#undef HAVE_PTHREAD_MUTEX_LOCK + /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H @@ -33,6 +36,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H diff -Nru cpputest-3.8/config.sub cpputest-4.0/config.sub --- cpputest-3.8/config.sub 2016-05-02 05:35:46.000000000 +0000 +++ cpputest-4.0/config.sub 2020-05-26 11:27:12.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2020 Free Software Foundation, Inc. -timestamp='2014-12-03' +timestamp='2020-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,12 +53,11 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -68,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -90,12 +89,12 @@ - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -111,1228 +110,1164 @@ exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos +# Split fields of configuration type +# shellcheck disable=SC2162 +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + alliant) + basic_machine=fx80-alliant + os= + ;; + altos | altos3068) + basic_machine=m68k-altos + os= + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amiga) + basic_machine=m68k-unknown + os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=bsd + ;; + aros) + basic_machine=i386-pc + os=aros + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=bsd + ;; + convex-c2) + basic_machine=c2-convex + os=bsd + ;; + convex-c32) + basic_machine=c32-convex + os=bsd + ;; + convex-c34) + basic_machine=c34-convex + os=bsd + ;; + convex-c38) + basic_machine=c38-convex + os=bsd + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + os= + ;; + da30) + basic_machine=m68k-da30 + os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + os= + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=hms + ;; + harris) + basic_machine=m88k-harris + os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-pc + os=msys + ;; + mvs) + basic_machine=i370-ibm + os=mvs + ;; + nacl) + basic_machine=le32-unknown + os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=newsos + ;; + news1000) + basic_machine=m68030-sony + os=newsos + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + nh3000) + basic_machine=m68k-harris + os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=cxux + ;; + nindy960) + basic_machine=i960-intel + os=nindy + ;; + mon960) + basic_machine=i960-intel + os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sequent) + basic_machine=i386-sequent + os= + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + os= + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + os= + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + os= + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + os= + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + os= + ;; + sv1) + basic_machine=sv1-cray + os=unicos + ;; + symmetry) + basic_machine=i386-sequent + os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=unicos + ;; + t90) + basic_machine=t90-cray + os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + os=tpf + ;; + udi29k) + basic_machine=a29k-amd + os=udi + ;; + ultra3) + basic_machine=a29k-nyu + os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=none + ;; + vaxv) + basic_machine=vax-dec + os=sysv + ;; + vms) + basic_machine=vax-dec + os=vms + ;; + vsta) + basic_machine=i386-pc + os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op50n) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola + cpu=m68k + vendor=motorola ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + dpx2*) + cpu=m68k + vendor=bull + os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + os=${os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + os=${os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi + cpu=mips + vendor=sgi case $os in - -irix*) + irix*) ;; *) - os=-irix4 + os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint + cpu=m68000 + vendor=convergent ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next + cpu=mips + vendor=sony + os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next case $os in - -nextstep* ) + openstep*) + ;; + nextstep*) ;; - -ns2*) - os=-nextstep2 + ns2*) + os=nextstep2 ;; *) - os=-nextstep3 + os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc + cpu=m68k + vendor=tti ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc + pc532) + cpu=ns32k + vendor=pc532 ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc + pn) + cpu=pn + vendor=gould ;; - pentium4) - basic_machine=i786-pc + power) + cpu=power + vendor=ibm ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ps2) + cpu=i386 + vendor=ibm ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + rm[46]00) + cpu=mips + vendor=siemens ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + rtpc | rtpc-*) + cpu=romp + vendor=ibm ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + sde) + cpu=mipsisa32 + vendor=sde + os=${os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + os=vxworks ;; - pn) - basic_machine=pn-gould + tower | tower-32) + cpu=m68k + vendor=ncr ;; - power) basic_machine=power-ibm + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - ppc | ppcbe) basic_machine=powerpc-unknown + w65) + cpu=w65 + vendor=wdc ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + w89k-*) + cpu=hppa1.1 + vendor=winbond + os=proelf ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown + none) + cpu=none + vendor=none ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - ppc64) basic_machine=powerpc64-unknown + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + + *-*) + # shellcheck disable=SC2162 + IFS="-" read cpu vendor <&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv64 \ + | rl78 | romp | rs6000 | rx \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1340,197 +1275,244 @@ # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if [ x$os != x ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` + bluegene*) + os=cnk ;; - -solaris) - os=-solaris2 + solaris1 | solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - -svr4*) - os=-sysv4 + solaris) + os=solaris2 ;; - -unixware*) - os=-sysv4.2uw + unixware*) + os=sysv4.2uw ;; - -gnu/linux*) + gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Each alternative MUST end in a * to match a version number. + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix) # Remember, each alternative MUST END IN *, to match a version number. ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) + qnx*) + case $cpu in + x86 | i*86) ;; *) - os=-nto$os + os=nto-$os ;; esac ;; - -nto-qnx*) + hiux*) + os=hiuxwe2 ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` + nto-qnx*) ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; - -linux-dietlibc) - os=-linux-dietlibc + linux-dietlibc) + os=linux-dietlibc ;; - -linux*) + linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + lynx*178) + os=lynxos178 ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + lynx*5) + os=lynxos5 ;; - -opened*) - os=-openedition + lynx*) + os=lynxos ;; - -os400*) - os=-os400 + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -wince*) - os=-wince + opened*) + os=openedition ;; - -osfrose*) - os=-osfrose + os400*) + os=os400 ;; - -osf*) - os=-osf + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -utek*) - os=-bsd + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -dynix*) - os=-bsd + wince*) + os=wince ;; - -acis*) - os=-aos + utek*) + os=bsd ;; - -atheos*) - os=-atheos + dynix*) + os=bsd ;; - -syllable*) - os=-syllable + acis*) + os=aos ;; - -386bsd) - os=-bsd + atheos*) + os=atheos ;; - -ctix* | -uts*) - os=-sysv + syllable*) + os=syllable + ;; + 386bsd) + os=bsd ;; - -nova*) - os=-rtmk-nova + ctix* | uts*) + os=sysv ;; - -ns2 ) - os=-nextstep2 + nova*) + os=rtmk-nova ;; - -nsk*) - os=-nsk + ns2) + os=nextstep2 ;; # Preserve the version number of sinix5. - -sinix5.*) + sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - -sinix*) - os=-sysv4 + sinix*) + os=sysv4 ;; - -tpf*) - os=-tpf + tpf*) + os=tpf ;; - -triton*) - os=-sysv3 + triton*) + os=sysv3 ;; - -oss*) - os=-sysv3 + oss*) + os=sysv3 ;; - -svr4) - os=-sysv4 + svr4*) + os=sysv4 ;; - -svr3) - os=-sysv3 + svr3) + os=sysv3 ;; - -sysvr4) - os=-sysv4 + sysvr4) + os=sysv4 ;; - # This must come after -sysvr4. - -sysv*) + # This must come after sysvr4. + sysv*) ;; - -ose*) - os=-ose + ose*) + os=ose ;; - -es1800*) - os=-ose + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint ;; - -xenix) - os=-xenix + zvmoe) + os=zvmoe ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + dicos*) + os=dicos ;; - -aros*) - os=-aros + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $cpu in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; - -zvmoe) - os=-zvmoe + nacl*) ;; - -dicos*) - os=-dicos + ios) ;; - -nacl*) + none) ;; - -none) + *-eabi) ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1546,261 +1528,265 @@ # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + os=linux ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; - *-be) - os=-beos + pru-*) + os=elf ;; - *-haiku) - os=-haiku + *-be) + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; - *-next ) - os=-nextstep + *-next) + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) +case $vendor in + unknown) case $os in - -riscix*) + riscix*) vendor=acorn ;; - -sunos*) + sunos*) vendor=sun ;; - -cnk*|-aix*) + cnk*|-aix*) vendor=ibm ;; - -beos*) + beos*) vendor=be ;; - -hpux*) + hpux*) vendor=hp ;; - -mpeix*) + mpeix*) vendor=hp ;; - -hiux*) + hiux*) vendor=hitachi ;; - -unos*) + unos*) vendor=crds ;; - -dgux*) + dgux*) vendor=dg ;; - -luna*) + luna*) vendor=omron ;; - -genix*) + genix*) vendor=ns ;; - -mvs* | -opened*) + clix*) + vendor=intergraph + ;; + mvs* | opened*) vendor=ibm ;; - -os400*) + os400*) vendor=ibm ;; - -ptx*) + ptx*) vendor=sequent ;; - -tpf*) + tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + vxsim* | vxworks* | windiss*) vendor=wrs ;; - -aux*) + aux*) vendor=apple ;; - -hms*) + hms*) vendor=hitachi ;; - -mpw* | -macos*) + mpw* | macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; - -vos*) + vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff -Nru cpputest-3.8/configure cpputest-4.0/configure --- cpputest-3.8/configure 2016-05-25 05:42:34.000000000 +0000 +++ cpputest-4.0/configure 2020-05-27 11:04:20.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for CppUTest 3.8. +# Generated by GNU Autoconf 2.69 for CppUTest 4.0. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='CppUTest' PACKAGE_TARNAME='cpputest' -PACKAGE_VERSION='3.8' -PACKAGE_STRING='CppUTest 3.8' +PACKAGE_VERSION='4.0' +PACKAGE_STRING='CppUTest 4.0' PACKAGE_BUGREPORT='https://github.com/cpputest/cpputest' PACKAGE_URL='' @@ -701,7 +701,6 @@ AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -784,7 +783,8 @@ PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -800,13 +800,18 @@ enable_libtool_lock enable_std_c enable_std_cpp +enable_std_cpp98 enable_std_cpp11 +enable_std_cpp14 +enable_std_cpp17 +enable_std_cpp20 enable_cpputest_flags enable_memory_leak_detection enable_extensions enable_longlong enable_generate_map_file enable_coverage +enable_sanitize_address ' ac_precious_vars='build_alias host_alias @@ -1363,7 +1368,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures CppUTest 3.8 to adapt to many kinds of systems. +\`configure' configures CppUTest 4.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1433,7 +1438,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of CppUTest 3.8:";; + short | recursive ) echo "Configuration of CppUTest 4.0:";; esac cat <<\_ACEOF @@ -1455,8 +1460,16 @@ --disable-std-c disable the use of Standard C Library (warning: requires implementing Platforms/GccNoStdC) --disable-std-cpp disable the use of Standard C++ Library + --enable-std-cpp98 enable the use of Standard C++ 98 (if the compiler + supports that) --enable-std-cpp11 enable the use of Standard C++ 11 (if the compiler supports that) + --enable-std-cpp14 enable the use of Standard C++ 14 (if the compiler + supports that) + --enable-std-cpp17 enable the use of Standard C++ 17 (if the compiler + supports that) + --enable-std-cpp20 enable the use of Standard C++ 20 (if the compiler + supports that) --disable-cpputest-flags disable CFLAGS/CPPFLAGS/CXXFLAGS set by CppUTest --disable-memory-leak-detection @@ -1466,6 +1479,8 @@ --enable-generate-map-file enable the creation of a map file --enable-coverage enable running with coverage + --enable-sanitize-address + enable running with address sanitizer Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1561,7 +1576,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -CppUTest configure 3.8 +CppUTest configure 4.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1957,6 +1972,189 @@ } # ac_fn_cxx_try_link +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 >confdefs.h <<_ACEOF @@ -3128,8 +3326,8 @@ # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -3180,7 +3378,7 @@ Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3373,45 +3571,45 @@ ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -17316,120 +17514,1151 @@ -# This additional -lpthread was added due to a bug on gcc for MacOSX: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42159 -# According to the bug report, a workaround is to link -lpthread. Even the ACX_PTHREAD doesn't do that, so we add an -# additional check if that it possible, and if it is, then we link pthread + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 +$as_echo_n "checking for C compiler vendor... " >&6; } +if ${ax_cv_c_compiler_vendor+:} false; then : + $as_echo_n "(cached) " >&6 +else -saved_libs="$LIBS" -LIBS=-lpthread -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can link -lpthread to work around a gcc bug (on MacOSX)" >&5 -$as_echo_n "checking if we can link -lpthread to work around a gcc bug (on MacOSX)... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + vendors=" + intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + sdcc: SDCC,__SDCC + sx: _SX + portland: __PGI + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + tcc: __TINYC__ + unknown: UNKNOWN + " + for ventest in $vendors; do + case $ventest in + *:) + vendor=$ventest + continue + ;; + *) + vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" + ;; + esac + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { +#if !($vencpp) + thisisanerror; +#endif + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; HACK_TO_USE_PTHREAD_LIBS=" -lpthread" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO"; then : + break fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS="$saved_libs $HACK_TO_USE_PTHREAD_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done -for ac_header in stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 +$as_echo "$ax_cv_c_compiler_vendor" >&6; } -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +$as_echo_n "checking for C compiler version... " >&6; } +if ${ax_cv_c_compiler_version+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif + case $ax_cv_c_compiler_vendor in #( + intel) : + if ac_fn_c_compute_int "$LINENO" "__INTEL_COMPILER/100" "_ax_c_compiler_version_major" ""; then : -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_INTEL unknown intel compiler version +See \`config.log' for more details" "$LINENO" 5; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done + if ac_fn_c_compute_int "$LINENO" "(__INTEL_COMPILER%100)/10" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_INTEL unknown intel compiler version +See \`config.log' for more details" "$LINENO" 5; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac + if ac_fn_c_compute_int "$LINENO" "(__INTEL_COMPILER%10)" "_ax_c_compiler_version_patch" ""; then : -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_INTEL unknown intel compiler version +See \`config.log' for more details" "$LINENO" 5; } +fi -cat >>confdefs.h <<_ACEOF -#define int16_t $ac_cv_c_int16_t -_ACEOF -;; -esac + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + ibm) : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) -cat >>confdefs.h <<_ACEOF -#define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac +int +main () +{ -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) + #if defined(__COMPILER_VER__) + choke me; + #endif -cat >>confdefs.h <<_ACEOF + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + if ac_fn_c_compute_int "$LINENO" "__xlC__/100" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_IBM unknown IBM compiler major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__xlC__%100" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_IBM unknown IBM compiler minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__xlC_ver__/0x100" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_IBM unknown IBM compiler patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__xlC_ver__%0x100" "_ax_c_compiler_version_build" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_IBM unknown IBM compiler build version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch.$_ax_c_compiler_version_build" + +else + + if ac_fn_c_compute_int "$LINENO" "__xlC__%1000" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_IBM unknown IBM compiler patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(__xlC__/10000)%10" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_IBM unknown IBM compiler minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(__xlC__/100000)%10" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_IBM unknown IBM compiler major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; #( + pathscale) : + + if ac_fn_c_compute_int "$LINENO" "__PATHCC__" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_PATHSCALE unknown pathscale major +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__PATHCC_MINOR__" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_PATHSCALE unknown pathscale minor +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__PATHCC_PATCHLEVEL__" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_PATHSCALE unknown pathscale patch level +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + clang) : + + if ac_fn_c_compute_int "$LINENO" "__clang_major__" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_CLANG unknown clang major +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__clang_minor__" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_CLANG unknown clang minor +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__clang_patchlevel__" "_ax_c_compiler_version_patch" ""; then : + +else + 0 +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + cray) : + + if ac_fn_c_compute_int "$LINENO" "_RELEASE" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_CRAY unknown crayc release +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "_RELEASE_MINOR" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_CRAY unknown crayc minor +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor" + ;; #( + fujitsu) : + + if ac_fn_c_compute_int "$LINENO" "__FCC_VERSION" "ax_cv_c_compiler_version" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_FUJITSUunknown fujitsu release +See \`config.log' for more details" "$LINENO" 5; } +fi + + ;; #( + gnu) : + + if ac_fn_c_compute_int "$LINENO" "__GNUC__" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_GNU unknown gcc major +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__GNUC_MINOR__" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_GNU unknown gcc minor +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__GNUC_PATCHLEVEL__" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_GNU unknown gcc patch level +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + sun) : + + + if ac_fn_c_compute_int "$LINENO" "!!( + #if defined(__SUNPRO_CC) + __SUNPRO_CC + #else + __SUNPRO_C + #endif + < 0x1000)" "_ax_c_compiler_version_until59" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SUN unknown sun release version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if test "X$_ax_c_compiler_version_until59" = X1; then : + if ac_fn_c_compute_int "$LINENO" " + #if defined(__SUNPRO_CC) + __SUNPRO_CC + #else + __SUNPRO_C + #endif + % 0x10" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SUN unknown sun patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "( + #if defined(__SUNPRO_CC) + __SUNPRO_CC + #else + __SUNPRO_C + #endif + / 0x10) % 0x10" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SUN unknown sun minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "( + #if defined(__SUNPRO_CC) + __SUNPRO_CC + #else + __SUNPRO_C + #endif + / 0x100)" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SUN unknown sun major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + +else + if ac_fn_c_compute_int "$LINENO" " + #if defined(__SUNPRO_CC) + __SUNPRO_CC + #else + __SUNPRO_C + #endif + % 0x10" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SUN unknown sun patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "( + #if defined(__SUNPRO_CC) + __SUNPRO_CC + #else + __SUNPRO_C + #endif + / 0x100) % 0x100" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SUN unknown sun minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "( + #if defined(__SUNPRO_CC) + __SUNPRO_CC + #else + __SUNPRO_C + #endif + / 0x1000)" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SUN unknown sun major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + +fi + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + hp) : + + + if ac_fn_c_compute_int "$LINENO" "!!( + #if defined(__HP_cc) + __HP_cc + #else + __HP_aCC + #endif + <= 1)" "_ax_c_compiler_version_untilA0121" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_HP unknown hp release version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if test "X$_ax_c_compiler_version_untilA0121" = X1; then : + ax_cv_c_compiler_version="01.21.00" + +else + if ac_fn_c_compute_int "$LINENO" "( + #if defined(__HP_cc) + __HP_cc + #else + __HP_aCC + #endif + % 100)" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_HP unknown hp release version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(( + #if defined(__HP_cc) + __HP_cc + #else + __HP_aCC + #endif + / 100)%100)" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_HP unknown hp minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(( + #if defined(__HP_cc) + __HP_cc + #else + __HP_aCC + #endif + / 10000)%100)" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_HP unknown hp major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + +fi + ;; #( + dec) : + + if ac_fn_c_compute_int "$LINENO" "( + #if defined(__DECC_VER) + __DECC_VER + #else + __DECCXX_VER + #endif + % 10000)" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_DEC unknown dec release version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(( + #if defined(__DECC_VER) + __DECC_VER + #else + __DECCXX_VER + #endif + / 100000UL)%100)" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_DEC unknown dec minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(( + #if defined(__DECC_VER) + __DECC_VER + #else + __DECCXX_VER + #endif + / 10000000UL)%100)" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_DEC unknown dec major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + borland) : + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + #if defined(__TURBOC__) + __TURBOC__ + #else + choke me + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_compute_int "$LINENO" " + #if defined(__TURBOC__) + __TURBOC__ + #else + choke me + #endif + " "_ax_c_compiler_version_turboc_raw" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_BORLAND unknown turboc version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if test $_ax_c_compiler_version_turboc_raw -lt 661 || test $_ax_c_compiler_version_turboc_raw -gt 1023; then : + if ac_fn_c_compute_int "$LINENO" " + #if defined(__TURBOC__) + __TURBOC__ + #else + choke me + #endif + % 0x100" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_BORLAND unknown turboc minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "( + #if defined(__TURBOC__) + __TURBOC__ + #else + choke me + #endif + /0x100)%0x100" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_BORLAND unknown turboc major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="0turboc:$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor" +else + case $_ax_c_compiler_version_turboc_raw in #( + 661) : + ax_cv_c_compiler_version="0turboc:1.00" ;; #( + 662) : + ax_cv_c_compiler_version="0turboc:1.01" ;; #( + 663) : + ax_cv_c_compiler_version="0turboc:2.00" ;; #( + *) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: [_AX_COMPILER_VERSION_BORLAND] unknown turboc version between 0x295 and 0x400 please report bug" >&5 +$as_echo "$as_me: WARNING: [_AX_COMPILER_VERSION_BORLAND] unknown turboc version between 0x295 and 0x400 please report bug" >&2;} + ax_cv_c_compiler_version="" + ;; +esac + +fi + +else + # borlandc + + if ac_fn_c_compute_int "$LINENO" " + #if defined(__BORLANDC__) + __BORLANDC__ + #else + __CODEGEARC__ + #endif + " "_ax_c_compiler_version_borlandc_raw" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_BORLAND unknown borlandc version +See \`config.log' for more details" "$LINENO" 5; } +fi + + case $_ax_c_compiler_version_borlandc_raw in #( + 512 ) : + ax_cv_c_compiler_version="1borlanc:2.00" ;; #( + 1024) : + ax_cv_c_compiler_version="1borlanc:3.00" ;; #( + 1024) : + ax_cv_c_compiler_version="1borlanc:3.00" ;; #( + 1040) : + ax_cv_c_compiler_version="1borlanc:3.1" ;; #( + 1106) : + ax_cv_c_compiler_version="1borlanc:4.0" ;; #( + 1280) : + ax_cv_c_compiler_version="1borlanc:5.0" ;; #( + 1312) : + ax_cv_c_compiler_version="1borlanc:5.02" ;; #( + 1328) : + ax_cv_c_compiler_version="2cppbuilder:3.0" ;; #( + 1344) : + ax_cv_c_compiler_version="2cppbuilder:4.0" ;; #( + 1360) : + ax_cv_c_compiler_version="3borlancpp:5.5" ;; #( + 1361) : + ax_cv_c_compiler_version="3borlancpp:5.51" ;; #( + 1378) : + ax_cv_c_compiler_version="3borlancpp:5.6.4" ;; #( + 1392) : + ax_cv_c_compiler_version="4cppbuilder:2006" ;; #( + 1424) : + ax_cv_c_compiler_version="4cppbuilder:2007" ;; #( + 1555) : + ax_cv_c_compiler_version="4cppbuilder:2009" ;; #( + 1569) : + ax_cv_c_compiler_version="4cppbuilder:2010" ;; #( + 1584) : + ax_cv_c_compiler_version="5xe" ;; #( + 1600) : + ax_cv_c_compiler_version="5xe:2" ;; #( + 1616) : + ax_cv_c_compiler_version="5xe:3" ;; #( + 1632) : + ax_cv_c_compiler_version="5xe:4" ;; #( + *) : + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: [_AX_COMPILER_VERSION_BORLAND] Unknown borlandc compiler version $_ax_c_compiler_version_borlandc_raw please report bug" >&5 +$as_echo "$as_me: WARNING: [_AX_COMPILER_VERSION_BORLAND] Unknown borlandc compiler version $_ax_c_compiler_version_borlandc_raw please report bug" >&2;} + ;; +esac + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; #( + comeau) : + if ac_fn_c_compute_int "$LINENO" "__COMO_VERSION__%100" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_COMEAU unknown comeau compiler minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(__COMO_VERSION__/100)%10" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_COMEAU unknown comeau compiler major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor" + ;; #( + kai) : + + if ac_fn_c_compute_int "$LINENO" "__KCC_VERSION%100" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_KAI unknown kay compiler patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(__KCC_VERSION/100)%10" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_KAI unknown kay compiler minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(__KCC_VERSION/1000)%10" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_KAI unknown kay compiler major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + sgi) : + + + if ac_fn_c_compute_int "$LINENO" " + #if defined(_COMPILER_VERSION) + _COMPILER_VERSION + #else + _SGI_COMPILER_VERSION + #endif + %10" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SGI unknown SGI compiler patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "( + #if defined(_COMPILER_VERSION) + _COMPILER_VERSION + #else + _SGI_COMPILER_VERSION + #endif + /10)%10" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SGI unknown SGI compiler minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "( + #if defined(_COMPILER_VERSION) + _COMPILER_VERSION + #else + _SGI_COMPILER_VERSION + #endif + /100)%10" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SGI unknown SGI compiler major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + microsoft) : + + if ac_fn_c_compute_int "$LINENO" "_MSC_VER%100" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_MICROSOFT unknown microsoft compiler minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(_MSC_VER/100)%100" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_MICROSOFT unknown microsoft compiler major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + _ax_c_compiler_version_patch=0 + _ax_c_compiler_version_build=0 + # special case for version 6 + if test "X$_ax_c_compiler_version_major" = "X12"; then : + if ac_fn_c_compute_int "$LINENO" "_MSC_FULL_VER%1000" "_ax_c_compiler_version_patch" ""; then : + +else + _ax_c_compiler_version_patch=0 +fi + +fi + # for version 7 + if test "X$_ax_c_compiler_version_major" = "X13"; then : + if ac_fn_c_compute_int "$LINENO" "_MSC_FULL_VER%1000" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_MICROSOFT unknown microsoft compiler patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + +fi + # for version > 8 + if test $_ax_c_compiler_version_major -ge 14; then : + if ac_fn_c_compute_int "$LINENO" "_MSC_FULL_VER%10000" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_MICROSOFT unknown microsoft compiler patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + +fi + if test $_ax_c_compiler_version_major -ge 15; then : + if ac_fn_c_compute_int "$LINENO" "_MSC_BUILD" "_ax_c_compiler_version_build" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_MICROSOFT unknown microsoft compiler build version +See \`config.log' for more details" "$LINENO" 5; } +fi + + +fi + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch.$_ax_c_compiler_version_build" + ;; #( + metrowerks) : + if ac_fn_c_compute_int "$LINENO" "__MWERKS__%0x100" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_METROWERKS unknown metrowerks compiler patch version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(__MWERKS__/0x100)%0x10" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_METROWERKS unknown metrowerks compiler minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(__MWERKS__/0x1000)%0x10" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_METROWERKS unknown metrowerks compiler major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + watcom) : + if ac_fn_c_compute_int "$LINENO" "__WATCOMC__%100" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_WATCOM unknown watcom compiler minor version +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "(__WATCOMC__/100)%100" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_WATCOM unknown watcom compiler major version +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor" + ;; #( + portland) : + + if ac_fn_c_compute_int "$LINENO" "__PGIC__" "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_PORTLAND unknown pgi major +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__PGIC_MINOR__" "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_PORTLAND unknown pgi minor +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "__PGIC_PATCHLEVEL__" "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_PORTLAND unknown pgi patch level +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + tcc) : + + ax_cv_c_compiler_version=`tcc -v | $SED 's/^[ ]*tcc[ ]\+version[ ]\+\([0-9.]\+\).*/\1/g'` + ;; #( + sdcc) : + + if ac_fn_c_compute_int "$LINENO" "/* avoid parse error with comments */ + #if(defined(__SDCC_VERSION_MAJOR)) + __SDCC_VERSION_MAJOR + #else + SDCC/100 + #endif + " "_ax_c_compiler_version_major" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SDCC unknown sdcc major +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" "/* avoid parse error with comments */ + #if(defined(__SDCC_VERSION_MINOR)) + __SDCC_VERSION_MINOR + #else + (SDCC%100)/10 + #endif + " "_ax_c_compiler_version_minor" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SDCC unknown sdcc minor +See \`config.log' for more details" "$LINENO" 5; } +fi + + if ac_fn_c_compute_int "$LINENO" " + /* avoid parse error with comments */ + #if(defined(__SDCC_VERSION_PATCH)) + __SDCC_VERSION_PATCH + #elsif(defined(_SDCC_VERSION_PATCHLEVEL)) + __SDCC_VERSION_PATCHLEVEL + #else + SDCC%10 + #endif + " "_ax_c_compiler_version_patch" ""; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_AX_COMPILER_VERSION_SDCC unknown sdcc patch level +See \`config.log' for more details" "$LINENO" 5; } +fi + + ax_cv_c_compiler_version="$_ax_c_compiler_version_major.$_ax_c_compiler_version_minor.$_ax_c_compiler_version_patch" + ;; #( + *) : + ax_cv_c_compiler_version="" ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_version" >&5 +$as_echo "$ax_cv_c_compiler_version" >&6; } + +# This additional -lpthread was added due to a bug on gcc for MacOSX: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42159 +# According to the bug report, a workaround is to link -lpthread. Even the ACX_PTHREAD doesn't do that, so we add an +# additional check if that it possible, and if it is, then we link pthread + +saved_libs="$LIBS" +LIBS=-lpthread +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can link -lpthread to work around a gcc bug (on MacOSX)" >&5 +$as_echo_n "checking if we can link -lpthread to work around a gcc bug (on MacOSX)... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; HACK_TO_USE_PTHREAD_LIBS=" -lpthread" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS="$saved_libs $HACK_TO_USE_PTHREAD_LIBS" + +for ac_header in stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF #define int64_t $ac_cv_c_int64_t _ACEOF ;; @@ -17854,7 +19083,7 @@ fi -for ac_func in gettimeofday memset strstr +for ac_func in gettimeofday memset strstr strdup pthread_mutex_lock do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -18090,19 +19319,172 @@ CFLAGS="$saved_cflags" fi -##################################################################################### -##### C++ 11 checks - -### Checking for Standard C++ 11 compiler flags ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +##################################################################################### +##### C++ checks + +# FLag -std=c++1y +CXXFLAGS="-Werror -std=c++1y" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -std=c++1y" >&5 +$as_echo_n "checking whether CXX supports -std=c++1y... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; CPPUTEST_CPP14FLAG="-std=c++1y" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CXXFLAGS="$saved_cxxflags" + +# FLag std=c++14 +CXXFLAGS="-Werror -std=c++14" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -std=c++14" >&5 +$as_echo_n "checking whether CXX supports -std=c++14... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; CPPUTEST_CPP14FLAG="-std=c++14" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CXXFLAGS="$saved_cxxflags" + +# FLag std=c++17 +CXXFLAGS="-Werror -std=c++17" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -std=c++17" >&5 +$as_echo_n "checking whether CXX supports -std=c++17... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; CPPUTEST_CPP17FLAG="-std=c++17" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CXXFLAGS="$saved_cxxflags" + +# FLag std=c++20 +CXXFLAGS="-Werror -std=c++2a" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -std=c++2a" >&5 +$as_echo_n "checking whether CXX supports -std=c++2a... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; CPPUTEST_CPP20FLAG="-std=c++2a" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CXXFLAGS="$saved_cxxflags" + +# FLag std=c++20 +CXXFLAGS="-Werror -std=c++20" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -std=c++20" >&5 +$as_echo_n "checking whether CXX supports -std=c++20... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; CPPUTEST_CPP20FLAG="-std=c++20" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CXXFLAGS="$saved_cxxflags" + +##################################################################################### +##### C++ version checks + +### Checking for C++ version compiler flags + +# FLag -std=c++98 +CXXFLAGS="-Werror -std=c++98" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -std=c++98" >&5 +$as_echo_n "checking whether CXX supports -std=c++98... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; CPPUTEST_CPP98FLAG="-std=c++98" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CXXFLAGS="$saved_cxxflags" # FLag -std=c++0x -CXXFLAGS="-std=c++0x" +CXXFLAGS="-Werror -std=c++0x" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -std=c++0x" >&5 $as_echo_n "checking whether CXX supports -std=c++0x... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18126,7 +19508,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$saved_cxxflags" -CXXFLAGS="-std=c++11" +CXXFLAGS="-Werror -std=c++11" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -std=c++11" >&5 $as_echo_n "checking whether CXX supports -std=c++11... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18150,7 +19532,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$saved_cxxflags" -CXXFLAGS="-stdlib=libc++" +CXXFLAGS="-Werror -stdlib=libc++" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -stdlib=libc++" >&5 $as_echo_n "checking whether CXX supports -stdlib=libc++... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18191,7 +19573,7 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; CPPUTEST_CPP11BLACKLIST="${CPPUTEST_CPP11BLACKLIST} -Wno-c++98-compat" +$as_echo "yes" >&6; }; CPPUTEST_CXXWARNINGFLAGS="${CPPUTEST_CXXWARNINGFLAGS} -Wno-c++98-compat" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -18216,7 +19598,32 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; CPPUTEST_CPP11BLACKLIST="${CPPUTEST_CPP11BLACKLIST} -Wno-c++98-compat-pedantic" +$as_echo "yes" >&6; }; CPPUTEST_CXXWARNINGFLAGS="${CPPUTEST_CXXWARNINGFLAGS} -Wno-c++98-compat-pedantic" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CXXFLAGS="$saved_cxxflags" + +# Flag -Wno-c++14-compat +CXXFLAGS="-Werror -Wno-c++14-compat" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CXX supports -Wno-c++14-compat" >&5 +$as_echo_n "checking whether CXX supports -Wno-c++14-compat... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; CPPUTEST_CXXWARNINGFLAGS="${CPPUTEST_CXXWARNINGFLAGS} -Wno-c++14-compat" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -18258,8 +19665,8 @@ # FLag -Wno-long-long must be on for C. CFLAGS="-Werror -Wno-long-long" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CC supports -Wno-long-long" >&5 -$as_echo_n "checking whether CC supports -Wno-long-long... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CC and CXX supports -Wno-long-long" >&5 +$as_echo_n "checking whether CC and CXX supports -Wno-long-long... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19026,6 +20433,14 @@ fi +# Check whether --enable-std-cpp98 was given. +if test "${enable_std_cpp98+set}" = set; then : + enableval=$enable_std_cpp98; use_std_cpp98=${enableval} +else + use_std_cpp98=no +fi + + # Check whether --enable-std-cpp11 was given. if test "${enable_std_cpp11+set}" = set; then : enableval=$enable_std_cpp11; use_std_cpp11=${enableval} @@ -19034,6 +20449,30 @@ fi +# Check whether --enable-std-cpp14 was given. +if test "${enable_std_cpp14+set}" = set; then : + enableval=$enable_std_cpp14; use_std_cpp14=${enableval} +else + use_std_cpp14=no +fi + + +# Check whether --enable-std-cpp17 was given. +if test "${enable_std_cpp17+set}" = set; then : + enableval=$enable_std_cpp17; use_std_cpp17=${enableval} +else + use_std_cpp17=no +fi + + +# Check whether --enable-std-cpp20 was given. +if test "${enable_std_cpp20+set}" = set; then : + enableval=$enable_std_cpp20; use_std_cpp20=${enableval} +else + use_std_cpp20=no +fi + + # Check whether --enable-cpputest-flags was given. if test "${enable_cpputest_flags+set}" = set; then : enableval=$enable_cpputest_flags; cpputest_flags=${enableval} @@ -19082,6 +20521,14 @@ fi +# Check whether --enable-sanitize-address was given. +if test "${enable_sanitize_address+set}" = set; then : + enableval=$enable_sanitize_address; sanitize_address=${enableval} +else + sanitize_address=no +fi + + ############################## Setting options ############################### if test "x${cpputest_ext}" = xyes; then @@ -19120,10 +20567,36 @@ fi fi +cpp_standard_used="default" + +# Using the C++98 standard? +if test "x${use_std_cpp98}" = xyes; then + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP98FLAG}" + cpp_standard_used="C++98" +fi # Using the C++11 standard? if test "x${use_std_cpp11}" = xyes; then - CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP11FLAG} ${CPPUTEST_CPP11BLACKLIST}" + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP11FLAG}" + cpp_standard_used="C++11" +fi + +# Using the C++14 standard? +if test "x${use_std_cpp14}" = xyes; then + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP14FLAG}" + cpp_standard_used="C++14" +fi + +# Using the C++17 standard? +if test "x${use_std_cpp17}" = xyes; then + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP17FLAG}" + cpp_standard_used="C++17" +fi + +# Using the C++20 standard? +if test "x${use_std_cpp20}" = xyes; then + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP20FLAG}" + cpp_standard_used="C++20" fi # Dealing with memory leak detection @@ -19143,6 +20616,13 @@ fi +# Dealing with address sanitizer +if test "x${sanitize_address}" = xyes; then + CPPUTEST_CFLAGS="${CPPUTEST_CFLAGS} -fsanitize=address -fno-omit-frame-pointer" + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} -fsanitize=address -fno-omit-frame-pointer" + CPPUTEST_LDFLAGS="${CPPUTEST_CXXFLAGS} -fsanitize=address -fno-omit-frame-pointer" +fi + # Generating map files. if test "x${generate_map_file}" = xyes; then CPPUTEST_LDFLAGS="${CPPUTEST_LDFLAGS} ${CPPUTEST_LD_MAP_GENERATION}" @@ -19177,14 +20657,19 @@ $as_echo "#define INCLUDE_GTEST_TESTS 1" >>confdefs.h - GTEST_HOME=${GMOCK_HOME}/gtest + + if test -z "${GTEST_HOME}"; then + GTEST_HOME=${GMOCK_HOME}/gtest + fi CPPUTEST_CPPFLAGS="${CPPUTEST_CPPFLAGS} -I${GMOCK_HOME}/include -I${GTEST_HOME}/include -I${GTEST_HOME}" - CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1" + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1 -DGMOCK_RENAME_MAIN=1" if test -e ${GMOCK_HOME}/lib/libgmock.la && test -e ${GTEST_HOME}/lib/libgtest.la; then \ CPPUTEST_LDADD="${CPPUTEST_LDADD} ${GMOCK_HOME}/lib/libgmock.la ${GTEST_HOME}/lib/libgtest.la"; \ elif test -e ${GMOCK_HOME}/libgmock.a && test -e ${GTEST_HOME}/libgtest.a; then \ CPPUTEST_LDADD="${CPPUTEST_LDADD} ${GMOCK_HOME}/libgmock.a ${GTEST_HOME}/libgtest.a"; \ + elif test -e ${GMOCK_HOME}/libgmock.a && test -e ${GMOCK_HOME}/gtest/libgtest.a; then \ + CPPUTEST_LDADD="${CPPUTEST_LDADD} ${GMOCK_HOME}/libgmock.a ${GMOCK_HOME}/gtest/libgtest.a"; \ else \ as_fn_error $? " ------------------------------------- @@ -19799,7 +21284,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by CppUTest $as_me 3.8, which was +This file was extended by CppUTest $as_me 4.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19865,7 +21350,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -CppUTest config.status 3.8 +CppUTest config.status 4.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -19985,7 +21470,7 @@ # INIT-COMMANDS # PACKAGE="$PACKAGE" -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -21070,29 +22555,35 @@ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -21110,53 +22601,50 @@ q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; "libtool":C) @@ -21908,6 +23396,7 @@ fi + echo \ "---------------------------------------------------------------- @@ -21916,6 +23405,8 @@ Current compiler options: CC: ${CC} CXX: ${CXX} + CC version: ${ax_cv_c_compiler_version} + CXX version: ${ax_cv_cxx_compiler_version} LD: ${LD} Default CFLAGS: ${CFLAGS} Default CXXFLAGS: ${CXXFLAGS} @@ -21926,10 +23417,12 @@ CppUTest LIB: ${LIBS} Features configured in ${PACKAGE_NAME}: + C++ standard used: ${cpp_standard_used} Memory Leak Detection: ${memory_leak_detection} Compiling extensions: ${cpputest_ext} Use Long Long (if available): ${use_longlong} Disable CppUTest compile/link flags: ${cpputest_flags} + Address sanitizer: ${sanitize_address} Using Standard C++ Library: ${use_std_cpp} Using Standard C Library: ${use_std_c} diff -Nru cpputest-3.8/configure.ac cpputest-4.0/configure.ac --- cpputest-3.8/configure.ac 2016-05-25 05:40:28.000000000 +0000 +++ cpputest-4.0/configure.ac 2020-05-27 11:00:11.000000000 +0000 @@ -1,6 +1,7 @@ AC_PREREQ([2.68]) -AC_INIT([CppUTest], [3.8], [https://github.com/cpputest/cpputest]) +AC_INIT([CppUTest], [4.0], [https://github.com/cpputest/cpputest]) +AC_CONFIG_AUX_DIR([.]) AM_INIT_AUTOMAKE([subdir-objects]) AC_CONFIG_SRCDIR([src/CppUTest/Utest.cpp]) AC_CONFIG_HEADERS([config.h]) @@ -33,6 +34,7 @@ ACX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS"]) +AX_COMPILER_VERSION # This additional -lpthread was added due to a bug on gcc for MacOSX: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42159 # According to the bug report, a workaround is to link -lpthread. Even the ACX_PTHREAD doesn't do that, so we add an # additional check if that it possible, and if it is, then we link pthread @@ -60,7 +62,7 @@ # Checks for library functions. AC_FUNC_FORK -AC_CHECK_FUNCS([gettimeofday memset strstr]) +AC_CHECK_FUNCS([gettimeofday memset strstr strdup pthread_mutex_lock]) AC_CHECK_PROG([CPPUTEST_HAS_GCC], [gcc], [yes], [no]) AC_CHECK_PROG([CPPUTEST_HAS_CLANG], [clang], [yes], [no]) @@ -81,24 +83,63 @@ CFLAGS="$saved_cflags" fi +AC_LANG_PUSH([C++]) ##################################################################################### -##### C++ 11 checks +##### C++ checks -### Checking for Standard C++ 11 compiler flags -AC_LANG_PUSH([C++]) +# FLag -std=c++1y +CXXFLAGS="-Werror -std=c++1y" +AC_MSG_CHECKING([whether CXX supports -std=c++1y]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP14FLAG="-std=c++1y" ], [AC_MSG_RESULT([no])]) +CXXFLAGS="$saved_cxxflags" + +# FLag std=c++14 +CXXFLAGS="-Werror -std=c++14" +AC_MSG_CHECKING([whether CXX supports -std=c++14]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP14FLAG="-std=c++14" ], [AC_MSG_RESULT([no])]) +CXXFLAGS="$saved_cxxflags" + +# FLag std=c++17 +CXXFLAGS="-Werror -std=c++17" +AC_MSG_CHECKING([whether CXX supports -std=c++17]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP17FLAG="-std=c++17" ], [AC_MSG_RESULT([no])]) +CXXFLAGS="$saved_cxxflags" + +# FLag std=c++20 +CXXFLAGS="-Werror -std=c++2a" +AC_MSG_CHECKING([whether CXX supports -std=c++2a]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP20FLAG="-std=c++2a" ], [AC_MSG_RESULT([no])]) +CXXFLAGS="$saved_cxxflags" + +# FLag std=c++20 +CXXFLAGS="-Werror -std=c++20" +AC_MSG_CHECKING([whether CXX supports -std=c++20]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP20FLAG="-std=c++20" ], [AC_MSG_RESULT([no])]) +CXXFLAGS="$saved_cxxflags" + +##################################################################################### +##### C++ version checks + +### Checking for C++ version compiler flags + +# FLag -std=c++98 +CXXFLAGS="-Werror -std=c++98" +AC_MSG_CHECKING([whether CXX supports -std=c++98]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP98FLAG="-std=c++98" ], [AC_MSG_RESULT([no])]) +CXXFLAGS="$saved_cxxflags" # FLag -std=c++0x -CXXFLAGS="-std=c++0x" +CXXFLAGS="-Werror -std=c++0x" AC_MSG_CHECKING([whether CXX supports -std=c++0x]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP11FLAG="-std=c++0x" ], [AC_MSG_RESULT([no])]) CXXFLAGS="$saved_cxxflags" -CXXFLAGS="-std=c++11" +CXXFLAGS="-Werror -std=c++11" AC_MSG_CHECKING([whether CXX supports -std=c++11]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP11FLAG="-std=c++11" ], [AC_MSG_RESULT([no])]) CXXFLAGS="$saved_cxxflags" -CXXFLAGS="-stdlib=libc++" +CXXFLAGS="-Werror -stdlib=libc++" AC_MSG_CHECKING([whether CXX supports -stdlib=libc++]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP11FLAG="${CPPUTEST_CPP11FLAG} -stdlib=libc++" ], [AC_MSG_RESULT([no])]) CXXFLAGS="$saved_cxxflags" @@ -106,13 +147,19 @@ # Flag -Wno-c++98-compat CXXFLAGS="-Werror -Wno-c++98-compat" AC_MSG_CHECKING([whether CXX supports -Wno-c++98-compat]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP11BLACKLIST="${CPPUTEST_CPP11BLACKLIST} -Wno-c++98-compat" ], [AC_MSG_RESULT([no])]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CXXWARNINGFLAGS="${CPPUTEST_CXXWARNINGFLAGS} -Wno-c++98-compat" ], [AC_MSG_RESULT([no])]) CXXFLAGS="$saved_cxxflags" # Flag -Wno-c++98-compat-pedantic CXXFLAGS="-Werror -Wno-c++98-compat-pedantic" AC_MSG_CHECKING([whether CXX supports -Wno-c++98-compat-pedantic]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CPP11BLACKLIST="${CPPUTEST_CPP11BLACKLIST} -Wno-c++98-compat-pedantic" ], [AC_MSG_RESULT([no])]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CXXWARNINGFLAGS="${CPPUTEST_CXXWARNINGFLAGS} -Wno-c++98-compat-pedantic" ], [AC_MSG_RESULT([no])]) +CXXFLAGS="$saved_cxxflags" + +# Flag -Wno-c++14-compat +CXXFLAGS="-Werror -Wno-c++14-compat" +AC_MSG_CHECKING([whether CXX supports -Wno-c++14-compat]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CXXWARNINGFLAGS="${CPPUTEST_CXXWARNINGFLAGS} -Wno-c++14-compat" ], [AC_MSG_RESULT([no])]) CXXFLAGS="$saved_cxxflags" AC_LANG_POP @@ -125,7 +172,7 @@ # FLag -Wno-long-long must be on for C. CFLAGS="-Werror -Wno-long-long" -AC_MSG_CHECKING([whether CC supports -Wno-long-long]) +AC_MSG_CHECKING([whether CC and CXX supports -Wno-long-long]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes]); CPPUTEST_CWARNINGFLAGS="${CPPUTEST_CWARNINGFLAGS} -Wno-long-long" CPPUTEST_CXXWARNINGFLAGS="${CPPUTEST_CXXWARNINGFLAGS} -Wno-long-long"], [AC_MSG_RESULT([no])]) CFLAGS="$saved_cflags" @@ -335,9 +382,21 @@ AC_ARG_ENABLE([std-cpp], [AC_HELP_STRING([--disable-std-cpp], [disable the use of Standard C++ Library])], [use_std_cpp=${enableval}], [use_std_cpp=${default_use_std_cpp}]) +AC_ARG_ENABLE([std-cpp98], [AC_HELP_STRING([--enable-std-cpp98], [enable the use of Standard C++ 98 (if the compiler supports that)])], + [use_std_cpp98=${enableval}], [use_std_cpp98=no]) + AC_ARG_ENABLE([std-cpp11], [AC_HELP_STRING([--enable-std-cpp11], [enable the use of Standard C++ 11 (if the compiler supports that)])], [use_std_cpp11=${enableval}], [use_std_cpp11=no]) +AC_ARG_ENABLE([std-cpp14], [AC_HELP_STRING([--enable-std-cpp14], [enable the use of Standard C++ 14 (if the compiler supports that)])], + [use_std_cpp14=${enableval}], [use_std_cpp14=no]) + +AC_ARG_ENABLE([std-cpp17], [AC_HELP_STRING([--enable-std-cpp17], [enable the use of Standard C++ 17 (if the compiler supports that)])], + [use_std_cpp17=${enableval}], [use_std_cpp17=no]) + +AC_ARG_ENABLE([std-cpp20], [AC_HELP_STRING([--enable-std-cpp20], [enable the use of Standard C++ 20 (if the compiler supports that)])], + [use_std_cpp20=${enableval}], [use_std_cpp20=no]) + AC_ARG_ENABLE([cpputest-flags], [AC_HELP_STRING([--disable-cpputest-flags], [disable CFLAGS/CPPFLAGS/CXXFLAGS set by CppUTest])], [cpputest_flags=${enableval}], [cpputest_flags=yes]) @@ -356,6 +415,9 @@ AC_ARG_ENABLE([coverage], [AC_HELP_STRING([--enable-coverage], [enable running with coverage])], [coverage=${enableval}], [coverage=no]) +AC_ARG_ENABLE([sanitize-address], [AC_HELP_STRING([--enable-sanitize-address], [enable running with address sanitizer])], + [sanitize_address=${enableval}], [sanitize_address=no]) + ############################## Setting options ############################### AM_CONDITIONAL([INCLUDE_CPPUTEST_EXT], [test "x${cpputest_ext}" = xyes]) @@ -383,10 +445,36 @@ fi fi +cpp_standard_used="default" + +# Using the C++98 standard? +if test "x${use_std_cpp98}" = xyes; then + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP98FLAG}" + cpp_standard_used="C++98" +fi # Using the C++11 standard? if test "x${use_std_cpp11}" = xyes; then - CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP11FLAG} ${CPPUTEST_CPP11BLACKLIST}" + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP11FLAG}" + cpp_standard_used="C++11" +fi + +# Using the C++14 standard? +if test "x${use_std_cpp14}" = xyes; then + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP14FLAG}" + cpp_standard_used="C++14" +fi + +# Using the C++17 standard? +if test "x${use_std_cpp17}" = xyes; then + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP17FLAG}" + cpp_standard_used="C++17" +fi + +# Using the C++20 standard? +if test "x${use_std_cpp20}" = xyes; then + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} ${CPPUTEST_CPP20FLAG}" + cpp_standard_used="C++20" fi # Dealing with memory leak detection @@ -402,6 +490,13 @@ AC_DEFINE([LONG_LONG_DISABLED], 1, [disable long long]) fi +# Dealing with address sanitizer +if test "x${sanitize_address}" = xyes; then + CPPUTEST_CFLAGS="${CPPUTEST_CFLAGS} -fsanitize=address -fno-omit-frame-pointer" + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} -fsanitize=address -fno-omit-frame-pointer" + CPPUTEST_LDFLAGS="${CPPUTEST_CXXFLAGS} -fsanitize=address -fno-omit-frame-pointer" +fi + # Generating map files. if test "x${generate_map_file}" = xyes; then CPPUTEST_LDFLAGS="${CPPUTEST_LDFLAGS} ${CPPUTEST_LD_MAP_GENERATION}" @@ -426,14 +521,19 @@ AC_DEFINE([INCLUDE_GTEST_TESTS], 1, [Include the GTest-related tests in the build]) AC_ARG_VAR([GMOCK_HOME], [Location of the GMock]) - GTEST_HOME=${GMOCK_HOME}/gtest + + if test -z "${GTEST_HOME}"; then + GTEST_HOME=${GMOCK_HOME}/gtest + fi CPPUTEST_CPPFLAGS="${CPPUTEST_CPPFLAGS} -I${GMOCK_HOME}/include -I${GTEST_HOME}/include -I${GTEST_HOME}" - CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1" + CPPUTEST_CXXFLAGS="${CPPUTEST_CXXFLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1 -DGMOCK_RENAME_MAIN=1" if test -e ${GMOCK_HOME}/lib/libgmock.la && test -e ${GTEST_HOME}/lib/libgtest.la; then \ CPPUTEST_LDADD="${CPPUTEST_LDADD} ${GMOCK_HOME}/lib/libgmock.la ${GTEST_HOME}/lib/libgtest.la"; \ elif test -e ${GMOCK_HOME}/libgmock.a && test -e ${GTEST_HOME}/libgtest.a; then \ CPPUTEST_LDADD="${CPPUTEST_LDADD} ${GMOCK_HOME}/libgmock.a ${GTEST_HOME}/libgtest.a"; \ + elif test -e ${GMOCK_HOME}/libgmock.a && test -e ${GMOCK_HOME}/gtest/libgtest.a; then \ + CPPUTEST_LDADD="${CPPUTEST_LDADD} ${GMOCK_HOME}/libgmock.a ${GMOCK_HOME}/gtest/libgtest.a"; \ else \ AC_MSG_ERROR([ ------------------------------------- @@ -499,6 +599,7 @@ AC_CONFIG_FILES([Makefile]) AC_OUTPUT + echo \ "---------------------------------------------------------------- @@ -507,6 +608,8 @@ Current compiler options: CC: ${CC} CXX: ${CXX} + CC version: ${ax_cv_c_compiler_version} + CXX version: ${ax_cv_cxx_compiler_version} LD: ${LD} Default CFLAGS: ${CFLAGS} Default CXXFLAGS: ${CXXFLAGS} @@ -517,10 +620,12 @@ CppUTest LIB: ${LIBS} Features configured in ${PACKAGE_NAME}: + C++ standard used: ${cpp_standard_used} Memory Leak Detection: ${memory_leak_detection} Compiling extensions: ${cpputest_ext} Use Long Long (if available): ${use_longlong} Disable CppUTest compile/link flags: ${cpputest_flags} + Address sanitizer: ${sanitize_address} Using Standard C++ Library: ${use_std_cpp} Using Standard C Library: ${use_std_c} diff -Nru cpputest-3.8/CppUTestConfig.cmake.install.in cpputest-4.0/CppUTestConfig.cmake.install.in --- cpputest-3.8/CppUTestConfig.cmake.install.in 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/CppUTestConfig.cmake.install.in 2020-05-26 11:24:07.000000000 +0000 @@ -3,5 +3,6 @@ set_and_check(CppUTest_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@") include("${CMAKE_CURRENT_LIST_DIR}/CppUTestTargets.cmake") set(CppUTest_LIBRARIES CppUTest CppUTestExt) +include("${CMAKE_CURRENT_LIST_DIR}/Modules/CppUTestBuildTimeDiscoverTests.cmake") check_required_components(CppUTest) diff -Nru cpputest-3.8/CppUTest.dep cpputest-4.0/CppUTest.dep --- cpputest-3.8/CppUTest.dep 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/CppUTest.dep 1970-01-01 00:00:00.000000000 +0000 @@ -1,583 +0,0 @@ -# Microsoft Developer Studio Generated Dependency File, included by CppUTest.mak - -.\src\CppUTestExt\CodeMemoryReportFormatter.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\CppUTestExt\CodeMemoryReportFormatter.h"\ - ".\include\CppUTestExt\MemoryReportAllocator.h"\ - ".\include\CppUTestExt\MemoryReportFormatter.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\CommandLineArguments.cpp : \ - ".\include\CppUTest\CommandLineArguments.h"\ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestFilter.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\CommandLineTestRunner.cpp : \ - ".\include\CppUTest\CommandLineArguments.h"\ - ".\include\CppUTest\CommandLineTestRunner.h"\ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\JunitTestOutput.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestFilter.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestRegistry.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\JUnitTestOutput.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\JunitTestOutput.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\MemoryLeakDetector.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetector.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleMutex.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\MemoryLeakWarningPlugin.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetector.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleMutex.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\src\CppUTestExt\MemoryReportAllocator.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\CppUTestExt\MemoryReportAllocator.h"\ - ".\include\CppUTestExt\MemoryReportFormatter.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\src\CppUTestExt\MemoryReporterPlugin.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\CppUTestExt\CodeMemoryReportFormatter.h"\ - ".\include\CppUTestExt\MemoryReportAllocator.h"\ - ".\include\CppUTestExt\MemoryReporterPlugin.h"\ - ".\include\CppUTestExt\MemoryReportFormatter.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\src\CppUTestExt\MemoryReportFormatter.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\CppUTestExt\MemoryReportAllocator.h"\ - ".\include\CppUTestExt\MemoryReportFormatter.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\MockActualCall.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\cpputestext\mockactualcall.h"\ - ".\include\CppUTestExt\MockCheckedActualCall.h"\ - ".\include\CppUTestExt\MockCheckedExpectedCall.h"\ - ".\include\cpputestext\mockexpectedcall.h"\ - ".\include\CppUTestExt\MockExpectedCallsList.h"\ - ".\include\CppUTestExt\MockFailure.h"\ - ".\include\CppUTestExt\MockNamedValue.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\MockExpectedCall.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\CppUTestExt\MockCheckedExpectedCall.h"\ - ".\include\cpputestext\mockexpectedcall.h"\ - ".\include\CppUTestExt\MockNamedValue.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\MockExpectedCallsList.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\CppUTestExt\MockCheckedExpectedCall.h"\ - ".\include\cpputestext\mockexpectedcall.h"\ - ".\include\CppUTestExt\MockExpectedCallsList.h"\ - ".\include\CppUTestExt\MockNamedValue.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\MockFailure.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\cpputestext\mockexpectedcall.h"\ - ".\include\CppUTestExt\MockExpectedCallsList.h"\ - ".\include\CppUTestExt\MockFailure.h"\ - ".\include\CppUTestExt\MockNamedValue.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\MockNamedValue.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\CppUTestExt\MockNamedValue.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\MockSupport.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\cpputestext\mockactualcall.h"\ - ".\include\CppUTestExt\MockCheckedActualCall.h"\ - ".\include\CppUTestExt\MockCheckedExpectedCall.h"\ - ".\include\cpputestext\mockexpectedcall.h"\ - ".\include\CppUTestExt\MockExpectedCallsList.h"\ - ".\include\CppUTestExt\MockFailure.h"\ - ".\include\CppUTestExt\MockNamedValue.h"\ - ".\include\CppUTestExt\MockSupport.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\MockSupport_c.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\cpputestext\mockactualcall.h"\ - ".\include\CppUTestExt\MockCheckedActualCall.h"\ - ".\include\CppUTestExt\MockCheckedExpectedCall.h"\ - ".\include\cpputestext\mockexpectedcall.h"\ - ".\include\CppUTestExt\MockExpectedCallsList.h"\ - ".\include\CppUTestExt\MockFailure.h"\ - ".\include\CppUTestExt\MockNamedValue.h"\ - ".\include\CppUTestExt\MockSupport.h"\ - ".\include\CppUTestExt\MockSupport_c.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\MockSupportPlugin.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\cpputestext\mockactualcall.h"\ - ".\include\CppUTestExt\MockCheckedActualCall.h"\ - ".\include\CppUTestExt\MockCheckedExpectedCall.h"\ - ".\include\cpputestext\mockexpectedcall.h"\ - ".\include\CppUTestExt\MockExpectedCallsList.h"\ - ".\include\CppUTestExt\MockFailure.h"\ - ".\include\CppUTestExt\MockNamedValue.h"\ - ".\include\CppUTestExt\MockSupport.h"\ - ".\include\CppUTestExt\MockSupportPlugin.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -".\src\CppUTestExt\OrderedTest.cpp" : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestFilter.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestRegistry.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\CppUTestExt\OrderedTest.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\SimpleMutex.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleMutex.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\SimpleString.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\TestFailure.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\TestFilter.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFilter.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\TestHarness_c.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetector.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestHarness_c.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\TestMemoryAllocator.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetector.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestMemoryAllocator.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\TestOutput.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\TestPlugin.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\TestRegistry.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestFilter.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestRegistry.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\TestResult.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\SRC\CPPUTEST\Utest.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestFilter.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestRegistry.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - - -.\src\Platforms\VisualCpp\UtestPlatform.cpp : \ - ".\include\CppUTest\CppUTestConfig.h"\ - ".\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - ".\include\CppUTest\MemoryLeakWarningPlugin.h"\ - ".\include\CppUTest\PlatformSpecificFunctions.h"\ - ".\include\CppUTest\PlatformSpecificFunctions_c.h"\ - ".\include\CppUTest\SimpleString.h"\ - ".\include\CppUTest\StandardCLibrary.h"\ - ".\include\CppUTest\TestFailure.h"\ - ".\include\CppUTest\TestHarness.h"\ - ".\include\CppUTest\TestOutput.h"\ - ".\include\CppUTest\TestPlugin.h"\ - ".\include\CppUTest\TestResult.h"\ - ".\include\CppUTest\Utest.h"\ - ".\include\CppUTest\UtestMacros.h"\ - ".\include\platforms\visualcpp\platform.h"\ - ".\include\platforms\visualcpp\stdint.h"\ - diff -Nru cpputest-3.8/CppUTest.dsp cpputest-4.0/CppUTest.dsp --- cpputest-3.8/CppUTest.dsp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/CppUTest.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,361 +0,0 @@ -# Microsoft Developer Studio Project File - Name="CppUTest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=CppUTest - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "CppUTest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "CppUTest.mak" CFG="CppUTest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "CppUTest - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "CppUTest - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "CppUTest - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I ".\include\Platforms\VisualCpp" /I ".\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /D "CPPUTEST_USE_LONG_LONG" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"lib\CppUTest.lib" - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I ".\include\Platforms\VisualCpp" /I ".\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /D "CPPUTEST_USE_LONG_LONG" /FR /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"lib\CppUTestd.lib" - -!ENDIF - -# Begin Target - -# Name "CppUTest - Win32 Release" -# Name "CppUTest - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\src\CppUTestExt\CodeMemoryReportFormatter.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MemoryReportAllocator.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MemoryReporterPlugin.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MemoryReportFormatter.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MockActualCall.cpp" -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MockExpectedCall.cpp" -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MockExpectedCallsList.cpp" -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MockFailure.cpp" -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MockNamedValue.cpp" -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MockSupport.cpp" -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MockSupportPlugin.cpp" -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\MockSupport_c.cpp" -# End Source File -# Begin Source File - -SOURCE=.\src\CppUTestExt\OrderedTest.cpp" -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\CommandLineArguments.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\CommandLineTestRunner.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\JUnitTestOutput.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\MemoryLeakDetector.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\MemoryLeakWarningPlugin.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\SimpleMutex.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\SimpleString.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TeamCityTestOutput.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TestFailure.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TestFilter.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TestHarness_c.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TestMemoryAllocator.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TestOutput.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TestPlugin.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TestRegistry.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\TestResult.cpp -# End Source File -# Begin Source File - -SOURCE=.\SRC\CPPUTEST\Utest.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\Platforms\VisualCpp\UtestPlatform.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\include\CppUTestExt\CodeMemoryReportFormatter.h" -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\GMock.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\GTestConvertor.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MemoryReportAllocator.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MemoryReporterPlugin.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MemoryReportFormatter.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MockCheckedActualCall.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MockCheckedExpectedCall.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MockExpectedCallsList.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MockFailure.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MockNamedValue.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MockSupport.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MockSupportPlugin.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\MockSupport_c.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTestExt\OrderedTest.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\CommandLineTestRunner.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\EqualsFailure.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\Failure.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\JunitTestOutput.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\MemoryLeakWarning.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\MemoryLeakWarningPlugin.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\MockTestOutput.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\NullTest.h -# End Source File -# Begin Source File - -SOURCE=.\src\Platforms\VisualCpp\Platform.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\RealTestOutput.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\SimpleString.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\SimpleStringExtensions.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\TestHarness.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\TestHarness_c.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\TestInstaller.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\TestOutput.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\TestPlugin.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\TestRegistry.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\TestResult.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\Utest.h -# End Source File -# Begin Source File - -SOURCE=.\include\CppUTest\VirtualCall.h -# End Source File -# End Group -# End Target -# End Project diff -Nru cpputest-3.8/CppUTest.dsw cpputest-4.0/CppUTest.dsw --- cpputest-3.8/CppUTest.dsw 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/CppUTest.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "AllTests"=.\tests\AllTests.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name CppUTest - End Project Dependency -}}} - -############################################################################### - -Project: "CppUTest"=.\CppUTest.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru cpputest-3.8/CppUTest.mak cpputest-4.0/CppUTest.mak --- cpputest-3.8/CppUTest.mak 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/CppUTest.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,891 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on CppUTest.dsp -!IF "$(CFG)" == "" -CFG=CppUTest - Win32 Debug -!MESSAGE No configuration specified. Defaulting to CppUTest - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "CppUTest - Win32 Release" && "$(CFG)" != "CppUTest - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "CppUTest.mak" CFG="CppUTest - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "CppUTest - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "CppUTest - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "CppUTest - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\Release -# End Custom Macros - -ALL : "$(OUTDIR)\CppUTest.lib" - - -CLEAN : - -@erase "$(INTDIR)\CodeMemoryReportFormatter.obj" - -@erase "$(INTDIR)\CommandLineArguments.obj" - -@erase "$(INTDIR)\CommandLineTestRunner.obj" - -@erase "$(INTDIR)\JUnitTestOutput.obj" - -@erase "$(INTDIR)\TeamCityTestOutput.obj" - -@erase "$(INTDIR)\MemoryLeakDetector.obj" - -@erase "$(INTDIR)\MemoryLeakWarningPlugin.obj" - -@erase "$(INTDIR)\MemoryReportAllocator.obj" - -@erase "$(INTDIR)\MemoryReporterPlugin.obj" - -@erase "$(INTDIR)\MemoryReportFormatter.obj" - -@erase "$(INTDIR)\MockActualCall.obj" - -@erase "$(INTDIR)\MockExpectedCall.obj" - -@erase "$(INTDIR)\MockExpectedCallsList.obj" - -@erase "$(INTDIR)\MockFailure.obj" - -@erase "$(INTDIR)\MockNamedValue.obj" - -@erase "$(INTDIR)\MockSupport.obj" - -@erase "$(INTDIR)\MockSupport_c.obj" - -@erase "$(INTDIR)\MockSupportPlugin.obj" - -@erase "$(INTDIR)\OrderedTest.obj" - -@erase "$(INTDIR)\SimpleMutex.obj" - -@erase "$(INTDIR)\SimpleString.obj" - -@erase "$(INTDIR)\TestFailure.obj" - -@erase "$(INTDIR)\TestFilter.obj" - -@erase "$(INTDIR)\TestHarness_c.obj" - -@erase "$(INTDIR)\TestMemoryAllocator.obj" - -@erase "$(INTDIR)\TestOutput.obj" - -@erase "$(INTDIR)\TestPlugin.obj" - -@erase "$(INTDIR)\TestRegistry.obj" - -@erase "$(INTDIR)\TestResult.obj" - -@erase "$(INTDIR)\Utest.obj" - -@erase "$(INTDIR)\UtestPlatform.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(OUTDIR)\CppUTest.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /ML /W3 /GX /O2 /I ".\include\Platforms\VisualCpp" /I ".\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /D "CPPUTEST_USE_LONG_LONG" /Fp"$(INTDIR)\CppUTest.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\CppUTest.bsc" -BSC32_SBRS= \ - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\CppUTest.lib" -LIB32_OBJS= \ - "$(INTDIR)\CodeMemoryReportFormatter.obj" \ - "$(INTDIR)\MemoryReportAllocator.obj" \ - "$(INTDIR)\MemoryReporterPlugin.obj" \ - "$(INTDIR)\MemoryReportFormatter.obj" \ - "$(INTDIR)\MockActualCall.obj" \ - "$(INTDIR)\MockExpectedCall.obj" \ - "$(INTDIR)\MockExpectedCallsList.obj" \ - "$(INTDIR)\MockFailure.obj" \ - "$(INTDIR)\MockNamedValue.obj" \ - "$(INTDIR)\MockSupport.obj" \ - "$(INTDIR)\MockSupportPlugin.obj" \ - "$(INTDIR)\MockSupport_c.obj" \ - "$(INTDIR)\OrderedTest.obj" \ - "$(INTDIR)\CommandLineArguments.obj" \ - "$(INTDIR)\CommandLineTestRunner.obj" \ - "$(INTDIR)\JUnitTestOutput.obj" \ - "$(INTDIR)\TeamCityTestOutput.obj" \ - "$(INTDIR)\MemoryLeakDetector.obj" \ - "$(INTDIR)\MemoryLeakWarningPlugin.obj" \ - "$(INTDIR)\SimpleMutex.obj" \ - "$(INTDIR)\SimpleString.obj" \ - "$(INTDIR)\TestFailure.obj" \ - "$(INTDIR)\TestFilter.obj" \ - "$(INTDIR)\TestHarness_c.obj" \ - "$(INTDIR)\TestMemoryAllocator.obj" \ - "$(INTDIR)\TestOutput.obj" \ - "$(INTDIR)\TestPlugin.obj" \ - "$(INTDIR)\TestRegistry.obj" \ - "$(INTDIR)\TestResult.obj" \ - "$(INTDIR)\Utest.obj" \ - "$(INTDIR)\UtestPlatform.obj" - -"$(OUTDIR)\CppUTest.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\Debug -# End Custom Macros - -ALL : ".\lib\CppUTest.lib" "$(OUTDIR)\CppUTest.bsc" - - -CLEAN : - -@erase "$(INTDIR)\CodeMemoryReportFormatter.obj" - -@erase "$(INTDIR)\CodeMemoryReportFormatter.sbr" - -@erase "$(INTDIR)\CommandLineArguments.obj" - -@erase "$(INTDIR)\CommandLineArguments.sbr" - -@erase "$(INTDIR)\CommandLineTestRunner.obj" - -@erase "$(INTDIR)\CommandLineTestRunner.sbr" - -@erase "$(INTDIR)\JUnitTestOutput.obj" - -@erase "$(INTDIR)\JUnitTestOutput.sbr" - -@erase "$(INTDIR)\TeamCityTestOutput.obj" - -@erase "$(INTDIR)\TeamCityTestOutput.sbr" - -@erase "$(INTDIR)\MemoryLeakDetector.obj" - -@erase "$(INTDIR)\MemoryLeakDetector.sbr" - -@erase "$(INTDIR)\MemoryLeakWarningPlugin.obj" - -@erase "$(INTDIR)\MemoryLeakWarningPlugin.sbr" - -@erase "$(INTDIR)\MemoryReportAllocator.obj" - -@erase "$(INTDIR)\MemoryReportAllocator.sbr" - -@erase "$(INTDIR)\MemoryReporterPlugin.obj" - -@erase "$(INTDIR)\MemoryReporterPlugin.sbr" - -@erase "$(INTDIR)\MemoryReportFormatter.obj" - -@erase "$(INTDIR)\MemoryReportFormatter.sbr" - -@erase "$(INTDIR)\MockActualCall.obj" - -@erase "$(INTDIR)\MockActualCall.sbr" - -@erase "$(INTDIR)\MockExpectedCall.obj" - -@erase "$(INTDIR)\MockExpectedCall.sbr" - -@erase "$(INTDIR)\MockExpectedCallsList.obj" - -@erase "$(INTDIR)\MockExpectedCallsList.sbr" - -@erase "$(INTDIR)\MockFailure.obj" - -@erase "$(INTDIR)\MockFailure.sbr" - -@erase "$(INTDIR)\MockNamedValue.obj" - -@erase "$(INTDIR)\MockNamedValue.sbr" - -@erase "$(INTDIR)\MockSupport.obj" - -@erase "$(INTDIR)\MockSupport.sbr" - -@erase "$(INTDIR)\MockSupport_c.obj" - -@erase "$(INTDIR)\MockSupport_c.sbr" - -@erase "$(INTDIR)\MockSupportPlugin.obj" - -@erase "$(INTDIR)\MockSupportPlugin.sbr" - -@erase "$(INTDIR)\OrderedTest.obj" - -@erase "$(INTDIR)\OrderedTest.sbr" - -@erase "$(INTDIR)\SimpleMutex.obj" - -@erase "$(INTDIR)\SimpleMutex.sbr" - -@erase "$(INTDIR)\SimpleString.obj" - -@erase "$(INTDIR)\SimpleString.sbr" - -@erase "$(INTDIR)\TestFailure.obj" - -@erase "$(INTDIR)\TestFailure.sbr" - -@erase "$(INTDIR)\TestFilter.obj" - -@erase "$(INTDIR)\TestFilter.sbr" - -@erase "$(INTDIR)\TestHarness_c.obj" - -@erase "$(INTDIR)\TestHarness_c.sbr" - -@erase "$(INTDIR)\TestMemoryAllocator.obj" - -@erase "$(INTDIR)\TestMemoryAllocator.sbr" - -@erase "$(INTDIR)\TestOutput.obj" - -@erase "$(INTDIR)\TestOutput.sbr" - -@erase "$(INTDIR)\TestPlugin.obj" - -@erase "$(INTDIR)\TestPlugin.sbr" - -@erase "$(INTDIR)\TestRegistry.obj" - -@erase "$(INTDIR)\TestRegistry.sbr" - -@erase "$(INTDIR)\TestResult.obj" - -@erase "$(INTDIR)\TestResult.sbr" - -@erase "$(INTDIR)\Utest.obj" - -@erase "$(INTDIR)\Utest.sbr" - -@erase "$(INTDIR)\UtestPlatform.obj" - -@erase "$(INTDIR)\UtestPlatform.sbr" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(OUTDIR)\CppUTest.bsc" - -@erase ".\lib\CppUTest.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /GX /ZI /Od /I ".\include\Platforms\VisualCpp" /I ".\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /D "CPPUTEST_USE_LONG_LONG" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\CppUTest.bsc" -BSC32_SBRS= \ - "$(INTDIR)\CodeMemoryReportFormatter.sbr" \ - "$(INTDIR)\MemoryReportAllocator.sbr" \ - "$(INTDIR)\MemoryReporterPlugin.sbr" \ - "$(INTDIR)\MemoryReportFormatter.sbr" \ - "$(INTDIR)\MockActualCall.sbr" \ - "$(INTDIR)\MockExpectedCall.sbr" \ - "$(INTDIR)\MockExpectedCallsList.sbr" \ - "$(INTDIR)\MockFailure.sbr" \ - "$(INTDIR)\MockNamedValue.sbr" \ - "$(INTDIR)\MockSupport.sbr" \ - "$(INTDIR)\MockSupportPlugin.sbr" \ - "$(INTDIR)\MockSupport_c.sbr" \ - "$(INTDIR)\OrderedTest.sbr" \ - "$(INTDIR)\CommandLineArguments.sbr" \ - "$(INTDIR)\CommandLineTestRunner.sbr" \ - "$(INTDIR)\JUnitTestOutput.sbr" \ - "$(INTDIR)\TeamCityTestOutput.sbr" \ - "$(INTDIR)\MemoryLeakDetector.sbr" \ - "$(INTDIR)\MemoryLeakWarningPlugin.sbr" \ - "$(INTDIR)\SimpleMutex.sbr" \ - "$(INTDIR)\SimpleString.sbr" \ - "$(INTDIR)\TestFailure.sbr" \ - "$(INTDIR)\TestFilter.sbr" \ - "$(INTDIR)\TestHarness_c.sbr" \ - "$(INTDIR)\TestMemoryAllocator.sbr" \ - "$(INTDIR)\TestOutput.sbr" \ - "$(INTDIR)\TestPlugin.sbr" \ - "$(INTDIR)\TestRegistry.sbr" \ - "$(INTDIR)\TestResult.sbr" \ - "$(INTDIR)\Utest.sbr" \ - "$(INTDIR)\UtestPlatform.sbr" - -"$(OUTDIR)\CppUTest.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"lib\CppUTest.lib" -LIB32_OBJS= \ - "$(INTDIR)\CodeMemoryReportFormatter.obj" \ - "$(INTDIR)\MemoryReportAllocator.obj" \ - "$(INTDIR)\MemoryReporterPlugin.obj" \ - "$(INTDIR)\MemoryReportFormatter.obj" \ - "$(INTDIR)\MockActualCall.obj" \ - "$(INTDIR)\MockExpectedCall.obj" \ - "$(INTDIR)\MockExpectedCallsList.obj" \ - "$(INTDIR)\MockFailure.obj" \ - "$(INTDIR)\MockNamedValue.obj" \ - "$(INTDIR)\MockSupport.obj" \ - "$(INTDIR)\MockSupportPlugin.obj" \ - "$(INTDIR)\MockSupport_c.obj" \ - "$(INTDIR)\OrderedTest.obj" \ - "$(INTDIR)\CommandLineArguments.obj" \ - "$(INTDIR)\CommandLineTestRunner.obj" \ - "$(INTDIR)\JUnitTestOutput.obj" \ - "$(INTDIR)\TeamCityTestOutput.obj" \ - "$(INTDIR)\MemoryLeakDetector.obj" \ - "$(INTDIR)\MemoryLeakWarningPlugin.obj" \ - "$(INTDIR)\SimpleMutex.obj" \ - "$(INTDIR)\SimpleString.obj" \ - "$(INTDIR)\TestFailure.obj" \ - "$(INTDIR)\TestFilter.obj" \ - "$(INTDIR)\TestHarness_c.obj" \ - "$(INTDIR)\TestMemoryAllocator.obj" \ - "$(INTDIR)\TestOutput.obj" \ - "$(INTDIR)\TestPlugin.obj" \ - "$(INTDIR)\TestRegistry.obj" \ - "$(INTDIR)\TestResult.obj" \ - "$(INTDIR)\Utest.obj" \ - "$(INTDIR)\UtestPlatform.obj" - -".\lib\CppUTest.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ENDIF - -.c{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(NO_EXTERNAL_DEPS)" != "1" -!IF EXISTS("CppUTest.dep") -!INCLUDE "CppUTest.dep" -!ELSE -!MESSAGE Warning: cannot find "CppUTest.dep" -!ENDIF -!ENDIF - - -!IF "$(CFG)" == "CppUTest - Win32 Release" || "$(CFG)" == "CppUTest - Win32 Debug" -SOURCE=.\src\CppUTestExt\CodeMemoryReportFormatter.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\CodeMemoryReportFormatter.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\CodeMemoryReportFormatter.obj" "$(INTDIR)\CodeMemoryReportFormatter.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\CommandLineArguments.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\CommandLineArguments.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\CommandLineArguments.obj" "$(INTDIR)\CommandLineArguments.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\CommandLineTestRunner.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\CommandLineTestRunner.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\CommandLineTestRunner.obj" "$(INTDIR)\CommandLineTestRunner.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\JUnitTestOutput.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\JUnitTestOutput.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\JUnitTestOutput.obj" "$(INTDIR)\JUnitTestOutput.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TeamCityTestOutput.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TeamCityTestOutput.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TeamCityTestOutput.obj" "$(INTDIR)\TeamCityTestOutput.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\MemoryLeakDetector.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MemoryLeakDetector.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MemoryLeakDetector.obj" "$(INTDIR)\MemoryLeakDetector.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\MemoryLeakWarningPlugin.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MemoryLeakWarningPlugin.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MemoryLeakWarningPlugin.obj" "$(INTDIR)\MemoryLeakWarningPlugin.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\src\CppUTestExt\MemoryReportAllocator.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MemoryReportAllocator.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MemoryReportAllocator.obj" "$(INTDIR)\MemoryReportAllocator.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\src\CppUTestExt\MemoryReporterPlugin.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MemoryReporterPlugin.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MemoryReporterPlugin.obj" "$(INTDIR)\MemoryReporterPlugin.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\src\CppUTestExt\MemoryReportFormatter.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MemoryReportFormatter.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MemoryReportFormatter.obj" "$(INTDIR)\MemoryReportFormatter.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\MockActualCall.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MockActualCall.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MockActualCall.obj" "$(INTDIR)\MockActualCall.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\MockExpectedCall.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MockExpectedCall.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MockExpectedCall.obj" "$(INTDIR)\MockExpectedCall.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\MockExpectedCallsList.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MockExpectedCallsList.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MockExpectedCallsList.obj" "$(INTDIR)\MockExpectedCallsList.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\MockFailure.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MockFailure.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MockFailure.obj" "$(INTDIR)\MockFailure.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\MockNamedValue.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MockNamedValue.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MockNamedValue.obj" "$(INTDIR)\MockNamedValue.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\MockSupport.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MockSupport.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MockSupport.obj" "$(INTDIR)\MockSupport.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\MockSupport_c.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MockSupport_c.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MockSupport_c.obj" "$(INTDIR)\MockSupport_c.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\MockSupportPlugin.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\MockSupportPlugin.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\MockSupportPlugin.obj" "$(INTDIR)\MockSupportPlugin.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=".\src\CppUTestExt\OrderedTest.cpp" - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\OrderedTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\OrderedTest.obj" "$(INTDIR)\OrderedTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\SimpleMutex.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\SimpleMutex.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\SimpleMutex.obj" "$(INTDIR)\SimpleMutex.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\SimpleString.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\SimpleString.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\SimpleString.obj" "$(INTDIR)\SimpleString.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TestFailure.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TestFailure.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TestFailure.obj" "$(INTDIR)\TestFailure.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TestFilter.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TestFilter.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TestFilter.obj" "$(INTDIR)\TestFilter.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TestHarness_c.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TestHarness_c.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TestHarness_c.obj" "$(INTDIR)\TestHarness_c.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TestMemoryAllocator.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TestMemoryAllocator.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TestMemoryAllocator.obj" "$(INTDIR)\TestMemoryAllocator.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TestOutput.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TestOutput.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TestOutput.obj" "$(INTDIR)\TestOutput.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TestPlugin.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TestPlugin.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TestPlugin.obj" "$(INTDIR)\TestPlugin.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TestRegistry.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TestRegistry.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TestRegistry.obj" "$(INTDIR)\TestRegistry.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\TestResult.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\TestResult.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\TestResult.obj" "$(INTDIR)\TestResult.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\SRC\CPPUTEST\Utest.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\Utest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\Utest.obj" "$(INTDIR)\Utest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\src\Platforms\VisualCpp\UtestPlatform.cpp - -!IF "$(CFG)" == "CppUTest - Win32 Release" - - -"$(INTDIR)\UtestPlatform.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "CppUTest - Win32 Debug" - - -"$(INTDIR)\UtestPlatform.obj" "$(INTDIR)\UtestPlatform.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - - -!ENDIF - diff -Nru cpputest-3.8/CppUTest.vcproj cpputest-4.0/CppUTest.vcproj --- cpputest-3.8/CppUTest.vcproj 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/CppUTest.vcproj 2020-05-26 11:24:07.000000000 +0000 @@ -183,6 +183,28 @@ + + + + + + + + + + + + + + + + + + @@ -984,6 +1032,10 @@ > + + diff -Nru cpputest-3.8/CppUTest.vcxproj cpputest-4.0/CppUTest.vcxproj --- cpputest-3.8/CppUTest.vcxproj 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/CppUTest.vcxproj 2020-05-26 11:24:07.000000000 +0000 @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {F468F539-27BD-468E-BE64-DDE641400B51} @@ -19,30 +27,49 @@ false MultiByte + + StaticLibrary + false + MultiByte + StaticLibrary false MultiByte + + StaticLibrary + false + MultiByte + - + + + - + + + <_ProjectFileVersion>10.0.30319.1 lib\ + lib\ cpputest_build\Debug\$(ProjectName)\ + cpputest_build\Debug\$(ProjectName)\ lib\ + lib\ cpputest_build\Release\$(ProjectName)\ + cpputest_build\Release\$(ProjectName)\ $(ProjectName)d + $(ProjectName)d @@ -76,6 +103,38 @@ true + + + Disabled + .\include;.\include\Platforms\VisualCpp;%(AdditionalIncludeDirectories) + _LIB;WIN32;_DEBUG;STDC_WANT_SECURE_LIB;CPPUTEST_USE_LONG_LONG;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + winmm.lib;%(AdditionalDependencies) + + + true + .\Debug/CppUTestd.bsc + + + + + + + + true + + Disabled @@ -88,6 +147,42 @@ Level3 true OldStyle + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + winmm.lib;%(AdditionalDependencies) + + + true + .\Release/CppUTest.bsc + + + + + + + + true + + + + + Disabled + .\include;.\include\Platforms\VisualCpp;%(AdditionalIncludeDirectories) + OnlyExplicitInline + WIN32;NDEBUG;_LIB;STDC_WANT_SECURE_LIB;CPPUTEST_USE_LONG_LONG;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + Level3 + true + OldStyle + true NDEBUG;%(PreprocessorDefinitions) @@ -112,6 +207,7 @@ + @@ -133,6 +229,7 @@ + @@ -143,16 +240,13 @@ - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - + + @@ -183,6 +277,7 @@ + @@ -200,4 +295,4 @@ - \ No newline at end of file + diff -Nru cpputest-3.8/CppUTest_VS201x.sln cpputest-4.0/CppUTest_VS201x.sln --- cpputest-3.8/CppUTest_VS201x.sln 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/CppUTest_VS201x.sln 2020-05-26 11:24:07.000000000 +0000 @@ -8,17 +8,27 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {913088F6-37C0-4195-80E9-548C7C5303CB}.Debug|Win32.ActiveCfg = Debug|Win32 {913088F6-37C0-4195-80E9-548C7C5303CB}.Debug|Win32.Build.0 = Debug|Win32 + {913088F6-37C0-4195-80E9-548C7C5303CB}.Debug|x64.ActiveCfg = Debug|x64 + {913088F6-37C0-4195-80E9-548C7C5303CB}.Debug|x64.Build.0 = Debug|x64 {913088F6-37C0-4195-80E9-548C7C5303CB}.Release|Win32.ActiveCfg = Release|Win32 {913088F6-37C0-4195-80E9-548C7C5303CB}.Release|Win32.Build.0 = Release|Win32 + {913088F6-37C0-4195-80E9-548C7C5303CB}.Release|x64.ActiveCfg = Release|x64 + {913088F6-37C0-4195-80E9-548C7C5303CB}.Release|x64.Build.0 = Release|x64 {F468F539-27BD-468E-BE64-DDE641400B51}.Debug|Win32.ActiveCfg = Debug|Win32 {F468F539-27BD-468E-BE64-DDE641400B51}.Debug|Win32.Build.0 = Debug|Win32 + {F468F539-27BD-468E-BE64-DDE641400B51}.Debug|x64.ActiveCfg = Debug|x64 + {F468F539-27BD-468E-BE64-DDE641400B51}.Debug|x64.Build.0 = Debug|x64 {F468F539-27BD-468E-BE64-DDE641400B51}.Release|Win32.ActiveCfg = Release|Win32 {F468F539-27BD-468E-BE64-DDE641400B51}.Release|Win32.Build.0 = Release|Win32 + {F468F539-27BD-468E-BE64-DDE641400B51}.Release|x64.ActiveCfg = Release|x64 + {F468F539-27BD-468E-BE64-DDE641400B51}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff -Nru cpputest-3.8/debian/changelog cpputest-4.0/debian/changelog --- cpputest-3.8/debian/changelog 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/changelog 2020-08-08 22:02:52.000000000 +0000 @@ -1,3 +1,32 @@ +cpputest (4.0-2) unstable; urgency=medium + + * Fix autopkgtest + * Disable build log scanner as it fails on a false-positive + + -- Raphaël Hertzog Sun, 09 Aug 2020 00:02:52 +0200 + +cpputest (4.0-1) unstable; urgency=medium + + [ OndÅ™ej Nový ] + * d/copyright: Use https protocol in Format field + * d/changelog: Remove trailing whitespaces + + [ Raphaël Hertzog ] + * Add a git-buildpackage configuration file + * New upstream version 4.0 + * Drop patches merged upstream + * Switch to debhelper compat level 13 + * Bump Standards-Version to 4.5.0 + * Update list of docs files to include + * Update rules to no longer touch removed files + * Drop upstream's problematic .gitignore + * Add salsa CI configuration file + * Install the new cmake files in libcpputest-dev + * Add some lintian overrides for + package-contains-documentation-outside-usr-share-doc + + -- Raphaël Hertzog Sat, 08 Aug 2020 23:02:15 +0200 + cpputest (3.8-7) unstable; urgency=medium * Update Vcs-* fields in light of move to salsa. @@ -122,7 +151,7 @@ * Update watch file to point to the new GitHub location. * Drop fix-shebangs.patch, merged upstream. * Add fix-ruby-shebangs.patch to fix incorrect /bin/ruby in shebang lines of - some scripts. + some scripts. * Drop workaround for #676462 and increase debhelper build-dep to ensure we have a fixed version. diff -Nru cpputest-3.8/debian/compat cpputest-4.0/debian/compat --- cpputest-3.8/debian/compat 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru cpputest-3.8/debian/control cpputest-4.0/debian/control --- cpputest-3.8/debian/control 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/control 2020-08-08 22:02:52.000000000 +0000 @@ -5,8 +5,8 @@ Homepage: http://cpputest.github.io/ Vcs-Git: https://salsa.debian.org/debian/cpputest.git Vcs-Browser: https://salsa.debian.org/debian/cpputest -Standards-Version: 4.1.3 -Build-Depends: debhelper (>= 11) +Standards-Version: 4.5.0 +Build-Depends: debhelper-compat (= 13) Package: cpputest Architecture: all diff -Nru cpputest-3.8/debian/copyright cpputest-4.0/debian/copyright --- cpputest-3.8/debian/copyright 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/copyright 2020-08-08 22:02:52.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: http://sourceforge.net/projects/cpputest/files/ Upstream-Name: CppUTest diff -Nru cpputest-3.8/debian/cpputest.docs cpputest-4.0/debian/cpputest.docs --- cpputest-3.8/debian/cpputest.docs 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/cpputest.docs 2020-08-08 22:02:52.000000000 +0000 @@ -1,3 +1,2 @@ -README +README.md README_CppUTest_for_C.txt -README_UsersOfPriorVersions.txt diff -Nru cpputest-3.8/debian/cpputest.lintian-overrides cpputest-4.0/debian/cpputest.lintian-overrides --- cpputest-3.8/debian/cpputest.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/debian/cpputest.lintian-overrides 2020-08-08 22:02:52.000000000 +0000 @@ -0,0 +1,2 @@ +# Documentation for those scripts are fine where they are +package-contains-documentation-outside-usr-share-doc usr/share/cpputest/scripts/* diff -Nru cpputest-3.8/debian/gbp.conf cpputest-4.0/debian/gbp.conf --- cpputest-3.8/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/debian/gbp.conf 2020-08-08 22:02:52.000000000 +0000 @@ -0,0 +1,12 @@ +[DEFAULT] +pristine-tar = True + +[import-orig] +filter-pristine-tar = True + +[pq] +patch-numbers = False + +[dch] +multimaint-merge = True +ignore-branch = True diff -Nru cpputest-3.8/debian/libcpputest-dev.install cpputest-4.0/debian/libcpputest-dev.install --- cpputest-3.8/debian/libcpputest-dev.install 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/libcpputest-dev.install 2020-08-08 22:02:52.000000000 +0000 @@ -1,3 +1,4 @@ usr/include usr/lib/*/*.a usr/lib/*/pkgconfig/cpputest.pc +usr/lib/*/CppUTest diff -Nru cpputest-3.8/debian/patches/Install-include-CppUTestExt-CodeMemoryReportFormatter.h.patch cpputest-4.0/debian/patches/Install-include-CppUTestExt-CodeMemoryReportFormatter.h.patch --- cpputest-3.8/debian/patches/Install-include-CppUTestExt-CodeMemoryReportFormatter.h.patch 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/patches/Install-include-CppUTestExt-CodeMemoryReportFormatter.h.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -From: =?utf-8?q?Rapha=C3=ABl_Hertzog?= -Date: Wed, 15 Jun 2016 12:51:48 +0200 -Subject: Install include/CppUTestExt/CodeMemoryReportFormatter.h - ---- - Makefile.am | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Makefile.am b/Makefile.am -index 7939800..be25be2 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -108,6 +108,7 @@ if INCLUDE_CPPUTEST_EXT - include_cpputestextdir = $(includedir)/CppUTestExt - - include_cpputestext_HEADERS = \ -+ include/CppUTestExt/CodeMemoryReportFormatter.h \ - include/CppUTestExt/GMock.h \ - include/CppUTestExt/GTest.h \ - include/CppUTestExt/GTestConvertor.h \ diff -Nru cpputest-3.8/debian/patches/Portability-fixes.patch cpputest-4.0/debian/patches/Portability-fixes.patch --- cpputest-3.8/debian/patches/Portability-fixes.patch 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/patches/Portability-fixes.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -From: =?utf-8?q?Rapha=C3=ABl_Hertzog?= -Date: Fri, 17 Jun 2016 23:31:43 +0200 -Subject: Portability fixes - -This patches fixes the build on armel/m68k (changes to CppUTestConfig.h) -and to s390x/ppc64/sparc64 (changes to -tests/CppUTestExt/MockSupport_cTest.cpp). - -Bug: https://github.com/cpputest/cpputest/issues/1004 ---- - include/CppUTest/CppUTestConfig.h | 2 +- - tests/CppUTestExt/MockSupport_cTest.cpp | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/include/CppUTest/CppUTestConfig.h b/include/CppUTest/CppUTestConfig.h -index 9be2585..54cfc2d 100644 ---- a/include/CppUTest/CppUTestConfig.h -+++ b/include/CppUTest/CppUTestConfig.h -@@ -174,7 +174,7 @@ - - #if CPPUTEST_USE_STD_C_LIB && (!defined(_MSC_VER) || (_MSC_VER >= 1800)) - #define CPPUTEST_HAVE_FENV --#if defined(__WATCOMC__) -+#if defined(__WATCOMC__) || defined(__ARMEL__) || defined(__m68k__) - #define CPPUTEST_FENV_IS_WORKING_PROPERLY 0 - #else - #define CPPUTEST_FENV_IS_WORKING_PROPERLY 1 -diff --git a/tests/CppUTestExt/MockSupport_cTest.cpp b/tests/CppUTestExt/MockSupport_cTest.cpp -index 8fc55ec..5188857 100644 ---- a/tests/CppUTestExt/MockSupport_cTest.cpp -+++ b/tests/CppUTestExt/MockSupport_cTest.cpp -@@ -186,8 +186,8 @@ TEST(MockSupport_c, outputParameters_differentType) - - TEST(MockSupport_c, outputParametersOfType) - { -- long param = 1; -- const long retval = 2; -+ int param = 1; -+ const int retval = 2; - mock_c()->installCopier("typeName", typeCopy); - mock_c()->expectOneCall("foo")->withOutputParameterOfTypeReturning("typeName", "out", &retval); - mock_c()->actualCall("foo")->withOutputParameterOfType("typeName", "out", ¶m); diff -Nru cpputest-3.8/debian/patches/series cpputest-4.0/debian/patches/series --- cpputest-3.8/debian/patches/series 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -Install-include-CppUTestExt-CodeMemoryReportFormatter.h.patch -Portability-fixes.patch diff -Nru cpputest-3.8/debian/rules cpputest-4.0/debian/rules --- cpputest-3.8/debian/rules 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/rules 2020-08-08 22:02:52.000000000 +0000 @@ -17,15 +17,6 @@ override_dh_compress: dh_compress -X.cpp -override_dh_missing: - dh_missing --fail-missing - -# Fixes for the cpputest (arch-all) package -override_dh_installexamples-indep: - dh_installexamples - chmod 644 debian/cpputest/usr/share/doc/cpputest/examples/*.dsw - override_dh_fixperms-indep: - chmod 755 debian/cpputest/usr/share/cpputest/scripts/NewProject.sh \ - debian/cpputest/usr/share/cpputest/scripts/convertToUnity/create_unity_test_runner.rb + chmod 755 debian/cpputest/usr/share/cpputest/scripts/NewProject.sh dh_fixperms diff -Nru cpputest-3.8/debian/salsa-ci.yml cpputest-4.0/debian/salsa-ci.yml --- cpputest-3.8/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/debian/salsa-ci.yml 2020-08-08 22:02:52.000000000 +0000 @@ -0,0 +1,8 @@ +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml + +variables: + # It's confused about some debug output that is not a command call... + SALSA_CI_DISABLE_BLHC: 1 diff -Nru cpputest-3.8/debian/tests/build-and-run-upstream-testsuite cpputest-4.0/debian/tests/build-and-run-upstream-testsuite --- cpputest-3.8/debian/tests/build-and-run-upstream-testsuite 2018-02-05 19:37:15.000000000 +0000 +++ cpputest-4.0/debian/tests/build-and-run-upstream-testsuite 2020-08-08 22:02:52.000000000 +0000 @@ -24,7 +24,9 @@ } echo "Testing CppUTest" +cd CppUTest build_and_run +cd .. echo "Testing CppUTestExt" cd CppUTestExt diff -Nru cpputest-3.8/depcomp cpputest-4.0/depcomp --- cpputest-3.8/depcomp 2016-05-02 05:35:46.000000000 +0000 +++ cpputest-4.0/depcomp 2020-05-26 11:27:12.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,9 +783,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru cpputest-3.8/docker/Dockerfile.dos cpputest-4.0/docker/Dockerfile.dos --- cpputest-3.8/docker/Dockerfile.dos 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/docker/Dockerfile.dos 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,7 @@ +FROM ubuntu + +RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends dosbox make openssl ca-certificates git + +WORKDIR /cpputest_build + +CMD BUILD=make_dos /cpputest/scripts/travis_ci_build.sh diff -Nru cpputest-3.8/docker/Dockerfile.ubuntu cpputest-4.0/docker/Dockerfile.ubuntu --- cpputest-3.8/docker/Dockerfile.ubuntu 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/docker/Dockerfile.ubuntu 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,8 @@ +FROM ubuntu + +RUN apt-get update && \ + apt-get install -y -q --no-install-recommends file git gcc g++ make automake autoconf libtool + +WORKDIR /cpputest_build + +CMD autoreconf -i ../cpputest && ../cpputest/configure && make tdd Binary files /tmp/tmpL7r1zS/u3zurAr3nj/cpputest-3.8/docs/WalkThrough_VS21010.docx and /tmp/tmpL7r1zS/oHgOxfsf6M/cpputest-4.0/docs/WalkThrough_VS21010.docx differ diff -Nru cpputest-3.8/examples/AllTests/AllTests.dsp cpputest-4.0/examples/AllTests/AllTests.dsp --- cpputest-3.8/examples/AllTests/AllTests.dsp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/examples/AllTests/AllTests.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ -# Microsoft Developer Studio Project File - Name="AllTests" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=AllTests - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "AllTests.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "AllTests.mak" CFG="AllTests - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "AllTests - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "AllTests - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "AllTests - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /I "..\ApplicationLib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\lib\CppUTest.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /incremental:yes /machine:I386 -# Begin Special Build Tool -TargetPath=.\Release\AllTests.exe -SOURCE="$(InputPath)" -PostBuild_Cmds=$(TargetPath) -# End Special Build Tool - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\..\include" /I "..\ApplicationLib" /FI"CppUTest/MemoryLeakDetectorMallocMacros.h" /FI"CppUTest/MemoryLeakDetectorNewMacros.h" /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /FR /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\lib\CppUTestd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /incremental:no -# Begin Special Build Tool -TargetPath=.\Debug\AllTests.exe -SOURCE="$(InputPath)" -PostBuild_Cmds=$(TargetPath) -v -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "AllTests - Win32 Release" -# Name "AllTests - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\AllTests.cpp -# End Source File -# Begin Source File - -SOURCE=.\CircularBufferTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\EventDispatcherTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\HelloTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\MockDocumentationTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\PrinterTest.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\AllTests.h -# End Source File -# Begin Source File - -SOURCE=.\MockPrinter.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff -Nru cpputest-3.8/examples/AllTests/CMakeLists.txt cpputest-4.0/examples/AllTests/CMakeLists.txt --- cpputest-3.8/examples/AllTests/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/examples/AllTests/CMakeLists.txt 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,15 @@ +include_directories(../ApplicationLib) + +add_executable(ExampleTests + AllTests.cpp + CircularBufferTest.cpp + EventDispatcherTest.cpp + FEDemoTest.cpp + HelloTest.cpp + MockDocumentationTest.cpp + PrinterTest.cpp +) + +cpputest_normalize_test_output_location(ExampleTests) +target_link_libraries(ExampleTests ApplicationLib CppUTest CppUTestExt) +cpputest_buildtime_discover_tests(ExampleTests) diff -Nru cpputest-3.8/examples/AllTests/EventDispatcherTest.cpp cpputest-4.0/examples/AllTests/EventDispatcherTest.cpp --- cpputest-3.8/examples/AllTests/EventDispatcherTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/examples/AllTests/EventDispatcherTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -47,11 +47,11 @@ public: virtual bool isEqual(const void* object1, const void* object2) { - return ((Event*)object1)->type == ((Event*)object2)->type; + return ((const Event*)object1)->type == ((const Event*)object2)->type; } virtual SimpleString valueToString(const void* object) { - return StringFrom(((Event*)object)->type); + return StringFrom(((const Event*)object)->type); } }; diff -Nru cpputest-3.8/examples/AllTests/FEDemoTest.cpp cpputest-4.0/examples/AllTests/FEDemoTest.cpp --- cpputest-3.8/examples/AllTests/FEDemoTest.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/examples/AllTests/FEDemoTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -28,9 +28,9 @@ #include "CppUTest/CommandLineTestRunner.h" #include "CppUTest/TestHarness.h" #include "CppUTest/TestRegistry.h" -#include "CppUTestExt/IEEE754ExceptionsPlugin.h" #ifdef CPPUTEST_HAVE_FENV +#include "CppUTestExt/IEEE754ExceptionsPlugin.h" /* * To see a demonstration of tests failing as a result of IEEE754ExceptionsPlugin diff -Nru cpputest-3.8/examples/ApplicationLib/ApplicationLib.dsp cpputest-4.0/examples/ApplicationLib/ApplicationLib.dsp --- cpputest-3.8/examples/ApplicationLib/ApplicationLib.dsp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/examples/ApplicationLib/ApplicationLib.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ApplicationLib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=ApplicationLib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ApplicationLib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ApplicationLib.mak" CFG="ApplicationLib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ApplicationLib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "ApplicationLib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ApplicationLib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "ApplicationLib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "../../include" /I "../../include/Platforms/VisualCpp" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "ApplicationLib - Win32 Release" -# Name "ApplicationLib - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CircularBuffer.cpp -# End Source File -# Begin Source File - -SOURCE=.\EventDispatcher.cpp -# End Source File -# Begin Source File - -SOURCE=.\hello.c -# End Source File -# Begin Source File - -SOURCE=.\Printer.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CircularBuffer.h -# End Source File -# Begin Source File - -SOURCE=.\ExamplesNewOverrides.h -# End Source File -# Begin Source File - -SOURCE=.\hello.h -# End Source File -# Begin Source File - -SOURCE=.\Printer.h -# End Source File -# End Group -# End Target -# End Project diff -Nru cpputest-3.8/examples/ApplicationLib/CircularBuffer.cpp cpputest-4.0/examples/ApplicationLib/CircularBuffer.cpp --- cpputest-3.8/examples/ApplicationLib/CircularBuffer.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/examples/ApplicationLib/CircularBuffer.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -27,11 +27,12 @@ #include "CircularBuffer.h" #include "Printer.h" +#include CircularBuffer::CircularBuffer(int _capacity) : index(0), outdex(0), capacity(_capacity), empty(true), full(false) { - buffer = new int[this->capacity]; + buffer = new int[(size_t) this->capacity]; } CircularBuffer::~CircularBuffer() diff -Nru cpputest-3.8/examples/ApplicationLib/CMakeLists.txt cpputest-4.0/examples/ApplicationLib/CMakeLists.txt --- cpputest-3.8/examples/ApplicationLib/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/examples/ApplicationLib/CMakeLists.txt 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,6 @@ +add_library(ApplicationLib + CircularBuffer.cpp + EventDispatcher.cpp + hello.c + Printer.cpp +) diff -Nru cpputest-3.8/examples/CMakeLists.txt cpputest-4.0/examples/CMakeLists.txt --- cpputest-3.8/examples/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/examples/CMakeLists.txt 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,2 @@ +add_subdirectory(AllTests) +add_subdirectory(ApplicationLib) diff -Nru cpputest-3.8/examples/CppUTestExample.dsw cpputest-4.0/examples/CppUTestExample.dsw --- cpputest-3.8/examples/CppUTestExample.dsw 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/examples/CppUTestExample.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "AllTests"=.\AllTests\AllTests.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name ApplicationLib - End Project Dependency -}}} - -############################################################################### - -Project: "ApplicationLib"=.\ApplicationLib\ApplicationLib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru cpputest-3.8/examples/Makefile_ExamplesWithCppUTestInstalled.mk cpputest-4.0/examples/Makefile_ExamplesWithCppUTestInstalled.mk --- cpputest-3.8/examples/Makefile_ExamplesWithCppUTestInstalled.mk 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/examples/Makefile_ExamplesWithCppUTestInstalled.mk 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,26 @@ + +CPPFLAGS += -I /usr/local/include +LD_LIBRARIES = -L/usr/local/lib -lCppUTest -lCppUTestExt + +VPATH = ApplicationLib AllTests + +APPLIB_OBJECTS = CircularBuffer.o EventDispatcher.o hello.o Printer.o +TEST_OBJECTS = AllTests.o CircularBufferTest.o EventDispatcherTest.o FEDemoTest.o HelloTest.o MockDocumentationTest.o PrinterTest.o + +CPPFLAGS += -I ApplicationLib + +TEST_TARGET = CppUTestExamples +APPLIB = applicationLib.a + +$(TEST_TARGET): $(TEST_OBJECTS) applicationLib.a + $(CXX) -o $@ $^ $(LD_LIBRARIES) $(LDFLAGS) + ./$(TEST_TARGET) + +$(APPLIB): $(APPLIB_OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +clean: + rm -f -rf *.o + rm -f $(TEST_TARGET) + rm -f $(APPLIB) + diff -Nru cpputest-3.8/gcovr.cfg cpputest-4.0/gcovr.cfg --- cpputest-3.8/gcovr.cfg 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/gcovr.cfg 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,6 @@ +filter = src/ +filter = include/ +html = yes +html-details = yes +output = coverage.html +print-summary = yes diff -Nru cpputest-3.8/generated/CppUTestGeneratedConfig.h cpputest-4.0/generated/CppUTestGeneratedConfig.h --- cpputest-3.8/generated/CppUTestGeneratedConfig.h 2016-05-25 05:45:17.000000000 +0000 +++ cpputest-4.0/generated/CppUTestGeneratedConfig.h 2020-05-27 11:04:43.000000000 +0000 @@ -43,6 +43,11 @@ /* Define if you have POSIX threads libraries and header files. */ /* #undef HAVE_PTHREAD */ +/* Define to 1 if you have the `pthread_mutex_lock' function. */ +#ifndef CPPUTEST_HAVE_PTHREAD_MUTEX_LOCK +#define CPPUTEST_HAVE_PTHREAD_MUTEX_LOCK 1 +#endif + /* Define to 1 if you have the header file. */ #ifndef CPPUTEST_HAVE_STDDEF_H #define CPPUTEST_HAVE_STDDEF_H 1 @@ -58,6 +63,11 @@ #define CPPUTEST_HAVE_STDLIB_H 1 #endif +/* Define to 1 if you have the `strdup' function. */ +#ifndef CPPUTEST_HAVE_STRDUP +#define CPPUTEST_HAVE_STRDUP 1 +#endif + /* Define to 1 if you have the header file. */ #ifndef CPPUTEST_HAVE_STRINGS_H #define CPPUTEST_HAVE_STRINGS_H 1 @@ -147,7 +157,7 @@ /* Define to the full name and version of this package. */ #ifndef CPPUTEST_PACKAGE_STRING -#define CPPUTEST_PACKAGE_STRING "CppUTest 3.8" +#define CPPUTEST_PACKAGE_STRING "CppUTest 4.0" #endif /* Define to the one symbol short name of this package. */ @@ -162,7 +172,7 @@ /* Define to the version of this package. */ #ifndef CPPUTEST_PACKAGE_VERSION -#define CPPUTEST_PACKAGE_VERSION "3.8" +#define CPPUTEST_PACKAGE_VERSION "4.0" #endif /* Define to necessary symbol if this constant uses a non-standard name on @@ -182,7 +192,7 @@ /* Version number of package */ #ifndef CPPUTEST_VERSION -#define CPPUTEST_VERSION "3.8" +#define CPPUTEST_VERSION "4.0" #endif /* Define for Solaris 2.5.1 so the uint32_t typedef from , diff -Nru cpputest-3.8/.gitattributes cpputest-4.0/.gitattributes --- cpputest-3.8/.gitattributes 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/.gitattributes 2020-05-26 11:24:07.000000000 +0000 @@ -13,3 +13,8 @@ *.mak text eol=crlf *.vcproj text eol=crlf *.vcxproj text eol=crlf + + +*.sh text +*.ac text +*.am text diff -Nru cpputest-3.8/.gitignore cpputest-4.0/.gitignore --- cpputest-3.8/.gitignore 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/.gitignore 2020-05-26 11:24:07.000000000 +0000 @@ -1,82 +1,2 @@ -.DS_Store -*.swp -*.*~ -.*~ -*.d -*.o -*.a -.settings -*doxygen* -*.gcov -*.gcno -*.gcda -*_tests -*_cslim -*a.out -*.zip -tmp -pdfs -*.map -gcov -objs -lib -*_tests.txt -gcov*.html -ErrorLogs -testResults -.metadata -/ipch -Debug -Release -*/Debug/* -*/Release/* -*.exe -*.obj -*.ncb -*.opt -*.plg -*.idb -*.pdb -*.suo -*.sdf -*.opensdf -*.lib -*.log -*.tlog -*.cache -*.user -*.VC.db -*.VC.opendb -_build_ -_build -builds/*gcc* -/.deps -CppUTestExtTests -CppUTestTests -/Makefile -config.h -config.h.in -config.status -cpputest.pc -filename.map.txt -libtool -stamp-h1 -INSTALL -Makefile.in -aclocal.m4 -compile -config.guess -config.sub -configure -depcomp -install-sh -ltmain.sh -m4/libtool.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 -missing -test-driver -platforms/iar/settings -cpputest_*.xml +* +!.gitignore diff -Nru cpputest-3.8/include/CppUTest/CommandLineArguments.h cpputest-4.0/include/CppUTest/CommandLineArguments.h --- cpputest-3.8/include/CppUTest/CommandLineArguments.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/CommandLineArguments.h 2020-05-26 11:24:07.000000000 +0000 @@ -37,16 +37,21 @@ class CommandLineArguments { public: - explicit CommandLineArguments(int ac, const char** av); + explicit CommandLineArguments(int ac, const char *const *av); virtual ~CommandLineArguments(); bool parse(TestPlugin* plugin); + bool needHelp() const; bool isVerbose() const; + bool isVeryVerbose() const; bool isColor() const; bool isListingTestGroupNames() const; bool isListingTestGroupAndCaseNames() const; bool isRunIgnored() const; - int getRepeatCount() const; + size_t getRepeatCount() const; + bool isShuffling() const; + bool isReversing() const; + size_t getShuffleSeed() const; const TestFilter* getGroupFilters() const; const TestFilter* getNameFilters() const; bool isJUnitOutput() const; @@ -55,6 +60,7 @@ bool runTestsInSeperateProcess() const; const SimpleString& getPackageName() const; const char* usage() const; + const char* help() const; private: @@ -62,34 +68,43 @@ { OUTPUT_ECLIPSE, OUTPUT_JUNIT, OUTPUT_TEAMCITY }; + int ac_; - const char** av_; + const char *const *av_; + bool needHelp_; bool verbose_; + bool veryVerbose_; bool color_; bool runTestsAsSeperateProcess_; bool listTestGroupNames_; bool listTestGroupAndCaseNames_; bool runIgnored_; - int repeat_; + bool reversing_; + bool shuffling_; + bool shufflingPreSeeded_; + size_t repeat_; + size_t shuffleSeed_; TestFilter* groupFilters_; TestFilter* nameFilters_; OutputType outputType_; SimpleString packageName_; - SimpleString getParameterField(int ac, const char** av, int& i, const SimpleString& parameterName); - void SetRepeatCount(int ac, const char** av, int& index); - void AddGroupFilter(int ac, const char** av, int& index); - void AddStrictGroupFilter(int ac, const char** av, int& index); - void AddExcludeGroupFilter(int ac, const char** av, int& index); - void AddExcludeStrictGroupFilter(int ac, const char** av, int& index); - void AddNameFilter(int ac, const char** av, int& index); - void AddStrictNameFilter(int ac, const char** av, int& index); - void AddExcludeNameFilter(int ac, const char** av, int& index); - void AddExcludeStrictNameFilter(int ac, const char** av, int& index); - void AddTestToRunBasedOnVerboseOutput(int ac, const char** av, int& index, const char* parameterName); - bool SetOutputType(int ac, const char** av, int& index); - void SetPackageName(int ac, const char** av, int& index); + SimpleString getParameterField(int ac, const char *const *av, int& i, const SimpleString& parameterName); + void setRepeatCount(int ac, const char *const *av, int& index); + bool setShuffle(int ac, const char *const *av, int& index); + void addGroupFilter(int ac, const char *const *av, int& index); + bool addGroupDotNameFilter(int ac, const char *const *av, int& index); + void addStrictGroupFilter(int ac, const char *const *av, int& index); + void addExcludeGroupFilter(int ac, const char *const *av, int& index); + void addExcludeStrictGroupFilter(int ac, const char *const *av, int& index); + void addNameFilter(int ac, const char *const *av, int& index); + void addStrictNameFilter(int ac, const char *const *av, int& index); + void addExcludeNameFilter(int ac, const char *const *av, int& index); + void addExcludeStrictNameFilter(int ac, const char *const *av, int& index); + void addTestToRunBasedOnVerboseOutput(int ac, const char *const *av, int& index, const char* parameterName); + bool setOutputType(int ac, const char *const *av, int& index); + void setPackageName(int ac, const char *const *av, int& index); CommandLineArguments(const CommandLineArguments&); CommandLineArguments& operator=(const CommandLineArguments&); diff -Nru cpputest-3.8/include/CppUTest/CommandLineTestRunner.h cpputest-4.0/include/CppUTest/CommandLineTestRunner.h --- cpputest-3.8/include/CppUTest/CommandLineTestRunner.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/CommandLineTestRunner.h 2020-05-26 11:24:07.000000000 +0000 @@ -41,10 +41,10 @@ class CommandLineTestRunner { public: - static int RunAllTests(int ac, const char** av); + static int RunAllTests(int ac, const char *const *av); static int RunAllTests(int ac, char** av); - CommandLineTestRunner(int ac, const char** av, TestRegistry* registry); + CommandLineTestRunner(int ac, const char *const *av, TestRegistry* registry); virtual ~CommandLineTestRunner(); int runAllTestsMain(); diff -Nru cpputest-3.8/include/CppUTest/CppUTestConfig.h cpputest-4.0/include/CppUTest/CppUTestConfig.h --- cpputest-3.8/include/CppUTest/CppUTestConfig.h 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/include/CppUTest/CppUTestConfig.h 2020-05-26 11:24:07.000000000 +0000 @@ -42,7 +42,7 @@ #ifdef __clang__ #pragma clang diagnostic push - #if __clang_major__ >= 3 && __clang_minor__ >= 6 + #if (__clang_major__ == 3 && __clang_minor__ >= 6) || __clang_major__ >= 4 #pragma clang diagnostic ignored "-Wreserved-id-macro" #endif #endif @@ -94,7 +94,7 @@ /* Should be the only #include here. Standard C library wrappers */ #include "StandardCLibrary.h" -/* Create a __no_return__ macro, which is used to flag a function as not returning. +/* Create a _no_return_ macro, which is used to flag a function as not returning. * Used for functions that always throws for instance. * * This is needed for compiling with clang, without breaking other compilers. @@ -104,15 +104,15 @@ #endif #if __has_attribute(noreturn) - #define __no_return__ __attribute__((noreturn)) + #define _no_return_ __attribute__((noreturn)) #else - #define __no_return__ + #define _no_return_ #endif #if __has_attribute(format) - #define __check_format__(type, format_parameter, other_parameters) __attribute__ ((format (type, format_parameter, other_parameters))) + #define _check_format_(type, format_parameter, other_parameters) __attribute__ ((format (type, format_parameter, other_parameters))) #else - #define __check_format__(type, format_parameter, other_parameters) /* type, format_parameter, other_parameters */ + #define _check_format_(type, format_parameter, other_parameters) /* type, format_parameter, other_parameters */ #endif /* @@ -168,13 +168,49 @@ #endif /* + * Address sanitizer is a good thing... and it causes some conflicts with the CppUTest tests + * To check whether it is on or off, we create a CppUTest define here. +*/ +#if defined(__has_feature) +#if __has_feature(address_sanitizer) +#define CPPUTEST_SANITIZE_ADDRESS 1 +#endif +#endif + +#ifdef __SANITIZE_ADDRESS__ +#define CPPUTEST_SANITIZE_ADDRESS 1 +#endif + +#ifndef CPPUTEST_SANITIZE_ADDRESS +#define CPPUTEST_SANITIZE_ADDRESS 0 +#endif + +#if CPPUTEST_SANITIZE_ADDRESS +#define CPPUTEST_SANITIZE_ADDRESS 1 +#define CPPUTEST_DO_NOT_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) + #if defined(__linux__) && defined(__clang__) + #if CPPUTEST_USE_MEM_LEAK_DETECTION + #warning Compiling with Address Sanitizer with clang on linux will cause duplicate symbols for operator new. Turning off memory leak detection. Compile with -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED to get rid of this warning. + #undef CPPUTEST_USE_MEM_LEAK_DETECTION + #define CPPUTEST_USE_MEM_LEAK_DETECTION 0 + #endif + #endif +#else +#define CPPUTEST_SANITIZER_ADDRESS 0 +#define CPPUTEST_DO_NOT_SANITIZE_ADDRESS +#endif + +/* * Handling of IEEE754 floating point exceptions via fenv.h - * Works on non-Visual C++ compilers and Visual C++ 2008 and newer + * Predominantly works on non-Visual C++ compilers and Visual C++ 2008 and newer */ -#if CPPUTEST_USE_STD_C_LIB && (!defined(_MSC_VER) || (_MSC_VER >= 1800)) +#if CPPUTEST_USE_STD_C_LIB && \ + (!defined(_MSC_VER) || (_MSC_VER >= 1800)) && \ + (!defined(__APPLE__)) && \ + (!defined(__ghs__) || !defined(__ColdFire__)) #define CPPUTEST_HAVE_FENV -#if defined(__WATCOMC__) +#if defined(__WATCOMC__) || defined(__ARMEL__) || defined(__m68k__) #define CPPUTEST_FENV_IS_WORKING_PROPERLY 0 #else #define CPPUTEST_FENV_IS_WORKING_PROPERLY 1 @@ -201,10 +237,16 @@ #define CPPUTEST_CHAR_BIT 8 #endif +/* Handling of systems with a different int-width (e.g. 16 bit). + */ +#if CPPUTEST_USE_STD_C_LIB && (INT_MAX == 0x7fff) +#define CPPUTEST_16BIT_INTS +#endif + /* * Support for "long long" type. * - * Not supported when CPUTEST_LONG_LONG_DISABLED is set. + * Not supported when CPPUTEST_LONG_LONG_DISABLED is set. * Can be overridden by using CPPUTEST_USE_LONG_LONG * * CPPUTEST_HAVE_LONG_LONG_INT is set by configure @@ -250,22 +292,41 @@ char dummy[CPPUTEST_SIZE_OF_FAKE_LONG_LONG_TYPE]; }; +#if !defined(__cplusplus) +typedef struct cpputest_longlong cpputest_longlong; +typedef struct cpputest_ulonglong cpputest_ulonglong; +#endif + #endif /* Visual C++ 10.0+ (2010+) supports the override keyword, but doesn't define the C++ version as C++11 */ #if defined(__cplusplus) && ((__cplusplus >= 201103L) || (defined(_MSC_VER) && (_MSC_VER >= 1600))) +#if !defined(__ghs__) #define CPPUTEST_COMPILER_FULLY_SUPPORTS_CXX11 #define _override override #else +/* GreenHills is not compatible with other compilers with regards to where + * it expects the override specifier to be on methods that return function + * pointers. Given this, it is easiest to not use the override specifier. + */ +#define _override +#endif +#define NULLPTR nullptr +#else #define _override +#define NULLPTR NULL #endif -/* MinGW-w64 prefers to act like Visual C++, but we want the ANSI behaviors instead */ -#undef __USE_MINGW_ANSI_STDIO -#define __USE_MINGW_ANSI_STDIO 1 +/* Visual C++ 11.0+ (2012+) supports the override keyword on destructors */ +#if defined(__cplusplus) && ((__cplusplus >= 201103L) || (defined(_MSC_VER) && (_MSC_VER >= 1700))) +#define _destructor_override override +#else +#define _destructor_override +#endif #ifdef __clang__ #pragma clang diagnostic pop #endif + #endif diff -Nru cpputest-3.8/include/CppUTest/JUnitTestOutput.h cpputest-4.0/include/CppUTest/JUnitTestOutput.h --- cpputest-3.8/include/CppUTest/JUnitTestOutput.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/JUnitTestOutput.h 2020-05-26 11:24:07.000000000 +0000 @@ -38,7 +38,7 @@ { public: JUnitTestOutput(); - virtual ~JUnitTestOutput(); + virtual ~JUnitTestOutput() _destructor_override; virtual void printTestsStarted() _override; virtual void printTestsEnded(const TestResult& result) _override; @@ -50,6 +50,7 @@ virtual void printBuffer(const char*) _override; virtual void print(const char*) _override; virtual void print(long) _override; + virtual void print(size_t) _override; virtual void printFailure(const TestFailure& failure) _override; virtual void flush() _override; @@ -71,9 +72,10 @@ virtual void writeTestSuiteSummary(); virtual void writeProperties(); virtual void writeTestCases(); + virtual SimpleString encodeXmlText(const SimpleString& textbody); + virtual SimpleString encodeFileName(const SimpleString& fileName); virtual void writeFailure(JUnitTestCaseResultNode* node); virtual void writeFileEnding(); - }; #endif diff -Nru cpputest-3.8/include/CppUTest/MemoryLeakDetector.h cpputest-4.0/include/CppUTest/MemoryLeakDetector.h --- cpputest-3.8/include/CppUTest/MemoryLeakDetector.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/MemoryLeakDetector.h 2020-05-26 11:24:07.000000000 +0000 @@ -58,7 +58,7 @@ SimpleStringBuffer(); void clear(); - void add(const char* format, ...) __check_format__(printf, 2, 3); + void add(const char* format, ...) _check_format_(printf, 2, 3); void addMemoryDump(const void* memory, size_t memorySize); char* toString(); @@ -86,30 +86,30 @@ void reportMemoryLeak(MemoryLeakDetectorNode* leak); - void reportDeallocateNonAllocatedMemoryFailure(const char* freeFile, int freeLine, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter); - void reportMemoryCorruptionFailure(MemoryLeakDetectorNode* node, const char* freeFile, int freeLineNumber, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter); - void reportAllocationDeallocationMismatchFailure(MemoryLeakDetectorNode* node, const char* freeFile, int freeLineNumber, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter); + void reportDeallocateNonAllocatedMemoryFailure(const char* freeFile, size_t freeLine, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter); + void reportMemoryCorruptionFailure(MemoryLeakDetectorNode* node, const char* freeFile, size_t freeLineNumber, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter); + void reportAllocationDeallocationMismatchFailure(MemoryLeakDetectorNode* node, const char* freeFile, size_t freeLineNumber, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter); char* toString(); private: - void addAllocationLocation(const char* allocationFile, int allocationLineNumber, size_t allocationSize, TestMemoryAllocator* allocator); - void addDeallocationLocation(const char* freeFile, int freeLineNumber, TestMemoryAllocator* allocator); + void addAllocationLocation(const char* allocationFile, size_t allocationLineNumber, size_t allocationSize, TestMemoryAllocator* allocator); + void addDeallocationLocation(const char* freeFile, size_t freeLineNumber, TestMemoryAllocator* allocator); void addMemoryLeakHeader(); - void addMemoryLeakFooter(int totalAmountOfLeaks); + void addMemoryLeakFooter(size_t totalAmountOfLeaks); void addWarningForUsingMalloc(); void addNoMemoryLeaksMessage(); void addErrorMessageForTooMuchLeaks(); private: - int total_leaks_; + size_t total_leaks_; bool giveWarningOnUsingMalloc_; void reportFailure(const char* message, const char* allocFile, - int allocLine, size_t allocSize, + size_t allocLine, size_t allocSize, TestMemoryAllocator* allocAllocator, const char* freeFile, - int freeLine, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter); + size_t freeLine, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter); SimpleStringBuffer outputBuffer_; }; @@ -117,19 +117,20 @@ struct MemoryLeakDetectorNode { MemoryLeakDetectorNode() : - size_(0), number_(0), memory_(0), file_(0), line_(0), allocator_(0), period_(mem_leak_period_enabled), next_(0) + size_(0), number_(0), memory_(NULLPTR), file_(NULLPTR), line_(0), allocator_(NULLPTR), period_(mem_leak_period_enabled), allocation_stage_(0), next_(NULLPTR) { } - void init(char* memory, unsigned number, size_t size, TestMemoryAllocator* allocator, MemLeakPeriod period, const char* file, int line); + void init(char* memory, unsigned number, size_t size, TestMemoryAllocator* allocator, MemLeakPeriod period, unsigned char allocation_stage, const char* file, size_t line); size_t size_; unsigned number_; char* memory_; const char* file_; - int line_; + size_t line_; TestMemoryAllocator* allocator_; MemLeakPeriod period_; + unsigned char allocation_stage_; private: friend struct MemoryLeakDetectorList; @@ -139,7 +140,7 @@ struct MemoryLeakDetectorList { MemoryLeakDetectorList() : - head_(0) + head_(NULLPTR) {} void addNewNode(MemoryLeakDetectorNode* node); @@ -147,15 +148,19 @@ MemoryLeakDetectorNode* removeNode(char* memory); MemoryLeakDetectorNode* getFirstLeak(MemLeakPeriod period); - MemoryLeakDetectorNode* getNextLeak(MemoryLeakDetectorNode* node, - MemLeakPeriod period); - MemoryLeakDetectorNode* getLeakFrom(MemoryLeakDetectorNode* node, - MemLeakPeriod period); + MemoryLeakDetectorNode* getFirstLeakForAllocationStage(unsigned char allocation_stage); - int getTotalLeaks(MemLeakPeriod period); + MemoryLeakDetectorNode* getNextLeak(MemoryLeakDetectorNode* node, MemLeakPeriod period); + MemoryLeakDetectorNode* getNextLeakForAllocationStage(MemoryLeakDetectorNode* node, unsigned char allocation_stage); + + MemoryLeakDetectorNode* getLeakFrom(MemoryLeakDetectorNode* node, MemLeakPeriod period); + MemoryLeakDetectorNode* getLeakForAllocationStageFrom(MemoryLeakDetectorNode* node, unsigned char allocation_stage); + + size_t getTotalLeaks(MemLeakPeriod period); void clearAllAccounting(MemLeakPeriod period); bool isInPeriod(MemoryLeakDetectorNode* node, MemLeakPeriod period); + bool isInAllocationStage(MemoryLeakDetectorNode* node, unsigned char allocation_stage); private: MemoryLeakDetectorNode* head_; @@ -169,11 +174,12 @@ MemoryLeakDetectorNode* retrieveNode(char* memory); MemoryLeakDetectorNode* removeNode(char* memory); - int getTotalLeaks(MemLeakPeriod period); + size_t getTotalLeaks(MemLeakPeriod period); MemoryLeakDetectorNode* getFirstLeak(MemLeakPeriod period); - MemoryLeakDetectorNode* getNextLeak(MemoryLeakDetectorNode* leak, - MemLeakPeriod period); + MemoryLeakDetectorNode* getFirstLeakForAllocationStage(unsigned char allocation_stage); + MemoryLeakDetectorNode* getNextLeak(MemoryLeakDetectorNode* leak, MemLeakPeriod period); + MemoryLeakDetectorNode* getNextLeakForAllocationStage(MemoryLeakDetectorNode* leak, unsigned char allocation_stage); private: unsigned long hash(char* memory); @@ -200,23 +206,32 @@ void startChecking(); void stopChecking(); + unsigned char getCurrentAllocationStage() const; + void increaseAllocationStage(); + void decreaseAllocationStage(); + const char* report(MemLeakPeriod period); void markCheckingPeriodLeaksAsNonCheckingPeriod(); - int totalMemoryLeaks(MemLeakPeriod period); + size_t totalMemoryLeaks(MemLeakPeriod period); void clearAllAccounting(MemLeakPeriod period); char* allocMemory(TestMemoryAllocator* allocator, size_t size, bool allocatNodesSeperately = false); char* allocMemory(TestMemoryAllocator* allocator, size_t size, - const char* file, int line, bool allocatNodesSeperately = false); + const char* file, size_t line, bool allocatNodesSeperately = false); void deallocMemory(TestMemoryAllocator* allocator, void* memory, bool allocatNodesSeperately = false); - void deallocMemory(TestMemoryAllocator* allocator, void* memory, const char* file, int line, bool allocatNodesSeperately = false); - char* reallocMemory(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, int line, bool allocatNodesSeperately = false); + void deallocMemory(TestMemoryAllocator* allocator, void* memory, const char* file, size_t line, bool allocatNodesSeperately = false); + void deallocAllMemoryInCurrentAllocationStage(); + char* reallocMemory(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, size_t line, bool allocatNodesSeperately = false); void invalidateMemory(char* memory); void removeMemoryLeakInformationWithoutCheckingOrDeallocatingTheMemoryButDeallocatingTheAccountInformation(TestMemoryAllocator* allocator, void* memory, bool allocatNodesSeperately); enum { +#ifdef CPPUTEST_DISABLE_MEM_CORRUPTION_CHECK + memory_corruption_buffer_size = 0 +#else memory_corruption_buffer_size = 3 +#endif }; unsigned getCurrentAllocationNumber(); @@ -229,26 +244,27 @@ MemoryLeakDetectorTable memoryTable_; bool doAllocationTypeChecking_; unsigned allocationSequenceNumber_; + unsigned char current_allocation_stage_; SimpleMutex* mutex_; - char* allocateMemoryWithAccountingInformation(TestMemoryAllocator* allocator, size_t size, const char* file, int line, bool allocatNodesSeperately); - char* reallocateMemoryWithAccountingInformation(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, int line, bool allocatNodesSeperately); + char* allocateMemoryWithAccountingInformation(TestMemoryAllocator* allocator, size_t size, const char* file, size_t line, bool allocatNodesSeperately); + char* reallocateMemoryWithAccountingInformation(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, size_t line, bool allocatNodesSeperately); MemoryLeakDetectorNode* createMemoryLeakAccountingInformation(TestMemoryAllocator* allocator, size_t size, char* memory, bool allocatNodesSeperately); bool validMemoryCorruptionInformation(char* memory); bool matchingAllocation(TestMemoryAllocator *alloc_allocator, TestMemoryAllocator *free_allocator); - void storeLeakInformation(MemoryLeakDetectorNode * node, char *new_memory, size_t size, TestMemoryAllocator *allocator, const char *file, int line); + void storeLeakInformation(MemoryLeakDetectorNode * node, char *new_memory, size_t size, TestMemoryAllocator *allocator, const char *file, size_t line); void ConstructMemoryLeakReport(MemLeakPeriod period); size_t sizeOfMemoryWithCorruptionInfo(size_t size); MemoryLeakDetectorNode* getNodeFromMemoryPointer(char* memory, size_t size); - char* reallocateMemoryAndLeakInformation(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, int line, bool allocatNodesSeperately); + char* reallocateMemoryAndLeakInformation(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, size_t line, bool allocatNodesSeperately); void addMemoryCorruptionInformation(char* memory); - void checkForCorruption(MemoryLeakDetectorNode* node, const char* file, int line, TestMemoryAllocator* allocator, bool allocateNodesSeperately); + void checkForCorruption(MemoryLeakDetectorNode* node, const char* file, size_t line, TestMemoryAllocator* allocator, bool allocateNodesSeperately); }; #endif diff -Nru cpputest-3.8/include/CppUTest/MemoryLeakDetectorMallocMacros.h cpputest-4.0/include/CppUTest/MemoryLeakDetectorMallocMacros.h --- cpputest-3.8/include/CppUTest/MemoryLeakDetectorMallocMacros.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/MemoryLeakDetectorMallocMacros.h 2020-05-26 11:24:07.000000000 +0000 @@ -21,10 +21,10 @@ { #endif -extern void* cpputest_malloc_location(size_t size, const char* file, int line); -extern void* cpputest_calloc_location(size_t count, size_t size, const char* file, int line); -extern void* cpputest_realloc_location(void *, size_t, const char* file, int line); -extern void cpputest_free_location(void* buffer, const char* file, int line); +extern void* cpputest_malloc_location(size_t size, const char* file, size_t line); +extern void* cpputest_calloc_location(size_t count, size_t size, const char* file, size_t line); +extern void* cpputest_realloc_location(void *, size_t, const char* file, size_t line); +extern void cpputest_free_location(void* buffer, const char* file, size_t line); #ifdef __cplusplus } @@ -32,20 +32,6 @@ extern void crash_on_allocation_number(unsigned number); -#endif - -/* NOTE on strdup! - * - * strdup was implemented earlier, however it is *not* an Standard C function but a POSIX function. - * Because of that, it can lead to portability issues by providing more than is available on the local platform. - * For that reason, strdup is *not* implemented as a macro. If you still want to use it, an easy implementation would be: - * - * size_t length = 1 + strlen(str); - * char* result = (char*) cpputest_malloc_location(length, file, line); - * memcpy(result, str, length); - * return result; - * - */ #define malloc(a) cpputest_malloc_location(a, __FILE__, __LINE__) #define calloc(a, b) cpputest_calloc_location(a, b, __FILE__, __LINE__) @@ -53,4 +39,30 @@ #define free(a) cpputest_free_location(a, __FILE__, __LINE__) #define CPPUTEST_USE_MALLOC_MACROS 1 +#endif /* CPPUTEST_USE_MALLOC_MACROS */ + +/* This prevents strdup macros to get defined, unless it has been enabled by the user or generated config */ +#ifdef CPPUTEST_HAVE_STRDUP + +/* This prevents the declaration from done twice and makes sure the file only #defines strdup, so it can be included anywhere */ +#ifndef CPPUTEST_USE_STRDUP_MACROS + +#ifdef __cplusplus +extern "C" +{ #endif + +extern char* cpputest_strdup_location(const char* str, const char* file, size_t line); +extern char* cpputest_strndup_location(const char* str, size_t n, const char* file, size_t line); + +#ifdef __cplusplus +} +#endif + +#define strdup(str) cpputest_strdup_location(str, __FILE__, __LINE__) +#define strndup(str, n) cpputest_strndup_location(str, n, __FILE__, __LINE__) + +#define CPPUTEST_USE_STRDUP_MACROS 1 +#endif /* CPPUTEST_USE_STRDUP_MACROS */ +#endif /* CPPUTEST_HAVE_STRDUP */ +#endif /* CPPUTEST_USE_MEM_LEAK_DETECTION */ diff -Nru cpputest-3.8/include/CppUTest/MemoryLeakDetectorNewMacros.h cpputest-4.0/include/CppUTest/MemoryLeakDetectorNewMacros.h --- cpputest-3.8/include/CppUTest/MemoryLeakDetectorNewMacros.h 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/include/CppUTest/MemoryLeakDetectorNewMacros.h 2020-05-26 11:24:07.000000000 +0000 @@ -28,29 +28,49 @@ #ifndef CPPUTEST_USE_NEW_MACROS #if CPPUTEST_USE_STD_CPP_LIB + #ifdef CPPUTEST_USE_STRDUP_MACROS + #if CPPUTEST_USE_STRDUP_MACROS == 1 + /* + * Some platforms (OSx, i.e.) will get or included when using header, + * in order to avoid conflicts with strdup and strndup macros defined by MemoryLeakDetectorMallocMacros.h + * we will undefined those macros, include the C++ headers and then reinclude MemoryLeakDetectorMallocMacros.h. + * The check `#if CPPUTEST_USE_STRDUP_MACROS` will ensure we only include MemoryLeakDetectorMallocMacros.h if + * it has already been includeded earlier. + */ + #undef strdup + #undef strndup + #undef CPPUTEST_USE_STRDUP_MACROS + #define __CPPUTEST_REINCLUDE_MALLOC_MEMORY_LEAK_DETECTOR + #endif + #endif #include #include #include + #ifdef __CPPUTEST_REINCLUDE_MALLOC_MEMORY_LEAK_DETECTOR + #include "MemoryLeakDetectorMallocMacros.h" + #endif #endif - void* operator new(size_t size, const char* file, int line) UT_THROW (std::bad_alloc); - void* operator new[](size_t size, const char* file, int line) UT_THROW (std::bad_alloc); + void* operator new(size_t size, const char* file, size_t line) UT_THROW (std::bad_alloc); + void* operator new[](size_t size, const char* file, size_t line) UT_THROW (std::bad_alloc); void* operator new(size_t size) UT_THROW(std::bad_alloc); void* operator new[](size_t size) UT_THROW(std::bad_alloc); - void operator delete(void* mem, const char* file, int line) UT_NOTHROW; - void operator delete[](void* mem, const char* file, int line) UT_NOTHROW; + void operator delete(void* mem, const char* file, size_t line) UT_NOTHROW; + void operator delete[](void* mem, const char* file, size_t line) UT_NOTHROW; void operator delete(void* mem) UT_NOTHROW; void operator delete[](void* mem) UT_NOTHROW; +#if __cplusplus >= 201402L void operator delete (void* mem, size_t size) UT_NOTHROW; void operator delete[] (void* mem, size_t size) UT_NOTHROW; +#endif #endif #ifdef __clang__ #pragma clang diagnostic push - #if __clang_major__ >= 3 && __clang_minor__ >= 6 + #if (__clang_major__ == 3 && __clang_minor__ >= 6) || __clang_major__ >= 4 #pragma clang diagnostic ignored "-Wkeyword-macro" #endif #endif diff -Nru cpputest-3.8/include/CppUTest/MemoryLeakWarningPlugin.h cpputest-4.0/include/CppUTest/MemoryLeakWarningPlugin.h --- cpputest-3.8/include/CppUTest/MemoryLeakWarningPlugin.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/MemoryLeakWarningPlugin.h 2020-05-26 11:24:07.000000000 +0000 @@ -31,8 +31,8 @@ #include "TestPlugin.h" #include "MemoryLeakDetectorNewMacros.h" -#define IGNORE_ALL_LEAKS_IN_TEST() MemoryLeakWarningPlugin::getFirstPlugin()->ignoreAllLeaksInTest(); -#define EXPECT_N_LEAKS(n) MemoryLeakWarningPlugin::getFirstPlugin()->expectLeaksInTest(n); +#define IGNORE_ALL_LEAKS_IN_TEST() if (MemoryLeakWarningPlugin::getFirstPlugin()) MemoryLeakWarningPlugin::getFirstPlugin()->ignoreAllLeaksInTest() +#define EXPECT_N_LEAKS(n) if (MemoryLeakWarningPlugin::getFirstPlugin()) MemoryLeakWarningPlugin::getFirstPlugin()->expectLeaksInTest(n) extern void crash_on_allocation_number(unsigned alloc_number); @@ -42,16 +42,16 @@ class MemoryLeakWarningPlugin: public TestPlugin { public: - MemoryLeakWarningPlugin(const SimpleString& name, MemoryLeakDetector* localDetector = 0); - virtual ~MemoryLeakWarningPlugin(); + MemoryLeakWarningPlugin(const SimpleString& name, MemoryLeakDetector* localDetector = NULLPTR); + virtual ~MemoryLeakWarningPlugin() _destructor_override; virtual void preTestAction(UtestShell& test, TestResult& result) _override; virtual void postTestAction(UtestShell& test, TestResult& result) _override; - virtual const char* FinalReport(int toBeDeletedLeaks = 0); + virtual const char* FinalReport(size_t toBeDeletedLeaks = 0); void ignoreAllLeaksInTest(); - void expectLeaksInTest(int n); + void expectLeaksInTest(size_t n); void destroyGlobalDetectorAndTurnOffMemoryLeakDetectionInDestructor(bool des); @@ -65,21 +65,25 @@ static void destroyGlobalDetector(); static void turnOffNewDeleteOverloads(); - static void turnOnNewDeleteOverloads(); + static void turnOnDefaultNotThreadSafeNewDeleteOverloads(); static void turnOnThreadSafeNewDeleteOverloads(); static bool areNewDeleteOverloaded(); + + static void saveAndDisableNewDeleteOverloads(); + static void restoreNewDeleteOverloads(); + private: MemoryLeakDetector* memLeakDetector_; bool ignoreAllWarnings_; bool destroyGlobalDetectorAndTurnOfMemoryLeakDetectionInDestructor_; - int expectedLeaks_; - int failureCount_; + size_t expectedLeaks_; + size_t failureCount_; static MemoryLeakWarningPlugin* firstPlugin_; }; -extern void* cpputest_malloc_location_with_leak_detection(size_t size, const char* file, int line); -extern void* cpputest_realloc_location_with_leak_detection(void* memory, size_t size, const char* file, int line); -extern void cpputest_free_location_with_leak_detection(void* buffer, const char* file, int line); +extern void* cpputest_malloc_location_with_leak_detection(size_t size, const char* file, size_t line); +extern void* cpputest_realloc_location_with_leak_detection(void* memory, size_t size, const char* file, size_t line); +extern void cpputest_free_location_with_leak_detection(void* buffer, const char* file, size_t line); #endif diff -Nru cpputest-3.8/include/CppUTest/PlatformSpecificFunctions_c.h cpputest-4.0/include/CppUTest/PlatformSpecificFunctions_c.h --- cpputest-3.8/include/CppUTest/PlatformSpecificFunctions_c.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/PlatformSpecificFunctions_c.h 2020-05-26 11:24:07.000000000 +0000 @@ -69,6 +69,10 @@ extern int (*PlatformSpecificPutchar)(int c); extern void (*PlatformSpecificFlush)(void); +/* Random operations */ +extern void (*PlatformSpecificSrand)(unsigned int); +extern int (*PlatformSpecificRand)(void); + /* Dynamic Memory operations */ extern void* (*PlatformSpecificMalloc)(size_t size); extern void* (*PlatformSpecificRealloc)(void* memory, size_t size); diff -Nru cpputest-3.8/include/CppUTest/SimpleString.h cpputest-4.0/include/CppUTest/SimpleString.h --- cpputest-3.8/include/CppUTest/SimpleString.h 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/include/CppUTest/SimpleString.h 2020-05-26 11:24:07.000000000 +0000 @@ -93,22 +93,35 @@ static void setStringAllocator(TestMemoryAllocator* allocator); static int AtoI(const char*str); + static unsigned AtoU(const char*str); static int StrCmp(const char* s1, const char* s2); static size_t StrLen(const char*); static int StrNCmp(const char* s1, const char* s2, size_t n); static char* StrNCpy(char* s1, const char* s2, size_t n); - static char* StrStr(const char* s1, const char* s2); + static const char* StrStr(const char* s1, const char* s2); static char ToLower(char ch); static int MemCmp(const void* s1, const void *s2, size_t n); - static char* allocStringBuffer(size_t size, const char* file, int line); - static void deallocStringBuffer(char* str, const char* file, int line); + static char* allocStringBuffer(size_t size, const char* file, size_t line); + static void deallocStringBuffer(char* str, size_t size, const char* file, size_t line); private: + + const char* getBuffer() const; + + void deallocateInternalBuffer(); + void setInternalBufferAsEmptyString(); + void setInternalBufferToNewBuffer(size_t bufferSize); + void setInternalBufferTo(char* buffer, size_t bufferSize); + void copyBufferToNewInternalBuffer(const char* otherBuffer); + void copyBufferToNewInternalBuffer(const char* otherBuffer, size_t bufferSize); + void copyBufferToNewInternalBuffer(const SimpleString& otherBuffer); + char *buffer_; + size_t bufferSize_; static TestMemoryAllocator* stringAllocator_; char* getEmptyString() const; - static char* copyToNewBuffer(const char* bufferToCopy, size_t bufferSize=0); + static char* copyToNewBuffer(const char* bufferToCopy, size_t bufferSize); static bool isDigit(char ch); static bool isSpace(char ch); static bool isUpper(char ch); @@ -134,6 +147,39 @@ SimpleStringCollection(SimpleStringCollection&); }; +class GlobalSimpleStringAllocatorStash +{ +public: + GlobalSimpleStringAllocatorStash(); + void save(); + void restore(); +private: + TestMemoryAllocator* originalAllocator_; +}; + +class MemoryAccountant; +class AccountingTestMemoryAllocator; + +class GlobalSimpleStringMemoryAccountant +{ +public: + GlobalSimpleStringMemoryAccountant(); + ~GlobalSimpleStringMemoryAccountant(); + + void useCacheSizes(size_t cacheSizes[], size_t length); + + void start(); + void stop(); + SimpleString report(); + + AccountingTestMemoryAllocator* getAllocator(); +private: + void restoreAllocator(); + + AccountingTestMemoryAllocator* allocator_; + MemoryAccountant* accountant_; +}; + SimpleString StringFrom(bool value); SimpleString StringFrom(const void* value); SimpleString StringFrom(void (*value)()); @@ -146,6 +192,8 @@ SimpleString StringFrom(unsigned long value); SimpleString StringFrom(cpputest_longlong value); SimpleString StringFrom(cpputest_ulonglong value); +SimpleString HexStringFrom(unsigned int value); +SimpleString HexStringFrom(int value); SimpleString HexStringFrom(signed char value); SimpleString HexStringFrom(long value); SimpleString HexStringFrom(unsigned long value); @@ -155,7 +203,7 @@ SimpleString HexStringFrom(void (*value)()); SimpleString StringFrom(double value, int precision = 6); SimpleString StringFrom(const SimpleString& other); -SimpleString StringFromFormat(const char* format, ...) __check_format__(printf, 1, 2); +SimpleString StringFromFormat(const char* format, ...) _check_format_(printf, 1, 2); SimpleString VStringFromFormat(const char* format, va_list args); SimpleString StringFromBinary(const unsigned char* value, size_t size); SimpleString StringFromBinaryOrNull(const unsigned char* value, size_t size); @@ -163,6 +211,22 @@ SimpleString StringFromBinaryWithSizeOrNull(const unsigned char* value, size_t size); SimpleString StringFromMaskedBits(unsigned long value, unsigned long mask, size_t byteCount); SimpleString StringFromOrdinalNumber(unsigned int number); +SimpleString BracketsFormattedHexStringFrom(int value); +SimpleString BracketsFormattedHexStringFrom(unsigned int value); +SimpleString BracketsFormattedHexStringFrom(long value); +SimpleString BracketsFormattedHexStringFrom(unsigned long value); +SimpleString BracketsFormattedHexStringFrom(cpputest_longlong value); +SimpleString BracketsFormattedHexStringFrom(cpputest_ulonglong value); +SimpleString BracketsFormattedHexStringFrom(signed char value); +SimpleString BracketsFormattedHexString(SimpleString hexString); + +/* + * ARM compiler has only partial support for C++11. + * Specifically nullptr_t is not officially supported + */ +#if __cplusplus > 199711L && !defined __arm__ && CPPUTEST_USE_STD_CPP_LIB +SimpleString StringFrom(const std::nullptr_t value); +#endif #if CPPUTEST_USE_STD_CPP_LIB diff -Nru cpputest-3.8/include/CppUTest/SimpleStringInternalCache.h cpputest-4.0/include/CppUTest/SimpleStringInternalCache.h --- cpputest-3.8/include/CppUTest/SimpleStringInternalCache.h 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/include/CppUTest/SimpleStringInternalCache.h 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef D_SimpleStringInternalCache_h +#define D_SimpleStringInternalCache_h + +#include "CppUTest/TestMemoryAllocator.h" + +struct SimpleStringMemoryBlock; +struct SimpleStringInternalCacheNode; + +class SimpleStringInternalCache +{ +public: + SimpleStringInternalCache(); + ~SimpleStringInternalCache(); + + void setAllocator(TestMemoryAllocator* allocator); + + char* alloc(size_t size); + void dealloc(char* memory, size_t size); + + bool hasFreeBlocksOfSize(size_t size); + + void clearCache(); + void clearAllIncludingCurrentlyUsedMemory(); +private: + void printDeallocatingUnknownMemory(char* memory); + + enum { amountOfInternalCacheNodes = 5}; + bool isCached(size_t size); + size_t getIndexForCache(size_t size); + SimpleStringInternalCacheNode* getCacheNodeFromSize(size_t size); + + SimpleStringInternalCacheNode* createInternalCacheNodes(); + void destroyInternalCacheNode(SimpleStringInternalCacheNode * node); + SimpleStringMemoryBlock* createSimpleStringMemoryBlock(size_t sizeOfString, SimpleStringMemoryBlock* next); + void destroySimpleStringMemoryBlock(SimpleStringMemoryBlock * block, size_t size); + void destroySimpleStringMemoryBlockList(SimpleStringMemoryBlock * block, size_t size); + + SimpleStringMemoryBlock* reserveCachedBlockFrom(SimpleStringInternalCacheNode* node); + void releaseCachedBlockFrom(char* memory, SimpleStringInternalCacheNode* node); + void releaseNonCachedMemory(char* memory, size_t size); + + SimpleStringMemoryBlock* allocateNewCacheBlockFrom(SimpleStringInternalCacheNode* node); + SimpleStringMemoryBlock* addToSimpleStringMemoryBlockList(SimpleStringMemoryBlock* newBlock, SimpleStringMemoryBlock* previousHead); + + TestMemoryAllocator* allocator_; + SimpleStringInternalCacheNode* cache_; + SimpleStringMemoryBlock* nonCachedAllocations_; + bool hasWarnedAboutDeallocations; +}; + +class SimpleStringCacheAllocator : public TestMemoryAllocator +{ +public: + SimpleStringCacheAllocator(SimpleStringInternalCache& cache, TestMemoryAllocator* previousAllocator); + virtual ~SimpleStringCacheAllocator() _destructor_override; + + virtual char* alloc_memory(size_t size, const char* file, size_t line) _override; + virtual void free_memory(char* memory, size_t size, const char* file, size_t line) _override; + + virtual const char* name() const _override; + virtual const char* alloc_name() const _override; + virtual const char* free_name() const _override; + + virtual TestMemoryAllocator* actualAllocator() _override; + TestMemoryAllocator* originalAllocator(); +private: + SimpleStringInternalCache& cache_; + TestMemoryAllocator* originalAllocator_; +}; + +class GlobalSimpleStringCache +{ + SimpleStringCacheAllocator* allocator_; + SimpleStringInternalCache cache_; + +public: + GlobalSimpleStringCache(); + ~GlobalSimpleStringCache(); + + TestMemoryAllocator* getAllocator(); +}; + +#endif diff -Nru cpputest-3.8/include/CppUTest/StandardCLibrary.h cpputest-4.0/include/CppUTest/StandardCLibrary.h --- cpputest-3.8/include/CppUTest/StandardCLibrary.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/StandardCLibrary.h 2020-05-26 11:24:07.000000000 +0000 @@ -5,7 +5,6 @@ #ifndef STANDARDCLIBRARY_H_ #define STANDARDCLIBRARY_H_ - #if CPPUTEST_USE_STD_C_LIB /* Needed for size_t */ @@ -21,12 +20,33 @@ /* Needed for malloc */ #include +/* Needed for std::nullptr */ +#ifdef __cplusplus + #if CPPUTEST_USE_STD_CPP_LIB + #include + #endif +#endif + /* Needed for ... */ #include +/* Kludge to get a va_copy in VC++ V6 and in GCC 98 */ +#ifndef va_copy +#ifdef __GNUC__ +#define va_copy __va_copy +#else +#define va_copy(copy, original) copy = original; +#endif +#endif + /* Needed for some detection of long long and 64 bit */ #include +/* Needed to ensure that string.h is included prior to strdup redefinition */ +#ifdef CPPUTEST_HAVE_STRING_H +#include +#endif + #else #ifdef __KERNEL__ @@ -57,14 +77,16 @@ typedef long unsigned int size_t; #endif -typedef char* va_list; #define NULL (0) extern void* malloc(size_t); extern void free(void *); #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) -#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,sizeof(int)-1)))) -#define va_end(ap) (void) 0 + +#define va_list __builtin_va_list +#define va_copy __builtin_va_copy +#define va_start __builtin_va_start +#define va_end __builtin_va_end #endif diff -Nru cpputest-3.8/include/CppUTest/TeamCityTestOutput.h cpputest-4.0/include/CppUTest/TeamCityTestOutput.h --- cpputest-3.8/include/CppUTest/TeamCityTestOutput.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TeamCityTestOutput.h 2020-05-26 11:24:07.000000000 +0000 @@ -8,7 +8,7 @@ { public: TeamCityTestOutput(void); - virtual ~TeamCityTestOutput(void); + virtual ~TeamCityTestOutput(void) _destructor_override; virtual void printCurrentTestStarted(const UtestShell& test) _override; virtual void printCurrentTestEnded(const TestResult& res) _override; diff -Nru cpputest-3.8/include/CppUTest/TestFailure.h cpputest-4.0/include/CppUTest/TestFailure.h --- cpputest-3.8/include/CppUTest/TestFailure.h 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TestFailure.h 2020-05-26 11:24:07.000000000 +0000 @@ -45,20 +45,19 @@ { public: - TestFailure(UtestShell*, const char* fileName, int lineNumber, - const SimpleString& theMessage); + TestFailure(UtestShell*, const char* fileName, size_t lineNumber, const SimpleString& theMessage); TestFailure(UtestShell*, const SimpleString& theMessage); - TestFailure(UtestShell*, const char* fileName, int lineNumber); + TestFailure(UtestShell*, const char* fileName, size_t lineNumber); TestFailure(const TestFailure&); virtual ~TestFailure(); virtual SimpleString getFileName() const; virtual SimpleString getTestName() const; virtual SimpleString getTestNameOnly() const; - virtual int getFailureLineNumber() const; + virtual size_t getFailureLineNumber() const; virtual SimpleString getMessage() const; virtual SimpleString getTestFileName() const; - virtual int getTestLineNumber() const; + virtual size_t getTestLineNumber() const; bool isOutsideTestFile() const; bool isInHelperFunction() const; @@ -76,9 +75,9 @@ SimpleString testName_; SimpleString testNameOnly_; SimpleString fileName_; - int lineNumber_; + size_t lineNumber_; SimpleString testFileName_; - int testLineNumber_; + size_t testLineNumber_; SimpleString message_; TestFailure& operator=(const TestFailure&); @@ -88,99 +87,104 @@ class EqualsFailure: public TestFailure { public: - EqualsFailure(UtestShell*, const char* fileName, int lineNumber, const char* expected, const char* actual, const SimpleString& text); - EqualsFailure(UtestShell*, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text); + EqualsFailure(UtestShell*, const char* fileName, size_t lineNumber, const char* expected, const char* actual, const SimpleString& text); + EqualsFailure(UtestShell*, const char* fileName, size_t lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text); }; class DoublesEqualFailure: public TestFailure { public: - DoublesEqualFailure(UtestShell*, const char* fileName, int lineNumber, double expected, double actual, double threshold, const SimpleString& text); + DoublesEqualFailure(UtestShell*, const char* fileName, size_t lineNumber, double expected, double actual, double threshold, const SimpleString& text); }; class CheckEqualFailure : public TestFailure { public: - CheckEqualFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text); + CheckEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text); }; -class ContainsFailure: public TestFailure +class ComparisonFailure : public TestFailure { public: - ContainsFailure(UtestShell*, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text); + ComparisonFailure(UtestShell* test, const char *fileName, size_t lineNumber, const SimpleString& checkString, const SimpleString& comparisonString, const SimpleString& text); +}; +class ContainsFailure: public TestFailure +{ +public: + ContainsFailure(UtestShell*, const char* fileName, size_t lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text); }; class CheckFailure : public TestFailure { public: - CheckFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& checkString, const SimpleString& conditionString, const SimpleString& textString = ""); + CheckFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& checkString, const SimpleString& conditionString, const SimpleString& textString = ""); }; class FailFailure : public TestFailure { public: - FailFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& message); + FailFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& message); }; class LongsEqualFailure : public TestFailure { public: - LongsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, long expected, long actual, const SimpleString& text); + LongsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, long expected, long actual, const SimpleString& text); }; class UnsignedLongsEqualFailure : public TestFailure { public: - UnsignedLongsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, unsigned long expected, unsigned long actual, const SimpleString& text); + UnsignedLongsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, unsigned long expected, unsigned long actual, const SimpleString& text); }; class LongLongsEqualFailure : public TestFailure { public: - LongLongsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, cpputest_longlong expected, cpputest_longlong actual, const SimpleString& text); + LongLongsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, cpputest_longlong expected, cpputest_longlong actual, const SimpleString& text); }; class UnsignedLongLongsEqualFailure : public TestFailure { public: - UnsignedLongLongsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, cpputest_ulonglong expected, cpputest_ulonglong actual, const SimpleString& text); + UnsignedLongLongsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, cpputest_ulonglong expected, cpputest_ulonglong actual, const SimpleString& text); }; class SignedBytesEqualFailure : public TestFailure { public: - SignedBytesEqualFailure (UtestShell* test, const char* fileName, int lineNumber, signed char expected, signed char actual, const SimpleString& text); + SignedBytesEqualFailure (UtestShell* test, const char* fileName, size_t lineNumber, signed char expected, signed char actual, const SimpleString& text); }; class StringEqualFailure : public TestFailure { public: - StringEqualFailure(UtestShell* test, const char* fileName, int lineNumber, const char* expected, const char* actual, const SimpleString& text); + StringEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, const char* expected, const char* actual, const SimpleString& text); }; class StringEqualNoCaseFailure : public TestFailure { public: - StringEqualNoCaseFailure(UtestShell* test, const char* fileName, int lineNumber, const char* expected, const char* actual, const SimpleString& text); + StringEqualNoCaseFailure(UtestShell* test, const char* fileName, size_t lineNumber, const char* expected, const char* actual, const SimpleString& text); }; class BinaryEqualFailure : public TestFailure { public: - BinaryEqualFailure(UtestShell* test, const char* fileName, int lineNumber, const unsigned char* expected, const unsigned char* actual, size_t size, const SimpleString& text); + BinaryEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, const unsigned char* expected, const unsigned char* actual, size_t size, const SimpleString& text); }; class BitsEqualFailure : public TestFailure { public: - BitsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, unsigned long expected, unsigned long actual, unsigned long mask, size_t byteCount, const SimpleString& text); + BitsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, unsigned long expected, unsigned long actual, unsigned long mask, size_t byteCount, const SimpleString& text); }; class FeatureUnsupportedFailure : public TestFailure { public: - FeatureUnsupportedFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& featureName, const SimpleString& text); + FeatureUnsupportedFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& featureName, const SimpleString& text); }; #endif diff -Nru cpputest-3.8/include/CppUTest/TestHarness_c.h cpputest-4.0/include/CppUTest/TestHarness_c.h --- cpputest-3.8/include/CppUTest/TestHarness_c.h 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TestHarness_c.h 2020-05-26 11:24:07.000000000 +0000 @@ -36,29 +36,89 @@ #include "CppUTestConfig.h" +#define CHECK_EQUAL_C_BOOL(expected,actual) \ + CHECK_EQUAL_C_BOOL_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_BOOL_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_BOOL_LOCATION(expected,actual,text,__FILE__,__LINE__) + #define CHECK_EQUAL_C_INT(expected,actual) \ - CHECK_EQUAL_C_INT_LOCATION(expected,actual,__FILE__,__LINE__) + CHECK_EQUAL_C_INT_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_INT_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_INT_LOCATION(expected,actual,text,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_UINT(expected,actual) \ + CHECK_EQUAL_C_UINT_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_UINT_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_UINT_LOCATION(expected,actual,text,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_LONG(expected,actual) \ + CHECK_EQUAL_C_LONG_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_LONG_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_LONG_LOCATION(expected,actual,text,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_ULONG(expected,actual) \ + CHECK_EQUAL_C_ULONG_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_ULONG_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_ULONG_LOCATION(expected,actual,text,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_LONGLONG(expected,actual) \ + CHECK_EQUAL_C_LONGLONG_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_LONGLONG_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_LONGLONG_LOCATION(expected,actual,text,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_ULONGLONG(expected,actual) \ + CHECK_EQUAL_C_ULONGLONG_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_ULONGLONG_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_ULONGLONG_LOCATION(expected,actual,text,__FILE__,__LINE__) #define CHECK_EQUAL_C_REAL(expected,actual,threshold) \ - CHECK_EQUAL_C_REAL_LOCATION(expected,actual,threshold,__FILE__,__LINE__) + CHECK_EQUAL_C_REAL_LOCATION(expected,actual,threshold,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_REAL_TEXT(expected,actual,threshold,text) \ + CHECK_EQUAL_C_REAL_LOCATION(expected,actual,threshold,text,__FILE__,__LINE__) #define CHECK_EQUAL_C_CHAR(expected,actual) \ - CHECK_EQUAL_C_CHAR_LOCATION(expected,actual,__FILE__,__LINE__) + CHECK_EQUAL_C_CHAR_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_CHAR_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_CHAR_LOCATION(expected,actual,text,__FILE__,__LINE__) #define CHECK_EQUAL_C_UBYTE(expected,actual) \ - CHECK_EQUAL_C_UBYTE_LOCATION(expected,actual,__FILE__,__LINE__) + CHECK_EQUAL_C_UBYTE_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_UBYTE_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_UBYTE_LOCATION(expected,actual,text,__FILE__,__LINE__) #define CHECK_EQUAL_C_SBYTE(expected,actual) \ - CHECK_EQUAL_C_SBYTE_LOCATION(expected,actual,__FILE__,__LINE__) + CHECK_EQUAL_C_SBYTE_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_SBYTE_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_SBYTE_LOCATION(expected,actual,text,__FILE__,__LINE__) #define CHECK_EQUAL_C_STRING(expected,actual) \ - CHECK_EQUAL_C_STRING_LOCATION(expected,actual,__FILE__,__LINE__) + CHECK_EQUAL_C_STRING_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_STRING_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_STRING_LOCATION(expected,actual,text,__FILE__,__LINE__) #define CHECK_EQUAL_C_POINTER(expected,actual) \ - CHECK_EQUAL_C_POINTER_LOCATION(expected,actual,__FILE__,__LINE__) + CHECK_EQUAL_C_POINTER_LOCATION(expected,actual,NULLPTR,__FILE__,__LINE__) -#define CHECK_EQUAL_C_BITS(expected, actual, mask)\ - CHECK_EQUAL_C_BITS_LOCATION(expected, actual, mask, sizeof(actual), __FILE__, __LINE__) +#define CHECK_EQUAL_C_POINTER_TEXT(expected,actual,text) \ + CHECK_EQUAL_C_POINTER_LOCATION(expected,actual,text,__FILE__,__LINE__) + +#define CHECK_EQUAL_C_BITS(expected, actual, mask) \ + CHECK_EQUAL_C_BITS_LOCATION(expected, actual, mask, sizeof(actual), NULLPTR, __FILE__, __LINE__) + +#define CHECK_EQUAL_C_BITS_TEXT(expected, actual, mask, text) \ + CHECK_EQUAL_C_BITS_LOCATION(expected, actual, mask, sizeof(actual), text, __FILE__, __LINE__) #define FAIL_TEXT_C(text) \ FAIL_TEXT_C_LOCATION(text,__FILE__,__LINE__) @@ -67,8 +127,10 @@ FAIL_C_LOCATION(__FILE__,__LINE__) #define CHECK_C(condition) \ - CHECK_C_LOCATION(condition, #condition, __FILE__,__LINE__) + CHECK_C_LOCATION(condition, #condition, NULLPTR, __FILE__,__LINE__) +#define CHECK_C_TEXT(condition, text) \ + CHECK_C_LOCATION(condition, #condition, text, __FILE__, __LINE__) /****************************************************************************** * @@ -89,6 +151,10 @@ extern void test_##group_name##_##test_name##_wrapper_c(void);\ void test_##group_name##_##test_name##_wrapper_c() +#define IGNORE_TEST_C(group_name, test_name) \ + extern void ignore_##group_name##_##test_name##_wrapper_c(void);\ + void ignore_##group_name##_##test_name##_wrapper_c() + /* For use in C++ file */ @@ -113,6 +179,12 @@ test_##group_name##_##test_name##_wrapper_c(); \ } +#define IGNORE_TEST_C_WRAPPER(group_name, test_name) \ + extern "C" void ignore_##group_name##_##test_name##_wrapper_c(); \ + IGNORE_TEST(group_name, test_name) { \ + ignore_##group_name##_##test_name##_wrapper_c(); \ + } + #ifdef __cplusplus extern "C" { @@ -120,39 +192,37 @@ /* CHECKS that can be used from C code */ -extern void CHECK_EQUAL_C_INT_LOCATION(int expected, int actual, - const char* fileName, int lineNumber); -extern void CHECK_EQUAL_C_REAL_LOCATION(double expected, double actual, - double threshold, const char* fileName, int lineNumber); -extern void CHECK_EQUAL_C_CHAR_LOCATION(char expected, char actual, - const char* fileName, int lineNumber); -extern void CHECK_EQUAL_C_UBYTE_LOCATION(unsigned char expected, unsigned char actual, - const char* fileName, int lineNumber); -extern void CHECK_EQUAL_C_SBYTE_LOCATION(signed char expected, signed char actual, - const char* fileName, int lineNumber); -extern void CHECK_EQUAL_C_STRING_LOCATION(const char* expected, - const char* actual, const char* fileName, int lineNumber); -extern void CHECK_EQUAL_C_POINTER_LOCATION(const void* expected, - const void* actual, const char* fileName, int lineNumber); -extern void CHECK_EQUAL_C_BITS_LOCATION(unsigned int expected, unsigned int actual, - unsigned int mask, size_t size, const char* fileName, int lineNumber); -extern void FAIL_TEXT_C_LOCATION(const char* text, const char* fileName, - int lineNumber); -extern void FAIL_C_LOCATION(const char* fileName, int lineNumber); -extern void CHECK_C_LOCATION(int condition, const char* conditionString, - const char* fileName, int lineNumber); +extern void CHECK_EQUAL_C_BOOL_LOCATION(int expected, int actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_INT_LOCATION(int expected, int actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_UINT_LOCATION(unsigned int expected, unsigned int actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_LONG_LOCATION(long expected, long actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_ULONG_LOCATION(unsigned long expected, unsigned long actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_LONGLONG_LOCATION(cpputest_longlong expected, cpputest_longlong actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_ULONGLONG_LOCATION(cpputest_ulonglong expected, cpputest_ulonglong actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_REAL_LOCATION(double expected, double actual, double threshold, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_CHAR_LOCATION(char expected, char actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_UBYTE_LOCATION(unsigned char expected, unsigned char actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_SBYTE_LOCATION(signed char expected, signed char actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_STRING_LOCATION(const char* expected, const char* actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_POINTER_LOCATION(const void* expected, const void* actual, const char* text, const char* fileName, size_t lineNumber); +extern void CHECK_EQUAL_C_BITS_LOCATION(unsigned int expected, unsigned int actual, unsigned int mask, size_t size, const char* text, const char* fileName, size_t lineNumber); +extern void FAIL_TEXT_C_LOCATION(const char* text, const char* fileName, size_t lineNumber); +extern void FAIL_C_LOCATION(const char* fileName, size_t lineNumber); +extern void CHECK_C_LOCATION(int condition, const char* conditionString, const char* text, const char* fileName, size_t lineNumber); extern void* cpputest_malloc(size_t size); +extern char* cpputest_strdup(const char* str); +extern char* cpputest_strndup(const char* str, size_t n); extern void* cpputest_calloc(size_t num, size_t size); extern void* cpputest_realloc(void* ptr, size_t size); extern void cpputest_free(void* buffer); -extern void* cpputest_malloc_location(size_t size, const char* file, int line); -extern void* cpputest_calloc_location(size_t num, size_t size, - const char* file, int line); -extern void* cpputest_realloc_location(void* memory, size_t size, - const char* file, int line); -extern void cpputest_free_location(void* buffer, const char* file, int line); +extern void* cpputest_malloc_location(size_t size, const char* file, size_t line); +extern char* cpputest_strdup_location(const char* str, const char* file, size_t line); +extern char* cpputest_strndup_location(const char* str, size_t n, const char* file, size_t line); +extern void* cpputest_calloc_location(size_t num, size_t size, const char* file, size_t line); +extern void* cpputest_realloc_location(void* memory, size_t size, const char* file, size_t line); +extern void cpputest_free_location(void* buffer, const char* file, size_t line); void cpputest_malloc_set_out_of_memory(void); void cpputest_malloc_set_not_out_of_memory(void); @@ -171,7 +241,7 @@ */ #ifndef PUNUSED -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) # define PUNUSED(x) PUNUSED_ ##x __attribute__((unused)) #else # define PUNUSED(x) x diff -Nru cpputest-3.8/include/CppUTest/TestMemoryAllocator.h cpputest-4.0/include/CppUTest/TestMemoryAllocator.h --- cpputest-3.8/include/CppUTest/TestMemoryAllocator.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TestMemoryAllocator.h 2020-05-26 11:24:07.000000000 +0000 @@ -46,6 +46,19 @@ extern void setCurrentMallocAllocatorToDefault(); extern TestMemoryAllocator* defaultMallocAllocator(); +class GlobalMemoryAllocatorStash +{ +public: + GlobalMemoryAllocatorStash(); + void save(); + void restore(); + +private: + TestMemoryAllocator* originalMallocAllocator; + TestMemoryAllocator* originalNewAllocator; + TestMemoryAllocator* originalNewArrayAllocator; +}; + class TestMemoryAllocator { public: @@ -53,18 +66,20 @@ virtual ~TestMemoryAllocator(); bool hasBeenDestroyed(); - virtual char* alloc_memory(size_t size, const char* file, int line); - virtual void free_memory(char* memory, const char* file, int line); + virtual char* alloc_memory(size_t size, const char* file, size_t line); + virtual void free_memory(char* memory, size_t size, const char* file, size_t line); - virtual const char* name(); - virtual const char* alloc_name(); - virtual const char* free_name(); + virtual const char* name() const; + virtual const char* alloc_name() const; + virtual const char* free_name() const; virtual bool isOfEqualType(TestMemoryAllocator* allocator); virtual char* allocMemoryLeakNode(size_t size); virtual void freeMemoryLeakNode(char* memory); + virtual TestMemoryAllocator* actualAllocator(); + protected: const char* name_; @@ -74,15 +89,34 @@ bool hasBeenDestroyed_; }; +class MemoryLeakAllocator : public TestMemoryAllocator +{ +public: + MemoryLeakAllocator(TestMemoryAllocator* originalAllocator); + virtual ~MemoryLeakAllocator() _destructor_override; + + virtual char* alloc_memory(size_t size, const char* file, size_t line) _override; + virtual void free_memory(char* memory, size_t size, const char* file, size_t line) _override; + + virtual const char* name() const _override; + virtual const char* alloc_name() const _override; + virtual const char* free_name() const _override; + + virtual TestMemoryAllocator* actualAllocator() _override; +private: + TestMemoryAllocator* originalAllocator_; +}; + class CrashOnAllocationAllocator : public TestMemoryAllocator { unsigned allocationToCrashOn_; public: CrashOnAllocationAllocator(); + virtual ~CrashOnAllocationAllocator() _destructor_override; virtual void setNumberToCrashOn(unsigned allocationToCrashOn); - virtual char* alloc_memory(size_t size, const char* file, int line) _override; + virtual char* alloc_memory(size_t size, const char* file, size_t line) _override; }; @@ -90,8 +124,10 @@ { public: NullUnknownAllocator(); - virtual char* alloc_memory(size_t size, const char* file, int line) _override; - virtual void free_memory(char* memory, const char* file, int line) _override; + virtual ~NullUnknownAllocator() _destructor_override; + + virtual char* alloc_memory(size_t size, const char* file, size_t line) _override; + virtual void free_memory(char* memory, size_t size, const char* file, size_t line) _override; static TestMemoryAllocator* defaultAllocator(); }; @@ -102,12 +138,13 @@ { public: FailableMemoryAllocator(const char* name_str = "failable alloc", const char* alloc_name_str = "alloc", const char* free_name_str = "free"); + virtual ~FailableMemoryAllocator() _destructor_override; - virtual char* alloc_memory(size_t size, const char* file, int line); - virtual char* allocMemoryLeakNode(size_t size); + virtual char* alloc_memory(size_t size, const char* file, size_t line) _override; + virtual char* allocMemoryLeakNode(size_t size) _override; virtual void failAllocNumber(int number); - virtual void failNthAllocAt(int allocationNumber, const char* file, int line); + virtual void failNthAllocAt(int allocationNumber, const char* file, size_t line); virtual void checkAllFailedAllocsWereDone(); virtual void clearFailedAllocs(); @@ -118,5 +155,107 @@ int currentAllocNumber_; }; +struct MemoryAccountantAllocationNode; + +class MemoryAccountant +{ +public: + MemoryAccountant(); + ~MemoryAccountant(); + + void useCacheSizes(size_t sizes[], size_t length); + + void clear(); + + void alloc(size_t size); + void dealloc(size_t size); + + size_t totalAllocationsOfSize(size_t size) const; + size_t totalDeallocationsOfSize(size_t size) const; + size_t maximumAllocationAtATimeOfSize(size_t size) const; + + size_t totalAllocations() const; + size_t totalDeallocations() const; + + SimpleString report() const; + + void setAllocator(TestMemoryAllocator* allocator); +private: + MemoryAccountantAllocationNode* findOrCreateNodeOfSize(size_t size); + MemoryAccountantAllocationNode* findNodeOfSize(size_t size) const; + + MemoryAccountantAllocationNode* createNewAccountantAllocationNode(size_t size, MemoryAccountantAllocationNode* next) const; + void destroyAccountantAllocationNode(MemoryAccountantAllocationNode* node) const; + + void createCacheSizeNodes(size_t sizes[], size_t length); + + MemoryAccountantAllocationNode* head_; + TestMemoryAllocator* allocator_; + bool useCacheSizes_; + + SimpleString reportNoAllocations() const; + SimpleString reportTitle() const; + SimpleString reportHeader() const; + SimpleString reportFooter() const; + SimpleString stringSize(size_t size) const; + +}; + +struct AccountingTestMemoryAllocatorMemoryNode; + +class AccountingTestMemoryAllocator : public TestMemoryAllocator +{ +public: + AccountingTestMemoryAllocator(MemoryAccountant& accountant, TestMemoryAllocator* originalAllocator); + virtual ~AccountingTestMemoryAllocator() _destructor_override; + + virtual char* alloc_memory(size_t size, const char* file, size_t line) _override; + virtual void free_memory(char* memory, size_t size, const char* file, size_t line) _override; + + virtual TestMemoryAllocator* actualAllocator() _override; + TestMemoryAllocator* originalAllocator(); + + virtual const char* alloc_name() const _override; + virtual const char* free_name() const _override; +private: + + void addMemoryToMemoryTrackingToKeepTrackOfSize(char* memory, size_t size); + size_t removeMemoryFromTrackingAndReturnAllocatedSize(char* memory); + + size_t removeNextNodeAndReturnSize(AccountingTestMemoryAllocatorMemoryNode* node); + size_t removeHeadAndReturnSize(); + + MemoryAccountant& accountant_; + TestMemoryAllocator* originalAllocator_; + AccountingTestMemoryAllocatorMemoryNode* head_; +}; + +class GlobalMemoryAccountant +{ +public: + GlobalMemoryAccountant(); + ~GlobalMemoryAccountant(); + + void useCacheSizes(size_t sizes[], size_t length); + + void start(); + void stop(); + SimpleString report(); + SimpleString reportWithCacheSizes(size_t sizes[], size_t length); + + TestMemoryAllocator* getMallocAllocator(); + TestMemoryAllocator* getNewAllocator(); + TestMemoryAllocator* getNewArrayAllocator(); + +private: + + void restoreMemoryAllocators(); + + MemoryAccountant accountant_; + AccountingTestMemoryAllocator* mallocAllocator_; + AccountingTestMemoryAllocator* newAllocator_; + AccountingTestMemoryAllocator* newArrayAllocator_; +}; + #endif diff -Nru cpputest-3.8/include/CppUTest/TestOutput.h cpputest-4.0/include/CppUTest/TestOutput.h --- cpputest-3.8/include/CppUTest/TestOutput.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TestOutput.h 2020-05-26 11:24:07.000000000 +0000 @@ -46,6 +46,9 @@ class TestOutput { public: + enum WorkingEnvironment {visualStudio, eclipse, detectEnvironment}; + enum VerbosityLevel {level_quiet, level_verbose, level_veryVerbose}; + explicit TestOutput(); virtual ~TestOutput(); @@ -56,40 +59,41 @@ virtual void printCurrentGroupStarted(const UtestShell& test); virtual void printCurrentGroupEnded(const TestResult& res); - virtual void verbose(); + virtual void verbose(VerbosityLevel level); virtual void color(); virtual void printBuffer(const char*)=0; virtual void print(const char*); virtual void print(long); + virtual void print(size_t); virtual void printDouble(double); virtual void printFailure(const TestFailure& failure); - virtual void printTestRun(int number, int total); + virtual void printTestRun(size_t number, size_t total); virtual void setProgressIndicator(const char*); - virtual void flush()=0; + virtual void printVeryVerbose(const char*); - enum WorkingEnvironment {visualStudio, eclipse, detectEnvironment}; + virtual void flush()=0; static void setWorkingEnvironment(WorkingEnvironment workEnvironment); static WorkingEnvironment getWorkingEnvironment(); protected: - virtual void printEclipseErrorInFileOnLine(SimpleString file, int lineNumber); - virtual void printVisualStudioErrorInFileOnLine(SimpleString file, int lineNumber); + virtual void printEclipseErrorInFileOnLine(SimpleString file, size_t lineNumber); + virtual void printVisualStudioErrorInFileOnLine(SimpleString file, size_t lineNumber); virtual void printProgressIndicator(); void printFileAndLineForTestAndFailure(const TestFailure& failure); void printFileAndLineForFailure(const TestFailure& failure); void printFailureInTest(SimpleString testName); void printFailureMessage(SimpleString reason); - void printErrorInFileOnLineFormattedForWorkingEnvironment(SimpleString testFile, int lineNumber); + void printErrorInFileOnLineFormattedForWorkingEnvironment(SimpleString testFile, size_t lineNumber); TestOutput(const TestOutput&); TestOutput& operator=(const TestOutput&); int dotCount_; - bool verbose_; + VerbosityLevel verbose_; bool color_; const char* progressIndication_; @@ -113,7 +117,7 @@ explicit ConsoleTestOutput() { } - virtual ~ConsoleTestOutput() + virtual ~ConsoleTestOutput() _destructor_override { } @@ -141,7 +145,7 @@ { } - virtual ~StringBufferTestOutput(); + virtual ~StringBufferTestOutput() _destructor_override; void printBuffer(const char* s) _override { @@ -174,26 +178,27 @@ virtual void setOutputTwo(TestOutput* output); CompositeTestOutput(); - virtual ~CompositeTestOutput(); + virtual ~CompositeTestOutput() _destructor_override; - virtual void printTestsStarted(); - virtual void printTestsEnded(const TestResult& result); + virtual void printTestsStarted() _override; + virtual void printTestsEnded(const TestResult& result) _override; - virtual void printCurrentTestStarted(const UtestShell& test); - virtual void printCurrentTestEnded(const TestResult& res); - virtual void printCurrentGroupStarted(const UtestShell& test); - virtual void printCurrentGroupEnded(const TestResult& res); + virtual void printCurrentTestStarted(const UtestShell& test) _override; + virtual void printCurrentTestEnded(const TestResult& res) _override; + virtual void printCurrentGroupStarted(const UtestShell& test) _override; + virtual void printCurrentGroupEnded(const TestResult& res) _override; + + virtual void verbose(VerbosityLevel level) _override; + virtual void color() _override; + virtual void printBuffer(const char*) _override; + virtual void print(const char*) _override; + virtual void print(long) _override; + virtual void print(size_t) _override; + virtual void printDouble(double) _override; + virtual void printFailure(const TestFailure& failure) _override; + virtual void setProgressIndicator(const char*) _override; - virtual void verbose(); - virtual void color(); - virtual void printBuffer(const char*); - virtual void print(const char*); - virtual void print(long); - virtual void printDouble(double); - virtual void printFailure(const TestFailure& failure); - virtual void setProgressIndicator(const char*); - - virtual void flush(); + virtual void flush() _override; protected: CompositeTestOutput(const TestOutput&); diff -Nru cpputest-3.8/include/CppUTest/TestPlugin.h cpputest-4.0/include/CppUTest/TestPlugin.h --- cpputest-3.8/include/CppUTest/TestPlugin.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TestPlugin.h 2020-05-26 11:24:07.000000000 +0000 @@ -46,14 +46,14 @@ { } - virtual bool parseArguments(int /* ac */, const char** /* av */, int /* index */ ) + virtual bool parseArguments(int /* ac */, const char *const * /* av */, int /* index */ ) { return false; } virtual void runAllPreTestAction(UtestShell&, TestResult&); virtual void runAllPostTestAction(UtestShell&, TestResult&); - virtual bool parseAllArguments(int ac, const char** av, int index); + virtual bool parseAllArguments(int ac, const char *const *av, int index); virtual bool parseAllArguments(int ac, char** av, int index); virtual TestPlugin* addPlugin(TestPlugin*); @@ -98,7 +98,7 @@ }; }; -#define UT_PTR_SET(a, b) { CppUTestStore( (void**)&a ); a = b; } +#define UT_PTR_SET(a, b) do { CppUTestStore( (void**)&a ); a = b; } while(0) ///////////// Null Plugin diff -Nru cpputest-3.8/include/CppUTest/TestRegistry.h cpputest-4.0/include/CppUTest/TestRegistry.h --- cpputest-3.8/include/CppUTest/TestRegistry.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TestRegistry.h 2020-05-26 11:24:07.000000000 +0000 @@ -33,6 +33,7 @@ #ifndef D_TestRegistry_h #define D_TestRegistry_h +#include "StandardCLibrary.h" #include "SimpleString.h" #include "TestFilter.h" @@ -48,8 +49,10 @@ virtual void addTest(UtestShell *test); virtual void unDoLastAddTest(); - virtual int countTests(); + virtual size_t countTests(); virtual void runAllTests(TestResult& result); + virtual void shuffleTests(size_t seed); + virtual void reverseTests(); virtual void listTestGroupNames(TestResult& result); virtual void listTestGroupAndCaseNames(TestResult& result); virtual void setNameFilters(const TestFilter* filters); @@ -73,6 +76,7 @@ virtual void setRunTestsInSeperateProcess(); int getCurrentRepetition(); void setRunIgnored(); + private: bool testShouldRun(UtestShell* test, TestResult& result); diff -Nru cpputest-3.8/include/CppUTest/TestResult.h cpputest-4.0/include/CppUTest/TestResult.h --- cpputest-3.8/include/CppUTest/TestResult.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TestResult.h 2020-05-26 11:24:07.000000000 +0000 @@ -59,52 +59,58 @@ virtual void countIgnored(); virtual void addFailure(const TestFailure& failure); virtual void print(const char* text); + virtual void printVeryVerbose(const char* text); - int getTestCount() const + size_t getTestCount() const { return testCount_; } - int getRunCount() const + size_t getRunCount() const { return runCount_; } - int getCheckCount() const + size_t getCheckCount() const { return checkCount_; } - int getFilteredOutCount() const + size_t getFilteredOutCount() const { return filteredOutCount_; } - int getIgnoredCount() const + size_t getIgnoredCount() const { return ignoredCount_; } - int getFailureCount() const + size_t getFailureCount() const { return failureCount_; } - long getTotalExecutionTime() const; - void setTotalExecutionTime(long exTime); + bool isFailure() const + { + return (getFailureCount() != 0) || (getRunCount() + getIgnoredCount() == 0); + } + + size_t getTotalExecutionTime() const; + void setTotalExecutionTime(size_t exTime); - long getCurrentTestTotalExecutionTime() const; - long getCurrentGroupTotalExecutionTime() const; + size_t getCurrentTestTotalExecutionTime() const; + size_t getCurrentGroupTotalExecutionTime() const; private: TestOutput& output_; - int testCount_; - int runCount_; - int checkCount_; - int failureCount_; - int filteredOutCount_; - int ignoredCount_; - long totalExecutionTime_; - long timeStarted_; - long currentTestTimeStarted_; - long currentTestTotalExecutionTime_; - long currentGroupTimeStarted_; - long currentGroupTotalExecutionTime_; + size_t testCount_; + size_t runCount_; + size_t checkCount_; + size_t failureCount_; + size_t filteredOutCount_; + size_t ignoredCount_; + size_t totalExecutionTime_; + size_t timeStarted_; + size_t currentTestTimeStarted_; + size_t currentTestTotalExecutionTime_; + size_t currentGroupTimeStarted_; + size_t currentGroupTotalExecutionTime_; }; #endif diff -Nru cpputest-3.8/include/CppUTest/TestTestingFixture.h cpputest-4.0/include/CppUTest/TestTestingFixture.h --- cpputest-3.8/include/CppUTest/TestTestingFixture.h 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/include/CppUTest/TestTestingFixture.h 2020-05-26 11:24:07.000000000 +0000 @@ -35,106 +35,47 @@ { public: - TestTestingFixture() - { - output_ = new StringBufferTestOutput(); - result_ = new TestResult(*output_); - genTest_ = new ExecFunctionTestShell(); - registry_ = new TestRegistry(); - - registry_->setCurrentRegistry(registry_); - registry_->addTest(genTest_); - - lineOfCodeExecutedAfterCheck = false; - } - - virtual ~TestTestingFixture() - { - registry_->setCurrentRegistry(0); - delete registry_; - delete result_; - delete output_; - delete genTest_; - } - - void addTest(UtestShell * test) - { - registry_->addTest(test); - } - - void setTestFunction(void(*testFunction)()) - { - genTest_->testFunction_ = testFunction; - } - - void setSetup(void(*setupFunction)()) - { - genTest_->setup_ = setupFunction; - } - - void setTeardown(void(*teardownFunction)()) - { - genTest_->teardown_ = teardownFunction; - } - - void runTestWithMethod(void(*method)()) - { - setTestFunction(method); - runAllTests(); - } - - void runAllTests() - { - registry_->runAllTests(*result_); - } - - int getFailureCount() - { - return result_->getFailureCount(); - } - - int getCheckCount() - { - return result_->getCheckCount(); - } - - int getIgnoreCount() - { - return result_->getIgnoredCount(); - } - - bool hasTestFailed() - { - return genTest_->hasFailed(); - } - - void assertPrintContains(const SimpleString& contains) - { - assertPrintContains(getOutput(), contains); - } - - const SimpleString& getOutput() - { - return output_->getOutput(); - } - - static void assertPrintContains(const SimpleString& output, const SimpleString& contains) - { - STRCMP_CONTAINS(contains.asCharString(), output.asCharString()); - } - - int getRunCount() - { - return result_->getRunCount(); - } - - void checkTestFailsWithProperTestLocation(const char* text, const char* file, int line); + TestTestingFixture(); + virtual ~TestTestingFixture(); + void flushOutputAndResetResult(); + + void addTest(UtestShell * test); + void installPlugin(TestPlugin* plugin); + + void setTestFunction(void(*testFunction)()); + void setTestFunction(ExecFunction* testFunction); + void setSetup(void(*setupFunction)()); + void setTeardown(void(*teardownFunction)()); + + void setOutputVerbose(); + void setRunTestsInSeperateProcess(); + + void runTestWithMethod(void(*method)()); + void runAllTests(); + + size_t getFailureCount(); + size_t getCheckCount(); + size_t getIgnoreCount(); + size_t getRunCount(); + size_t getTestCount(); + const SimpleString& getOutput(); + TestRegistry* getRegistry(); + + bool hasTestFailed(); + void assertPrintContains(const SimpleString& contains); + void assertPrintContainsNot(const SimpleString& contains); + void checkTestFailsWithProperTestLocation(const char* text, const char* file, size_t line); static void lineExecutedAfterCheck(); + +private: + void clearExecFunction(); + static bool lineOfCodeExecutedAfterCheck; TestRegistry* registry_; ExecFunctionTestShell* genTest_; + bool ownsExecFunction_; StringBufferTestOutput* output_; TestResult * result_; }; diff -Nru cpputest-3.8/include/CppUTest/Utest.h cpputest-4.0/include/CppUTest/Utest.h --- cpputest-3.8/include/CppUTest/Utest.h 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/include/CppUTest/Utest.h 2020-05-26 11:24:07.000000000 +0000 @@ -70,14 +70,14 @@ { public: virtual void exitCurrentTest() const _override; - virtual ~NormalTestTerminator(); + virtual ~NormalTestTerminator() _destructor_override; }; class TestTerminatorWithoutExceptions : public TestTerminator { public: virtual void exitCurrentTest() const _override; - virtual ~TestTerminatorWithoutExceptions(); + virtual ~TestTerminatorWithoutExceptions() _destructor_override; }; //////////////////// UtestShell @@ -88,48 +88,50 @@ static UtestShell *getCurrent(); public: - UtestShell(const char* groupName, const char* testName, const char* fileName, int lineNumber); + UtestShell(const char* groupName, const char* testName, const char* fileName, size_t lineNumber); virtual ~UtestShell(); virtual UtestShell* addTest(UtestShell* test); virtual UtestShell *getNext() const; - virtual int countTests(); + virtual size_t countTests(); bool shouldRun(const TestFilter* groupFilters, const TestFilter* nameFilters) const; const SimpleString getName() const; const SimpleString getGroup() const; virtual SimpleString getFormattedName() const; const SimpleString getFile() const; - int getLineNumber() const; + size_t getLineNumber() const; virtual bool willRun() const; virtual bool hasFailed() const; void countCheck(); - virtual void assertTrue(bool condition, const char *checkString, const char *conditionString, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertCstrEqual(const char *expected, const char *actual, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertCstrNEqual(const char *expected, const char *actual, size_t length, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertCstrNoCaseEqual(const char *expected, const char *actual, const char* text, const char *fileName, int lineNumber); - virtual void assertCstrContains(const char *expected, const char *actual, const char* text, const char *fileName, int lineNumber); - virtual void assertCstrNoCaseContains(const char *expected, const char *actual, const char* text, const char *fileName, int lineNumber); - virtual void assertLongsEqual(long expected, long actual, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertUnsignedLongsEqual(unsigned long expected, unsigned long actual, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertLongLongsEqual(cpputest_longlong expected, cpputest_longlong actual, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertUnsignedLongLongsEqual(cpputest_ulonglong expected, cpputest_ulonglong actual, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertSignedBytesEqual(signed char expected, signed char actual, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertPointersEqual(const void *expected, const void *actual, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertFunctionPointersEqual(void (*expected)(), void (*actual)(), const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertDoublesEqual(double expected, double actual, double threshold, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertEquals(bool failed, const char* expected, const char* actual, const char* text, const char* file, int line, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertBinaryEqual(const void *expected, const void *actual, size_t length, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void assertBitsEqual(unsigned long expected, unsigned long actual, unsigned long mask, size_t byteCount, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void fail(const char *text, const char *fileName, int lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertTrue(bool condition, const char *checkString, const char *conditionString, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertCstrEqual(const char *expected, const char *actual, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertCstrNEqual(const char *expected, const char *actual, size_t length, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertCstrNoCaseEqual(const char *expected, const char *actual, const char* text, const char *fileName, size_t lineNumber); + virtual void assertCstrContains(const char *expected, const char *actual, const char* text, const char *fileName, size_t lineNumber); + virtual void assertCstrNoCaseContains(const char *expected, const char *actual, const char* text, const char *fileName, size_t lineNumber); + virtual void assertLongsEqual(long expected, long actual, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertUnsignedLongsEqual(unsigned long expected, unsigned long actual, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertLongLongsEqual(cpputest_longlong expected, cpputest_longlong actual, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertUnsignedLongLongsEqual(cpputest_ulonglong expected, cpputest_ulonglong actual, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertSignedBytesEqual(signed char expected, signed char actual, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertPointersEqual(const void *expected, const void *actual, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertFunctionPointersEqual(void (*expected)(), void (*actual)(), const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertDoublesEqual(double expected, double actual, double threshold, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertEquals(bool failed, const char* expected, const char* actual, const char* text, const char* file, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertBinaryEqual(const void *expected, const void *actual, size_t length, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertBitsEqual(unsigned long expected, unsigned long actual, unsigned long mask, size_t byteCount, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void assertCompare(bool comparison, const char *checkString, const char *comparisonString, const char *text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); + virtual void fail(const char *text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator = NormalTestTerminator()); virtual void exitTest(const TestTerminator& testTerminator = NormalTestTerminator()); - virtual void print(const char *text, const char *fileName, int lineNumber); - virtual void print(const SimpleString & text, const char *fileName, int lineNumber); + virtual void print(const char *text, const char *fileName, size_t lineNumber); + virtual void print(const SimpleString & text, const char *fileName, size_t lineNumber); + virtual void printVeryVerbose(const char* text); void setFileName(const char *fileName); - void setLineNumber(int lineNumber); + void setLineNumber(size_t lineNumber); void setGroupName(const char *groupName); void setTestName(const char *testName); @@ -153,7 +155,7 @@ protected: UtestShell(); - UtestShell(const char *groupName, const char *testName, const char *fileName, int lineNumber, UtestShell *nextTest); + UtestShell(const char *groupName, const char *testName, const char *fileName, size_t lineNumber, UtestShell *nextTest); virtual SimpleString getMacroName() const; TestResult *getTestResult(); @@ -161,7 +163,7 @@ const char *group_; const char *name_; const char *file_; - int lineNumber_; + size_t lineNumber_; UtestShell *next_; bool isRunAsSeperateProcess_; bool hasFailed_; @@ -192,22 +194,44 @@ ExecFunctionTestShell* shell_; }; +//////////////////// ExecFunction + +class ExecFunction +{ +public: + ExecFunction(); + virtual ~ExecFunction(); + + virtual void exec()=0; +}; + +class ExecFunctionWithoutParameters : public ExecFunction +{ +public: + void (*testFunction_)(); + + ExecFunctionWithoutParameters(void(*testFunction)()); + virtual ~ExecFunctionWithoutParameters() _destructor_override; + + virtual void exec() _override; +}; + //////////////////// ExecFunctionTestShell -class ExecFunctionTestShell: public UtestShell +class ExecFunctionTestShell : public UtestShell { public: void (*setup_)(); void (*teardown_)(); - void (*testFunction_)(); + ExecFunction* testFunction_; - ExecFunctionTestShell(void(*set)() = 0, void(*tear)() = 0) : - UtestShell("Generic", "Generic", "Generic", 1), setup_(set), teardown_( - tear), testFunction_(0) + ExecFunctionTestShell(void(*set)() = NULLPTR, void(*tear)() = NULLPTR) : + UtestShell("ExecFunction", "ExecFunction", "ExecFunction", 1), setup_(set), teardown_(tear), testFunction_(NULLPTR) { } - Utest* createTest() { return new ExecFunctionTest(this); } - virtual ~ExecFunctionTestShell(); + + Utest* createTest() _override { return new ExecFunctionTest(this); } + virtual ~ExecFunctionTestShell() _destructor_override; }; //////////////////// CppUTestFailedException @@ -224,9 +248,9 @@ { public: IgnoredUtestShell(); - virtual ~IgnoredUtestShell(); + virtual ~IgnoredUtestShell() _destructor_override; explicit IgnoredUtestShell(const char* groupName, const char* testName, - const char* fileName, int lineNumber); + const char* fileName, size_t lineNumber); virtual bool willRun() const _override; virtual void setRunIgnored() _override; protected: @@ -241,13 +265,36 @@ }; +//////////////////// UtestShellPointerArray + +class UtestShellPointerArray +{ +public: + UtestShellPointerArray(UtestShell* firstTest); + ~UtestShellPointerArray(); + + void shuffle(size_t seed); + void reverse(); + void relinkTestsInOrder(); + UtestShell* getFirstTest() const; + UtestShell* get(size_t index) const; + +private: + + void swap(size_t index1, size_t index2); + + UtestShell** arrayOfTests_; + size_t count_; +}; + + //////////////////// TestInstaller class TestInstaller { public: explicit TestInstaller(UtestShell& shell, const char* groupName, const char* testName, - const char* fileName, int lineNumber); + const char* fileName, size_t lineNumber); virtual ~TestInstaller(); void unDo(); diff -Nru cpputest-3.8/include/CppUTest/UtestMacros.h cpputest-4.0/include/CppUTest/UtestMacros.h --- cpputest-3.8/include/CppUTest/UtestMacros.h 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/include/CppUTest/UtestMacros.h 2020-05-26 11:24:07.000000000 +0000 @@ -62,7 +62,7 @@ \ class TEST_##testGroup##_##testName##_Test : public TEST_GROUP_##CppUTestGroup##testGroup \ { public: TEST_##testGroup##_##testName##_Test () : TEST_GROUP_##CppUTestGroup##testGroup () {} \ - void testBody(); }; \ + void testBody() _override; }; \ class TEST_##testGroup##_##testName##_TestShell : public UtestShell { \ virtual Utest* createTest() _override { return new TEST_##testGroup##_##testName##_Test; } \ } TEST_##testGroup##_##testName##_TestShell_instance; \ @@ -76,7 +76,7 @@ \ class IGNORE##testGroup##_##testName##_Test : public TEST_GROUP_##CppUTestGroup##testGroup \ { public: IGNORE##testGroup##_##testName##_Test () : TEST_GROUP_##CppUTestGroup##testGroup () {} \ - public: void testBody (); }; \ + public: void testBody() _override; }; \ class IGNORE##testGroup##_##testName##_TestShell : public IgnoredUtestShell { \ virtual Utest* createTest() _override { return new IGNORE##testGroup##_##testName##_Test; } \ } IGNORE##testGroup##_##testName##_TestShell_instance; \ @@ -99,38 +99,38 @@ // Different checking macros #define CHECK(condition)\ - CHECK_TRUE_LOCATION(condition, "CHECK", #condition, NULL, __FILE__, __LINE__) + CHECK_TRUE_LOCATION(condition, "CHECK", #condition, NULLPTR, __FILE__, __LINE__) #define CHECK_TEXT(condition, text) \ - CHECK_TRUE_LOCATION(condition, "CHECK", #condition, text, __FILE__, __LINE__) + CHECK_TRUE_LOCATION((bool)(condition), "CHECK", #condition, text, __FILE__, __LINE__) #define CHECK_TRUE(condition)\ - CHECK_TRUE_LOCATION(condition, "CHECK_TRUE", #condition, NULL, __FILE__, __LINE__) + CHECK_TRUE_LOCATION((bool) (condition), "CHECK_TRUE", #condition, NULLPTR, __FILE__, __LINE__) #define CHECK_TRUE_TEXT(condition, text)\ CHECK_TRUE_LOCATION(condition, "CHECK_TRUE", #condition, text, __FILE__, __LINE__) #define CHECK_FALSE(condition)\ - CHECK_FALSE_LOCATION(condition, "CHECK_FALSE", #condition, NULL, __FILE__, __LINE__) + CHECK_FALSE_LOCATION(condition, "CHECK_FALSE", #condition, NULLPTR, __FILE__, __LINE__) #define CHECK_FALSE_TEXT(condition, text)\ CHECK_FALSE_LOCATION(condition, "CHECK_FALSE", #condition, text, __FILE__, __LINE__) #define CHECK_TRUE_LOCATION(condition, checkString, conditionString, text, file, line)\ - { UtestShell::getCurrent()->assertTrue((condition) != 0, checkString, conditionString, text, file, line); } + do { UtestShell::getCurrent()->assertTrue((condition), checkString, conditionString, text, file, line); } while(0) #define CHECK_FALSE_LOCATION(condition, checkString, conditionString, text, file, line)\ - { UtestShell::getCurrent()->assertTrue((condition) == 0, checkString, conditionString, text, file, line); } + do { UtestShell::getCurrent()->assertTrue(!(condition), checkString, conditionString, text, file, line); } while(0) //This check needs the operator!=(), and a StringFrom(YourType) function #define CHECK_EQUAL(expected, actual)\ - CHECK_EQUAL_LOCATION(expected, actual, NULL, __FILE__, __LINE__) + CHECK_EQUAL_LOCATION(expected, actual, NULLPTR, __FILE__, __LINE__) #define CHECK_EQUAL_TEXT(expected, actual, text)\ CHECK_EQUAL_LOCATION(expected, actual, text, __FILE__, __LINE__) #define CHECK_EQUAL_LOCATION(expected, actual, text, file, line)\ - { if ((expected) != (actual)) { \ + do { if ((expected) != (actual)) { \ if ((actual) != (actual)) \ UtestShell::getCurrent()->print("WARNING:\n\tThe \"Actual Parameter\" parameter is evaluated multiple times resulting in different values.\n\tThus the value in the error message is probably incorrect.", file, line); \ if ((expected) != (expected)) \ @@ -139,92 +139,106 @@ } \ else \ { \ - UtestShell::getCurrent()->assertLongsEqual((long)0, (long)0, NULL, file, line); \ - } } + UtestShell::getCurrent()->assertLongsEqual((long)0, (long)0, NULLPTR, file, line); \ + } } while(0) + +#define CHECK_COMPARE(first, relop, second)\ + CHECK_COMPARE_TEXT(first, relop, second, NULLPTR) + +#define CHECK_COMPARE_TEXT(first, relop, second, text)\ + CHECK_COMPARE_LOCATION(first, relop, second, text, __FILE__, __LINE__) + +#define CHECK_COMPARE_LOCATION(first, relop, second, text, file, line)\ + do { SimpleString conditionString;\ + conditionString += StringFrom(first); conditionString += " ";\ + conditionString += #relop; conditionString += " ";\ + conditionString += StringFrom(second);\ + UtestShell::getCurrent()->assertCompare((first) relop (second), "CHECK_COMPARE", conditionString.asCharString(), text, __FILE__, __LINE__);\ + } while(0) //This check checks for char* string equality using strcmp. //This makes up for the fact that CHECK_EQUAL only compares the pointers to char*'s #define STRCMP_EQUAL(expected, actual)\ - STRCMP_EQUAL_LOCATION(expected, actual, NULL, __FILE__, __LINE__) + STRCMP_EQUAL_LOCATION(expected, actual, NULLPTR, __FILE__, __LINE__) #define STRCMP_EQUAL_TEXT(expected, actual, text)\ STRCMP_EQUAL_LOCATION(expected, actual, text, __FILE__, __LINE__) #define STRCMP_EQUAL_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertCstrEqual(expected, actual, text, file, line); } + do { UtestShell::getCurrent()->assertCstrEqual(expected, actual, text, file, line); } while(0) #define STRNCMP_EQUAL(expected, actual, length)\ - STRNCMP_EQUAL_LOCATION(expected, actual, length, NULL, __FILE__, __LINE__) + STRNCMP_EQUAL_LOCATION(expected, actual, length, NULLPTR, __FILE__, __LINE__) #define STRNCMP_EQUAL_TEXT(expected, actual, length, text)\ STRNCMP_EQUAL_LOCATION(expected, actual, length, text, __FILE__, __LINE__) #define STRNCMP_EQUAL_LOCATION(expected, actual, length, text, file, line)\ - { UtestShell::getCurrent()->assertCstrNEqual(expected, actual, length, text, file, line); } + do { UtestShell::getCurrent()->assertCstrNEqual(expected, actual, length, text, file, line); } while(0) #define STRCMP_NOCASE_EQUAL(expected, actual)\ - STRCMP_NOCASE_EQUAL_LOCATION(expected, actual, NULL, __FILE__, __LINE__) + STRCMP_NOCASE_EQUAL_LOCATION(expected, actual, NULLPTR, __FILE__, __LINE__) #define STRCMP_NOCASE_EQUAL_TEXT(expected, actual, text)\ STRCMP_NOCASE_EQUAL_LOCATION(expected, actual, text, __FILE__, __LINE__) #define STRCMP_NOCASE_EQUAL_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertCstrNoCaseEqual(expected, actual, text, file, line); } + do { UtestShell::getCurrent()->assertCstrNoCaseEqual(expected, actual, text, file, line); } while(0) #define STRCMP_CONTAINS(expected, actual)\ - STRCMP_CONTAINS_LOCATION(expected, actual, NULL, __FILE__, __LINE__) + STRCMP_CONTAINS_LOCATION(expected, actual, NULLPTR, __FILE__, __LINE__) #define STRCMP_CONTAINS_TEXT(expected, actual, text)\ STRCMP_CONTAINS_LOCATION(expected, actual, text, __FILE__, __LINE__) #define STRCMP_CONTAINS_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertCstrContains(expected, actual, text, file, line); } + do { UtestShell::getCurrent()->assertCstrContains(expected, actual, text, file, line); } while(0) #define STRCMP_NOCASE_CONTAINS(expected, actual)\ - STRCMP_NOCASE_CONTAINS_LOCATION(expected, actual, NULL, __FILE__, __LINE__) + STRCMP_NOCASE_CONTAINS_LOCATION(expected, actual, NULLPTR, __FILE__, __LINE__) #define STRCMP_NOCASE_CONTAINS_TEXT(expected, actual, text)\ STRCMP_NOCASE_CONTAINS_LOCATION(expected, actual, text, __FILE__, __LINE__) #define STRCMP_NOCASE_CONTAINS_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertCstrNoCaseContains(expected, actual, text, file, line); } + do { UtestShell::getCurrent()->assertCstrNoCaseContains(expected, actual, text, file, line); } while(0) //Check two long integers for equality #define LONGS_EQUAL(expected, actual)\ - LONGS_EQUAL_LOCATION((expected), (actual), NULL, __FILE__, __LINE__) + LONGS_EQUAL_LOCATION((expected), (actual), "LONGS_EQUAL(" #expected ", " #actual ") failed", __FILE__, __LINE__) #define LONGS_EQUAL_TEXT(expected, actual, text)\ LONGS_EQUAL_LOCATION((expected), (actual), text, __FILE__, __LINE__) #define UNSIGNED_LONGS_EQUAL(expected, actual)\ - UNSIGNED_LONGS_EQUAL_LOCATION((expected), (actual), NULL, __FILE__, __LINE__) + UNSIGNED_LONGS_EQUAL_LOCATION((expected), (actual), NULLPTR, __FILE__, __LINE__) #define UNSIGNED_LONGS_EQUAL_TEXT(expected, actual, text)\ UNSIGNED_LONGS_EQUAL_LOCATION((expected), (actual), text, __FILE__, __LINE__) #define LONGS_EQUAL_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertLongsEqual((long)expected, (long)actual, text, file, line); } + do { UtestShell::getCurrent()->assertLongsEqual((long)expected, (long)actual, text, file, line); } while(0) #define UNSIGNED_LONGS_EQUAL_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertUnsignedLongsEqual((unsigned long)expected, (unsigned long)actual, text, file, line); } + do { UtestShell::getCurrent()->assertUnsignedLongsEqual((unsigned long)expected, (unsigned long)actual, text, file, line); } while(0) #define LONGLONGS_EQUAL(expected, actual)\ - LONGLONGS_EQUAL_LOCATION(expected, actual, NULL, __FILE__, __LINE__) + LONGLONGS_EQUAL_LOCATION(expected, actual, NULLPTR, __FILE__, __LINE__) #define LONGLONGS_EQUAL_TEXT(expected, actual, text)\ LONGLONGS_EQUAL_LOCATION(expected, actual, text, __FILE__, __LINE__) #define UNSIGNED_LONGLONGS_EQUAL(expected, actual)\ - UNSIGNED_LONGLONGS_EQUAL_LOCATION(expected, actual, NULL, __FILE__, __LINE__) + UNSIGNED_LONGLONGS_EQUAL_LOCATION(expected, actual, NULLPTR, __FILE__, __LINE__) #define UNSIGNED_LONGLONGS_EQUAL_TEXT(expected, actual, text)\ UNSIGNED_LONGLONGS_EQUAL_LOCATION(expected, actual, text, __FILE__, __LINE__) #define LONGLONGS_EQUAL_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertLongLongsEqual(expected, actual, text, file, line); } + do { UtestShell::getCurrent()->assertLongLongsEqual((long long)expected, (long long)actual, text, file, line); } while(0) #define UNSIGNED_LONGLONGS_EQUAL_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertUnsignedLongLongsEqual(expected, actual, text, file, line); } + do { UtestShell::getCurrent()->assertUnsignedLongLongsEqual((unsigned long long)expected, (unsigned long long)actual, text, file, line); } while(0) #define BYTES_EQUAL(expected, actual)\ LONGS_EQUAL((expected) & 0xff,(actual) & 0xff) @@ -236,59 +250,83 @@ SIGNED_BYTES_EQUAL_LOCATION(expected, actual, __FILE__, __LINE__) #define SIGNED_BYTES_EQUAL_LOCATION(expected, actual, file, line) \ - { UtestShell::getCurrent()->assertSignedBytesEqual(expected, actual, NULL, file, line); } + do { UtestShell::getCurrent()->assertSignedBytesEqual(expected, actual, NULLPTR, file, line); } while(0) #define SIGNED_BYTES_EQUAL_TEXT(expected, actual, text)\ SIGNED_BYTES_EQUAL_TEXT_LOCATION(expected, actual, text, __FILE__, __LINE__) #define SIGNED_BYTES_EQUAL_TEXT_LOCATION(expected, actual, text, file, line) \ - { UtestShell::getCurrent()->assertSignedBytesEqual(expected, actual, text, file, line); } + do { UtestShell::getCurrent()->assertSignedBytesEqual(expected, actual, text, file, line); } while(0) #define POINTERS_EQUAL(expected, actual)\ - POINTERS_EQUAL_LOCATION((expected), (actual), NULL, __FILE__, __LINE__) + POINTERS_EQUAL_LOCATION((expected), (actual), NULLPTR, __FILE__, __LINE__) #define POINTERS_EQUAL_TEXT(expected, actual, text)\ POINTERS_EQUAL_LOCATION((expected), (actual), text, __FILE__, __LINE__) #define POINTERS_EQUAL_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertPointersEqual((void *)expected, (void *)actual, text, file, line); } + do { UtestShell::getCurrent()->assertPointersEqual((const void *)expected, (const void *)actual, text, file, line); } while(0) #define FUNCTIONPOINTERS_EQUAL(expected, actual)\ - FUNCTIONPOINTERS_EQUAL_LOCATION((expected), (actual), NULL, __FILE__, __LINE__) + FUNCTIONPOINTERS_EQUAL_LOCATION((expected), (actual), NULLPTR, __FILE__, __LINE__) #define FUNCTIONPOINTERS_EQUAL_TEXT(expected, actual, text)\ FUNCTIONPOINTERS_EQUAL_LOCATION((expected), (actual), text, __FILE__, __LINE__) #define FUNCTIONPOINTERS_EQUAL_LOCATION(expected, actual, text, file, line)\ - { UtestShell::getCurrent()->assertFunctionPointersEqual((void (*)())expected, (void (*)())actual, text, file, line); } + do { UtestShell::getCurrent()->assertFunctionPointersEqual((void (*)())expected, (void (*)())actual, text, file, line); } while(0) //Check two doubles for equality within a tolerance threshold #define DOUBLES_EQUAL(expected, actual, threshold)\ - DOUBLES_EQUAL_LOCATION(expected, actual, threshold, NULL, __FILE__, __LINE__) + DOUBLES_EQUAL_LOCATION(expected, actual, threshold, NULLPTR, __FILE__, __LINE__) #define DOUBLES_EQUAL_TEXT(expected, actual, threshold, text)\ DOUBLES_EQUAL_LOCATION(expected, actual, threshold, text, __FILE__, __LINE__) #define DOUBLES_EQUAL_LOCATION(expected, actual, threshold, text, file, line)\ - { UtestShell::getCurrent()->assertDoublesEqual(expected, actual, threshold, text, file, line); } + do { UtestShell::getCurrent()->assertDoublesEqual(expected, actual, threshold, text, file, line); } while(0) #define MEMCMP_EQUAL(expected, actual, size)\ - MEMCMP_EQUAL_LOCATION(expected, actual, size, NULL, __FILE__, __LINE__) + MEMCMP_EQUAL_LOCATION(expected, actual, size, NULLPTR, __FILE__, __LINE__) #define MEMCMP_EQUAL_TEXT(expected, actual, size, text)\ MEMCMP_EQUAL_LOCATION(expected, actual, size, text, __FILE__, __LINE__) #define MEMCMP_EQUAL_LOCATION(expected, actual, size, text, file, line)\ - { UtestShell::getCurrent()->assertBinaryEqual(expected, actual, size, text, file, line); } + do { UtestShell::getCurrent()->assertBinaryEqual(expected, actual, size, text, file, line); } while(0) #define BITS_EQUAL(expected, actual, mask)\ - BITS_LOCATION(expected, actual, mask, NULL, __FILE__, __LINE__) + BITS_LOCATION(expected, actual, mask, NULLPTR, __FILE__, __LINE__) #define BITS_EQUAL_TEXT(expected, actual, mask, text)\ BITS_LOCATION(expected, actual, mask, text, __FILE__, __LINE__) #define BITS_LOCATION(expected, actual, mask, text, file, line)\ - { UtestShell::getCurrent()->assertBitsEqual(expected, actual, mask, sizeof(actual), text, file, line); } + do { UtestShell::getCurrent()->assertBitsEqual(expected, actual, mask, sizeof(actual), text, file, line); } while(0) + +#define ENUMS_EQUAL_INT(expected, actual)\ + ENUMS_EQUAL_TYPE(int, expected, actual) + +#define ENUMS_EQUAL_INT_TEXT(expected, actual, text)\ + ENUMS_EQUAL_TYPE_TEXT(int, expected, actual, text) + +#define ENUMS_EQUAL_TYPE(underlying_type, expected, actual)\ + ENUMS_EQUAL_TYPE_LOCATION(underlying_type, expected, actual, NULLPTR, __FILE__, __LINE__) + +#define ENUMS_EQUAL_TYPE_TEXT(underlying_type, expected, actual, text)\ + ENUMS_EQUAL_TYPE_LOCATION(underlying_type, expected, actual, text, __FILE__, __LINE__) + +#define ENUMS_EQUAL_TYPE_LOCATION(underlying_type, expected, actual, text, file, line)\ + do { underlying_type expected_underlying_value = (underlying_type)(expected); \ + underlying_type actual_underlying_value = (underlying_type)(actual); \ + if (expected_underlying_value != actual_underlying_value) { \ + UtestShell::getCurrent()->assertEquals(true, StringFrom(expected_underlying_value).asCharString(), StringFrom(actual_underlying_value).asCharString(), text, file, line); \ + } \ + else \ + { \ + UtestShell::getCurrent()->assertLongsEqual((long)0, long(0), NULLPTR, file, line); \ + } \ + } while(0) //Fail if you get to this macro //The macro FAIL may already be taken, so allow FAIL_TEST too @@ -297,27 +335,27 @@ FAIL_LOCATION(text, __FILE__,__LINE__) #define FAIL_LOCATION(text, file, line)\ - { UtestShell::getCurrent()->fail(text, file, line); } + do { UtestShell::getCurrent()->fail(text, file, line); } while(0) #endif #define FAIL_TEST(text)\ FAIL_TEST_LOCATION(text, __FILE__,__LINE__) #define FAIL_TEST_LOCATION(text, file,line)\ - { UtestShell::getCurrent()->fail(text, file, line); } + do { UtestShell::getCurrent()->fail(text, file, line); } while(0) #define TEST_EXIT\ - { UtestShell::getCurrent()->exitTest(); } + do { UtestShell::getCurrent()->exitTest(); } while(0) #define UT_PRINT_LOCATION(text, file, line) \ - { UtestShell::getCurrent()->print(text, file, line); } + do { UtestShell::getCurrent()->print(text, file, line); } while(0) #define UT_PRINT(text) \ UT_PRINT_LOCATION(text, __FILE__, __LINE__) #if CPPUTEST_USE_STD_CPP_LIB #define CHECK_THROWS(expected, expression) \ - { \ + do { \ SimpleString failure_msg("expected to throw "#expected "\nbut threw nothing"); \ bool caught_expected = false; \ try { \ @@ -333,10 +371,10 @@ else { \ UtestShell::getCurrent()->countCheck(); \ } \ - } + } while(0) #endif /* CPPUTEST_USE_STD_CPP_LIB */ -#define UT_CRASH() { UtestShell::crash(); } +#define UT_CRASH() do { UtestShell::crash(); } while(0) #define RUN_ALL_TESTS(ac, av) CommandLineTestRunner::RunAllTests(ac, av) #endif /*D_UTestMacros_h*/ diff -Nru cpputest-3.8/include/CppUTestExt/CodeMemoryReportFormatter.h cpputest-4.0/include/CppUTestExt/CodeMemoryReportFormatter.h --- cpputest-3.8/include/CppUTestExt/CodeMemoryReportFormatter.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/CodeMemoryReportFormatter.h 2020-05-26 11:24:07.000000000 +0000 @@ -39,7 +39,7 @@ public: CodeMemoryReportFormatter(TestMemoryAllocator* internalAllocator); - virtual ~CodeMemoryReportFormatter(); + virtual ~CodeMemoryReportFormatter() _destructor_override; virtual void report_testgroup_start(TestResult* result, UtestShell& test) _override; virtual void report_testgroup_end(TestResult* /*result*/, UtestShell& /*test*/) _override {} // LCOV_EXCL_LINE @@ -47,8 +47,8 @@ virtual void report_test_start(TestResult* result, UtestShell& test) _override; virtual void report_test_end(TestResult* result, UtestShell& test) _override; - virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, int line) _override; - virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, int line) _override; + virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, size_t line) _override; + virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, size_t line) _override; private: @@ -58,10 +58,10 @@ void clearReporting(); bool isNewAllocator(TestMemoryAllocator* allocator); - SimpleString createVariableNameFromFileLineInfo(const char *file, int line); + SimpleString createVariableNameFromFileLineInfo(const char *file, size_t line); SimpleString getAllocationString(TestMemoryAllocator* allocator, const SimpleString& variableName, size_t size); - SimpleString getDeallocationString(TestMemoryAllocator* allocator, const SimpleString& variableName, const char* file, int line); + SimpleString getDeallocationString(TestMemoryAllocator* allocator, const SimpleString& variableName, const char* file, size_t line); }; #endif diff -Nru cpputest-3.8/include/CppUTestExt/GMock.h cpputest-4.0/include/CppUTestExt/GMock.h --- cpputest-3.8/include/CppUTestExt/GMock.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/GMock.h 2020-05-26 11:24:07.000000000 +0000 @@ -29,6 +29,8 @@ #define GMOCK_H_ #undef new +#undef strdup +#undef strndup #undef RUN_ALL_TESTS @@ -45,4 +47,8 @@ #include "CppUTest/MemoryLeakDetectorNewMacros.h" #endif +#ifdef CPPUTEST_USE_MALLOC_MACROS +#include "CppUTest/MemoryLeakDetectorMallocMacros.h" +#endif + #endif diff -Nru cpputest-3.8/include/CppUTestExt/GTest.h cpputest-4.0/include/CppUTestExt/GTest.h --- cpputest-3.8/include/CppUTestExt/GTest.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/GTest.h 2020-05-26 11:24:07.000000000 +0000 @@ -29,6 +29,8 @@ #define GTEST__H_ #undef new +#undef strdup +#undef strndup #undef RUN_ALL_TESTS @@ -38,6 +40,12 @@ #include "CppUTest/MemoryLeakDetectorNewMacros.h" #endif +#ifdef CPPUTEST_USE_MALLOC_MACROS +#include "CppUTest/MemoryLeakDetectorMallocMacros.h" +#endif + +#include "CppUTestExt/GTestSupport.h" + #ifndef RUN_ALL_TESTS #define GTEST_VERSION_GTEST_1_7 #else diff -Nru cpputest-3.8/include/CppUTestExt/GTestSupport.h cpputest-4.0/include/CppUTestExt/GTestSupport.h --- cpputest-3.8/include/CppUTestExt/GTestSupport.h 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/GTestSupport.h 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2011, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef GTESTSUPPORT__H_ +#define GTESTSUPPORT__H_ + +extern void CppuTestGTestIgnoreLeaksInTest(); + +#endif diff -Nru cpputest-3.8/include/CppUTestExt/MemoryReportAllocator.h cpputest-4.0/include/CppUTestExt/MemoryReportAllocator.h --- cpputest-3.8/include/CppUTestExt/MemoryReportAllocator.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MemoryReportAllocator.h 2020-05-26 11:24:07.000000000 +0000 @@ -40,7 +40,7 @@ MemoryReportFormatter* formatter_; public: MemoryReportAllocator(); - virtual ~MemoryReportAllocator(); + virtual ~MemoryReportAllocator() _destructor_override; virtual void setFormatter(MemoryReportFormatter* formatter); virtual void setTestResult(TestResult* result); @@ -48,12 +48,14 @@ virtual TestMemoryAllocator* getRealAllocator(); - virtual char* alloc_memory(size_t size, const char* file, int line) _override; - virtual void free_memory(char* memory, const char* file, int line) _override; + virtual char* alloc_memory(size_t size, const char* file, size_t line) _override; + virtual void free_memory(char* memory, size_t size, const char* file, size_t line) _override; - virtual const char* name() _override; - virtual const char* alloc_name() _override; - virtual const char* free_name() _override; + virtual const char* name() const _override; + virtual const char* alloc_name() const _override; + virtual const char* free_name() const _override; + + virtual TestMemoryAllocator* actualAllocator() _override; }; #endif diff -Nru cpputest-3.8/include/CppUTestExt/MemoryReporterPlugin.h cpputest-4.0/include/CppUTestExt/MemoryReporterPlugin.h --- cpputest-3.8/include/CppUTestExt/MemoryReporterPlugin.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MemoryReporterPlugin.h 2020-05-26 11:24:07.000000000 +0000 @@ -44,12 +44,15 @@ SimpleString currentTestGroup_; public: MemoryReporterPlugin(); - virtual ~MemoryReporterPlugin(); + virtual ~MemoryReporterPlugin() _destructor_override; virtual void preTestAction(UtestShell & test, TestResult & result) _override; virtual void postTestAction(UtestShell & test, TestResult & result) _override; - virtual bool parseArguments(int, const char**, int) _override; + virtual bool parseArguments(int, const char *const *, int) _override; + MemoryReportAllocator* getMallocAllocator(); + MemoryReportAllocator* getNewAllocator(); + MemoryReportAllocator* getNewArrayAllocator(); protected: virtual MemoryReportFormatter* createMemoryFormatter(const SimpleString& type); diff -Nru cpputest-3.8/include/CppUTestExt/MemoryReportFormatter.h cpputest-4.0/include/CppUTestExt/MemoryReportFormatter.h --- cpputest-3.8/include/CppUTestExt/MemoryReportFormatter.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MemoryReportFormatter.h 2020-05-26 11:24:07.000000000 +0000 @@ -42,15 +42,15 @@ virtual void report_test_start(TestResult* result, UtestShell& test)=0; virtual void report_test_end(TestResult* result, UtestShell& test)=0; - virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, int line)=0; - virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, int line)=0; + virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, size_t line)=0; + virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, size_t line)=0; }; class NormalMemoryReportFormatter : public MemoryReportFormatter { public: NormalMemoryReportFormatter(); - virtual ~NormalMemoryReportFormatter(); + virtual ~NormalMemoryReportFormatter() _destructor_override; virtual void report_testgroup_start(TestResult* /*result*/, UtestShell& /*test*/) _override; virtual void report_testgroup_end(TestResult* /*result*/, UtestShell& /*test*/) _override {} // LCOV_EXCL_LINE @@ -58,8 +58,8 @@ virtual void report_test_start(TestResult* result, UtestShell& test) _override; virtual void report_test_end(TestResult* result, UtestShell& test) _override; - virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, int line) _override; - virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, int line) _override; + virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, size_t line) _override; + virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, size_t line) _override; }; #endif diff -Nru cpputest-3.8/include/CppUTestExt/MockActualCall.h cpputest-4.0/include/CppUTestExt/MockActualCall.h --- cpputest-3.8/include/CppUTestExt/MockActualCall.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockActualCall.h 2020-05-26 11:24:07.000000000 +0000 @@ -28,6 +28,7 @@ #ifndef D_MockActualCall_h #define D_MockActualCall_h +#include "CppUTest/CppUTestConfig.h" #include "CppUTest/TestHarness.h" #include "CppUTestExt/MockNamedValue.h" #include "CppUTestExt/MockExpectedCallsList.h" @@ -42,12 +43,14 @@ virtual ~MockActualCall(); virtual MockActualCall& withName(const SimpleString& name)=0; - virtual MockActualCall& withCallOrder(int callOrder)=0; + virtual MockActualCall& withCallOrder(unsigned int callOrder)=0; MockActualCall& withParameter(const SimpleString& name, bool value) { return withBoolParameter(name, value); } MockActualCall& withParameter(const SimpleString& name, int value) { return withIntParameter(name, value); } MockActualCall& withParameter(const SimpleString& name, unsigned int value) { return withUnsignedIntParameter(name, value); } MockActualCall& withParameter(const SimpleString& name, long int value) { return withLongIntParameter(name, value); } MockActualCall& withParameter(const SimpleString& name, unsigned long int value) { return withUnsignedLongIntParameter(name, value); } + MockActualCall& withParameter(const SimpleString& name, cpputest_longlong value) { return withLongLongIntParameter(name, value); } + MockActualCall& withParameter(const SimpleString& name, cpputest_ulonglong value) { return withUnsignedLongLongIntParameter(name, value); } MockActualCall& withParameter(const SimpleString& name, double value) { return withDoubleParameter(name, value); } MockActualCall& withParameter(const SimpleString& name, const char* value) { return withStringParameter(name, value); } MockActualCall& withParameter(const SimpleString& name, void* value) { return withPointerParameter(name, value); } @@ -63,6 +66,8 @@ virtual MockActualCall& withUnsignedIntParameter(const SimpleString& name, unsigned int value)=0; virtual MockActualCall& withLongIntParameter(const SimpleString& name, long int value)=0; virtual MockActualCall& withUnsignedLongIntParameter(const SimpleString& name, unsigned long int value)=0; + virtual MockActualCall& withLongLongIntParameter(const SimpleString& name, cpputest_longlong value)=0; + virtual MockActualCall& withUnsignedLongLongIntParameter(const SimpleString& name, cpputest_ulonglong value)=0; virtual MockActualCall& withDoubleParameter(const SimpleString& name, double value)=0; virtual MockActualCall& withStringParameter(const SimpleString& name, const char* value)=0; virtual MockActualCall& withPointerParameter(const SimpleString& name, void* value)=0; @@ -85,6 +90,12 @@ virtual long int returnLongIntValue()=0; virtual long int returnLongIntValueOrDefault(long int default_value)=0; + virtual cpputest_ulonglong returnUnsignedLongLongIntValue()=0; + virtual cpputest_ulonglong returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong default_value)=0; + + virtual cpputest_longlong returnLongLongIntValue()=0; + virtual cpputest_longlong returnLongLongIntValueOrDefault(cpputest_longlong default_value)=0; + virtual unsigned int returnUnsignedIntValue()=0; virtual unsigned int returnUnsignedIntValueOrDefault(unsigned int default_value)=0; diff -Nru cpputest-3.8/include/CppUTestExt/MockCheckedActualCall.h cpputest-4.0/include/CppUTestExt/MockCheckedActualCall.h --- cpputest-3.8/include/CppUTestExt/MockCheckedActualCall.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockCheckedActualCall.h 2020-05-26 11:24:07.000000000 +0000 @@ -34,16 +34,18 @@ class MockCheckedActualCall : public MockActualCall { public: - MockCheckedActualCall(int callOrder, MockFailureReporter* reporter, const MockExpectedCallsList& expectations); - virtual ~MockCheckedActualCall(); + MockCheckedActualCall(unsigned int callOrder, MockFailureReporter* reporter, const MockExpectedCallsList& expectations); + virtual ~MockCheckedActualCall() _destructor_override; virtual MockActualCall& withName(const SimpleString& name) _override; - virtual MockActualCall& withCallOrder(int) _override; + virtual MockActualCall& withCallOrder(unsigned int) _override; virtual MockActualCall& withBoolParameter(const SimpleString& name, bool value) _override; virtual MockActualCall& withIntParameter(const SimpleString& name, int value) _override; virtual MockActualCall& withUnsignedIntParameter(const SimpleString& name, unsigned int value) _override; virtual MockActualCall& withLongIntParameter(const SimpleString& name, long int value) _override; virtual MockActualCall& withUnsignedLongIntParameter(const SimpleString& name, unsigned long int value) _override; + virtual MockActualCall& withLongLongIntParameter(const SimpleString& name, cpputest_longlong value) _override; + virtual MockActualCall& withUnsignedLongLongIntParameter(const SimpleString& name, cpputest_ulonglong value) _override; virtual MockActualCall& withDoubleParameter(const SimpleString& name, double value) _override; virtual MockActualCall& withStringParameter(const SimpleString& name, const char* value) _override; virtual MockActualCall& withPointerParameter(const SimpleString& name, void* value) _override; @@ -69,6 +71,12 @@ virtual long int returnLongIntValue() _override; virtual long int returnLongIntValueOrDefault(long int default_value) _override; + virtual cpputest_ulonglong returnUnsignedLongLongIntValue() _override; + virtual cpputest_ulonglong returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong default_value) _override; + + virtual cpputest_longlong returnLongLongIntValue() _override; + virtual cpputest_longlong returnLongLongIntValueOrDefault(cpputest_longlong default_value) _override; + virtual unsigned int returnUnsignedIntValue() _override; virtual unsigned int returnUnsignedIntValueOrDefault(unsigned int default_value) _override; @@ -100,12 +108,12 @@ SimpleString getName() const; virtual UtestShell* getTest() const; virtual void callHasSucceeded(); - virtual void finalizeOutputParameters(MockCheckedExpectedCall* call); - virtual void finalizeCallWhenFulfilled(); + virtual void copyOutputParameters(MockCheckedExpectedCall* call); + virtual void completeCallWhenMatchIsFound(); virtual void failTest(const MockFailure& failure); virtual void checkInputParameter(const MockNamedValue& actualParameter); virtual void checkOutputParameter(const MockNamedValue& outputParameter); - virtual void callIsInProgress(); + virtual void discardCurrentlyMatchingExpectations(); enum ActualCallState { CALL_IN_PROGRESS, @@ -116,13 +124,14 @@ private: SimpleString functionName_; - int callOrder_; + unsigned int callOrder_; MockFailureReporter* reporter_; ActualCallState state_; - MockCheckedExpectedCall* fulfilledExpectation_; + bool expectationsChecked_; + MockCheckedExpectedCall* matchingExpectation_; - MockExpectedCallsList unfulfilledExpectations_; + MockExpectedCallsList potentiallyMatchingExpectations_; const MockExpectedCallsList& allExpectations_; class MockOutputParametersListNode @@ -134,7 +143,7 @@ MockOutputParametersListNode* next_; MockOutputParametersListNode(const SimpleString& name, const SimpleString& type, void* ptr) - : name_(name), type_(type), ptr_(ptr), next_(NULL) {} + : name_(name), type_(type), ptr_(ptr), next_(NULLPTR) {} }; MockOutputParametersListNode* outputParameterExpectations_; @@ -147,15 +156,17 @@ { public: MockActualCallTrace(); - virtual ~MockActualCallTrace(); + virtual ~MockActualCallTrace() _destructor_override; virtual MockActualCall& withName(const SimpleString& name) _override; - virtual MockActualCall& withCallOrder(int) _override; + virtual MockActualCall& withCallOrder(unsigned int) _override; virtual MockActualCall& withBoolParameter(const SimpleString& name, bool value) _override; virtual MockActualCall& withIntParameter(const SimpleString& name, int value) _override; virtual MockActualCall& withUnsignedIntParameter(const SimpleString& name, unsigned int value) _override; virtual MockActualCall& withLongIntParameter(const SimpleString& name, long int value) _override; virtual MockActualCall& withUnsignedLongIntParameter(const SimpleString& name, unsigned long int value) _override; + virtual MockActualCall& withLongLongIntParameter(const SimpleString& name, cpputest_longlong value) _override; + virtual MockActualCall& withUnsignedLongLongIntParameter(const SimpleString& name, cpputest_ulonglong value) _override; virtual MockActualCall& withDoubleParameter(const SimpleString& name, double value) _override; virtual MockActualCall& withStringParameter(const SimpleString& name, const char* value) _override; virtual MockActualCall& withPointerParameter(const SimpleString& name, void* value) _override; @@ -181,6 +192,12 @@ virtual long int returnLongIntValue() _override; virtual long int returnLongIntValueOrDefault(long int default_value) _override; + virtual cpputest_ulonglong returnUnsignedLongLongIntValue() _override; + virtual cpputest_ulonglong returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong default_value) _override; + + virtual cpputest_longlong returnLongLongIntValue() _override; + virtual cpputest_longlong returnLongLongIntValueOrDefault(cpputest_longlong default_value) _override; + virtual unsigned int returnUnsignedIntValue() _override; virtual unsigned int returnUnsignedIntValueOrDefault(unsigned int default_value) _override; @@ -204,10 +221,13 @@ const char* getTraceOutput(); void clear(); static MockActualCallTrace& instance(); + static void clearInstance(); private: SimpleString traceBuffer_; + static MockActualCallTrace* instance_; + void addParameterName(const SimpleString& name); }; @@ -215,12 +235,14 @@ { public: virtual MockActualCall& withName(const SimpleString&) _override { return *this;} - virtual MockActualCall& withCallOrder(int) _override { return *this; } + virtual MockActualCall& withCallOrder(unsigned int) _override { return *this; } virtual MockActualCall& withBoolParameter(const SimpleString&, bool) _override { return *this; } virtual MockActualCall& withIntParameter(const SimpleString&, int) _override { return *this; } virtual MockActualCall& withUnsignedIntParameter(const SimpleString&, unsigned int) _override { return *this; } virtual MockActualCall& withLongIntParameter(const SimpleString&, long int) _override { return *this; } virtual MockActualCall& withUnsignedLongIntParameter(const SimpleString&, unsigned long int) _override { return *this; } + virtual MockActualCall& withLongLongIntParameter(const SimpleString&, cpputest_longlong) _override { return *this; } + virtual MockActualCall& withUnsignedLongLongIntParameter(const SimpleString&, cpputest_ulonglong) _override { return *this; } virtual MockActualCall& withDoubleParameter(const SimpleString&, double) _override { return *this; } virtual MockActualCall& withStringParameter(const SimpleString&, const char*) _override { return *this; } virtual MockActualCall& withPointerParameter(const SimpleString& , void*) _override { return *this; } @@ -234,7 +256,7 @@ virtual bool hasReturnValue() _override { return false; } virtual MockNamedValue returnValue() _override { return MockNamedValue(""); } - virtual bool returnBoolValueOrDefault(bool) _override { return false; } + virtual bool returnBoolValueOrDefault(bool value) _override { return value; } virtual bool returnBoolValue() _override { return false; } virtual int returnIntValue() _override { return 0; } @@ -246,6 +268,12 @@ virtual long int returnLongIntValue() _override { return 0; } virtual long int returnLongIntValueOrDefault(long int value) _override { return value; } + virtual cpputest_ulonglong returnUnsignedLongLongIntValue() _override { return 0; } + virtual cpputest_ulonglong returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong value) _override { return value; } + + virtual cpputest_longlong returnLongLongIntValue() _override { return 0; } + virtual cpputest_longlong returnLongLongIntValueOrDefault(cpputest_longlong value) _override { return value; } + virtual unsigned int returnUnsignedIntValue() _override { return 0; } virtual unsigned int returnUnsignedIntValueOrDefault(unsigned int value) _override { return value; } @@ -255,13 +283,13 @@ virtual const char * returnStringValue() _override { return ""; } virtual const char * returnStringValueOrDefault(const char * value) _override { return value; } - virtual void * returnPointerValue() _override { return NULL; } + virtual void * returnPointerValue() _override { return NULLPTR; } virtual void * returnPointerValueOrDefault(void * value) _override { return value; } - virtual const void * returnConstPointerValue() _override { return NULL; } + virtual const void * returnConstPointerValue() _override { return NULLPTR; } virtual const void * returnConstPointerValueOrDefault(const void * value) _override { return value; } - virtual void (*returnFunctionPointerValue())() _override { return NULL; } + virtual void (*returnFunctionPointerValue())() _override { return NULLPTR; } virtual void (*returnFunctionPointerValueOrDefault(void (*value)()))() _override { return value; } virtual MockActualCall& onObject(const void* ) _override { return *this; } diff -Nru cpputest-3.8/include/CppUTestExt/MockCheckedExpectedCall.h cpputest-4.0/include/CppUTestExt/MockCheckedExpectedCall.h --- cpputest-3.8/include/CppUTestExt/MockCheckedExpectedCall.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockCheckedExpectedCall.h 2020-05-26 11:24:07.000000000 +0000 @@ -36,16 +36,21 @@ public: MockCheckedExpectedCall(); - virtual ~MockCheckedExpectedCall(); + MockCheckedExpectedCall(unsigned int numCalls); + virtual ~MockCheckedExpectedCall() _destructor_override; virtual MockExpectedCall& withName(const SimpleString& name) _override; - virtual MockExpectedCall& withCallOrder(int callOrder) _override; + virtual MockExpectedCall& withCallOrder(unsigned int callOrder) _override { return withCallOrder(callOrder, callOrder); } + virtual MockExpectedCall& withCallOrder(unsigned int initialCallOrder, unsigned int finalCallOrder) _override; virtual MockExpectedCall& withBoolParameter(const SimpleString& name, bool value) _override; virtual MockExpectedCall& withIntParameter(const SimpleString& name, int value) _override; virtual MockExpectedCall& withUnsignedIntParameter(const SimpleString& name, unsigned int value) _override; virtual MockExpectedCall& withLongIntParameter(const SimpleString& name, long int value) _override; virtual MockExpectedCall& withUnsignedLongIntParameter(const SimpleString& name, unsigned long int value) _override; + virtual MockExpectedCall& withLongLongIntParameter(const SimpleString& name, cpputest_longlong value) _override; + virtual MockExpectedCall& withUnsignedLongLongIntParameter(const SimpleString& name, cpputest_ulonglong value) _override; virtual MockExpectedCall& withDoubleParameter(const SimpleString& name, double value) _override; + virtual MockExpectedCall& withDoubleParameter(const SimpleString& name, double value, double tolerance) _override; virtual MockExpectedCall& withStringParameter(const SimpleString& name, const char* value) _override; virtual MockExpectedCall& withPointerParameter(const SimpleString& name, void* value) _override; virtual MockExpectedCall& withConstPointerParameter(const SimpleString& name, const void* value) _override; @@ -54,6 +59,7 @@ virtual MockExpectedCall& withParameterOfType(const SimpleString& typeName, const SimpleString& name, const void* value) _override; virtual MockExpectedCall& withOutputParameterReturning(const SimpleString& name, const void* value, size_t size) _override; virtual MockExpectedCall& withOutputParameterOfTypeReturning(const SimpleString& typeName, const SimpleString& name, const void* value) _override; + virtual MockExpectedCall& withUnmodifiedOutputParameter(const SimpleString& name) _override; virtual MockExpectedCall& ignoreOtherParameters() _override; virtual MockExpectedCall& andReturnValue(bool value) _override; @@ -61,6 +67,8 @@ virtual MockExpectedCall& andReturnValue(unsigned int value) _override; virtual MockExpectedCall& andReturnValue(long int value) _override; virtual MockExpectedCall& andReturnValue(unsigned long int value) _override; + virtual MockExpectedCall& andReturnValue(cpputest_longlong value) _override; + virtual MockExpectedCall& andReturnValue(cpputest_ulonglong value) _override; virtual MockExpectedCall& andReturnValue(double value) _override; virtual MockExpectedCall& andReturnValue(const char* value) _override; virtual MockExpectedCall& andReturnValue(void* value) _override; @@ -84,23 +92,25 @@ virtual bool relatesToObject(const void* objectPtr) const; virtual bool isFulfilled(); - virtual bool isFulfilledWithoutIgnoredParameters(); - virtual bool areParametersFulfilled(); - virtual bool areIgnoredParametersFulfilled(); + virtual bool canMatchActualCalls(); + virtual bool isMatchingActualCallAndFinalized(); + virtual bool isMatchingActualCall(); + virtual bool areParametersMatchingActualCall(); virtual bool isOutOfOrder() const; - virtual void callWasMade(int callOrder); + virtual void callWasMade(unsigned int callOrder); virtual void inputParameterWasPassed(const SimpleString& name); virtual void outputParameterWasPassed(const SimpleString& name); - virtual void parametersWereIgnored(); + virtual void finalizeActualCallMatch(); virtual void wasPassedToObject(); - virtual void resetExpectation(); + virtual void resetActualCallMatchingState(); virtual SimpleString callToString(); virtual SimpleString missingParametersToString(); - enum { NOT_CALLED_YET = -1, NO_EXPECTED_CALL_ORDER = -1}; - virtual int getCallOrder() const; + enum { NO_EXPECTED_CALL_ORDER = 0 }; + + virtual unsigned int getActualCallsFulfilled() const; protected: void setName(const SimpleString& name); @@ -113,69 +123,28 @@ { public: MockExpectedFunctionParameter(const SimpleString& name); - void setFulfilled(bool b); - bool isFulfilled() const; + void setMatchesActualCall(bool b); + bool isMatchingActualCall() const; private: - bool fulfilled_; + bool matchesActualCall_; }; MockExpectedFunctionParameter* item(MockNamedValueListNode* node); bool ignoreOtherParameters_; - bool parametersWereIgnored_; - int callOrder_; - int expectedCallOrder_; + bool isActualCallMatchFinalized_; + unsigned int initialExpectedCallOrder_; + unsigned int finalExpectedCallOrder_; bool outOfOrder_; MockNamedValueList* inputParameters_; MockNamedValueList* outputParameters_; MockNamedValue returnValue_; void* objectPtr_; + bool isSpecificObjectExpected_; bool wasPassedToObject_; -}; - -struct MockExpectedCallCompositeNode; -class MockExpectedCallComposite : public MockExpectedCall -{ -public: - MockExpectedCallComposite(); - virtual ~MockExpectedCallComposite(); - - virtual MockExpectedCall& withName(const SimpleString& name) _override; - virtual MockExpectedCall& withCallOrder(int callOrder) _override; - virtual MockExpectedCall& withBoolParameter(const SimpleString& name, bool value) _override; - virtual MockExpectedCall& withIntParameter(const SimpleString& name, int value) _override; - virtual MockExpectedCall& withUnsignedIntParameter(const SimpleString& name, unsigned int value) _override; - virtual MockExpectedCall& withLongIntParameter(const SimpleString& name, long int value) _override; - virtual MockExpectedCall& withUnsignedLongIntParameter(const SimpleString& name, unsigned long int value) _override; - virtual MockExpectedCall& withDoubleParameter(const SimpleString& name, double value) _override; - virtual MockExpectedCall& withStringParameter(const SimpleString& name, const char* value) _override; - virtual MockExpectedCall& withConstPointerParameter(const SimpleString& name, const void* value) _override; - virtual MockExpectedCall& withPointerParameter(const SimpleString& name, void* value) _override; - virtual MockExpectedCall& withFunctionPointerParameter(const SimpleString& name, void (*value)()) _override; - virtual MockExpectedCall& withMemoryBufferParameter(const SimpleString& name, const unsigned char* value, size_t size) _override; - virtual MockExpectedCall& withParameterOfType(const SimpleString& typeName, const SimpleString& name, const void* value) _override; - virtual MockExpectedCall& withOutputParameterReturning(const SimpleString& name, const void* value, size_t size) _override; - virtual MockExpectedCall& withOutputParameterOfTypeReturning(const SimpleString& typeName, const SimpleString& name, const void* value) _override; - virtual MockExpectedCall& ignoreOtherParameters() _override; - - virtual MockExpectedCall& andReturnValue(bool value) _override; - virtual MockExpectedCall& andReturnValue(int value) _override; - virtual MockExpectedCall& andReturnValue(unsigned int value) _override; - virtual MockExpectedCall& andReturnValue(long int value) _override; - virtual MockExpectedCall& andReturnValue(unsigned long int value) _override; - virtual MockExpectedCall& andReturnValue(double value) _override; - virtual MockExpectedCall& andReturnValue(const char* value) _override; - virtual MockExpectedCall& andReturnValue(void* value) _override; - virtual MockExpectedCall& andReturnValue(const void* value) _override; - virtual MockExpectedCall& andReturnValue(void (*value)()) _override; - - virtual MockExpectedCall& onObject(void* objectPtr) _override; - - virtual void add(MockExpectedCall& call); - virtual void clear(); -private: - MockExpectedCallCompositeNode* head_; + unsigned int actualCalls_; + unsigned int expectedCalls_; }; class MockIgnoredExpectedCall: public MockExpectedCall @@ -183,13 +152,17 @@ public: virtual MockExpectedCall& withName(const SimpleString&) _override { return *this;} - virtual MockExpectedCall& withCallOrder(int) _override { return *this; } + virtual MockExpectedCall& withCallOrder(unsigned int) _override { return *this; } + virtual MockExpectedCall& withCallOrder(unsigned int, unsigned int) _override { return *this; } virtual MockExpectedCall& withBoolParameter(const SimpleString&, bool) _override { return *this; } virtual MockExpectedCall& withIntParameter(const SimpleString&, int) _override { return *this; } virtual MockExpectedCall& withUnsignedIntParameter(const SimpleString&, unsigned int) _override{ return *this; } virtual MockExpectedCall& withLongIntParameter(const SimpleString&, long int) _override { return *this; } virtual MockExpectedCall& withUnsignedLongIntParameter(const SimpleString&, unsigned long int) _override { return *this; } + virtual MockExpectedCall& withLongLongIntParameter(const SimpleString&, cpputest_longlong) _override { return *this; } + virtual MockExpectedCall& withUnsignedLongLongIntParameter(const SimpleString&, cpputest_ulonglong) _override { return *this; } virtual MockExpectedCall& withDoubleParameter(const SimpleString&, double) _override { return *this; } + virtual MockExpectedCall& withDoubleParameter(const SimpleString&, double, double) _override { return *this; } virtual MockExpectedCall& withStringParameter(const SimpleString&, const char*) _override { return *this; } virtual MockExpectedCall& withPointerParameter(const SimpleString& , void*) _override { return *this; } virtual MockExpectedCall& withConstPointerParameter(const SimpleString& , const void*) _override { return *this; } @@ -198,6 +171,7 @@ virtual MockExpectedCall& withParameterOfType(const SimpleString&, const SimpleString&, const void*) _override { return *this; } virtual MockExpectedCall& withOutputParameterReturning(const SimpleString&, const void*, size_t) _override { return *this; } virtual MockExpectedCall& withOutputParameterOfTypeReturning(const SimpleString&, const SimpleString&, const void*) _override { return *this; } + virtual MockExpectedCall& withUnmodifiedOutputParameter(const SimpleString&) _override { return *this; } virtual MockExpectedCall& ignoreOtherParameters() _override { return *this;} virtual MockExpectedCall& andReturnValue(bool) _override { return *this; } @@ -205,6 +179,8 @@ virtual MockExpectedCall& andReturnValue(unsigned int) _override { return *this; } virtual MockExpectedCall& andReturnValue(long int) _override { return *this; } virtual MockExpectedCall& andReturnValue(unsigned long int) _override { return *this; } + virtual MockExpectedCall& andReturnValue(cpputest_longlong) _override { return *this; } + virtual MockExpectedCall& andReturnValue(cpputest_ulonglong) _override { return *this; } virtual MockExpectedCall& andReturnValue(double) _override { return *this;} virtual MockExpectedCall& andReturnValue(const char*) _override { return *this; } virtual MockExpectedCall& andReturnValue(void*) _override { return *this; } diff -Nru cpputest-3.8/include/CppUTestExt/MockExpectedCall.h cpputest-4.0/include/CppUTestExt/MockExpectedCall.h --- cpputest-3.8/include/CppUTestExt/MockExpectedCall.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockExpectedCall.h 2020-05-26 11:24:07.000000000 +0000 @@ -28,6 +28,8 @@ #ifndef D_MockExpectedCall_h #define D_MockExpectedCall_h +#include "CppUTest/CppUTestConfig.h" + class MockNamedValue; extern SimpleString StringFrom(const MockNamedValue& parameter); @@ -39,13 +41,17 @@ virtual ~MockExpectedCall(); virtual MockExpectedCall& withName(const SimpleString& name)=0; - virtual MockExpectedCall& withCallOrder(int)=0; + virtual MockExpectedCall& withCallOrder(unsigned int)=0; + virtual MockExpectedCall& withCallOrder(unsigned int, unsigned int)=0; MockExpectedCall& withParameter(const SimpleString& name, bool value) { return withBoolParameter(name, value); } MockExpectedCall& withParameter(const SimpleString& name, int value) { return withIntParameter(name, value); } MockExpectedCall& withParameter(const SimpleString& name, unsigned int value) { return withUnsignedIntParameter(name, value); } MockExpectedCall& withParameter(const SimpleString& name, long int value) { return withLongIntParameter(name, value); } MockExpectedCall& withParameter(const SimpleString& name, unsigned long int value) { return withUnsignedLongIntParameter(name, value); } + MockExpectedCall& withParameter(const SimpleString& name, cpputest_longlong value) { return withLongLongIntParameter(name, value); } + MockExpectedCall& withParameter(const SimpleString& name, cpputest_ulonglong value) { return withUnsignedLongLongIntParameter(name, value); } MockExpectedCall& withParameter(const SimpleString& name, double value) { return withDoubleParameter(name, value); } + MockExpectedCall& withParameter(const SimpleString& name, double value, double tolerance) { return withDoubleParameter(name, value, tolerance); } MockExpectedCall& withParameter(const SimpleString& name, const char* value) { return withStringParameter(name, value); } MockExpectedCall& withParameter(const SimpleString& name, void* value) { return withPointerParameter(name, value); } MockExpectedCall& withParameter(const SimpleString& name, const void* value) { return withConstPointerParameter(name, value); } @@ -54,6 +60,7 @@ virtual MockExpectedCall& withParameterOfType(const SimpleString& typeName, const SimpleString& name, const void* value)=0; virtual MockExpectedCall& withOutputParameterReturning(const SimpleString& name, const void* value, size_t size)=0; virtual MockExpectedCall& withOutputParameterOfTypeReturning(const SimpleString& typeName, const SimpleString& name, const void* value)=0; + virtual MockExpectedCall& withUnmodifiedOutputParameter(const SimpleString& name)=0; virtual MockExpectedCall& ignoreOtherParameters()=0; virtual MockExpectedCall& withBoolParameter(const SimpleString& name, bool value)=0; @@ -61,7 +68,10 @@ virtual MockExpectedCall& withUnsignedIntParameter(const SimpleString& name, unsigned int value)=0; virtual MockExpectedCall& withLongIntParameter(const SimpleString& name, long int value)=0; virtual MockExpectedCall& withUnsignedLongIntParameter(const SimpleString& name, unsigned long int value)=0; + virtual MockExpectedCall& withLongLongIntParameter(const SimpleString& name, cpputest_longlong value)=0; + virtual MockExpectedCall& withUnsignedLongLongIntParameter(const SimpleString& name, cpputest_ulonglong value)=0; virtual MockExpectedCall& withDoubleParameter(const SimpleString& name, double value)=0; + virtual MockExpectedCall& withDoubleParameter(const SimpleString& name, double value, double tolerance)=0; virtual MockExpectedCall& withStringParameter(const SimpleString& name, const char* value)=0; virtual MockExpectedCall& withPointerParameter(const SimpleString& name, void* value)=0; virtual MockExpectedCall& withFunctionPointerParameter(const SimpleString& name, void (*value)())=0; @@ -72,6 +82,8 @@ virtual MockExpectedCall& andReturnValue(unsigned int value)=0; virtual MockExpectedCall& andReturnValue(long int value)=0; virtual MockExpectedCall& andReturnValue(unsigned long int value)=0; + virtual MockExpectedCall& andReturnValue(cpputest_longlong value)=0; + virtual MockExpectedCall& andReturnValue(cpputest_ulonglong value)=0; virtual MockExpectedCall& andReturnValue(double value)=0; virtual MockExpectedCall& andReturnValue(const char* value)=0; virtual MockExpectedCall& andReturnValue(void* value)=0; diff -Nru cpputest-3.8/include/CppUTestExt/MockExpectedCallsList.h cpputest-4.0/include/CppUTestExt/MockExpectedCallsList.h --- cpputest-3.8/include/CppUTestExt/MockExpectedCallsList.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockExpectedCallsList.h 2020-05-26 11:24:07.000000000 +0000 @@ -39,13 +39,12 @@ virtual ~MockExpectedCallsList(); virtual void deleteAllExpectationsAndClearList(); - virtual int size() const; - virtual int amountOfExpectationsFor(const SimpleString& name) const; - virtual int amountOfUnfulfilledExpectations() const; + virtual unsigned int size() const; + virtual unsigned int amountOfActualCallsFulfilledFor(const SimpleString& name) const; + virtual unsigned int amountOfUnfulfilledExpectations() const; virtual bool hasUnfulfilledExpectations() const; - virtual bool hasFulfilledExpectations() const; - virtual bool hasFulfilledExpectationsWithoutIgnoredParameters() const; - virtual bool hasUnfulfilledExpectationsBecauseOfMissingParameters() const; + virtual bool hasFinalizedMatchingExpectations() const; + virtual bool hasUnmatchingExpectationsBecauseOfMissingParameters() const; virtual bool hasExpectationWithName(const SimpleString& name) const; virtual bool hasCallsOutOfOrder() const; virtual bool isEmpty() const; @@ -55,7 +54,7 @@ virtual void addExpectationsRelatedTo(const SimpleString& name, const MockExpectedCallsList& list); virtual void onlyKeepOutOfOrderExpectations(); - virtual void addUnfulfilledExpectations(const MockExpectedCallsList& list); + virtual void addPotentiallyMatchingExpectations(const MockExpectedCallsList& list); virtual void onlyKeepExpectationsRelatedTo(const SimpleString& name); virtual void onlyKeepExpectationsWithInputParameter(const MockNamedValue& parameter); @@ -63,14 +62,13 @@ virtual void onlyKeepExpectationsWithOutputParameter(const MockNamedValue& parameter); virtual void onlyKeepExpectationsWithOutputParameterName(const SimpleString& name); virtual void onlyKeepExpectationsOnObject(const void* objectPtr); - virtual void onlyKeepUnfulfilledExpectations(); + virtual void onlyKeepUnmatchingExpectations(); - virtual MockCheckedExpectedCall* removeOneFulfilledExpectation(); - virtual MockCheckedExpectedCall* removeOneFulfilledExpectationWithIgnoredParameters(); - virtual MockCheckedExpectedCall* getOneFulfilledExpectationWithIgnoredParameters(); + virtual MockCheckedExpectedCall* removeFirstFinalizedMatchingExpectation(); + virtual MockCheckedExpectedCall* removeFirstMatchingExpectation(); + virtual MockCheckedExpectedCall* getFirstMatchingExpectation(); - virtual void resetExpectations(); - virtual void callWasMade(int callOrder); + virtual void resetActualCallMatchingState(); virtual void wasPassedToObject(); virtual void parameterWasPassed(const SimpleString& parameterName); virtual void outputParameterWasPassed(const SimpleString& parameterName); @@ -89,10 +87,9 @@ MockExpectedCallsListNode* next_; MockExpectedCallsListNode(MockCheckedExpectedCall* expectedCall) - : expectedCall_(expectedCall), next_(NULL) {} + : expectedCall_(expectedCall), next_(NULLPTR) {} }; - virtual MockExpectedCallsListNode* findNodeWithCallOrderOf(int callOrder) const; private: MockExpectedCallsListNode* head_; diff -Nru cpputest-3.8/include/CppUTestExt/MockFailure.h cpputest-4.0/include/CppUTestExt/MockFailure.h --- cpputest-3.8/include/CppUTestExt/MockFailure.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockFailure.h 2020-05-26 11:24:07.000000000 +0000 @@ -54,7 +54,7 @@ { public: MockFailure(UtestShell* test); - virtual ~MockFailure(){} + virtual ~MockFailure() _destructor_override {} protected: void addExpectationsAndCallHistory(const MockExpectedCallsList& expectations); void addExpectationsAndCallHistoryRelatedTo(const SimpleString& function, const MockExpectedCallsList& expectations); diff -Nru cpputest-3.8/include/CppUTestExt/MockNamedValue.h cpputest-4.0/include/CppUTestExt/MockNamedValue.h --- cpputest-3.8/include/CppUTestExt/MockNamedValue.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockNamedValue.h 2020-05-26 11:24:07.000000000 +0000 @@ -27,6 +27,9 @@ #ifndef D_MockNamedValue_h #define D_MockNamedValue_h + +#include "CppUTest/CppUTestConfig.h" + /* * MockNamedValueComparator is an interface that needs to be used when creating Comparators. * This is needed when comparing values of non-native type. @@ -106,13 +109,17 @@ virtual void setValue(unsigned int value); virtual void setValue(long int value); virtual void setValue(unsigned long int value); + virtual void setValue(cpputest_longlong value); + virtual void setValue(cpputest_ulonglong value); virtual void setValue(double value); + virtual void setValue(double value, double tolerance); virtual void setValue(void* value); virtual void setValue(const void* value); virtual void setValue(void (*value)()); virtual void setValue(const char* value); virtual void setMemoryBuffer(const unsigned char* value, size_t size); - virtual void setObjectPointer(const SimpleString& type, const void* objectPtr); + virtual void setConstObjectPointer(const SimpleString& type, const void* objectPtr); + virtual void setObjectPointer(const SimpleString& type, void* objectPtr); virtual void setSize(size_t size); virtual void setName(const char* name); @@ -130,19 +137,27 @@ virtual unsigned int getUnsignedIntValue() const; virtual long int getLongIntValue() const; virtual unsigned long int getUnsignedLongIntValue() const; + virtual cpputest_longlong getLongLongIntValue() const; + virtual cpputest_ulonglong getUnsignedLongLongIntValue() const; virtual double getDoubleValue() const; + virtual double getDoubleTolerance() const; virtual const char* getStringValue() const; virtual void* getPointerValue() const; virtual const void* getConstPointerValue() const; virtual void (*getFunctionPointerValue() const)(); virtual const unsigned char* getMemoryBuffer() const; - virtual const void* getObjectPointer() const; + virtual const void* getConstObjectPointer() const; + virtual void* getObjectPointer() const; virtual size_t getSize() const; + virtual MockNamedValueComparator* getComparator() const; virtual MockNamedValueCopier* getCopier() const; static void setDefaultComparatorsAndCopiersRepository(MockNamedValueComparatorsAndCopiersRepository* repository); + static MockNamedValueComparatorsAndCopiersRepository* getDefaultComparatorsAndCopiersRepository(); + + static const double defaultDoubleTolerance; private: SimpleString name_; SimpleString type_; @@ -152,13 +167,23 @@ unsigned int unsignedIntValue_; long int longIntValue_; unsigned long int unsignedLongIntValue_; - double doubleValue_; +#ifdef CPPUTEST_USE_LONG_LONG + cpputest_longlong longLongIntValue_; + cpputest_ulonglong unsignedLongLongIntValue_; +#else + char longLongPlaceholder_[CPPUTEST_SIZE_OF_FAKE_LONG_LONG_TYPE]; +#endif + struct { + double value; + double tolerance; + } doubleValue_; const char* stringValue_; void* pointerValue_; const void* constPointerValue_; void (*functionPointerValue_)(); const unsigned char* memoryBufferValue_; - const void* objectPointerValue_; + const void* constObjectPointerValue_; + void* objectPointerValue_; const void* outputPointerValue_; } value_; size_t size_; diff -Nru cpputest-3.8/include/CppUTestExt/MockSupport_c.h cpputest-4.0/include/CppUTestExt/MockSupport_c.h --- cpputest-3.8/include/CppUTestExt/MockSupport_c.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockSupport_c.h 2020-05-26 11:24:07.000000000 +0000 @@ -32,6 +32,7 @@ extern "C" { #endif +#include "CppUTest/CppUTestConfig.h" #include "CppUTest/StandardCLibrary.h" typedef enum { @@ -40,6 +41,8 @@ MOCKVALUETYPE_INTEGER, MOCKVALUETYPE_LONG_INTEGER, MOCKVALUETYPE_UNSIGNED_LONG_INTEGER, + MOCKVALUETYPE_LONG_LONG_INTEGER, + MOCKVALUETYPE_UNSIGNED_LONG_LONG_INTEGER, MOCKVALUETYPE_DOUBLE, MOCKVALUETYPE_STRING, MOCKVALUETYPE_POINTER, @@ -58,13 +61,20 @@ unsigned int unsignedIntValue; long int longIntValue; unsigned long int unsignedLongIntValue; +#ifdef CPPUTEST_USE_LONG_LONG + cpputest_longlong longLongIntValue; + cpputest_ulonglong unsignedLongLongIntValue; +#else + char longLongPlaceholder[CPPUTEST_SIZE_OF_FAKE_LONG_LONG_TYPE]; +#endif double doubleValue; const char* stringValue; void* pointerValue; const void* constPointerValue; void (*functionPointerValue)(void); const unsigned char* memoryBufferValue; - const void* objectValue; + void* objectValue; + const void* constObjectValue; } value; } MockValue_c; @@ -76,6 +86,8 @@ MockActualCall_c* (*withUnsignedIntParameters)(const char* name, unsigned int value); MockActualCall_c* (*withLongIntParameters)(const char* name, long int value); MockActualCall_c* (*withUnsignedLongIntParameters)(const char* name, unsigned long int value); + MockActualCall_c* (*withLongLongIntParameters)(const char* name, cpputest_longlong value); + MockActualCall_c* (*withUnsignedLongLongIntParameters)(const char* name, cpputest_ulonglong value); MockActualCall_c* (*withDoubleParameters)(const char* name, double value); MockActualCall_c* (*withStringParameters)(const char* name, const char* value); MockActualCall_c* (*withPointerParameters)(const char* name, void* value); @@ -97,6 +109,10 @@ long int (*returnLongIntValueOrDefault)(long int defaultValue); unsigned long int (*unsignedLongIntReturnValue)(void); unsigned long int (*returnUnsignedLongIntValueOrDefault)(unsigned long int defaultValue); + cpputest_longlong (*longLongIntReturnValue)(void); + cpputest_longlong (*returnLongLongIntValueOrDefault)(cpputest_longlong defaultValue); + cpputest_ulonglong (*unsignedLongLongIntReturnValue)(void); + cpputest_ulonglong (*returnUnsignedLongLongIntValueOrDefault)(cpputest_ulonglong defaultValue); const char* (*stringReturnValue)(void); const char* (*returnStringValueOrDefault)(const char * defaultValue); double (*doubleReturnValue)(void); @@ -117,7 +133,10 @@ MockExpectedCall_c* (*withUnsignedIntParameters)(const char* name, unsigned int value); MockExpectedCall_c* (*withLongIntParameters)(const char* name, long int value); MockExpectedCall_c* (*withUnsignedLongIntParameters)(const char* name, unsigned long int value); + MockExpectedCall_c* (*withLongLongIntParameters)(const char* name, cpputest_longlong value); + MockExpectedCall_c* (*withUnsignedLongLongIntParameters)(const char* name, cpputest_ulonglong value); MockExpectedCall_c* (*withDoubleParameters)(const char* name, double value); + MockExpectedCall_c* (*withDoubleParametersAndTolerance)(const char* name, double value, double tolerance); MockExpectedCall_c* (*withStringParameters)(const char* name, const char* value); MockExpectedCall_c* (*withPointerParameters)(const char* name, void* value); MockExpectedCall_c* (*withConstPointerParameters)(const char* name, const void* value); @@ -126,6 +145,7 @@ MockExpectedCall_c* (*withParameterOfType)(const char* type, const char* name, const void* value); MockExpectedCall_c* (*withOutputParameterReturning)(const char* name, const void* value, size_t size); MockExpectedCall_c* (*withOutputParameterOfTypeReturning)(const char* type, const char* name, const void* value); + MockExpectedCall_c* (*withUnmodifiedOutputParameter)(const char* name); MockExpectedCall_c* (*ignoreOtherParameters)(void); MockExpectedCall_c* (*andReturnBoolValue)(int value); @@ -133,6 +153,8 @@ MockExpectedCall_c* (*andReturnIntValue)(int value); MockExpectedCall_c* (*andReturnLongIntValue)(long int value); MockExpectedCall_c* (*andReturnUnsignedLongIntValue)(unsigned long int value); + MockExpectedCall_c* (*andReturnLongLongIntValue)(cpputest_longlong value); + MockExpectedCall_c* (*andReturnUnsignedLongLongIntValue)(cpputest_ulonglong value); MockExpectedCall_c* (*andReturnDoubleValue)(double value); MockExpectedCall_c* (*andReturnStringValue)(const char* value); MockExpectedCall_c* (*andReturnPointerValue)(void* value); @@ -150,7 +172,7 @@ void (*strictOrder)(void); MockExpectedCall_c* (*expectOneCall)(const char* name); void (*expectNoCall)(const char* name); - MockExpectedCall_c* (*expectNCalls)(int number, const char* name); + MockExpectedCall_c* (*expectNCalls)(unsigned int number, const char* name); MockActualCall_c* (*actualCall)(const char* name); int (*hasReturnValue)(void); MockValue_c (*returnValue)(void); @@ -164,6 +186,10 @@ long int (*returnLongIntValueOrDefault)(long int defaultValue); unsigned long int (*unsignedLongIntReturnValue)(void); unsigned long int (*returnUnsignedLongIntValueOrDefault)(unsigned long int defaultValue); + cpputest_longlong (*longLongIntReturnValue)(void); + cpputest_longlong (*returnLongLongIntValueOrDefault)(cpputest_longlong defaultValue); + cpputest_ulonglong (*unsignedLongLongIntReturnValue)(void); + cpputest_ulonglong (*returnUnsignedLongLongIntValueOrDefault)(cpputest_ulonglong defaultValue); const char* (*stringReturnValue)(void); const char* (*returnStringValueOrDefault)(const char * defaultValue); double (*doubleReturnValue)(void); @@ -184,6 +210,7 @@ void (*setConstPointerData) (const char* name, const void* value); void (*setFunctionPointerData) (const char* name, void (*value)(void)); void (*setDataObject) (const char* name, const char* type, void* value); + void (*setDataConstObject) (const char* name, const char* type, const void* value); MockValue_c (*getData)(const char* name); void (*disable)(void); diff -Nru cpputest-3.8/include/CppUTestExt/MockSupport.h cpputest-4.0/include/CppUTestExt/MockSupport.h --- cpputest-3.8/include/CppUTestExt/MockSupport.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockSupport.h 2020-05-26 11:24:07.000000000 +0000 @@ -37,7 +37,7 @@ class MockSupport; /* This allows access to "the global" mocking support for easier testing */ -MockSupport& mock(const SimpleString& mockName = "", MockFailureReporter* failureReporterForThisCall = NULL); +MockSupport& mock(const SimpleString& mockName = "", MockFailureReporter* failureReporterForThisCall = NULLPTR); class MockSupport { @@ -48,7 +48,7 @@ virtual void strictOrder(); virtual MockExpectedCall& expectOneCall(const SimpleString& functionName); virtual void expectNoCall(const SimpleString& functionName); - virtual MockExpectedCall& expectNCalls(int amount, const SimpleString& functionName); + virtual MockExpectedCall& expectNCalls(unsigned int amount, const SimpleString& functionName); virtual MockActualCall& actualCall(const SimpleString& functionName); virtual bool hasReturnValue(); virtual MockNamedValue returnValue(); @@ -61,6 +61,10 @@ virtual long int returnLongIntValueOrDefault(long int defaultValue); virtual unsigned long int unsignedLongIntReturnValue(); virtual unsigned long int returnUnsignedLongIntValueOrDefault(unsigned long int defaultValue); + virtual cpputest_longlong longLongIntReturnValue(); + virtual cpputest_longlong returnLongLongIntValueOrDefault(cpputest_longlong defaultValue); + virtual cpputest_ulonglong unsignedLongLongIntReturnValue(); + virtual cpputest_ulonglong returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong defaultValue); virtual unsigned int returnUnsignedIntValueOrDefault(unsigned int defaultValue); virtual const char* stringReturnValue(); virtual const char* returnStringValueOrDefault(const char * defaultValue); @@ -83,6 +87,7 @@ void setData(const SimpleString& name, const void* value); void setData(const SimpleString& name, void (*value)()); void setDataObject(const SimpleString& name, const SimpleString& type, void* value); + void setDataConstObject(const SimpleString& name, const SimpleString& type, const void* value); MockNamedValue getData(const SimpleString& name); MockSupport* getMockSupportScope(const SimpleString& name); @@ -119,40 +124,37 @@ protected: MockSupport* clone(const SimpleString& mockName); - virtual MockCheckedActualCall *createActualFunctionCall(); + virtual MockCheckedActualCall *createActualCall(); virtual void failTest(MockFailure& failure); void countCheck(); private: - int callOrder_; - int expectedCallOrder_; + unsigned int actualCallOrder_; + unsigned int expectedCallOrder_; bool strictOrdering_; MockFailureReporter *activeReporter_; MockFailureReporter *standardReporter_; MockFailureReporter defaultReporter_; MockExpectedCallsList expectations_; - MockExpectedCallsList unExpectations_; bool ignoreOtherCalls_; bool enabled_; MockCheckedActualCall *lastActualFunctionCall_; - MockExpectedCallComposite compositeCalls_; MockNamedValueComparatorsAndCopiersRepository comparatorsAndCopiersRepository_; MockNamedValueList data_; const SimpleString mockName_; bool tracing_; - void checkExpectationsOfLastCall(); - bool wasLastCallFulfilled(); - void failTestWithUnexpectedCalls(); + void checkExpectationsOfLastActualCall(); + bool wasLastActualCallFulfilled(); + void failTestWithExpectedCallsNotFulfilled(); void failTestWithOutOfOrderCalls(); MockNamedValue* retrieveDataFromStore(const SimpleString& name); MockSupport* getMockSupport(MockNamedValueListNode* node); - bool hasntExpectationWithName(const SimpleString& functionName); - bool hasntUnexpectationWithName(const SimpleString& functionName); + bool callIsIgnored(const SimpleString& functionName); bool hasCallsOutOfOrder(); SimpleString appendScopeToName(const SimpleString& functionName); diff -Nru cpputest-3.8/include/CppUTestExt/MockSupportPlugin.h cpputest-4.0/include/CppUTestExt/MockSupportPlugin.h --- cpputest-3.8/include/CppUTestExt/MockSupportPlugin.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/MockSupportPlugin.h 2020-05-26 11:24:07.000000000 +0000 @@ -35,13 +35,15 @@ { public: MockSupportPlugin(const SimpleString& name = "MockSupportPLugin"); - virtual ~MockSupportPlugin(); + virtual ~MockSupportPlugin() _destructor_override; virtual void preTestAction(UtestShell&, TestResult&) _override; virtual void postTestAction(UtestShell&, TestResult&) _override; virtual void installComparator(const SimpleString& name, MockNamedValueComparator& comparator); virtual void installCopier(const SimpleString& name, MockNamedValueCopier& copier); + + void clear(); private: MockNamedValueComparatorsAndCopiersRepository repository_; }; diff -Nru cpputest-3.8/include/CppUTestExt/OrderedTest.h cpputest-4.0/include/CppUTestExt/OrderedTest.h --- cpputest-3.8/include/CppUTestExt/OrderedTest.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/include/CppUTestExt/OrderedTest.h 2020-05-26 11:24:07.000000000 +0000 @@ -32,7 +32,7 @@ { public: OrderedTestShell(); - virtual ~OrderedTestShell(); + virtual ~OrderedTestShell() _destructor_override; virtual OrderedTestShell* addOrderedTest(OrderedTestShell* test); virtual OrderedTestShell* getNextOrderedTest(); @@ -56,7 +56,7 @@ class OrderedTestInstaller { public: - explicit OrderedTestInstaller(OrderedTestShell& test, const char* groupName, const char* testName, const char* fileName, int lineNumber, int level); + explicit OrderedTestInstaller(OrderedTestShell& test, const char* groupName, const char* testName, const char* fileName, size_t lineNumber, int level); virtual ~OrderedTestInstaller(); private: @@ -78,5 +78,11 @@ static OrderedTestInstaller TEST_##testGroup##_##testName##_Installer(TEST_##testGroup##_##testName##_Instance, #testGroup, #testName, __FILE__,__LINE__, testLevel); \ void TEST_##testGroup##_##testName##_Test::testBody() +#define TEST_ORDERED_C_WRAPPER(group_name, test_name, testLevel) \ + extern "C" void test_##group_name##_##test_name##_wrapper_c(void); \ + TEST_ORDERED(group_name, test_name, testLevel) { \ + test_##group_name##_##test_name##_wrapper_c(); \ + } + #endif diff -Nru cpputest-3.8/INSTALL cpputest-4.0/INSTALL --- cpputest-3.8/INSTALL 2016-05-02 05:35:46.000000000 +0000 +++ cpputest-4.0/INSTALL 2020-05-26 11:27:12.000000000 +0000 @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -Inc. + Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software +Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -12,97 +12,96 @@ Basic Installation ================== - Briefly, the shell command `./configure && make && make install' + Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for +more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented +'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. - The `configure' shell script attempts to guess correct values for + The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you +some point 'config.cache' contains results you don't want to keep, you may remove or edit it. - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. The simplest way to compile this package is: - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. - Running `configure' might take a while. While running, it prints + Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. - 2. Type `make' to compile the package. + 2. Type 'make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with + 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. - 4. Type `make install' to install the programs and any data files and + 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root + user, and only the 'make install' phase executed with root privileges. - 5. Optionally, type `make installcheck' to repeat any self-tests, but + 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required + regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. - 7. Often, you can also type `make uninstall' to remove the installed + 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. - 8. Some packages, particularly those that use Automake, provide `make + 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. + targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' +the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix @@ -113,21 +112,21 @@ You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the +own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. - With a non-GNU `make', it is safer to compile the package for one + With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before +installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ @@ -136,105 +135,104 @@ This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. +using the 'lipo' tool if you have problems. Installation Names ================== - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or +correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without +'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each -affected directory. For example, `make install +affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the package recognizes. - For packages that use the X Window System, `configure' can usually + For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure +execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure +overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. +overridden with 'make V=0'. Particular systems ================== - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. + HP-UX 'make' updates targets which have the same time stamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try ./configure CC="cc" @@ -242,26 +240,26 @@ ./configure CC="cc -nodtk" - On Solaris, don't put `/usr/ucb' early in your `PATH'. This + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== - There may be some features `configure' cannot figure out + There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints +_same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM @@ -270,101 +268,101 @@ OS KERNEL-OS - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will +use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. +eventually be run) with '--host=TYPE'. Sharing Defaults ================ - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run +environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: +them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc -causes the specified `gcc' to be used as the C compiler (unless it is +causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf limitation. Until the limitation is lifted, you can use -this workaround: +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash -`configure' Invocation +'configure' Invocation ====================== - `configure' recognizes the following options to control how it + 'configure' recognizes the following options to control how it operates. -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. -`--help=short' -`--help=recursive' +'--help=short' +'--help=recursive' Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' script, and exit. -`--cache-file=FILE' +'--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to + traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error + suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). -`--srcdir=DIR' +'--srcdir=DIR' Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. + 'configure' can determine that directory automatically. -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. -`--no-create' -`-n' +'--no-create' +'-n' Run the configure checks, but stop before creating any output files. -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff -Nru cpputest-3.8/install-sh cpputest-4.0/install-sh --- cpputest-3.8/install-sh 2016-05-02 05:35:46.000000000 +0000 +++ cpputest-4.0/install-sh 2020-05-26 11:27:12.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-12-25.23; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -271,15 +271,18 @@ fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else dstdir=`dirname "$dst"` @@ -288,6 +291,11 @@ fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then @@ -324,34 +332,43 @@ # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi - rmdir "$tmpdir/d" "$tmpdir" + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; @@ -427,14 +444,25 @@ else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -493,9 +521,9 @@ done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru cpputest-3.8/m4/m4_ax_compiler_vendor.m4 cpputest-4.0/m4/m4_ax_compiler_vendor.m4 --- cpputest-3.8/m4/m4_ax_compiler_vendor.m4 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/m4/m4_ax_compiler_vendor.m4 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,117 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPILER_VENDOR +# +# DESCRIPTION +# +# Determine the vendor of the C, C++ or Fortran compiler. The vendor is +# returned in the cache variable $ax_cv_c_compiler_vendor for C, +# $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for +# (modern) Fortran. The value is one of "intel", "ibm", "pathscale", +# "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "portland" (PGI), "gnu" +# (GCC), "sun" (Oracle Developer Studio), "hp", "dec", "borland", +# "comeau", "kai", "lcc", "sgi", "microsoft", "metrowerks", "watcom", +# "tcc" (Tiny CC) or "unknown" (if the compiler cannot be determined). +# +# To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT +# with an appropriate preprocessor-enabled extension. For example: +# +# AC_LANG_PUSH([Fortran]) +# AC_PROG_FC +# AC_FC_PP_SRCEXT([F]) +# AX_COMPILER_VENDOR +# AC_LANG_POP([Fortran]) +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# Copyright (c) 2018-19 John Zaitseff +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 30 + +AC_DEFUN([AX_COMPILER_VENDOR], [dnl + AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl + dnl If you modify this list of vendors, please add similar support + dnl to ax_compiler_version.m4 if at all possible. + dnl + dnl Note: Do NOT check for GCC first since some other compilers + dnl define __GNUC__ to remain compatible with it. Compilers that + dnl are very slow to start (such as Intel) are listed first. + + vendors=" + intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + sdcc: SDCC,__SDCC + sx: _SX + portland: __PGI + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + tcc: __TINYC__ + unknown: UNKNOWN + " + for ventest in $vendors; do + case $ventest in + *:) + vendor=$ventest + continue + ;; + *) + vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" + ;; + esac + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ +#if !($vencpp) + thisisanerror; +#endif + ]])], [break]) + done + + ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` + ]) +])dnl diff -Nru cpputest-3.8/m4/m4_ax_compiler_version.m4 cpputest-4.0/m4/m4_ax_compiler_version.m4 --- cpputest-3.8/m4/m4_ax_compiler_version.m4 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/m4/m4_ax_compiler_version.m4 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,529 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_compiler_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPILER_VERSION +# +# DESCRIPTION +# +# This macro retrieves the compiler version and returns it in the cache +# variable $ax_cv_c_compiler_version for C and $ax_cv_cxx_compiler_version +# for C++. +# +# Version is returned as epoch:major.minor.patchversion +# +# Epoch is used in order to have an increasing version number in case of +# marketing change. +# +# Epoch use: * borland compiler use chronologically 0turboc for turboc +# era, +# +# 1borlanc BORLANDC++ before 5, 2cppbuilder for cppbuilder era, +# 3borlancpp for return of BORLANDC++ (after version 5.5), +# 4cppbuilder for cppbuilder with year version, +# and 5xe for XE era. +# +# An empty string is returned otherwise. +# +# LICENSE +# +# Copyright (c) 2014 Bastien ROUCARIES +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 12 + +# for intel +AC_DEFUN([_AX_COMPILER_VERSION_INTEL], + [ dnl + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + [__INTEL_COMPILER/100],, + AC_MSG_FAILURE([[[$0]] unknown intel compiler version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + [(__INTEL_COMPILER%100)/10],, + AC_MSG_FAILURE([[[$0]] unknown intel compiler version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [(__INTEL_COMPILER%10)],, + AC_MSG_FAILURE([[[$0]] unknown intel compiler version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# for IBM +AC_DEFUN([_AX_COMPILER_VERSION_IBM], + [ dnl + dnl check between z/OS C/C++ and XL C/C++ + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([], + [ + #if defined(__COMPILER_VER__) + choke me; + #endif + ])], + [ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + [__xlC__/100],, + AC_MSG_FAILURE([[[$0]] unknown IBM compiler major version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + [__xlC__%100],, + AC_MSG_FAILURE([[[$0]] unknown IBM compiler minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [__xlC_ver__/0x100],, + AC_MSG_FAILURE([[[$0]] unknown IBM compiler patch version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_build, + [__xlC_ver__%0x100],, + AC_MSG_FAILURE([[[$0]] unknown IBM compiler build version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_build" + ], + [ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [__xlC__%1000],, + AC_MSG_FAILURE([[[$0]] unknown IBM compiler patch version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + [(__xlC__/10000)%10],, + AC_MSG_FAILURE([[[$0]] unknown IBM compiler minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + [(__xlC__/100000)%10],, + AC_MSG_FAILURE([[[$0]] unknown IBM compiler major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) +]) + +# for pathscale +AC_DEFUN([_AX_COMPILER_VERSION_PATHSCALE],[ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + __PATHCC__,, + AC_MSG_FAILURE([[[$0]] unknown pathscale major])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + __PATHCC_MINOR__,, + AC_MSG_FAILURE([[[$0]] unknown pathscale minor])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [__PATHCC_PATCHLEVEL__],, + AC_MSG_FAILURE([[[$0]] unknown pathscale patch level])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# for clang +AC_DEFUN([_AX_COMPILER_VERSION_CLANG],[ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + __clang_major__,, + AC_MSG_FAILURE([[[$0]] unknown clang major])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + __clang_minor__,, + AC_MSG_FAILURE([[[$0]] unknown clang minor])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [__clang_patchlevel__],,0) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# for crayc +AC_DEFUN([_AX_COMPILER_VERSION_CRAY],[ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + _RELEASE,, + AC_MSG_FAILURE([[[$0]] unknown crayc release])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + _RELEASE_MINOR,, + AC_MSG_FAILURE([[[$0]] unknown crayc minor])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor" + ]) + +# for fujitsu +AC_DEFUN([_AX_COMPILER_VERSION_FUJITSU],[ + AC_COMPUTE_INT(ax_cv_[]_AC_LANG_ABBREV[]_compiler_version, + __FCC_VERSION,, + AC_MSG_FAILURE([[[$0]]unknown fujitsu release])) + ]) + +# for GNU +AC_DEFUN([_AX_COMPILER_VERSION_GNU],[ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + __GNUC__,, + AC_MSG_FAILURE([[[$0]] unknown gcc major])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + __GNUC_MINOR__,, + AC_MSG_FAILURE([[[$0]] unknown gcc minor])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [__GNUC_PATCHLEVEL__],, + AC_MSG_FAILURE([[[$0]] unknown gcc patch level])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# For sun +AC_DEFUN([_AX_COMPILER_VERSION_SUN],[ + m4_define([_AX_COMPILER_VERSION_SUN_NUMBER], + [ + #if defined(__SUNPRO_CC) + __SUNPRO_CC + #else + __SUNPRO_C + #endif + ]) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_until59, + !!(_AX_COMPILER_VERSION_SUN_NUMBER < 0x1000),, + AC_MSG_FAILURE([[[$0]] unknown sun release version])) + AS_IF([test "X$_ax_[]_AC_LANG_ABBREV[]_compiler_version_until59" = X1], + [dnl + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + _AX_COMPILER_VERSION_SUN_NUMBER % 0x10,, + AC_MSG_FAILURE([[[$0]] unknown sun patch version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + (_AX_COMPILER_VERSION_SUN_NUMBER / 0x10) % 0x10,, + AC_MSG_FAILURE([[[$0]] unknown sun minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + (_AX_COMPILER_VERSION_SUN_NUMBER / 0x100),, + AC_MSG_FAILURE([[[$0]] unknown sun major version])) + ], + [dnl + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + _AX_COMPILER_VERSION_SUN_NUMBER % 0x10,, + AC_MSG_FAILURE([[[$0]] unknown sun patch version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + (_AX_COMPILER_VERSION_SUN_NUMBER / 0x100) % 0x100,, + AC_MSG_FAILURE([[[$0]] unknown sun minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + (_AX_COMPILER_VERSION_SUN_NUMBER / 0x1000),, + AC_MSG_FAILURE([[[$0]] unknown sun major version])) + ]) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" +]) + +AC_DEFUN([_AX_COMPILER_VERSION_HP],[ + m4_define([_AX_COMPILER_VERSION_HP_NUMBER], + [ + #if defined(__HP_cc) + __HP_cc + #else + __HP_aCC + #endif + ]) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_untilA0121, + !!(_AX_COMPILER_VERSION_HP_NUMBER <= 1),, + AC_MSG_FAILURE([[[$0]] unknown hp release version])) + AS_IF([test "X$_ax_[]_AC_LANG_ABBREV[]_compiler_version_untilA0121" = X1], + [dnl By default output last version with this behavior. + dnl it is so old + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="01.21.00" + ], + [dnl + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + (_AX_COMPILER_VERSION_HP_NUMBER % 100),, + AC_MSG_FAILURE([[[$0]] unknown hp release version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + ((_AX_COMPILER_VERSION_HP_NUMBER / 100)%100),, + AC_MSG_FAILURE([[[$0]] unknown hp minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + ((_AX_COMPILER_VERSION_HP_NUMBER / 10000)%100),, + AC_MSG_FAILURE([[[$0]] unknown hp major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) +]) + +AC_DEFUN([_AX_COMPILER_VERSION_DEC],[dnl + m4_define([_AX_COMPILER_VERSION_DEC_NUMBER], + [ + #if defined(__DECC_VER) + __DECC_VER + #else + __DECCXX_VER + #endif + ]) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + (_AX_COMPILER_VERSION_DEC_NUMBER % 10000),, + AC_MSG_FAILURE([[[$0]] unknown dec release version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + ((_AX_COMPILER_VERSION_DEC_NUMBER / 100000UL)%100),, + AC_MSG_FAILURE([[[$0]] unknown dec minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + ((_AX_COMPILER_VERSION_DEC_NUMBER / 10000000UL)%100),, + AC_MSG_FAILURE([[[$0]] unknown dec major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# borland +AC_DEFUN([_AX_COMPILER_VERSION_BORLAND],[dnl + m4_define([_AX_COMPILER_VERSION_TURBOC_NUMBER], + [ + #if defined(__TURBOC__) + __TURBOC__ + #else + choke me + #endif + ]) + m4_define([_AX_COMPILER_VERSION_BORLANDC_NUMBER], + [ + #if defined(__BORLANDC__) + __BORLANDC__ + #else + __CODEGEARC__ + #endif + ]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM(, + _AX_COMPILER_VERSION_TURBOC_NUMBER)], + [dnl TURBOC + AC_COMPUTE_INT( + _ax_[]_AC_LANG_ABBREV[]_compiler_version_turboc_raw, + _AX_COMPILER_VERSION_TURBOC_NUMBER,, + AC_MSG_FAILURE([[[$0]] unknown turboc version])) + AS_IF( + [test $_ax_[]_AC_LANG_ABBREV[]_compiler_version_turboc_raw -lt 661 || test $_ax_[]_AC_LANG_ABBREV[]_compiler_version_turboc_raw -gt 1023], + [dnl compute normal version + AC_COMPUTE_INT( + _ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + _AX_COMPILER_VERSION_TURBOC_NUMBER % 0x100,, + AC_MSG_FAILURE([[[$0]] unknown turboc minor version])) + AC_COMPUTE_INT( + _ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + (_AX_COMPILER_VERSION_TURBOC_NUMBER/0x100)%0x100,, + AC_MSG_FAILURE([[[$0]] unknown turboc major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="0turboc:$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor"], + [dnl special version + AS_CASE([$_ax_[]_AC_LANG_ABBREV[]_compiler_version_turboc_raw], + [661],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="0turboc:1.00"], + [662],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="0turboc:1.01"], + [663],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="0turboc:2.00"], + [ + AC_MSG_WARN([[[$0]] unknown turboc version between 0x295 and 0x400 please report bug]) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="" + ]) + ]) + ], + # borlandc + [ + AC_COMPUTE_INT( + _ax_[]_AC_LANG_ABBREV[]_compiler_version_borlandc_raw, + _AX_COMPILER_VERSION_BORLANDC_NUMBER,, + AC_MSG_FAILURE([[[$0]] unknown borlandc version])) + AS_CASE([$_ax_[]_AC_LANG_ABBREV[]_compiler_version_borlandc_raw], + dnl BORLANDC++ before 5.5 + [512] ,[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:2.00"], + [1024],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:3.00"], + [1024],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:3.00"], + [1040],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:3.1"], + [1106],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:4.0"], + [1280],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:5.0"], + [1312],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:5.02"], + dnl C++ Builder era + [1328],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="2cppbuilder:3.0"], + [1344],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="2cppbuilder:4.0"], + dnl BORLANDC++ after 5.5 + [1360],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="3borlancpp:5.5"], + [1361],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="3borlancpp:5.51"], + [1378],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="3borlancpp:5.6.4"], + dnl C++ Builder with year number + [1392],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="4cppbuilder:2006"], + [1424],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="4cppbuilder:2007"], + [1555],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="4cppbuilder:2009"], + [1569],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="4cppbuilder:2010"], + dnl XE version + [1584],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="5xe"], + [1600],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="5xe:2"], + [1616],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="5xe:3"], + [1632],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="5xe:4"], + [ + AC_MSG_WARN([[[$0]] Unknown borlandc compiler version $_ax_[]_AC_LANG_ABBREV[]_compiler_version_borlandc_raw please report bug]) + ]) + ]) + ]) + +# COMO +AC_DEFUN([_AX_COMPILER_VERSION_COMEAU], + [ dnl + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + [__COMO_VERSION__%100],, + AC_MSG_FAILURE([[[$0]] unknown comeau compiler minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + [(__COMO_VERSION__/100)%10],, + AC_MSG_FAILURE([[[$0]] unknown comeau compiler major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor" + ]) + +# KAI +AC_DEFUN([_AX_COMPILER_VERSION_KAI],[ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [__KCC_VERSION%100],, + AC_MSG_FAILURE([[[$0]] unknown kay compiler patch version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + [(__KCC_VERSION/100)%10],, + AC_MSG_FAILURE([[[$0]] unknown kay compiler minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + [(__KCC_VERSION/1000)%10],, + AC_MSG_FAILURE([[[$0]] unknown kay compiler major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +dnl LCC +dnl LCC does not output version... + +# SGI +AC_DEFUN([_AX_COMPILER_VERSION_SGI],[ + m4_define([_AX_COMPILER_VERSION_SGI_NUMBER], + [ + #if defined(_COMPILER_VERSION) + _COMPILER_VERSION + #else + _SGI_COMPILER_VERSION + #endif + ]) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [_AX_COMPILER_VERSION_SGI_NUMBER%10],, + AC_MSG_FAILURE([[[$0]] unknown SGI compiler patch version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + [(_AX_COMPILER_VERSION_SGI_NUMBER/10)%10],, + AC_MSG_FAILURE([[[$0]] unknown SGI compiler minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + [(_AX_COMPILER_VERSION_SGI_NUMBER/100)%10],, + AC_MSG_FAILURE([[[$0]] unknown SGI compiler major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# microsoft +AC_DEFUN([_AX_COMPILER_VERSION_MICROSOFT],[ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + _MSC_VER%100,, + AC_MSG_FAILURE([[[$0]] unknown microsoft compiler minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + (_MSC_VER/100)%100,, + AC_MSG_FAILURE([[[$0]] unknown microsoft compiler major version])) + dnl could be overridden + _ax_[]_AC_LANG_ABBREV[]_compiler_version_patch=0 + _ax_[]_AC_LANG_ABBREV[]_compiler_version_build=0 + # special case for version 6 + AS_IF([test "X$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major" = "X12"], + [AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + _MSC_FULL_VER%1000,, + _ax_[]_AC_LANG_ABBREV[]_compiler_version_patch=0)]) + # for version 7 + AS_IF([test "X$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major" = "X13"], + [AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + _MSC_FULL_VER%1000,, + AC_MSG_FAILURE([[[$0]] unknown microsoft compiler patch version])) + ]) + # for version > 8 + AS_IF([test $_ax_[]_AC_LANG_ABBREV[]_compiler_version_major -ge 14], + [AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + _MSC_FULL_VER%10000,, + AC_MSG_FAILURE([[[$0]] unknown microsoft compiler patch version])) + ]) + AS_IF([test $_ax_[]_AC_LANG_ABBREV[]_compiler_version_major -ge 15], + [AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_build, + _MSC_BUILD,, + AC_MSG_FAILURE([[[$0]] unknown microsoft compiler build version])) + ]) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_build" + ]) + +# for metrowerks +AC_DEFUN([_AX_COMPILER_VERSION_METROWERKS],[dnl + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + __MWERKS__%0x100,, + AC_MSG_FAILURE([[[$0]] unknown metrowerks compiler patch version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + (__MWERKS__/0x100)%0x10,, + AC_MSG_FAILURE([[[$0]] unknown metrowerks compiler minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + (__MWERKS__/0x1000)%0x10,, + AC_MSG_FAILURE([[[$0]] unknown metrowerks compiler major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# for watcom +AC_DEFUN([_AX_COMPILER_VERSION_WATCOM],[dnl + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + __WATCOMC__%100,, + AC_MSG_FAILURE([[[$0]] unknown watcom compiler minor version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + (__WATCOMC__/100)%100,, + AC_MSG_FAILURE([[[$0]] unknown watcom compiler major version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor" + ]) + +# for PGI +AC_DEFUN([_AX_COMPILER_VERSION_PORTLAND],[ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + __PGIC__,, + AC_MSG_FAILURE([[[$0]] unknown pgi major])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + __PGIC_MINOR__,, + AC_MSG_FAILURE([[[$0]] unknown pgi minor])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [__PGIC_PATCHLEVEL__],, + AC_MSG_FAILURE([[[$0]] unknown pgi patch level])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# tcc +AC_DEFUN([_AX_COMPILER_VERSION_TCC],[ + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version=[`tcc -v | $SED 's/^[ ]*tcc[ ]\+version[ ]\+\([0-9.]\+\).*/\1/g'`] + ]) + +# for GNU +AC_DEFUN([_AX_COMPILER_VERSION_SDCC],[ + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + /* avoid parse error with comments */ + #if(defined(__SDCC_VERSION_MAJOR)) + __SDCC_VERSION_MAJOR + #else + SDCC/100 + #endif + ,, + AC_MSG_FAILURE([[[$0]] unknown sdcc major])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + /* avoid parse error with comments */ + #if(defined(__SDCC_VERSION_MINOR)) + __SDCC_VERSION_MINOR + #else + (SDCC%100)/10 + #endif + ,, + AC_MSG_FAILURE([[[$0]] unknown sdcc minor])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [ + /* avoid parse error with comments */ + #if(defined(__SDCC_VERSION_PATCH)) + __SDCC_VERSION_PATCH + #elsif(defined(_SDCC_VERSION_PATCHLEVEL)) + __SDCC_VERSION_PATCHLEVEL + #else + SDCC%10 + #endif + ],, + AC_MSG_FAILURE([[[$0]] unknown sdcc patch level])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) + +# main entry point +AC_DEFUN([AX_COMPILER_VERSION],[dnl + AC_REQUIRE([AX_COMPILER_VENDOR]) + AC_REQUIRE([AC_PROG_SED]) + AC_CACHE_CHECK([for _AC_LANG compiler version], + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version, + [ dnl + AS_CASE([$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor], + [intel],[_AX_COMPILER_VERSION_INTEL], + [ibm],[_AX_COMPILER_VERSION_IBM], + [pathscale],[_AX_COMPILER_VERSION_PATHSCALE], + [clang],[_AX_COMPILER_VERSION_CLANG], + [cray],[_AX_COMPILER_VERSION_CRAY], + [fujitsu],[_AX_COMPILER_VERSION_FUJITSU], + [gnu],[_AX_COMPILER_VERSION_GNU], + [sun],[_AX_COMPILER_VERSION_SUN], + [hp],[_AX_COMPILER_VERSION_HP], + [dec],[_AX_COMPILER_VERSION_DEC], + [borland],[_AX_COMPILER_VERSION_BORLAND], + [comeau],[_AX_COMPILER_VERSION_COMEAU], + [kai],[_AX_COMPILER_VERSION_KAI], + [sgi],[_AX_COMPILER_VERSION_SGI], + [microsoft],[_AX_COMPILER_VERSION_MICROSOFT], + [metrowerks],[_AX_COMPILER_VERSION_METROWERKS], + [watcom],[_AX_COMPILER_VERSION_WATCOM], + [portland],[_AX_COMPILER_VERSION_PORTLAND], + [tcc],[_AX_COMPILER_VERSION_TCC], + [sdcc],[_AX_COMPILER_VERSION_SDCC], + [ax_cv_[]_AC_LANG_ABBREV[]_compiler_version=""]) + ]) +]) diff -Nru cpputest-3.8/makeAndRun.bat cpputest-4.0/makeAndRun.bat --- cpputest-3.8/makeAndRun.bat 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/makeAndRun.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -rem **** -rem * for this command line build to work independent of where it was created -rem * -rem * Generate Project/Export Makefiles -rem * -rem * then do these edits to the generated files -rem * CppUTest.dep - change the relitive path to ....\program files to \program files -rem * AllTests.mak - At the end of the makefile where the depended upon CppUTest is made -rem* Change cd "\absolute\path\CppUTest" to cd .. -PATH=C:\Program Files\Microsoft Visual Studio\VC98\Bin;%PATH% -rem nmake /f CppUTest.mak CFG="CppUTest - Win32 Debug" all -cd tests -nmake /f AllTests.mak all -cd Debug -AllTests -v -cd ..\.. diff -Nru cpputest-3.8/Makefile.am cpputest-4.0/Makefile.am --- cpputest-3.8/Makefile.am 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/Makefile.am 2020-05-26 11:24:07.000000000 +0000 @@ -24,6 +24,21 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = cpputest.pc +cmakemodulesdir = $(libdir)/CppUTest/cmake/Modules +cmakemodules_DATA = \ + cmake/Modules/CppUTestBuildTimeDiscoverTests.cmake + +cmakescriptsdir = $(libdir)/CppUTest/cmake/Scripts +cmakescripts_DATA = \ + cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake + +cmakedir = $(libdir)/CppUTest/cmake +cmake_DATA = \ + build/cmake_package_files/CppUTestConfig.cmake \ + build/cmake_package_files/CppUTestConfigVersion.cmake \ + build/cmake_package_files/CppUTestTargets-relwithdebinfo.cmake \ + build/cmake_package_files/CppUTestTargets.cmake + EXTRA_DIST = \ cpputest.pc.in \ $(ALL_FILES_IN_GIT) @@ -39,6 +54,7 @@ src/CppUTest/MemoryLeakDetector.cpp \ src/CppUTest/MemoryLeakWarningPlugin.cpp \ src/CppUTest/SimpleString.cpp \ + src/CppUTest/SimpleStringInternalCache.cpp \ src/CppUTest/SimpleMutex.cpp \ src/CppUTest/TeamCityTestOutput.cpp \ src/CppUTest/TestFailure.cpp \ @@ -67,6 +83,7 @@ include/CppUTest/PlatformSpecificFunctions.h \ include/CppUTest/PlatformSpecificFunctions_c.h \ include/CppUTest/SimpleString.h \ + include/CppUTest/SimpleStringInternalCache.h \ include/CppUTest/SimpleMutex.h \ include/CppUTest/StandardCLibrary.h \ include/CppUTest/TeamCityTestOutput.h \ @@ -90,6 +107,7 @@ lib_libCppUTestExt_a_SOURCES = \ src/CppUTestExt/CodeMemoryReportFormatter.cpp \ + src/CppUTestExt/GTest.cpp \ src/CppUTestExt/IEEE754ExceptionsPlugin.cpp \ src/CppUTestExt/MemoryReportAllocator.cpp \ src/CppUTestExt/MemoryReporterPlugin.cpp \ @@ -108,8 +126,10 @@ include_cpputestextdir = $(includedir)/CppUTestExt include_cpputestext_HEADERS = \ + include/CppUTestExt/CodeMemoryReportFormatter.h \ include/CppUTestExt/GMock.h \ include/CppUTestExt/GTest.h \ + include/CppUTestExt/GTestSupport.h \ include/CppUTestExt/GTestConvertor.h \ include/CppUTestExt/IEEE754ExceptionsPlugin.h \ include/CppUTestExt/MemoryReportAllocator.h \ @@ -136,38 +156,41 @@ CppUTestTests_LDFLAGS = $(AM_LDFLAGS) $(CPPUTEST_LDFLAGS) $(CPPUTEST_ADDITIONAL_LDFLAGS) CppUTestTests_SOURCES = \ - tests/AllocationInCFile.c \ - tests/AllocationInCppFile.cpp \ - tests/AllocLetTestFree.c \ - tests/AllocLetTestFreeTest.cpp \ - tests/AllTests.cpp \ - tests/CheatSheetTest.cpp \ - tests/CommandLineArgumentsTest.cpp \ - tests/CommandLineTestRunnerTest.cpp \ - tests/JUnitOutputTest.cpp \ - tests/MemoryLeakDetectorTest.cpp \ - tests/MemoryOperatorOverloadTest.cpp \ - tests/MemoryLeakWarningTest.cpp \ - tests/PluginTest.cpp \ - tests/PreprocessorTest.cpp \ - tests/SetPluginTest.cpp \ - tests/SimpleStringTest.cpp \ - tests/SimpleMutexTest.cpp \ - tests/TeamCityOutputTest.cpp \ - tests/TestFailureNaNTest.cpp \ - tests/TestFailureTest.cpp \ - tests/TestFilterTest.cpp \ - tests/TestHarness_cTest.cpp \ - tests/TestHarness_cTestCFile.c \ - tests/TestInstallerTest.cpp \ - tests/TestMemoryAllocatorTest.cpp \ - tests/TestOutputTest.cpp \ - tests/TestRegistryTest.cpp \ - tests/TestResultTest.cpp \ - tests/TestUTestMacro.cpp \ - tests/TestUTestStringMacro.cpp \ - tests/UtestTest.cpp \ - tests/UtestPlatformTest.cpp + tests/CppUTest/AllocationInCFile.c \ + tests/CppUTest/AllocationInCppFile.cpp \ + tests/CppUTest/AllocLetTestFree.c \ + tests/CppUTest/AllocLetTestFreeTest.cpp \ + tests/CppUTest/AllTests.cpp \ + tests/CppUTest/CheatSheetTest.cpp \ + tests/CppUTest/CompatabilityTests.cpp \ + tests/CppUTest/CommandLineArgumentsTest.cpp \ + tests/CppUTest/CommandLineTestRunnerTest.cpp \ + tests/CppUTest/DummyMemoryLeakDetector.cpp \ + tests/CppUTest/JUnitOutputTest.cpp \ + tests/CppUTest/MemoryLeakDetectorTest.cpp \ + tests/CppUTest/MemoryOperatorOverloadTest.cpp \ + tests/CppUTest/MemoryLeakWarningTest.cpp \ + tests/CppUTest/PluginTest.cpp \ + tests/CppUTest/PreprocessorTest.cpp \ + tests/CppUTest/SetPluginTest.cpp \ + tests/CppUTest/SimpleStringTest.cpp \ + tests/CppUTest/SimpleStringCacheTest.cpp \ + tests/CppUTest/SimpleMutexTest.cpp \ + tests/CppUTest/TeamCityOutputTest.cpp \ + tests/CppUTest/TestFailureNaNTest.cpp \ + tests/CppUTest/TestFailureTest.cpp \ + tests/CppUTest/TestFilterTest.cpp \ + tests/CppUTest/TestHarness_cTest.cpp \ + tests/CppUTest/TestHarness_cTestCFile.c \ + tests/CppUTest/TestInstallerTest.cpp \ + tests/CppUTest/TestMemoryAllocatorTest.cpp \ + tests/CppUTest/TestOutputTest.cpp \ + tests/CppUTest/TestRegistryTest.cpp \ + tests/CppUTest/TestResultTest.cpp \ + tests/CppUTest/TestUTestMacro.cpp \ + tests/CppUTest/TestUTestStringMacro.cpp \ + tests/CppUTest/UtestTest.cpp \ + tests/CppUTest/UtestPlatformTest.cpp CppUTestExtTests_CPPFLAGS = $(lib_libCppUTestExt_a_CPPFLAGS) CppUTestExtTests_CFLAGS = $(lib_libCppUTestExt_a_CFLAGS) @@ -203,7 +226,9 @@ tests/CppUTestExt/MockSupport_cTestCFile.c \ tests/CppUTestExt/MockStrictOrderTest.cpp \ tests/CppUTestExt/MockReturnValueTest.cpp \ - tests/CppUTestExt/OrderedTestTest.cpp + tests/CppUTestExt/OrderedTestTest.cpp \ + tests/CppUTestExt/OrderedTestTest_c.c \ + tests/CppUTestExt/MockFakeLongLong.cpp DISTCLEANFILES = \ filename.map.txt \ @@ -235,45 +260,64 @@ ./$(CPPUTESTEXT_TESTS) endif +cpputest_build_gtest18: + mkdir -p cpputest_build_gtest18 + cd cpputest_build_gtest18; \ + wget https://github.com/google/googletest/archive/release-1.8.0.zip -O gtest-1.8.0.zip && unzip gtest-1.8.0.zip; \ + cd googletest-release-1.8.0; cmake .; make + cpputest_build_gtest17: mkdir -p cpputest_build_gtest17 cd cpputest_build_gtest17; \ - wget https://googlemock.googlecode.com/files/gmock-1.7.0.zip && unzip gmock-1.7.0.zip - cd cpputest_build_gtest17/gmock-1.7.0; ./configure && make check + wget https://github.com/google/googletest/archive/release-1.7.0.zip -O gtest-1.7.0.zip && unzip gtest-1.7.0.zip; \ + wget https://github.com/google/googlemock/archive/release-1.7.0.zip -O gmock-1.7.0.zip && unzip gmock-1.7.0.zip; \ + mv googletest-release-1.7.0 googlemock-release-1.7.0/gtest; \ + cd googlemock-release-1.7.0; autoreconf -i; ./configure && make cpputest_build_gtest16: mkdir -p cpputest_build_gtest16 cd cpputest_build_gtest16; \ - wget https://googlemock.googlecode.com/files/gmock-1.6.0.zip && unzip gmock-1.6.0.zip - cd cpputest_build_gtest16/gmock-1.6.0; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make check + wget https://github.com/google/googletest/archive/release-1.6.0.zip -O gtest-1.6.0.zip && unzip gtest-1.6.0.zip; \ + wget https://github.com/google/googlemock/archive/release-1.6.0.zip -O gmock-1.6.0.zip && unzip gmock-1.6.0.zip; \ + mv googletest-release-1.6.0 googlemock-release-1.6.0/gtest; \ + cd googlemock-release-1.6.0; autoreconf -i; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make cpputest_build_gtest15: mkdir -p cpputest_build_gtest15 cd cpputest_build_gtest15; \ - wget https://googlemock.googlecode.com/files/gmock-1.5.0.zip && unzip gmock-1.5.0.zip - cd cpputest_build_gtest15/gmock-1.5.0; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make + wget https://github.com/google/googletest/archive/release-1.5.0.zip -O gtest-1.5.0.zip && unzip gtest-1.5.0.zip; \ + wget https://github.com/google/googlemock/archive/release-1.5.0.zip -O gmock-1.5.0.zip && unzip gmock-1.5.0.zip; \ + mv googletest-release-1.5.0 googlemock-release-1.5.0/gtest; \ + cd googlemock-release-1.5.0; autoreconf -i; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make check_gtest15: cpputest_build_gtest15 @echo "Build using gmock 1.5"; - export GMOCK_HOME=`pwd`/cpputest_build_gtest15/gmock-1.5.0; \ - make distclean; $(srcdir)/configure; make check + export GMOCK_HOME=`pwd`/cpputest_build_gtest15/googlemock-release-1.5.0; \ + make distclean; $(srcdir)/configure --enable-std-cpp98; make check check_gtest16: cpputest_build_gtest16 @echo "Build using gmock 1.6"; - export GMOCK_HOME=`pwd`/cpputest_build_gtest16/gmock-1.6.0; \ - make distclean; $(srcdir)/configure; make check + export GMOCK_HOME=`pwd`/cpputest_build_gtest16/googlemock-release-1.6.0; \ + make distclean; $(srcdir)/configure --enable-std-cpp98; make check check_gtest17: cpputest_build_gtest17 @echo "Build using gmock 1.7" - export GMOCK_HOME=`pwd`/cpputest_build_gtest17/gmock-1.7.0; \ - make distclean; $(srcdir)/configure; make check + export GMOCK_HOME=`pwd`/cpputest_build_gtest17/googlemock-release-1.7.0; \ + make distclean; $(srcdir)/configure --enable-std-cpp98; make check + +check_gtest18: cpputest_build_gtest18 + @echo "Build using gmock 1.8" + export GMOCK_HOME=`pwd`/cpputest_build_gtest18/googletest-release-1.8.0/googlemock; \ + export GTEST_HOME=`pwd`/cpputest_build_gtest18/googletest-release-1.8.0/googletest; \ + make distclean; $(srcdir)/configure --enable-std-cpp98; make check remove_gtest_directories: rm -rf cpputest_build_gtest15 rm -rf cpputest_build_gtest16 rm -rf cpputest_build_gtest17 + rm -rf cpputest_build_gtest18 -check_gtest: remove_gtest_directories check_gtest15 check_gtest16 check_gtest17 +check_gtest: remove_gtest_directories check_gtest15 check_gtest16 check_gtest17 check_gtest18 check_basic: @echo "If dash is available, run the configure with dash to find bash-isms and increase portability" @@ -287,9 +331,21 @@ @echo "Building without extensions" make distclean; $(srcdir)/configure --disable-extensions; make check + @echo "Building with the Std C++ 98 turned on. Compiler acts differently then." + make distclean; $(srcdir)/configure --enable-std-cpp98; make + @echo "Building with the Std C++ 11 turned on. Compiler acts differently then." make distclean; $(srcdir)/configure --enable-std-cpp11; make + @echo "Building with the Std C++ 14 turned on. Compiler acts differently then." + make distclean; $(srcdir)/configure --enable-std-cpp14; make + + @echo "Building with the Std C++ 17 turned on. Compiler acts differently then." + make distclean; $(srcdir)/configure --enable-std-cpp17; make + + @echo "Building with the Std C++ 20 turned on. Compiler acts differently then." + make distclean; $(srcdir)/configure --enable-std-cpp20; make + @echo "Building without the Standard C library" make distclean; $(srcdir)/configure --disable-std-c; make @@ -299,6 +355,9 @@ @echo "Building without memory leak detection" make distclean; $(srcdir)/configure --disable-memory-leak-detection; make check + @echo "Building with address sanitizer" + make distclean; $(srcdir)/configure --enable-sanitize-address; make check + @echo "Building without memory leak detection and without Standard C++" make distclean; $(srcdir)/configure --disable-memory-leak-detection --disable-std-cpp; make check diff -Nru cpputest-3.8/Makefile.in cpputest-4.0/Makefile.in --- cpputest-3.8/Makefile.in 2016-05-25 05:42:34.000000000 +0000 +++ cpputest-4.0/Makefile.in 2020-05-27 11:04:21.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -100,6 +100,8 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/m4_ax_compiler_vendor.m4 \ + $(top_srcdir)/m4/m4_ax_compiler_version.m4 \ $(top_srcdir)/m4/m4_ax_prefix_config_h.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -113,6 +115,9 @@ CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = cpputest.pc CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = CppUTestTests$(EXEEXT) +am__EXEEXT_2 = CppUTestExtTests$(EXEEXT) +@INCLUDE_CPPUTEST_EXT_TRUE@am__EXEEXT_3 = $(am__EXEEXT_2) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -140,8 +145,9 @@ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(include_cpputestdir)" \ +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cmakedir)" \ + "$(DESTDIR)$(cmakemodulesdir)" "$(DESTDIR)$(cmakescriptsdir)" \ + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(include_cpputestdir)" \ "$(DESTDIR)$(include_cpputestextdir)" LIBRARIES = $(lib_LIBRARIES) ARFLAGS = cru @@ -159,6 +165,7 @@ src/CppUTest/lib_libCppUTest_a-MemoryLeakDetector.$(OBJEXT) \ src/CppUTest/lib_libCppUTest_a-MemoryLeakWarningPlugin.$(OBJEXT) \ src/CppUTest/lib_libCppUTest_a-SimpleString.$(OBJEXT) \ + src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.$(OBJEXT) \ src/CppUTest/lib_libCppUTest_a-SimpleMutex.$(OBJEXT) \ src/CppUTest/lib_libCppUTest_a-TeamCityTestOutput.$(OBJEXT) \ src/CppUTest/lib_libCppUTest_a-TestFailure.$(OBJEXT) \ @@ -176,6 +183,7 @@ lib_libCppUTestExt_a_AR = $(AR) $(ARFLAGS) lib_libCppUTestExt_a_LIBADD = am_lib_libCppUTestExt_a_OBJECTS = src/CppUTestExt/lib_libCppUTestExt_a-CodeMemoryReportFormatter.$(OBJEXT) \ + src/CppUTestExt/lib_libCppUTestExt_a-GTest.$(OBJEXT) \ src/CppUTestExt/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.$(OBJEXT) \ src/CppUTestExt/lib_libCppUTestExt_a-MemoryReportAllocator.$(OBJEXT) \ src/CppUTestExt/lib_libCppUTestExt_a-MemoryReporterPlugin.$(OBJEXT) \ @@ -190,9 +198,6 @@ src/CppUTestExt/lib_libCppUTestExt_a-MockSupport_c.$(OBJEXT) \ src/CppUTestExt/lib_libCppUTestExt_a-OrderedTest.$(OBJEXT) lib_libCppUTestExt_a_OBJECTS = $(am_lib_libCppUTestExt_a_OBJECTS) -am__EXEEXT_1 = CppUTestTests$(EXEEXT) -am__EXEEXT_2 = CppUTestExtTests$(EXEEXT) -@INCLUDE_CPPUTEST_EXT_TRUE@am__EXEEXT_3 = $(am__EXEEXT_2) am_CppUTestExtTests_OBJECTS = \ tests/CppUTestExt/CppUTestExtTests-AllTests.$(OBJEXT) \ tests/CppUTestExt/CppUTestExtTests-CodeMemoryReporterTest.$(OBJEXT) \ @@ -221,7 +226,9 @@ tests/CppUTestExt/CppUTestExtTests-MockSupport_cTestCFile.$(OBJEXT) \ tests/CppUTestExt/CppUTestExtTests-MockStrictOrderTest.$(OBJEXT) \ tests/CppUTestExt/CppUTestExtTests-MockReturnValueTest.$(OBJEXT) \ - tests/CppUTestExt/CppUTestExtTests-OrderedTestTest.$(OBJEXT) + tests/CppUTestExt/CppUTestExtTests-OrderedTestTest.$(OBJEXT) \ + tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.$(OBJEXT) \ + tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.$(OBJEXT) CppUTestExtTests_OBJECTS = $(am_CppUTestExtTests_OBJECTS) am__DEPENDENCIES_1 = CppUTestExtTests_DEPENDENCIES = lib/libCppUTestExt.a lib/libCppUTest.a \ @@ -235,38 +242,41 @@ $(CppUTestExtTests_CXXFLAGS) $(CXXFLAGS) \ $(CppUTestExtTests_LDFLAGS) $(LDFLAGS) -o $@ am_CppUTestTests_OBJECTS = \ - tests/CppUTestTests-AllocationInCFile.$(OBJEXT) \ - tests/CppUTestTests-AllocationInCppFile.$(OBJEXT) \ - tests/CppUTestTests-AllocLetTestFree.$(OBJEXT) \ - tests/CppUTestTests-AllocLetTestFreeTest.$(OBJEXT) \ - tests/CppUTestTests-AllTests.$(OBJEXT) \ - tests/CppUTestTests-CheatSheetTest.$(OBJEXT) \ - tests/CppUTestTests-CommandLineArgumentsTest.$(OBJEXT) \ - tests/CppUTestTests-CommandLineTestRunnerTest.$(OBJEXT) \ - tests/CppUTestTests-JUnitOutputTest.$(OBJEXT) \ - tests/CppUTestTests-MemoryLeakDetectorTest.$(OBJEXT) \ - tests/CppUTestTests-MemoryOperatorOverloadTest.$(OBJEXT) \ - tests/CppUTestTests-MemoryLeakWarningTest.$(OBJEXT) \ - tests/CppUTestTests-PluginTest.$(OBJEXT) \ - tests/CppUTestTests-PreprocessorTest.$(OBJEXT) \ - tests/CppUTestTests-SetPluginTest.$(OBJEXT) \ - tests/CppUTestTests-SimpleStringTest.$(OBJEXT) \ - tests/CppUTestTests-SimpleMutexTest.$(OBJEXT) \ - tests/CppUTestTests-TeamCityOutputTest.$(OBJEXT) \ - tests/CppUTestTests-TestFailureNaNTest.$(OBJEXT) \ - tests/CppUTestTests-TestFailureTest.$(OBJEXT) \ - tests/CppUTestTests-TestFilterTest.$(OBJEXT) \ - tests/CppUTestTests-TestHarness_cTest.$(OBJEXT) \ - tests/CppUTestTests-TestHarness_cTestCFile.$(OBJEXT) \ - tests/CppUTestTests-TestInstallerTest.$(OBJEXT) \ - tests/CppUTestTests-TestMemoryAllocatorTest.$(OBJEXT) \ - tests/CppUTestTests-TestOutputTest.$(OBJEXT) \ - tests/CppUTestTests-TestRegistryTest.$(OBJEXT) \ - tests/CppUTestTests-TestResultTest.$(OBJEXT) \ - tests/CppUTestTests-TestUTestMacro.$(OBJEXT) \ - tests/CppUTestTests-TestUTestStringMacro.$(OBJEXT) \ - tests/CppUTestTests-UtestTest.$(OBJEXT) \ - tests/CppUTestTests-UtestPlatformTest.$(OBJEXT) + tests/CppUTest/CppUTestTests-AllocationInCFile.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-AllocationInCppFile.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-AllocLetTestFree.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-AllTests.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-CheatSheetTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-CompatabilityTests.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-JUnitOutputTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-PluginTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-PreprocessorTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-SetPluginTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-SimpleStringTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-SimpleStringCacheTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-SimpleMutexTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TeamCityOutputTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestFailureNaNTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestFailureTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestFilterTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestHarness_cTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestInstallerTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestOutputTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestRegistryTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestResultTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestUTestMacro.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-TestUTestStringMacro.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-UtestTest.$(OBJEXT) \ + tests/CppUTest/CppUTestTests-UtestPlatformTest.$(OBJEXT) CppUTestTests_OBJECTS = $(am_CppUTestTests_OBJECTS) CppUTestTests_DEPENDENCIES = lib/libCppUTest.a $(am__DEPENDENCIES_1) CppUTestTests_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ @@ -287,7 +297,107 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineArguments.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineTestRunner.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-JUnitTestOutput.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakDetector.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakWarningPlugin.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleMutex.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleString.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TeamCityTestOutput.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFailure.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFilter.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestHarness_c.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestMemoryAllocator.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestOutput.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestPlugin.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestRegistry.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestResult.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestTestingFixture.Po \ + src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-Utest.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-CodeMemoryReportFormatter.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportAllocator.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportFormatter.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReporterPlugin.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockActualCall.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCall.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCallsList.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockFailure.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockNamedValue.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupportPlugin.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport_c.Po \ + src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-OrderedTest.Po \ + src/Platforms/@CPP_PLATFORM@/$(DEPDIR)/lib_libCppUTest_a-UtestPlatform.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po \ + tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-AllTests.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-CodeMemoryReporterTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-ExpectedFunctionsListTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GMockTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest1Test.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest2ConvertorTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest_c.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportAllocatorTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportFormatterTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReporterPluginTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockActualCallTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCallTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCheatSheetTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockComparatorCopierTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockExpectedCallTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureReporterForTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockHierarchyTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockNamedValueTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockParameterTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockPluginTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockReturnValueTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockStrictOrderTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupportTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTestCFile.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest.Po \ + tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -335,9 +445,12 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -DATA = $(pkgconfig_DATA) -am__include_cpputestext_HEADERS_DIST = include/CppUTestExt/GMock.h \ - include/CppUTestExt/GTest.h \ +DATA = $(cmake_DATA) $(cmakemodules_DATA) $(cmakescripts_DATA) \ + $(pkgconfig_DATA) +am__include_cpputestext_HEADERS_DIST = \ + include/CppUTestExt/CodeMemoryReportFormatter.h \ + include/CppUTestExt/GMock.h include/CppUTestExt/GTest.h \ + include/CppUTestExt/GTestSupport.h \ include/CppUTestExt/GTestConvertor.h \ include/CppUTestExt/IEEE754ExceptionsPlugin.h \ include/CppUTestExt/MemoryReportAllocator.h \ @@ -355,8 +468,8 @@ include/CppUTestExt/MockSupport_c.h \ include/CppUTestExt/OrderedTest.h HEADERS = $(include_cpputest_HEADERS) $(include_cpputestext_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -727,6 +840,21 @@ TESTS = $(check_PROGRAMS) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = cpputest.pc +cmakemodulesdir = $(libdir)/CppUTest/cmake/Modules +cmakemodules_DATA = \ + cmake/Modules/CppUTestBuildTimeDiscoverTests.cmake + +cmakescriptsdir = $(libdir)/CppUTest/cmake/Scripts +cmakescripts_DATA = \ + cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake + +cmakedir = $(libdir)/CppUTest/cmake +cmake_DATA = \ + build/cmake_package_files/CppUTestConfig.cmake \ + build/cmake_package_files/CppUTestConfigVersion.cmake \ + build/cmake_package_files/CppUTestTargets-relwithdebinfo.cmake \ + build/cmake_package_files/CppUTestTargets.cmake + EXTRA_DIST = \ cpputest.pc.in \ $(ALL_FILES_IN_GIT) @@ -741,6 +869,7 @@ src/CppUTest/MemoryLeakDetector.cpp \ src/CppUTest/MemoryLeakWarningPlugin.cpp \ src/CppUTest/SimpleString.cpp \ + src/CppUTest/SimpleStringInternalCache.cpp \ src/CppUTest/SimpleMutex.cpp \ src/CppUTest/TeamCityTestOutput.cpp \ src/CppUTest/TestFailure.cpp \ @@ -768,6 +897,7 @@ include/CppUTest/PlatformSpecificFunctions.h \ include/CppUTest/PlatformSpecificFunctions_c.h \ include/CppUTest/SimpleString.h \ + include/CppUTest/SimpleStringInternalCache.h \ include/CppUTest/SimpleMutex.h \ include/CppUTest/StandardCLibrary.h \ include/CppUTest/TeamCityTestOutput.h \ @@ -790,6 +920,7 @@ lib_libCppUTestExt_a_CXXFLAGS = $(lib_libCppUTest_a_CXXFLAGS) lib_libCppUTestExt_a_SOURCES = \ src/CppUTestExt/CodeMemoryReportFormatter.cpp \ + src/CppUTestExt/GTest.cpp \ src/CppUTestExt/IEEE754ExceptionsPlugin.cpp \ src/CppUTestExt/MemoryReportAllocator.cpp \ src/CppUTestExt/MemoryReporterPlugin.cpp \ @@ -806,8 +937,10 @@ @INCLUDE_CPPUTEST_EXT_TRUE@include_cpputestextdir = $(includedir)/CppUTestExt @INCLUDE_CPPUTEST_EXT_TRUE@include_cpputestext_HEADERS = \ +@INCLUDE_CPPUTEST_EXT_TRUE@ include/CppUTestExt/CodeMemoryReportFormatter.h \ @INCLUDE_CPPUTEST_EXT_TRUE@ include/CppUTestExt/GMock.h \ @INCLUDE_CPPUTEST_EXT_TRUE@ include/CppUTestExt/GTest.h \ +@INCLUDE_CPPUTEST_EXT_TRUE@ include/CppUTestExt/GTestSupport.h \ @INCLUDE_CPPUTEST_EXT_TRUE@ include/CppUTestExt/GTestConvertor.h \ @INCLUDE_CPPUTEST_EXT_TRUE@ include/CppUTestExt/IEEE754ExceptionsPlugin.h \ @INCLUDE_CPPUTEST_EXT_TRUE@ include/CppUTestExt/MemoryReportAllocator.h \ @@ -831,38 +964,41 @@ CppUTestTests_LDADD = lib/libCppUTest.a $(CPPUTEST_LDADD) CppUTestTests_LDFLAGS = $(AM_LDFLAGS) $(CPPUTEST_LDFLAGS) $(CPPUTEST_ADDITIONAL_LDFLAGS) CppUTestTests_SOURCES = \ - tests/AllocationInCFile.c \ - tests/AllocationInCppFile.cpp \ - tests/AllocLetTestFree.c \ - tests/AllocLetTestFreeTest.cpp \ - tests/AllTests.cpp \ - tests/CheatSheetTest.cpp \ - tests/CommandLineArgumentsTest.cpp \ - tests/CommandLineTestRunnerTest.cpp \ - tests/JUnitOutputTest.cpp \ - tests/MemoryLeakDetectorTest.cpp \ - tests/MemoryOperatorOverloadTest.cpp \ - tests/MemoryLeakWarningTest.cpp \ - tests/PluginTest.cpp \ - tests/PreprocessorTest.cpp \ - tests/SetPluginTest.cpp \ - tests/SimpleStringTest.cpp \ - tests/SimpleMutexTest.cpp \ - tests/TeamCityOutputTest.cpp \ - tests/TestFailureNaNTest.cpp \ - tests/TestFailureTest.cpp \ - tests/TestFilterTest.cpp \ - tests/TestHarness_cTest.cpp \ - tests/TestHarness_cTestCFile.c \ - tests/TestInstallerTest.cpp \ - tests/TestMemoryAllocatorTest.cpp \ - tests/TestOutputTest.cpp \ - tests/TestRegistryTest.cpp \ - tests/TestResultTest.cpp \ - tests/TestUTestMacro.cpp \ - tests/TestUTestStringMacro.cpp \ - tests/UtestTest.cpp \ - tests/UtestPlatformTest.cpp + tests/CppUTest/AllocationInCFile.c \ + tests/CppUTest/AllocationInCppFile.cpp \ + tests/CppUTest/AllocLetTestFree.c \ + tests/CppUTest/AllocLetTestFreeTest.cpp \ + tests/CppUTest/AllTests.cpp \ + tests/CppUTest/CheatSheetTest.cpp \ + tests/CppUTest/CompatabilityTests.cpp \ + tests/CppUTest/CommandLineArgumentsTest.cpp \ + tests/CppUTest/CommandLineTestRunnerTest.cpp \ + tests/CppUTest/DummyMemoryLeakDetector.cpp \ + tests/CppUTest/JUnitOutputTest.cpp \ + tests/CppUTest/MemoryLeakDetectorTest.cpp \ + tests/CppUTest/MemoryOperatorOverloadTest.cpp \ + tests/CppUTest/MemoryLeakWarningTest.cpp \ + tests/CppUTest/PluginTest.cpp \ + tests/CppUTest/PreprocessorTest.cpp \ + tests/CppUTest/SetPluginTest.cpp \ + tests/CppUTest/SimpleStringTest.cpp \ + tests/CppUTest/SimpleStringCacheTest.cpp \ + tests/CppUTest/SimpleMutexTest.cpp \ + tests/CppUTest/TeamCityOutputTest.cpp \ + tests/CppUTest/TestFailureNaNTest.cpp \ + tests/CppUTest/TestFailureTest.cpp \ + tests/CppUTest/TestFilterTest.cpp \ + tests/CppUTest/TestHarness_cTest.cpp \ + tests/CppUTest/TestHarness_cTestCFile.c \ + tests/CppUTest/TestInstallerTest.cpp \ + tests/CppUTest/TestMemoryAllocatorTest.cpp \ + tests/CppUTest/TestOutputTest.cpp \ + tests/CppUTest/TestRegistryTest.cpp \ + tests/CppUTest/TestResultTest.cpp \ + tests/CppUTest/TestUTestMacro.cpp \ + tests/CppUTest/TestUTestStringMacro.cpp \ + tests/CppUTest/UtestTest.cpp \ + tests/CppUTest/UtestPlatformTest.cpp CppUTestExtTests_CPPFLAGS = $(lib_libCppUTestExt_a_CPPFLAGS) CppUTestExtTests_CFLAGS = $(lib_libCppUTestExt_a_CFLAGS) @@ -897,7 +1033,9 @@ tests/CppUTestExt/MockSupport_cTestCFile.c \ tests/CppUTestExt/MockStrictOrderTest.cpp \ tests/CppUTestExt/MockReturnValueTest.cpp \ - tests/CppUTestExt/OrderedTestTest.cpp + tests/CppUTestExt/OrderedTestTest.cpp \ + tests/CppUTestExt/OrderedTestTest_c.c \ + tests/CppUTestExt/MockFakeLongLong.cpp DISTCLEANFILES = \ filename.map.txt \ @@ -941,8 +1079,8 @@ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -970,6 +1108,15 @@ -rm -f config.h stamp-h1 cpputest.pc: $(top_builddir)/config.status $(srcdir)/cpputest.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ @@ -1025,6 +1172,9 @@ src/CppUTest/lib_libCppUTest_a-SimpleString.$(OBJEXT): \ src/CppUTest/$(am__dirstamp) \ src/CppUTest/$(DEPDIR)/$(am__dirstamp) +src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.$(OBJEXT): \ + src/CppUTest/$(am__dirstamp) \ + src/CppUTest/$(DEPDIR)/$(am__dirstamp) src/CppUTest/lib_libCppUTest_a-SimpleMutex.$(OBJEXT): \ src/CppUTest/$(am__dirstamp) \ src/CppUTest/$(DEPDIR)/$(am__dirstamp) @@ -1087,6 +1237,9 @@ src/CppUTestExt/lib_libCppUTestExt_a-CodeMemoryReportFormatter.$(OBJEXT): \ src/CppUTestExt/$(am__dirstamp) \ src/CppUTestExt/$(DEPDIR)/$(am__dirstamp) +src/CppUTestExt/lib_libCppUTestExt_a-GTest.$(OBJEXT): \ + src/CppUTestExt/$(am__dirstamp) \ + src/CppUTestExt/$(DEPDIR)/$(am__dirstamp) src/CppUTestExt/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.$(OBJEXT): \ src/CppUTestExt/$(am__dirstamp) \ src/CppUTestExt/$(DEPDIR)/$(am__dirstamp) @@ -1131,15 +1284,6 @@ $(AM_V_at)-rm -f lib/libCppUTestExt.a $(AM_V_AR)$(lib_libCppUTestExt_a_AR) lib/libCppUTestExt.a $(lib_libCppUTestExt_a_OBJECTS) $(lib_libCppUTestExt_a_LIBADD) $(AM_V_at)$(RANLIB) lib/libCppUTestExt.a - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list tests/CppUTestExt/$(am__dirstamp): @$(MKDIR_P) tests/CppUTestExt @: > tests/CppUTestExt/$(am__dirstamp) @@ -1230,80 +1374,127 @@ tests/CppUTestExt/CppUTestExtTests-OrderedTestTest.$(OBJEXT): \ tests/CppUTestExt/$(am__dirstamp) \ tests/CppUTestExt/$(DEPDIR)/$(am__dirstamp) +tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.$(OBJEXT): \ + tests/CppUTestExt/$(am__dirstamp) \ + tests/CppUTestExt/$(DEPDIR)/$(am__dirstamp) +tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.$(OBJEXT): \ + tests/CppUTestExt/$(am__dirstamp) \ + tests/CppUTestExt/$(DEPDIR)/$(am__dirstamp) CppUTestExtTests$(EXEEXT): $(CppUTestExtTests_OBJECTS) $(CppUTestExtTests_DEPENDENCIES) $(EXTRA_CppUTestExtTests_DEPENDENCIES) @rm -f CppUTestExtTests$(EXEEXT) $(AM_V_CXXLD)$(CppUTestExtTests_LINK) $(CppUTestExtTests_OBJECTS) $(CppUTestExtTests_LDADD) $(LIBS) -tests/$(am__dirstamp): - @$(MKDIR_P) tests - @: > tests/$(am__dirstamp) -tests/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) tests/$(DEPDIR) - @: > tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-AllocationInCFile.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-AllocationInCppFile.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-AllocLetTestFree.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-AllocLetTestFreeTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-AllTests.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-CheatSheetTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-CommandLineArgumentsTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-CommandLineTestRunnerTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-JUnitOutputTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-MemoryLeakDetectorTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-MemoryOperatorOverloadTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-MemoryLeakWarningTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-PluginTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-PreprocessorTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-SetPluginTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-SimpleStringTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-SimpleMutexTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TeamCityOutputTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestFailureNaNTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestFailureTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestFilterTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestHarness_cTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestHarness_cTestCFile.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestInstallerTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestMemoryAllocatorTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestOutputTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestRegistryTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestResultTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestUTestMacro.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-TestUTestStringMacro.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-UtestTest.$(OBJEXT): tests/$(am__dirstamp) \ - tests/$(DEPDIR)/$(am__dirstamp) -tests/CppUTestTests-UtestPlatformTest.$(OBJEXT): \ - tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/$(am__dirstamp): + @$(MKDIR_P) tests/CppUTest + @: > tests/CppUTest/$(am__dirstamp) +tests/CppUTest/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) tests/CppUTest/$(DEPDIR) + @: > tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-AllocationInCFile.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-AllocationInCppFile.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-AllocLetTestFree.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-AllTests.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-CheatSheetTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-CompatabilityTests.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-JUnitOutputTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-PluginTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-PreprocessorTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-SetPluginTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-SimpleStringTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-SimpleStringCacheTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-SimpleMutexTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TeamCityOutputTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestFailureNaNTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestFailureTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestFilterTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestHarness_cTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestInstallerTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestOutputTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestRegistryTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestResultTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestUTestMacro.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-TestUTestStringMacro.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-UtestTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) +tests/CppUTest/CppUTestTests-UtestPlatformTest.$(OBJEXT): \ + tests/CppUTest/$(am__dirstamp) \ + tests/CppUTest/$(DEPDIR)/$(am__dirstamp) CppUTestTests$(EXEEXT): $(CppUTestTests_OBJECTS) $(CppUTestTests_DEPENDENCIES) $(EXTRA_CppUTestTests_DEPENDENCIES) @rm -f CppUTestTests$(EXEEXT) @@ -1314,105 +1505,118 @@ -rm -f src/CppUTest/*.$(OBJEXT) -rm -f src/CppUTestExt/*.$(OBJEXT) -rm -f src/Platforms/@CPP_PLATFORM@/*.$(OBJEXT) - -rm -f tests/*.$(OBJEXT) + -rm -f tests/CppUTest/*.$(OBJEXT) -rm -f tests/CppUTestExt/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineArguments.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineTestRunner.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-JUnitTestOutput.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakDetector.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakWarningPlugin.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleMutex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleString.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TeamCityTestOutput.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFailure.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFilter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestHarness_c.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestMemoryAllocator.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestOutput.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestPlugin.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestRegistry.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestResult.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestTestingFixture.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-Utest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-CodeMemoryReportFormatter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportAllocator.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportFormatter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReporterPlugin.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockActualCall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCallsList.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockFailure.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockNamedValue.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupportPlugin.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport_c.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-OrderedTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/Platforms/@CPP_PLATFORM@/$(DEPDIR)/lib_libCppUTest_a-UtestPlatform.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-AllTests.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-PluginTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-SetPluginTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestFailureTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestFilterTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestOutputTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestResultTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/CppUTestTests-UtestTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-AllTests.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-CodeMemoryReporterTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-ExpectedFunctionsListTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GMockTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest1Test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest2ConvertorTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest_c.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportAllocatorTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportFormatterTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReporterPluginTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockActualCallTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCallTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCheatSheetTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockComparatorCopierTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockExpectedCallTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureReporterForTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockHierarchyTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockNamedValueTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockParameterTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockPluginTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockReturnValueTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockStrictOrderTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupportTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTestCFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineArguments.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineTestRunner.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-JUnitTestOutput.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakDetector.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakWarningPlugin.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleMutex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleString.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TeamCityTestOutput.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFailure.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFilter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestHarness_c.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestMemoryAllocator.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestOutput.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestPlugin.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestRegistry.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestResult.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestTestingFixture.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-Utest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-CodeMemoryReportFormatter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportAllocator.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportFormatter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReporterPlugin.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockActualCall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCallsList.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockFailure.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockNamedValue.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupportPlugin.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport_c.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-OrderedTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/Platforms/@CPP_PLATFORM@/$(DEPDIR)/lib_libCppUTest_a-UtestPlatform.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-AllTests.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-CodeMemoryReporterTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-ExpectedFunctionsListTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GMockTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest1Test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest2ConvertorTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest_c.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportAllocatorTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportFormatterTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReporterPluginTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockActualCallTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCallTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCheatSheetTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockComparatorCopierTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockExpectedCallTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureReporterForTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockHierarchyTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockNamedValueTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockParameterTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockPluginTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockReturnValueTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockStrictOrderTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupportTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTestCFile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -1466,47 +1670,61 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestExt/CppUTestExtTests-MockSupport_cTestCFile.obj `if test -f 'tests/CppUTestExt/MockSupport_cTestCFile.c'; then $(CYGPATH_W) 'tests/CppUTestExt/MockSupport_cTestCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTestExt/MockSupport_cTestCFile.c'; fi` -tests/CppUTestTests-AllocationInCFile.o: tests/AllocationInCFile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTestTests-AllocationInCFile.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllocationInCFile.Tpo -c -o tests/CppUTestTests-AllocationInCFile.o `test -f 'tests/AllocationInCFile.c' || echo '$(srcdir)/'`tests/AllocationInCFile.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllocationInCFile.Tpo tests/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/AllocationInCFile.c' object='tests/CppUTestTests-AllocationInCFile.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.o: tests/CppUTestExt/OrderedTestTest_c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CFLAGS) $(CFLAGS) -MT tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.o -MD -MP -MF tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Tpo -c -o tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.o `test -f 'tests/CppUTestExt/OrderedTestTest_c.c' || echo '$(srcdir)/'`tests/CppUTestExt/OrderedTestTest_c.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Tpo tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/CppUTestExt/OrderedTestTest_c.c' object='tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.o `test -f 'tests/CppUTestExt/OrderedTestTest_c.c' || echo '$(srcdir)/'`tests/CppUTestExt/OrderedTestTest_c.c + +tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.obj: tests/CppUTestExt/OrderedTestTest_c.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CFLAGS) $(CFLAGS) -MT tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.obj -MD -MP -MF tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Tpo -c -o tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.obj `if test -f 'tests/CppUTestExt/OrderedTestTest_c.c'; then $(CYGPATH_W) 'tests/CppUTestExt/OrderedTestTest_c.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTestExt/OrderedTestTest_c.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Tpo tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/CppUTestExt/OrderedTestTest_c.c' object='tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestTests-AllocationInCFile.o `test -f 'tests/AllocationInCFile.c' || echo '$(srcdir)/'`tests/AllocationInCFile.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestExt/CppUTestExtTests-OrderedTestTest_c.obj `if test -f 'tests/CppUTestExt/OrderedTestTest_c.c'; then $(CYGPATH_W) 'tests/CppUTestExt/OrderedTestTest_c.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTestExt/OrderedTestTest_c.c'; fi` -tests/CppUTestTests-AllocationInCFile.obj: tests/AllocationInCFile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTestTests-AllocationInCFile.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllocationInCFile.Tpo -c -o tests/CppUTestTests-AllocationInCFile.obj `if test -f 'tests/AllocationInCFile.c'; then $(CYGPATH_W) 'tests/AllocationInCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/AllocationInCFile.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllocationInCFile.Tpo tests/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/AllocationInCFile.c' object='tests/CppUTestTests-AllocationInCFile.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-AllocationInCFile.o: tests/CppUTest/AllocationInCFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTest/CppUTestTests-AllocationInCFile.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Tpo -c -o tests/CppUTest/CppUTestTests-AllocationInCFile.o `test -f 'tests/CppUTest/AllocationInCFile.c' || echo '$(srcdir)/'`tests/CppUTest/AllocationInCFile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/CppUTest/AllocationInCFile.c' object='tests/CppUTest/CppUTestTests-AllocationInCFile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestTests-AllocationInCFile.obj `if test -f 'tests/AllocationInCFile.c'; then $(CYGPATH_W) 'tests/AllocationInCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/AllocationInCFile.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTest/CppUTestTests-AllocationInCFile.o `test -f 'tests/CppUTest/AllocationInCFile.c' || echo '$(srcdir)/'`tests/CppUTest/AllocationInCFile.c -tests/CppUTestTests-AllocLetTestFree.o: tests/AllocLetTestFree.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTestTests-AllocLetTestFree.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Tpo -c -o tests/CppUTestTests-AllocLetTestFree.o `test -f 'tests/AllocLetTestFree.c' || echo '$(srcdir)/'`tests/AllocLetTestFree.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Tpo tests/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/AllocLetTestFree.c' object='tests/CppUTestTests-AllocLetTestFree.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-AllocationInCFile.obj: tests/CppUTest/AllocationInCFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTest/CppUTestTests-AllocationInCFile.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Tpo -c -o tests/CppUTest/CppUTestTests-AllocationInCFile.obj `if test -f 'tests/CppUTest/AllocationInCFile.c'; then $(CYGPATH_W) 'tests/CppUTest/AllocationInCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllocationInCFile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/CppUTest/AllocationInCFile.c' object='tests/CppUTest/CppUTestTests-AllocationInCFile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestTests-AllocLetTestFree.o `test -f 'tests/AllocLetTestFree.c' || echo '$(srcdir)/'`tests/AllocLetTestFree.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTest/CppUTestTests-AllocationInCFile.obj `if test -f 'tests/CppUTest/AllocationInCFile.c'; then $(CYGPATH_W) 'tests/CppUTest/AllocationInCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllocationInCFile.c'; fi` -tests/CppUTestTests-AllocLetTestFree.obj: tests/AllocLetTestFree.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTestTests-AllocLetTestFree.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Tpo -c -o tests/CppUTestTests-AllocLetTestFree.obj `if test -f 'tests/AllocLetTestFree.c'; then $(CYGPATH_W) 'tests/AllocLetTestFree.c'; else $(CYGPATH_W) '$(srcdir)/tests/AllocLetTestFree.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Tpo tests/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/AllocLetTestFree.c' object='tests/CppUTestTests-AllocLetTestFree.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-AllocLetTestFree.o: tests/CppUTest/AllocLetTestFree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTest/CppUTestTests-AllocLetTestFree.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Tpo -c -o tests/CppUTest/CppUTestTests-AllocLetTestFree.o `test -f 'tests/CppUTest/AllocLetTestFree.c' || echo '$(srcdir)/'`tests/CppUTest/AllocLetTestFree.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/CppUTest/AllocLetTestFree.c' object='tests/CppUTest/CppUTestTests-AllocLetTestFree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestTests-AllocLetTestFree.obj `if test -f 'tests/AllocLetTestFree.c'; then $(CYGPATH_W) 'tests/AllocLetTestFree.c'; else $(CYGPATH_W) '$(srcdir)/tests/AllocLetTestFree.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTest/CppUTestTests-AllocLetTestFree.o `test -f 'tests/CppUTest/AllocLetTestFree.c' || echo '$(srcdir)/'`tests/CppUTest/AllocLetTestFree.c -tests/CppUTestTests-TestHarness_cTestCFile.o: tests/TestHarness_cTestCFile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTestTests-TestHarness_cTestCFile.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Tpo -c -o tests/CppUTestTests-TestHarness_cTestCFile.o `test -f 'tests/TestHarness_cTestCFile.c' || echo '$(srcdir)/'`tests/TestHarness_cTestCFile.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Tpo tests/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/TestHarness_cTestCFile.c' object='tests/CppUTestTests-TestHarness_cTestCFile.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-AllocLetTestFree.obj: tests/CppUTest/AllocLetTestFree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTest/CppUTestTests-AllocLetTestFree.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Tpo -c -o tests/CppUTest/CppUTestTests-AllocLetTestFree.obj `if test -f 'tests/CppUTest/AllocLetTestFree.c'; then $(CYGPATH_W) 'tests/CppUTest/AllocLetTestFree.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllocLetTestFree.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/CppUTest/AllocLetTestFree.c' object='tests/CppUTest/CppUTestTests-AllocLetTestFree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestTests-TestHarness_cTestCFile.o `test -f 'tests/TestHarness_cTestCFile.c' || echo '$(srcdir)/'`tests/TestHarness_cTestCFile.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTest/CppUTestTests-AllocLetTestFree.obj `if test -f 'tests/CppUTest/AllocLetTestFree.c'; then $(CYGPATH_W) 'tests/CppUTest/AllocLetTestFree.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllocLetTestFree.c'; fi` -tests/CppUTestTests-TestHarness_cTestCFile.obj: tests/TestHarness_cTestCFile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTestTests-TestHarness_cTestCFile.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Tpo -c -o tests/CppUTestTests-TestHarness_cTestCFile.obj `if test -f 'tests/TestHarness_cTestCFile.c'; then $(CYGPATH_W) 'tests/TestHarness_cTestCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/TestHarness_cTestCFile.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Tpo tests/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/TestHarness_cTestCFile.c' object='tests/CppUTestTests-TestHarness_cTestCFile.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.o: tests/CppUTest/TestHarness_cTestCFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Tpo -c -o tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.o `test -f 'tests/CppUTest/TestHarness_cTestCFile.c' || echo '$(srcdir)/'`tests/CppUTest/TestHarness_cTestCFile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/CppUTest/TestHarness_cTestCFile.c' object='tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTestTests-TestHarness_cTestCFile.obj `if test -f 'tests/TestHarness_cTestCFile.c'; then $(CYGPATH_W) 'tests/TestHarness_cTestCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/TestHarness_cTestCFile.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.o `test -f 'tests/CppUTest/TestHarness_cTestCFile.c' || echo '$(srcdir)/'`tests/CppUTest/TestHarness_cTestCFile.c + +tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.obj: tests/CppUTest/TestHarness_cTestCFile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -MT tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Tpo -c -o tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.obj `if test -f 'tests/CppUTest/TestHarness_cTestCFile.c'; then $(CYGPATH_W) 'tests/CppUTest/TestHarness_cTestCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestHarness_cTestCFile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/CppUTest/TestHarness_cTestCFile.c' object='tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CFLAGS) $(CFLAGS) -c -o tests/CppUTest/CppUTestTests-TestHarness_cTestCFile.obj `if test -f 'tests/CppUTest/TestHarness_cTestCFile.c'; then $(CYGPATH_W) 'tests/CppUTest/TestHarness_cTestCFile.c'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestHarness_cTestCFile.c'; fi` .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -1616,6 +1834,20 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTest_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTest_a_CXXFLAGS) $(CXXFLAGS) -c -o src/CppUTest/lib_libCppUTest_a-SimpleString.obj `if test -f 'src/CppUTest/SimpleString.cpp'; then $(CYGPATH_W) 'src/CppUTest/SimpleString.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CppUTest/SimpleString.cpp'; fi` +src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.o: src/CppUTest/SimpleStringInternalCache.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTest_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTest_a_CXXFLAGS) $(CXXFLAGS) -MT src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.o -MD -MP -MF src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Tpo -c -o src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.o `test -f 'src/CppUTest/SimpleStringInternalCache.cpp' || echo '$(srcdir)/'`src/CppUTest/SimpleStringInternalCache.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Tpo src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CppUTest/SimpleStringInternalCache.cpp' object='src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTest_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTest_a_CXXFLAGS) $(CXXFLAGS) -c -o src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.o `test -f 'src/CppUTest/SimpleStringInternalCache.cpp' || echo '$(srcdir)/'`src/CppUTest/SimpleStringInternalCache.cpp + +src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.obj: src/CppUTest/SimpleStringInternalCache.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTest_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTest_a_CXXFLAGS) $(CXXFLAGS) -MT src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.obj -MD -MP -MF src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Tpo -c -o src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.obj `if test -f 'src/CppUTest/SimpleStringInternalCache.cpp'; then $(CYGPATH_W) 'src/CppUTest/SimpleStringInternalCache.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CppUTest/SimpleStringInternalCache.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Tpo src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CppUTest/SimpleStringInternalCache.cpp' object='src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTest_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTest_a_CXXFLAGS) $(CXXFLAGS) -c -o src/CppUTest/lib_libCppUTest_a-SimpleStringInternalCache.obj `if test -f 'src/CppUTest/SimpleStringInternalCache.cpp'; then $(CYGPATH_W) 'src/CppUTest/SimpleStringInternalCache.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CppUTest/SimpleStringInternalCache.cpp'; fi` + src/CppUTest/lib_libCppUTest_a-SimpleMutex.o: src/CppUTest/SimpleMutex.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTest_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTest_a_CXXFLAGS) $(CXXFLAGS) -MT src/CppUTest/lib_libCppUTest_a-SimpleMutex.o -MD -MP -MF src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleMutex.Tpo -c -o src/CppUTest/lib_libCppUTest_a-SimpleMutex.o `test -f 'src/CppUTest/SimpleMutex.cpp' || echo '$(srcdir)/'`src/CppUTest/SimpleMutex.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleMutex.Tpo src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleMutex.Po @@ -1812,6 +2044,20 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTestExt_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTestExt_a_CXXFLAGS) $(CXXFLAGS) -c -o src/CppUTestExt/lib_libCppUTestExt_a-CodeMemoryReportFormatter.obj `if test -f 'src/CppUTestExt/CodeMemoryReportFormatter.cpp'; then $(CYGPATH_W) 'src/CppUTestExt/CodeMemoryReportFormatter.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CppUTestExt/CodeMemoryReportFormatter.cpp'; fi` +src/CppUTestExt/lib_libCppUTestExt_a-GTest.o: src/CppUTestExt/GTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTestExt_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTestExt_a_CXXFLAGS) $(CXXFLAGS) -MT src/CppUTestExt/lib_libCppUTestExt_a-GTest.o -MD -MP -MF src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Tpo -c -o src/CppUTestExt/lib_libCppUTestExt_a-GTest.o `test -f 'src/CppUTestExt/GTest.cpp' || echo '$(srcdir)/'`src/CppUTestExt/GTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Tpo src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CppUTestExt/GTest.cpp' object='src/CppUTestExt/lib_libCppUTestExt_a-GTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTestExt_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTestExt_a_CXXFLAGS) $(CXXFLAGS) -c -o src/CppUTestExt/lib_libCppUTestExt_a-GTest.o `test -f 'src/CppUTestExt/GTest.cpp' || echo '$(srcdir)/'`src/CppUTestExt/GTest.cpp + +src/CppUTestExt/lib_libCppUTestExt_a-GTest.obj: src/CppUTestExt/GTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTestExt_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTestExt_a_CXXFLAGS) $(CXXFLAGS) -MT src/CppUTestExt/lib_libCppUTestExt_a-GTest.obj -MD -MP -MF src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Tpo -c -o src/CppUTestExt/lib_libCppUTestExt_a-GTest.obj `if test -f 'src/CppUTestExt/GTest.cpp'; then $(CYGPATH_W) 'src/CppUTestExt/GTest.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CppUTestExt/GTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Tpo src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/CppUTestExt/GTest.cpp' object='src/CppUTestExt/lib_libCppUTestExt_a-GTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTestExt_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTestExt_a_CXXFLAGS) $(CXXFLAGS) -c -o src/CppUTestExt/lib_libCppUTestExt_a-GTest.obj `if test -f 'src/CppUTestExt/GTest.cpp'; then $(CYGPATH_W) 'src/CppUTestExt/GTest.cpp'; else $(CYGPATH_W) '$(srcdir)/src/CppUTestExt/GTest.cpp'; fi` + src/CppUTestExt/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.o: src/CppUTestExt/IEEE754ExceptionsPlugin.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libCppUTestExt_a_CPPFLAGS) $(CPPFLAGS) $(lib_libCppUTestExt_a_CXXFLAGS) $(CXXFLAGS) -MT src/CppUTestExt/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.o -MD -MP -MF src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.Tpo -c -o src/CppUTestExt/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.o `test -f 'src/CppUTestExt/IEEE754ExceptionsPlugin.cpp' || echo '$(srcdir)/'`src/CppUTestExt/IEEE754ExceptionsPlugin.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.Tpo src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.Po @@ -2358,411 +2604,467 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestExt/CppUTestExtTests-OrderedTestTest.obj `if test -f 'tests/CppUTestExt/OrderedTestTest.cpp'; then $(CYGPATH_W) 'tests/CppUTestExt/OrderedTestTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTestExt/OrderedTestTest.cpp'; fi` -tests/CppUTestTests-AllocationInCppFile.o: tests/AllocationInCppFile.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-AllocationInCppFile.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Tpo -c -o tests/CppUTestTests-AllocationInCppFile.o `test -f 'tests/AllocationInCppFile.cpp' || echo '$(srcdir)/'`tests/AllocationInCppFile.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Tpo tests/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/AllocationInCppFile.cpp' object='tests/CppUTestTests-AllocationInCppFile.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.o: tests/CppUTestExt/MockFakeLongLong.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.o -MD -MP -MF tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Tpo -c -o tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.o `test -f 'tests/CppUTestExt/MockFakeLongLong.cpp' || echo '$(srcdir)/'`tests/CppUTestExt/MockFakeLongLong.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Tpo tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTestExt/MockFakeLongLong.cpp' object='tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.o `test -f 'tests/CppUTestExt/MockFakeLongLong.cpp' || echo '$(srcdir)/'`tests/CppUTestExt/MockFakeLongLong.cpp + +tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.obj: tests/CppUTestExt/MockFakeLongLong.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.obj -MD -MP -MF tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Tpo -c -o tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.obj `if test -f 'tests/CppUTestExt/MockFakeLongLong.cpp'; then $(CYGPATH_W) 'tests/CppUTestExt/MockFakeLongLong.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTestExt/MockFakeLongLong.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Tpo tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTestExt/MockFakeLongLong.cpp' object='tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestExtTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestExtTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestExt/CppUTestExtTests-MockFakeLongLong.obj `if test -f 'tests/CppUTestExt/MockFakeLongLong.cpp'; then $(CYGPATH_W) 'tests/CppUTestExt/MockFakeLongLong.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTestExt/MockFakeLongLong.cpp'; fi` + +tests/CppUTest/CppUTestTests-AllocationInCppFile.o: tests/CppUTest/AllocationInCppFile.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-AllocationInCppFile.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Tpo -c -o tests/CppUTest/CppUTestTests-AllocationInCppFile.o `test -f 'tests/CppUTest/AllocationInCppFile.cpp' || echo '$(srcdir)/'`tests/CppUTest/AllocationInCppFile.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/AllocationInCppFile.cpp' object='tests/CppUTest/CppUTestTests-AllocationInCppFile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-AllocationInCppFile.o `test -f 'tests/CppUTest/AllocationInCppFile.cpp' || echo '$(srcdir)/'`tests/CppUTest/AllocationInCppFile.cpp + +tests/CppUTest/CppUTestTests-AllocationInCppFile.obj: tests/CppUTest/AllocationInCppFile.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-AllocationInCppFile.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Tpo -c -o tests/CppUTest/CppUTestTests-AllocationInCppFile.obj `if test -f 'tests/CppUTest/AllocationInCppFile.cpp'; then $(CYGPATH_W) 'tests/CppUTest/AllocationInCppFile.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllocationInCppFile.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/AllocationInCppFile.cpp' object='tests/CppUTest/CppUTestTests-AllocationInCppFile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-AllocationInCppFile.obj `if test -f 'tests/CppUTest/AllocationInCppFile.cpp'; then $(CYGPATH_W) 'tests/CppUTest/AllocationInCppFile.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllocationInCppFile.cpp'; fi` + +tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.o: tests/CppUTest/AllocLetTestFreeTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Tpo -c -o tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.o `test -f 'tests/CppUTest/AllocLetTestFreeTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/AllocLetTestFreeTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/AllocLetTestFreeTest.cpp' object='tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.o `test -f 'tests/CppUTest/AllocLetTestFreeTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/AllocLetTestFreeTest.cpp + +tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.obj: tests/CppUTest/AllocLetTestFreeTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Tpo -c -o tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.obj `if test -f 'tests/CppUTest/AllocLetTestFreeTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/AllocLetTestFreeTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllocLetTestFreeTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/AllocLetTestFreeTest.cpp' object='tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-AllocationInCppFile.o `test -f 'tests/AllocationInCppFile.cpp' || echo '$(srcdir)/'`tests/AllocationInCppFile.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-AllocLetTestFreeTest.obj `if test -f 'tests/CppUTest/AllocLetTestFreeTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/AllocLetTestFreeTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllocLetTestFreeTest.cpp'; fi` -tests/CppUTestTests-AllocationInCppFile.obj: tests/AllocationInCppFile.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-AllocationInCppFile.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Tpo -c -o tests/CppUTestTests-AllocationInCppFile.obj `if test -f 'tests/AllocationInCppFile.cpp'; then $(CYGPATH_W) 'tests/AllocationInCppFile.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/AllocationInCppFile.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Tpo tests/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/AllocationInCppFile.cpp' object='tests/CppUTestTests-AllocationInCppFile.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-AllTests.o: tests/CppUTest/AllTests.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-AllTests.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Tpo -c -o tests/CppUTest/CppUTestTests-AllTests.o `test -f 'tests/CppUTest/AllTests.cpp' || echo '$(srcdir)/'`tests/CppUTest/AllTests.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/AllTests.cpp' object='tests/CppUTest/CppUTestTests-AllTests.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-AllocationInCppFile.obj `if test -f 'tests/AllocationInCppFile.cpp'; then $(CYGPATH_W) 'tests/AllocationInCppFile.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/AllocationInCppFile.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-AllTests.o `test -f 'tests/CppUTest/AllTests.cpp' || echo '$(srcdir)/'`tests/CppUTest/AllTests.cpp -tests/CppUTestTests-AllocLetTestFreeTest.o: tests/AllocLetTestFreeTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-AllocLetTestFreeTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Tpo -c -o tests/CppUTestTests-AllocLetTestFreeTest.o `test -f 'tests/AllocLetTestFreeTest.cpp' || echo '$(srcdir)/'`tests/AllocLetTestFreeTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Tpo tests/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/AllocLetTestFreeTest.cpp' object='tests/CppUTestTests-AllocLetTestFreeTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-AllTests.obj: tests/CppUTest/AllTests.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-AllTests.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Tpo -c -o tests/CppUTest/CppUTestTests-AllTests.obj `if test -f 'tests/CppUTest/AllTests.cpp'; then $(CYGPATH_W) 'tests/CppUTest/AllTests.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllTests.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/AllTests.cpp' object='tests/CppUTest/CppUTestTests-AllTests.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-AllocLetTestFreeTest.o `test -f 'tests/AllocLetTestFreeTest.cpp' || echo '$(srcdir)/'`tests/AllocLetTestFreeTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-AllTests.obj `if test -f 'tests/CppUTest/AllTests.cpp'; then $(CYGPATH_W) 'tests/CppUTest/AllTests.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/AllTests.cpp'; fi` -tests/CppUTestTests-AllocLetTestFreeTest.obj: tests/AllocLetTestFreeTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-AllocLetTestFreeTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Tpo -c -o tests/CppUTestTests-AllocLetTestFreeTest.obj `if test -f 'tests/AllocLetTestFreeTest.cpp'; then $(CYGPATH_W) 'tests/AllocLetTestFreeTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/AllocLetTestFreeTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Tpo tests/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/AllocLetTestFreeTest.cpp' object='tests/CppUTestTests-AllocLetTestFreeTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-CheatSheetTest.o: tests/CppUTest/CheatSheetTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-CheatSheetTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Tpo -c -o tests/CppUTest/CppUTestTests-CheatSheetTest.o `test -f 'tests/CppUTest/CheatSheetTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/CheatSheetTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/CheatSheetTest.cpp' object='tests/CppUTest/CppUTestTests-CheatSheetTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-AllocLetTestFreeTest.obj `if test -f 'tests/AllocLetTestFreeTest.cpp'; then $(CYGPATH_W) 'tests/AllocLetTestFreeTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/AllocLetTestFreeTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-CheatSheetTest.o `test -f 'tests/CppUTest/CheatSheetTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/CheatSheetTest.cpp -tests/CppUTestTests-AllTests.o: tests/AllTests.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-AllTests.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllTests.Tpo -c -o tests/CppUTestTests-AllTests.o `test -f 'tests/AllTests.cpp' || echo '$(srcdir)/'`tests/AllTests.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllTests.Tpo tests/$(DEPDIR)/CppUTestTests-AllTests.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/AllTests.cpp' object='tests/CppUTestTests-AllTests.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-CheatSheetTest.obj: tests/CppUTest/CheatSheetTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-CheatSheetTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Tpo -c -o tests/CppUTest/CppUTestTests-CheatSheetTest.obj `if test -f 'tests/CppUTest/CheatSheetTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/CheatSheetTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/CheatSheetTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/CheatSheetTest.cpp' object='tests/CppUTest/CppUTestTests-CheatSheetTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-AllTests.o `test -f 'tests/AllTests.cpp' || echo '$(srcdir)/'`tests/AllTests.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-CheatSheetTest.obj `if test -f 'tests/CppUTest/CheatSheetTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/CheatSheetTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/CheatSheetTest.cpp'; fi` -tests/CppUTestTests-AllTests.obj: tests/AllTests.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-AllTests.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-AllTests.Tpo -c -o tests/CppUTestTests-AllTests.obj `if test -f 'tests/AllTests.cpp'; then $(CYGPATH_W) 'tests/AllTests.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/AllTests.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-AllTests.Tpo tests/$(DEPDIR)/CppUTestTests-AllTests.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/AllTests.cpp' object='tests/CppUTestTests-AllTests.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-CompatabilityTests.o: tests/CppUTest/CompatabilityTests.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-CompatabilityTests.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Tpo -c -o tests/CppUTest/CppUTestTests-CompatabilityTests.o `test -f 'tests/CppUTest/CompatabilityTests.cpp' || echo '$(srcdir)/'`tests/CppUTest/CompatabilityTests.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/CompatabilityTests.cpp' object='tests/CppUTest/CppUTestTests-CompatabilityTests.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-AllTests.obj `if test -f 'tests/AllTests.cpp'; then $(CYGPATH_W) 'tests/AllTests.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/AllTests.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-CompatabilityTests.o `test -f 'tests/CppUTest/CompatabilityTests.cpp' || echo '$(srcdir)/'`tests/CppUTest/CompatabilityTests.cpp -tests/CppUTestTests-CheatSheetTest.o: tests/CheatSheetTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-CheatSheetTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-CheatSheetTest.Tpo -c -o tests/CppUTestTests-CheatSheetTest.o `test -f 'tests/CheatSheetTest.cpp' || echo '$(srcdir)/'`tests/CheatSheetTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-CheatSheetTest.Tpo tests/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CheatSheetTest.cpp' object='tests/CppUTestTests-CheatSheetTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-CompatabilityTests.obj: tests/CppUTest/CompatabilityTests.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-CompatabilityTests.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Tpo -c -o tests/CppUTest/CppUTestTests-CompatabilityTests.obj `if test -f 'tests/CppUTest/CompatabilityTests.cpp'; then $(CYGPATH_W) 'tests/CppUTest/CompatabilityTests.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/CompatabilityTests.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/CompatabilityTests.cpp' object='tests/CppUTest/CppUTestTests-CompatabilityTests.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-CheatSheetTest.o `test -f 'tests/CheatSheetTest.cpp' || echo '$(srcdir)/'`tests/CheatSheetTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-CompatabilityTests.obj `if test -f 'tests/CppUTest/CompatabilityTests.cpp'; then $(CYGPATH_W) 'tests/CppUTest/CompatabilityTests.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/CompatabilityTests.cpp'; fi` -tests/CppUTestTests-CheatSheetTest.obj: tests/CheatSheetTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-CheatSheetTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-CheatSheetTest.Tpo -c -o tests/CppUTestTests-CheatSheetTest.obj `if test -f 'tests/CheatSheetTest.cpp'; then $(CYGPATH_W) 'tests/CheatSheetTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CheatSheetTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-CheatSheetTest.Tpo tests/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CheatSheetTest.cpp' object='tests/CppUTestTests-CheatSheetTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.o: tests/CppUTest/CommandLineArgumentsTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Tpo -c -o tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.o `test -f 'tests/CppUTest/CommandLineArgumentsTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/CommandLineArgumentsTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/CommandLineArgumentsTest.cpp' object='tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-CheatSheetTest.obj `if test -f 'tests/CheatSheetTest.cpp'; then $(CYGPATH_W) 'tests/CheatSheetTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CheatSheetTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.o `test -f 'tests/CppUTest/CommandLineArgumentsTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/CommandLineArgumentsTest.cpp -tests/CppUTestTests-CommandLineArgumentsTest.o: tests/CommandLineArgumentsTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-CommandLineArgumentsTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Tpo -c -o tests/CppUTestTests-CommandLineArgumentsTest.o `test -f 'tests/CommandLineArgumentsTest.cpp' || echo '$(srcdir)/'`tests/CommandLineArgumentsTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Tpo tests/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CommandLineArgumentsTest.cpp' object='tests/CppUTestTests-CommandLineArgumentsTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.obj: tests/CppUTest/CommandLineArgumentsTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Tpo -c -o tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.obj `if test -f 'tests/CppUTest/CommandLineArgumentsTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/CommandLineArgumentsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/CommandLineArgumentsTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/CommandLineArgumentsTest.cpp' object='tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-CommandLineArgumentsTest.o `test -f 'tests/CommandLineArgumentsTest.cpp' || echo '$(srcdir)/'`tests/CommandLineArgumentsTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-CommandLineArgumentsTest.obj `if test -f 'tests/CppUTest/CommandLineArgumentsTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/CommandLineArgumentsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/CommandLineArgumentsTest.cpp'; fi` -tests/CppUTestTests-CommandLineArgumentsTest.obj: tests/CommandLineArgumentsTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-CommandLineArgumentsTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Tpo -c -o tests/CppUTestTests-CommandLineArgumentsTest.obj `if test -f 'tests/CommandLineArgumentsTest.cpp'; then $(CYGPATH_W) 'tests/CommandLineArgumentsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CommandLineArgumentsTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Tpo tests/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CommandLineArgumentsTest.cpp' object='tests/CppUTestTests-CommandLineArgumentsTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.o: tests/CppUTest/CommandLineTestRunnerTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Tpo -c -o tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.o `test -f 'tests/CppUTest/CommandLineTestRunnerTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/CommandLineTestRunnerTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/CommandLineTestRunnerTest.cpp' object='tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-CommandLineArgumentsTest.obj `if test -f 'tests/CommandLineArgumentsTest.cpp'; then $(CYGPATH_W) 'tests/CommandLineArgumentsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CommandLineArgumentsTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.o `test -f 'tests/CppUTest/CommandLineTestRunnerTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/CommandLineTestRunnerTest.cpp -tests/CppUTestTests-CommandLineTestRunnerTest.o: tests/CommandLineTestRunnerTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-CommandLineTestRunnerTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Tpo -c -o tests/CppUTestTests-CommandLineTestRunnerTest.o `test -f 'tests/CommandLineTestRunnerTest.cpp' || echo '$(srcdir)/'`tests/CommandLineTestRunnerTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Tpo tests/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CommandLineTestRunnerTest.cpp' object='tests/CppUTestTests-CommandLineTestRunnerTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.obj: tests/CppUTest/CommandLineTestRunnerTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Tpo -c -o tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.obj `if test -f 'tests/CppUTest/CommandLineTestRunnerTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/CommandLineTestRunnerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/CommandLineTestRunnerTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/CommandLineTestRunnerTest.cpp' object='tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-CommandLineTestRunnerTest.o `test -f 'tests/CommandLineTestRunnerTest.cpp' || echo '$(srcdir)/'`tests/CommandLineTestRunnerTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-CommandLineTestRunnerTest.obj `if test -f 'tests/CppUTest/CommandLineTestRunnerTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/CommandLineTestRunnerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/CommandLineTestRunnerTest.cpp'; fi` -tests/CppUTestTests-CommandLineTestRunnerTest.obj: tests/CommandLineTestRunnerTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-CommandLineTestRunnerTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Tpo -c -o tests/CppUTestTests-CommandLineTestRunnerTest.obj `if test -f 'tests/CommandLineTestRunnerTest.cpp'; then $(CYGPATH_W) 'tests/CommandLineTestRunnerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CommandLineTestRunnerTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Tpo tests/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CommandLineTestRunnerTest.cpp' object='tests/CppUTestTests-CommandLineTestRunnerTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.o: tests/CppUTest/DummyMemoryLeakDetector.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Tpo -c -o tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.o `test -f 'tests/CppUTest/DummyMemoryLeakDetector.cpp' || echo '$(srcdir)/'`tests/CppUTest/DummyMemoryLeakDetector.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/DummyMemoryLeakDetector.cpp' object='tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-CommandLineTestRunnerTest.obj `if test -f 'tests/CommandLineTestRunnerTest.cpp'; then $(CYGPATH_W) 'tests/CommandLineTestRunnerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CommandLineTestRunnerTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.o `test -f 'tests/CppUTest/DummyMemoryLeakDetector.cpp' || echo '$(srcdir)/'`tests/CppUTest/DummyMemoryLeakDetector.cpp -tests/CppUTestTests-JUnitOutputTest.o: tests/JUnitOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-JUnitOutputTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Tpo -c -o tests/CppUTestTests-JUnitOutputTest.o `test -f 'tests/JUnitOutputTest.cpp' || echo '$(srcdir)/'`tests/JUnitOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Tpo tests/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/JUnitOutputTest.cpp' object='tests/CppUTestTests-JUnitOutputTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.obj: tests/CppUTest/DummyMemoryLeakDetector.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Tpo -c -o tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.obj `if test -f 'tests/CppUTest/DummyMemoryLeakDetector.cpp'; then $(CYGPATH_W) 'tests/CppUTest/DummyMemoryLeakDetector.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/DummyMemoryLeakDetector.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/DummyMemoryLeakDetector.cpp' object='tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-JUnitOutputTest.o `test -f 'tests/JUnitOutputTest.cpp' || echo '$(srcdir)/'`tests/JUnitOutputTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-DummyMemoryLeakDetector.obj `if test -f 'tests/CppUTest/DummyMemoryLeakDetector.cpp'; then $(CYGPATH_W) 'tests/CppUTest/DummyMemoryLeakDetector.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/DummyMemoryLeakDetector.cpp'; fi` -tests/CppUTestTests-JUnitOutputTest.obj: tests/JUnitOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-JUnitOutputTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Tpo -c -o tests/CppUTestTests-JUnitOutputTest.obj `if test -f 'tests/JUnitOutputTest.cpp'; then $(CYGPATH_W) 'tests/JUnitOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/JUnitOutputTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Tpo tests/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/JUnitOutputTest.cpp' object='tests/CppUTestTests-JUnitOutputTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-JUnitOutputTest.o: tests/CppUTest/JUnitOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-JUnitOutputTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Tpo -c -o tests/CppUTest/CppUTestTests-JUnitOutputTest.o `test -f 'tests/CppUTest/JUnitOutputTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/JUnitOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/JUnitOutputTest.cpp' object='tests/CppUTest/CppUTestTests-JUnitOutputTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-JUnitOutputTest.obj `if test -f 'tests/JUnitOutputTest.cpp'; then $(CYGPATH_W) 'tests/JUnitOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/JUnitOutputTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-JUnitOutputTest.o `test -f 'tests/CppUTest/JUnitOutputTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/JUnitOutputTest.cpp -tests/CppUTestTests-MemoryLeakDetectorTest.o: tests/MemoryLeakDetectorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-MemoryLeakDetectorTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Tpo -c -o tests/CppUTestTests-MemoryLeakDetectorTest.o `test -f 'tests/MemoryLeakDetectorTest.cpp' || echo '$(srcdir)/'`tests/MemoryLeakDetectorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Tpo tests/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/MemoryLeakDetectorTest.cpp' object='tests/CppUTestTests-MemoryLeakDetectorTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-JUnitOutputTest.obj: tests/CppUTest/JUnitOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-JUnitOutputTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Tpo -c -o tests/CppUTest/CppUTestTests-JUnitOutputTest.obj `if test -f 'tests/CppUTest/JUnitOutputTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/JUnitOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/JUnitOutputTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/JUnitOutputTest.cpp' object='tests/CppUTest/CppUTestTests-JUnitOutputTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-MemoryLeakDetectorTest.o `test -f 'tests/MemoryLeakDetectorTest.cpp' || echo '$(srcdir)/'`tests/MemoryLeakDetectorTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-JUnitOutputTest.obj `if test -f 'tests/CppUTest/JUnitOutputTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/JUnitOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/JUnitOutputTest.cpp'; fi` -tests/CppUTestTests-MemoryLeakDetectorTest.obj: tests/MemoryLeakDetectorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-MemoryLeakDetectorTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Tpo -c -o tests/CppUTestTests-MemoryLeakDetectorTest.obj `if test -f 'tests/MemoryLeakDetectorTest.cpp'; then $(CYGPATH_W) 'tests/MemoryLeakDetectorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/MemoryLeakDetectorTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Tpo tests/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/MemoryLeakDetectorTest.cpp' object='tests/CppUTestTests-MemoryLeakDetectorTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.o: tests/CppUTest/MemoryLeakDetectorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Tpo -c -o tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.o `test -f 'tests/CppUTest/MemoryLeakDetectorTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/MemoryLeakDetectorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/MemoryLeakDetectorTest.cpp' object='tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-MemoryLeakDetectorTest.obj `if test -f 'tests/MemoryLeakDetectorTest.cpp'; then $(CYGPATH_W) 'tests/MemoryLeakDetectorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/MemoryLeakDetectorTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.o `test -f 'tests/CppUTest/MemoryLeakDetectorTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/MemoryLeakDetectorTest.cpp -tests/CppUTestTests-MemoryOperatorOverloadTest.o: tests/MemoryOperatorOverloadTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-MemoryOperatorOverloadTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Tpo -c -o tests/CppUTestTests-MemoryOperatorOverloadTest.o `test -f 'tests/MemoryOperatorOverloadTest.cpp' || echo '$(srcdir)/'`tests/MemoryOperatorOverloadTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Tpo tests/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/MemoryOperatorOverloadTest.cpp' object='tests/CppUTestTests-MemoryOperatorOverloadTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.obj: tests/CppUTest/MemoryLeakDetectorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Tpo -c -o tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.obj `if test -f 'tests/CppUTest/MemoryLeakDetectorTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/MemoryLeakDetectorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/MemoryLeakDetectorTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/MemoryLeakDetectorTest.cpp' object='tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-MemoryOperatorOverloadTest.o `test -f 'tests/MemoryOperatorOverloadTest.cpp' || echo '$(srcdir)/'`tests/MemoryOperatorOverloadTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-MemoryLeakDetectorTest.obj `if test -f 'tests/CppUTest/MemoryLeakDetectorTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/MemoryLeakDetectorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/MemoryLeakDetectorTest.cpp'; fi` -tests/CppUTestTests-MemoryOperatorOverloadTest.obj: tests/MemoryOperatorOverloadTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-MemoryOperatorOverloadTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Tpo -c -o tests/CppUTestTests-MemoryOperatorOverloadTest.obj `if test -f 'tests/MemoryOperatorOverloadTest.cpp'; then $(CYGPATH_W) 'tests/MemoryOperatorOverloadTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/MemoryOperatorOverloadTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Tpo tests/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/MemoryOperatorOverloadTest.cpp' object='tests/CppUTestTests-MemoryOperatorOverloadTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.o: tests/CppUTest/MemoryOperatorOverloadTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Tpo -c -o tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.o `test -f 'tests/CppUTest/MemoryOperatorOverloadTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/MemoryOperatorOverloadTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/MemoryOperatorOverloadTest.cpp' object='tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-MemoryOperatorOverloadTest.obj `if test -f 'tests/MemoryOperatorOverloadTest.cpp'; then $(CYGPATH_W) 'tests/MemoryOperatorOverloadTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/MemoryOperatorOverloadTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.o `test -f 'tests/CppUTest/MemoryOperatorOverloadTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/MemoryOperatorOverloadTest.cpp -tests/CppUTestTests-MemoryLeakWarningTest.o: tests/MemoryLeakWarningTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-MemoryLeakWarningTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Tpo -c -o tests/CppUTestTests-MemoryLeakWarningTest.o `test -f 'tests/MemoryLeakWarningTest.cpp' || echo '$(srcdir)/'`tests/MemoryLeakWarningTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Tpo tests/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/MemoryLeakWarningTest.cpp' object='tests/CppUTestTests-MemoryLeakWarningTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.obj: tests/CppUTest/MemoryOperatorOverloadTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Tpo -c -o tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.obj `if test -f 'tests/CppUTest/MemoryOperatorOverloadTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/MemoryOperatorOverloadTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/MemoryOperatorOverloadTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/MemoryOperatorOverloadTest.cpp' object='tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-MemoryLeakWarningTest.o `test -f 'tests/MemoryLeakWarningTest.cpp' || echo '$(srcdir)/'`tests/MemoryLeakWarningTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-MemoryOperatorOverloadTest.obj `if test -f 'tests/CppUTest/MemoryOperatorOverloadTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/MemoryOperatorOverloadTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/MemoryOperatorOverloadTest.cpp'; fi` -tests/CppUTestTests-MemoryLeakWarningTest.obj: tests/MemoryLeakWarningTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-MemoryLeakWarningTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Tpo -c -o tests/CppUTestTests-MemoryLeakWarningTest.obj `if test -f 'tests/MemoryLeakWarningTest.cpp'; then $(CYGPATH_W) 'tests/MemoryLeakWarningTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/MemoryLeakWarningTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Tpo tests/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/MemoryLeakWarningTest.cpp' object='tests/CppUTestTests-MemoryLeakWarningTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.o: tests/CppUTest/MemoryLeakWarningTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Tpo -c -o tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.o `test -f 'tests/CppUTest/MemoryLeakWarningTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/MemoryLeakWarningTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/MemoryLeakWarningTest.cpp' object='tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-MemoryLeakWarningTest.obj `if test -f 'tests/MemoryLeakWarningTest.cpp'; then $(CYGPATH_W) 'tests/MemoryLeakWarningTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/MemoryLeakWarningTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.o `test -f 'tests/CppUTest/MemoryLeakWarningTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/MemoryLeakWarningTest.cpp -tests/CppUTestTests-PluginTest.o: tests/PluginTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-PluginTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-PluginTest.Tpo -c -o tests/CppUTestTests-PluginTest.o `test -f 'tests/PluginTest.cpp' || echo '$(srcdir)/'`tests/PluginTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-PluginTest.Tpo tests/$(DEPDIR)/CppUTestTests-PluginTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/PluginTest.cpp' object='tests/CppUTestTests-PluginTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.obj: tests/CppUTest/MemoryLeakWarningTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Tpo -c -o tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.obj `if test -f 'tests/CppUTest/MemoryLeakWarningTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/MemoryLeakWarningTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/MemoryLeakWarningTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/MemoryLeakWarningTest.cpp' object='tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-PluginTest.o `test -f 'tests/PluginTest.cpp' || echo '$(srcdir)/'`tests/PluginTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-MemoryLeakWarningTest.obj `if test -f 'tests/CppUTest/MemoryLeakWarningTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/MemoryLeakWarningTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/MemoryLeakWarningTest.cpp'; fi` -tests/CppUTestTests-PluginTest.obj: tests/PluginTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-PluginTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-PluginTest.Tpo -c -o tests/CppUTestTests-PluginTest.obj `if test -f 'tests/PluginTest.cpp'; then $(CYGPATH_W) 'tests/PluginTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/PluginTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-PluginTest.Tpo tests/$(DEPDIR)/CppUTestTests-PluginTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/PluginTest.cpp' object='tests/CppUTestTests-PluginTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-PluginTest.o: tests/CppUTest/PluginTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-PluginTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Tpo -c -o tests/CppUTest/CppUTestTests-PluginTest.o `test -f 'tests/CppUTest/PluginTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/PluginTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/PluginTest.cpp' object='tests/CppUTest/CppUTestTests-PluginTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-PluginTest.obj `if test -f 'tests/PluginTest.cpp'; then $(CYGPATH_W) 'tests/PluginTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/PluginTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-PluginTest.o `test -f 'tests/CppUTest/PluginTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/PluginTest.cpp -tests/CppUTestTests-PreprocessorTest.o: tests/PreprocessorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-PreprocessorTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-PreprocessorTest.Tpo -c -o tests/CppUTestTests-PreprocessorTest.o `test -f 'tests/PreprocessorTest.cpp' || echo '$(srcdir)/'`tests/PreprocessorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-PreprocessorTest.Tpo tests/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/PreprocessorTest.cpp' object='tests/CppUTestTests-PreprocessorTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-PluginTest.obj: tests/CppUTest/PluginTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-PluginTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Tpo -c -o tests/CppUTest/CppUTestTests-PluginTest.obj `if test -f 'tests/CppUTest/PluginTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/PluginTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/PluginTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/PluginTest.cpp' object='tests/CppUTest/CppUTestTests-PluginTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-PreprocessorTest.o `test -f 'tests/PreprocessorTest.cpp' || echo '$(srcdir)/'`tests/PreprocessorTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-PluginTest.obj `if test -f 'tests/CppUTest/PluginTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/PluginTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/PluginTest.cpp'; fi` -tests/CppUTestTests-PreprocessorTest.obj: tests/PreprocessorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-PreprocessorTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-PreprocessorTest.Tpo -c -o tests/CppUTestTests-PreprocessorTest.obj `if test -f 'tests/PreprocessorTest.cpp'; then $(CYGPATH_W) 'tests/PreprocessorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/PreprocessorTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-PreprocessorTest.Tpo tests/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/PreprocessorTest.cpp' object='tests/CppUTestTests-PreprocessorTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-PreprocessorTest.o: tests/CppUTest/PreprocessorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-PreprocessorTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Tpo -c -o tests/CppUTest/CppUTestTests-PreprocessorTest.o `test -f 'tests/CppUTest/PreprocessorTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/PreprocessorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/PreprocessorTest.cpp' object='tests/CppUTest/CppUTestTests-PreprocessorTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-PreprocessorTest.obj `if test -f 'tests/PreprocessorTest.cpp'; then $(CYGPATH_W) 'tests/PreprocessorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/PreprocessorTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-PreprocessorTest.o `test -f 'tests/CppUTest/PreprocessorTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/PreprocessorTest.cpp -tests/CppUTestTests-SetPluginTest.o: tests/SetPluginTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-SetPluginTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-SetPluginTest.Tpo -c -o tests/CppUTestTests-SetPluginTest.o `test -f 'tests/SetPluginTest.cpp' || echo '$(srcdir)/'`tests/SetPluginTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-SetPluginTest.Tpo tests/$(DEPDIR)/CppUTestTests-SetPluginTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/SetPluginTest.cpp' object='tests/CppUTestTests-SetPluginTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-PreprocessorTest.obj: tests/CppUTest/PreprocessorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-PreprocessorTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Tpo -c -o tests/CppUTest/CppUTestTests-PreprocessorTest.obj `if test -f 'tests/CppUTest/PreprocessorTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/PreprocessorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/PreprocessorTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/PreprocessorTest.cpp' object='tests/CppUTest/CppUTestTests-PreprocessorTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-SetPluginTest.o `test -f 'tests/SetPluginTest.cpp' || echo '$(srcdir)/'`tests/SetPluginTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-PreprocessorTest.obj `if test -f 'tests/CppUTest/PreprocessorTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/PreprocessorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/PreprocessorTest.cpp'; fi` -tests/CppUTestTests-SetPluginTest.obj: tests/SetPluginTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-SetPluginTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-SetPluginTest.Tpo -c -o tests/CppUTestTests-SetPluginTest.obj `if test -f 'tests/SetPluginTest.cpp'; then $(CYGPATH_W) 'tests/SetPluginTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/SetPluginTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-SetPluginTest.Tpo tests/$(DEPDIR)/CppUTestTests-SetPluginTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/SetPluginTest.cpp' object='tests/CppUTestTests-SetPluginTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-SetPluginTest.o: tests/CppUTest/SetPluginTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-SetPluginTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Tpo -c -o tests/CppUTest/CppUTestTests-SetPluginTest.o `test -f 'tests/CppUTest/SetPluginTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/SetPluginTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/SetPluginTest.cpp' object='tests/CppUTest/CppUTestTests-SetPluginTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-SetPluginTest.obj `if test -f 'tests/SetPluginTest.cpp'; then $(CYGPATH_W) 'tests/SetPluginTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/SetPluginTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-SetPluginTest.o `test -f 'tests/CppUTest/SetPluginTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/SetPluginTest.cpp -tests/CppUTestTests-SimpleStringTest.o: tests/SimpleStringTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-SimpleStringTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-SimpleStringTest.Tpo -c -o tests/CppUTestTests-SimpleStringTest.o `test -f 'tests/SimpleStringTest.cpp' || echo '$(srcdir)/'`tests/SimpleStringTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-SimpleStringTest.Tpo tests/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/SimpleStringTest.cpp' object='tests/CppUTestTests-SimpleStringTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-SetPluginTest.obj: tests/CppUTest/SetPluginTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-SetPluginTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Tpo -c -o tests/CppUTest/CppUTestTests-SetPluginTest.obj `if test -f 'tests/CppUTest/SetPluginTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/SetPluginTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/SetPluginTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/SetPluginTest.cpp' object='tests/CppUTest/CppUTestTests-SetPluginTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-SimpleStringTest.o `test -f 'tests/SimpleStringTest.cpp' || echo '$(srcdir)/'`tests/SimpleStringTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-SetPluginTest.obj `if test -f 'tests/CppUTest/SetPluginTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/SetPluginTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/SetPluginTest.cpp'; fi` -tests/CppUTestTests-SimpleStringTest.obj: tests/SimpleStringTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-SimpleStringTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-SimpleStringTest.Tpo -c -o tests/CppUTestTests-SimpleStringTest.obj `if test -f 'tests/SimpleStringTest.cpp'; then $(CYGPATH_W) 'tests/SimpleStringTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/SimpleStringTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-SimpleStringTest.Tpo tests/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/SimpleStringTest.cpp' object='tests/CppUTestTests-SimpleStringTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-SimpleStringTest.o: tests/CppUTest/SimpleStringTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-SimpleStringTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Tpo -c -o tests/CppUTest/CppUTestTests-SimpleStringTest.o `test -f 'tests/CppUTest/SimpleStringTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/SimpleStringTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/SimpleStringTest.cpp' object='tests/CppUTest/CppUTestTests-SimpleStringTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-SimpleStringTest.obj `if test -f 'tests/SimpleStringTest.cpp'; then $(CYGPATH_W) 'tests/SimpleStringTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/SimpleStringTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-SimpleStringTest.o `test -f 'tests/CppUTest/SimpleStringTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/SimpleStringTest.cpp -tests/CppUTestTests-SimpleMutexTest.o: tests/SimpleMutexTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-SimpleMutexTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Tpo -c -o tests/CppUTestTests-SimpleMutexTest.o `test -f 'tests/SimpleMutexTest.cpp' || echo '$(srcdir)/'`tests/SimpleMutexTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Tpo tests/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/SimpleMutexTest.cpp' object='tests/CppUTestTests-SimpleMutexTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-SimpleStringTest.obj: tests/CppUTest/SimpleStringTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-SimpleStringTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Tpo -c -o tests/CppUTest/CppUTestTests-SimpleStringTest.obj `if test -f 'tests/CppUTest/SimpleStringTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/SimpleStringTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/SimpleStringTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/SimpleStringTest.cpp' object='tests/CppUTest/CppUTestTests-SimpleStringTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-SimpleMutexTest.o `test -f 'tests/SimpleMutexTest.cpp' || echo '$(srcdir)/'`tests/SimpleMutexTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-SimpleStringTest.obj `if test -f 'tests/CppUTest/SimpleStringTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/SimpleStringTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/SimpleStringTest.cpp'; fi` -tests/CppUTestTests-SimpleMutexTest.obj: tests/SimpleMutexTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-SimpleMutexTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Tpo -c -o tests/CppUTestTests-SimpleMutexTest.obj `if test -f 'tests/SimpleMutexTest.cpp'; then $(CYGPATH_W) 'tests/SimpleMutexTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/SimpleMutexTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Tpo tests/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/SimpleMutexTest.cpp' object='tests/CppUTestTests-SimpleMutexTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-SimpleStringCacheTest.o: tests/CppUTest/SimpleStringCacheTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-SimpleStringCacheTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Tpo -c -o tests/CppUTest/CppUTestTests-SimpleStringCacheTest.o `test -f 'tests/CppUTest/SimpleStringCacheTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/SimpleStringCacheTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/SimpleStringCacheTest.cpp' object='tests/CppUTest/CppUTestTests-SimpleStringCacheTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-SimpleMutexTest.obj `if test -f 'tests/SimpleMutexTest.cpp'; then $(CYGPATH_W) 'tests/SimpleMutexTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/SimpleMutexTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-SimpleStringCacheTest.o `test -f 'tests/CppUTest/SimpleStringCacheTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/SimpleStringCacheTest.cpp -tests/CppUTestTests-TeamCityOutputTest.o: tests/TeamCityOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TeamCityOutputTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Tpo -c -o tests/CppUTestTests-TeamCityOutputTest.o `test -f 'tests/TeamCityOutputTest.cpp' || echo '$(srcdir)/'`tests/TeamCityOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Tpo tests/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TeamCityOutputTest.cpp' object='tests/CppUTestTests-TeamCityOutputTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-SimpleStringCacheTest.obj: tests/CppUTest/SimpleStringCacheTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-SimpleStringCacheTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Tpo -c -o tests/CppUTest/CppUTestTests-SimpleStringCacheTest.obj `if test -f 'tests/CppUTest/SimpleStringCacheTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/SimpleStringCacheTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/SimpleStringCacheTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/SimpleStringCacheTest.cpp' object='tests/CppUTest/CppUTestTests-SimpleStringCacheTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TeamCityOutputTest.o `test -f 'tests/TeamCityOutputTest.cpp' || echo '$(srcdir)/'`tests/TeamCityOutputTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-SimpleStringCacheTest.obj `if test -f 'tests/CppUTest/SimpleStringCacheTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/SimpleStringCacheTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/SimpleStringCacheTest.cpp'; fi` -tests/CppUTestTests-TeamCityOutputTest.obj: tests/TeamCityOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TeamCityOutputTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Tpo -c -o tests/CppUTestTests-TeamCityOutputTest.obj `if test -f 'tests/TeamCityOutputTest.cpp'; then $(CYGPATH_W) 'tests/TeamCityOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TeamCityOutputTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Tpo tests/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TeamCityOutputTest.cpp' object='tests/CppUTestTests-TeamCityOutputTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-SimpleMutexTest.o: tests/CppUTest/SimpleMutexTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-SimpleMutexTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Tpo -c -o tests/CppUTest/CppUTestTests-SimpleMutexTest.o `test -f 'tests/CppUTest/SimpleMutexTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/SimpleMutexTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/SimpleMutexTest.cpp' object='tests/CppUTest/CppUTestTests-SimpleMutexTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TeamCityOutputTest.obj `if test -f 'tests/TeamCityOutputTest.cpp'; then $(CYGPATH_W) 'tests/TeamCityOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TeamCityOutputTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-SimpleMutexTest.o `test -f 'tests/CppUTest/SimpleMutexTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/SimpleMutexTest.cpp -tests/CppUTestTests-TestFailureNaNTest.o: tests/TestFailureNaNTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestFailureNaNTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Tpo -c -o tests/CppUTestTests-TestFailureNaNTest.o `test -f 'tests/TestFailureNaNTest.cpp' || echo '$(srcdir)/'`tests/TestFailureNaNTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestFailureNaNTest.cpp' object='tests/CppUTestTests-TestFailureNaNTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-SimpleMutexTest.obj: tests/CppUTest/SimpleMutexTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-SimpleMutexTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Tpo -c -o tests/CppUTest/CppUTestTests-SimpleMutexTest.obj `if test -f 'tests/CppUTest/SimpleMutexTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/SimpleMutexTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/SimpleMutexTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/SimpleMutexTest.cpp' object='tests/CppUTest/CppUTestTests-SimpleMutexTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestFailureNaNTest.o `test -f 'tests/TestFailureNaNTest.cpp' || echo '$(srcdir)/'`tests/TestFailureNaNTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-SimpleMutexTest.obj `if test -f 'tests/CppUTest/SimpleMutexTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/SimpleMutexTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/SimpleMutexTest.cpp'; fi` -tests/CppUTestTests-TestFailureNaNTest.obj: tests/TestFailureNaNTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestFailureNaNTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Tpo -c -o tests/CppUTestTests-TestFailureNaNTest.obj `if test -f 'tests/TestFailureNaNTest.cpp'; then $(CYGPATH_W) 'tests/TestFailureNaNTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestFailureNaNTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestFailureNaNTest.cpp' object='tests/CppUTestTests-TestFailureNaNTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TeamCityOutputTest.o: tests/CppUTest/TeamCityOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TeamCityOutputTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Tpo -c -o tests/CppUTest/CppUTestTests-TeamCityOutputTest.o `test -f 'tests/CppUTest/TeamCityOutputTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TeamCityOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TeamCityOutputTest.cpp' object='tests/CppUTest/CppUTestTests-TeamCityOutputTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestFailureNaNTest.obj `if test -f 'tests/TestFailureNaNTest.cpp'; then $(CYGPATH_W) 'tests/TestFailureNaNTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestFailureNaNTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TeamCityOutputTest.o `test -f 'tests/CppUTest/TeamCityOutputTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TeamCityOutputTest.cpp -tests/CppUTestTests-TestFailureTest.o: tests/TestFailureTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestFailureTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestFailureTest.Tpo -c -o tests/CppUTestTests-TestFailureTest.o `test -f 'tests/TestFailureTest.cpp' || echo '$(srcdir)/'`tests/TestFailureTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestFailureTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestFailureTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestFailureTest.cpp' object='tests/CppUTestTests-TestFailureTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TeamCityOutputTest.obj: tests/CppUTest/TeamCityOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TeamCityOutputTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Tpo -c -o tests/CppUTest/CppUTestTests-TeamCityOutputTest.obj `if test -f 'tests/CppUTest/TeamCityOutputTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TeamCityOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TeamCityOutputTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TeamCityOutputTest.cpp' object='tests/CppUTest/CppUTestTests-TeamCityOutputTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestFailureTest.o `test -f 'tests/TestFailureTest.cpp' || echo '$(srcdir)/'`tests/TestFailureTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TeamCityOutputTest.obj `if test -f 'tests/CppUTest/TeamCityOutputTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TeamCityOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TeamCityOutputTest.cpp'; fi` -tests/CppUTestTests-TestFailureTest.obj: tests/TestFailureTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestFailureTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestFailureTest.Tpo -c -o tests/CppUTestTests-TestFailureTest.obj `if test -f 'tests/TestFailureTest.cpp'; then $(CYGPATH_W) 'tests/TestFailureTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestFailureTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestFailureTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestFailureTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestFailureTest.cpp' object='tests/CppUTestTests-TestFailureTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestFailureNaNTest.o: tests/CppUTest/TestFailureNaNTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestFailureNaNTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestFailureNaNTest.o `test -f 'tests/CppUTest/TestFailureNaNTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestFailureNaNTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestFailureNaNTest.cpp' object='tests/CppUTest/CppUTestTests-TestFailureNaNTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestFailureTest.obj `if test -f 'tests/TestFailureTest.cpp'; then $(CYGPATH_W) 'tests/TestFailureTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestFailureTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestFailureNaNTest.o `test -f 'tests/CppUTest/TestFailureNaNTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestFailureNaNTest.cpp -tests/CppUTestTests-TestFilterTest.o: tests/TestFilterTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestFilterTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestFilterTest.Tpo -c -o tests/CppUTestTests-TestFilterTest.o `test -f 'tests/TestFilterTest.cpp' || echo '$(srcdir)/'`tests/TestFilterTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestFilterTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestFilterTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestFilterTest.cpp' object='tests/CppUTestTests-TestFilterTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestFailureNaNTest.obj: tests/CppUTest/TestFailureNaNTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestFailureNaNTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestFailureNaNTest.obj `if test -f 'tests/CppUTest/TestFailureNaNTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestFailureNaNTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestFailureNaNTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestFailureNaNTest.cpp' object='tests/CppUTest/CppUTestTests-TestFailureNaNTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestFilterTest.o `test -f 'tests/TestFilterTest.cpp' || echo '$(srcdir)/'`tests/TestFilterTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestFailureNaNTest.obj `if test -f 'tests/CppUTest/TestFailureNaNTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestFailureNaNTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestFailureNaNTest.cpp'; fi` -tests/CppUTestTests-TestFilterTest.obj: tests/TestFilterTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestFilterTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestFilterTest.Tpo -c -o tests/CppUTestTests-TestFilterTest.obj `if test -f 'tests/TestFilterTest.cpp'; then $(CYGPATH_W) 'tests/TestFilterTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestFilterTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestFilterTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestFilterTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestFilterTest.cpp' object='tests/CppUTestTests-TestFilterTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestFailureTest.o: tests/CppUTest/TestFailureTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestFailureTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestFailureTest.o `test -f 'tests/CppUTest/TestFailureTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestFailureTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestFailureTest.cpp' object='tests/CppUTest/CppUTestTests-TestFailureTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestFilterTest.obj `if test -f 'tests/TestFilterTest.cpp'; then $(CYGPATH_W) 'tests/TestFilterTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestFilterTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestFailureTest.o `test -f 'tests/CppUTest/TestFailureTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestFailureTest.cpp -tests/CppUTestTests-TestHarness_cTest.o: tests/TestHarness_cTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestHarness_cTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Tpo -c -o tests/CppUTestTests-TestHarness_cTest.o `test -f 'tests/TestHarness_cTest.cpp' || echo '$(srcdir)/'`tests/TestHarness_cTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestHarness_cTest.cpp' object='tests/CppUTestTests-TestHarness_cTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestFailureTest.obj: tests/CppUTest/TestFailureTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestFailureTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestFailureTest.obj `if test -f 'tests/CppUTest/TestFailureTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestFailureTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestFailureTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestFailureTest.cpp' object='tests/CppUTest/CppUTestTests-TestFailureTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestHarness_cTest.o `test -f 'tests/TestHarness_cTest.cpp' || echo '$(srcdir)/'`tests/TestHarness_cTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestFailureTest.obj `if test -f 'tests/CppUTest/TestFailureTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestFailureTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestFailureTest.cpp'; fi` -tests/CppUTestTests-TestHarness_cTest.obj: tests/TestHarness_cTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestHarness_cTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Tpo -c -o tests/CppUTestTests-TestHarness_cTest.obj `if test -f 'tests/TestHarness_cTest.cpp'; then $(CYGPATH_W) 'tests/TestHarness_cTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestHarness_cTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestHarness_cTest.cpp' object='tests/CppUTestTests-TestHarness_cTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestFilterTest.o: tests/CppUTest/TestFilterTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestFilterTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestFilterTest.o `test -f 'tests/CppUTest/TestFilterTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestFilterTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestFilterTest.cpp' object='tests/CppUTest/CppUTestTests-TestFilterTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestHarness_cTest.obj `if test -f 'tests/TestHarness_cTest.cpp'; then $(CYGPATH_W) 'tests/TestHarness_cTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestHarness_cTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestFilterTest.o `test -f 'tests/CppUTest/TestFilterTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestFilterTest.cpp -tests/CppUTestTests-TestInstallerTest.o: tests/TestInstallerTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestInstallerTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestInstallerTest.Tpo -c -o tests/CppUTestTests-TestInstallerTest.o `test -f 'tests/TestInstallerTest.cpp' || echo '$(srcdir)/'`tests/TestInstallerTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestInstallerTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestInstallerTest.cpp' object='tests/CppUTestTests-TestInstallerTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestFilterTest.obj: tests/CppUTest/TestFilterTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestFilterTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestFilterTest.obj `if test -f 'tests/CppUTest/TestFilterTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestFilterTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestFilterTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestFilterTest.cpp' object='tests/CppUTest/CppUTestTests-TestFilterTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestInstallerTest.o `test -f 'tests/TestInstallerTest.cpp' || echo '$(srcdir)/'`tests/TestInstallerTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestFilterTest.obj `if test -f 'tests/CppUTest/TestFilterTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestFilterTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestFilterTest.cpp'; fi` -tests/CppUTestTests-TestInstallerTest.obj: tests/TestInstallerTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestInstallerTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestInstallerTest.Tpo -c -o tests/CppUTestTests-TestInstallerTest.obj `if test -f 'tests/TestInstallerTest.cpp'; then $(CYGPATH_W) 'tests/TestInstallerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestInstallerTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestInstallerTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestInstallerTest.cpp' object='tests/CppUTestTests-TestInstallerTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestHarness_cTest.o: tests/CppUTest/TestHarness_cTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestHarness_cTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestHarness_cTest.o `test -f 'tests/CppUTest/TestHarness_cTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestHarness_cTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestHarness_cTest.cpp' object='tests/CppUTest/CppUTestTests-TestHarness_cTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestInstallerTest.obj `if test -f 'tests/TestInstallerTest.cpp'; then $(CYGPATH_W) 'tests/TestInstallerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestInstallerTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestHarness_cTest.o `test -f 'tests/CppUTest/TestHarness_cTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestHarness_cTest.cpp -tests/CppUTestTests-TestMemoryAllocatorTest.o: tests/TestMemoryAllocatorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestMemoryAllocatorTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Tpo -c -o tests/CppUTestTests-TestMemoryAllocatorTest.o `test -f 'tests/TestMemoryAllocatorTest.cpp' || echo '$(srcdir)/'`tests/TestMemoryAllocatorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestMemoryAllocatorTest.cpp' object='tests/CppUTestTests-TestMemoryAllocatorTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestHarness_cTest.obj: tests/CppUTest/TestHarness_cTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestHarness_cTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestHarness_cTest.obj `if test -f 'tests/CppUTest/TestHarness_cTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestHarness_cTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestHarness_cTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestHarness_cTest.cpp' object='tests/CppUTest/CppUTestTests-TestHarness_cTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestMemoryAllocatorTest.o `test -f 'tests/TestMemoryAllocatorTest.cpp' || echo '$(srcdir)/'`tests/TestMemoryAllocatorTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestHarness_cTest.obj `if test -f 'tests/CppUTest/TestHarness_cTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestHarness_cTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestHarness_cTest.cpp'; fi` -tests/CppUTestTests-TestMemoryAllocatorTest.obj: tests/TestMemoryAllocatorTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestMemoryAllocatorTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Tpo -c -o tests/CppUTestTests-TestMemoryAllocatorTest.obj `if test -f 'tests/TestMemoryAllocatorTest.cpp'; then $(CYGPATH_W) 'tests/TestMemoryAllocatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestMemoryAllocatorTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestMemoryAllocatorTest.cpp' object='tests/CppUTestTests-TestMemoryAllocatorTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestInstallerTest.o: tests/CppUTest/TestInstallerTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestInstallerTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestInstallerTest.o `test -f 'tests/CppUTest/TestInstallerTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestInstallerTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestInstallerTest.cpp' object='tests/CppUTest/CppUTestTests-TestInstallerTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestMemoryAllocatorTest.obj `if test -f 'tests/TestMemoryAllocatorTest.cpp'; then $(CYGPATH_W) 'tests/TestMemoryAllocatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestMemoryAllocatorTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestInstallerTest.o `test -f 'tests/CppUTest/TestInstallerTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestInstallerTest.cpp -tests/CppUTestTests-TestOutputTest.o: tests/TestOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestOutputTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestOutputTest.Tpo -c -o tests/CppUTestTests-TestOutputTest.o `test -f 'tests/TestOutputTest.cpp' || echo '$(srcdir)/'`tests/TestOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestOutputTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestOutputTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestOutputTest.cpp' object='tests/CppUTestTests-TestOutputTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestInstallerTest.obj: tests/CppUTest/TestInstallerTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestInstallerTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestInstallerTest.obj `if test -f 'tests/CppUTest/TestInstallerTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestInstallerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestInstallerTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestInstallerTest.cpp' object='tests/CppUTest/CppUTestTests-TestInstallerTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestOutputTest.o `test -f 'tests/TestOutputTest.cpp' || echo '$(srcdir)/'`tests/TestOutputTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestInstallerTest.obj `if test -f 'tests/CppUTest/TestInstallerTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestInstallerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestInstallerTest.cpp'; fi` -tests/CppUTestTests-TestOutputTest.obj: tests/TestOutputTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestOutputTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestOutputTest.Tpo -c -o tests/CppUTestTests-TestOutputTest.obj `if test -f 'tests/TestOutputTest.cpp'; then $(CYGPATH_W) 'tests/TestOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestOutputTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestOutputTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestOutputTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestOutputTest.cpp' object='tests/CppUTestTests-TestOutputTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.o: tests/CppUTest/TestMemoryAllocatorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.o `test -f 'tests/CppUTest/TestMemoryAllocatorTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestMemoryAllocatorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestMemoryAllocatorTest.cpp' object='tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestOutputTest.obj `if test -f 'tests/TestOutputTest.cpp'; then $(CYGPATH_W) 'tests/TestOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestOutputTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.o `test -f 'tests/CppUTest/TestMemoryAllocatorTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestMemoryAllocatorTest.cpp -tests/CppUTestTests-TestRegistryTest.o: tests/TestRegistryTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestRegistryTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestRegistryTest.Tpo -c -o tests/CppUTestTests-TestRegistryTest.o `test -f 'tests/TestRegistryTest.cpp' || echo '$(srcdir)/'`tests/TestRegistryTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestRegistryTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestRegistryTest.cpp' object='tests/CppUTestTests-TestRegistryTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.obj: tests/CppUTest/TestMemoryAllocatorTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.obj `if test -f 'tests/CppUTest/TestMemoryAllocatorTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestMemoryAllocatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestMemoryAllocatorTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestMemoryAllocatorTest.cpp' object='tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestRegistryTest.o `test -f 'tests/TestRegistryTest.cpp' || echo '$(srcdir)/'`tests/TestRegistryTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestMemoryAllocatorTest.obj `if test -f 'tests/CppUTest/TestMemoryAllocatorTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestMemoryAllocatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestMemoryAllocatorTest.cpp'; fi` -tests/CppUTestTests-TestRegistryTest.obj: tests/TestRegistryTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestRegistryTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestRegistryTest.Tpo -c -o tests/CppUTestTests-TestRegistryTest.obj `if test -f 'tests/TestRegistryTest.cpp'; then $(CYGPATH_W) 'tests/TestRegistryTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestRegistryTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestRegistryTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestRegistryTest.cpp' object='tests/CppUTestTests-TestRegistryTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestOutputTest.o: tests/CppUTest/TestOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestOutputTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestOutputTest.o `test -f 'tests/CppUTest/TestOutputTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestOutputTest.cpp' object='tests/CppUTest/CppUTestTests-TestOutputTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestRegistryTest.obj `if test -f 'tests/TestRegistryTest.cpp'; then $(CYGPATH_W) 'tests/TestRegistryTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestRegistryTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestOutputTest.o `test -f 'tests/CppUTest/TestOutputTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestOutputTest.cpp -tests/CppUTestTests-TestResultTest.o: tests/TestResultTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestResultTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestResultTest.Tpo -c -o tests/CppUTestTests-TestResultTest.o `test -f 'tests/TestResultTest.cpp' || echo '$(srcdir)/'`tests/TestResultTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestResultTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestResultTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestResultTest.cpp' object='tests/CppUTestTests-TestResultTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestOutputTest.obj: tests/CppUTest/TestOutputTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestOutputTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestOutputTest.obj `if test -f 'tests/CppUTest/TestOutputTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestOutputTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestOutputTest.cpp' object='tests/CppUTest/CppUTestTests-TestOutputTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestResultTest.o `test -f 'tests/TestResultTest.cpp' || echo '$(srcdir)/'`tests/TestResultTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestOutputTest.obj `if test -f 'tests/CppUTest/TestOutputTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestOutputTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestOutputTest.cpp'; fi` -tests/CppUTestTests-TestResultTest.obj: tests/TestResultTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestResultTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestResultTest.Tpo -c -o tests/CppUTestTests-TestResultTest.obj `if test -f 'tests/TestResultTest.cpp'; then $(CYGPATH_W) 'tests/TestResultTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestResultTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestResultTest.Tpo tests/$(DEPDIR)/CppUTestTests-TestResultTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestResultTest.cpp' object='tests/CppUTestTests-TestResultTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestRegistryTest.o: tests/CppUTest/TestRegistryTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestRegistryTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestRegistryTest.o `test -f 'tests/CppUTest/TestRegistryTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestRegistryTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestRegistryTest.cpp' object='tests/CppUTest/CppUTestTests-TestRegistryTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestResultTest.obj `if test -f 'tests/TestResultTest.cpp'; then $(CYGPATH_W) 'tests/TestResultTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestResultTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestRegistryTest.o `test -f 'tests/CppUTest/TestRegistryTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestRegistryTest.cpp -tests/CppUTestTests-TestUTestMacro.o: tests/TestUTestMacro.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestUTestMacro.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestUTestMacro.Tpo -c -o tests/CppUTestTests-TestUTestMacro.o `test -f 'tests/TestUTestMacro.cpp' || echo '$(srcdir)/'`tests/TestUTestMacro.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestUTestMacro.Tpo tests/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestUTestMacro.cpp' object='tests/CppUTestTests-TestUTestMacro.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestRegistryTest.obj: tests/CppUTest/TestRegistryTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestRegistryTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestRegistryTest.obj `if test -f 'tests/CppUTest/TestRegistryTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestRegistryTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestRegistryTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestRegistryTest.cpp' object='tests/CppUTest/CppUTestTests-TestRegistryTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestUTestMacro.o `test -f 'tests/TestUTestMacro.cpp' || echo '$(srcdir)/'`tests/TestUTestMacro.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestRegistryTest.obj `if test -f 'tests/CppUTest/TestRegistryTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestRegistryTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestRegistryTest.cpp'; fi` -tests/CppUTestTests-TestUTestMacro.obj: tests/TestUTestMacro.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestUTestMacro.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestUTestMacro.Tpo -c -o tests/CppUTestTests-TestUTestMacro.obj `if test -f 'tests/TestUTestMacro.cpp'; then $(CYGPATH_W) 'tests/TestUTestMacro.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestUTestMacro.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestUTestMacro.Tpo tests/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestUTestMacro.cpp' object='tests/CppUTestTests-TestUTestMacro.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestResultTest.o: tests/CppUTest/TestResultTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestResultTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestResultTest.o `test -f 'tests/CppUTest/TestResultTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestResultTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestResultTest.cpp' object='tests/CppUTest/CppUTestTests-TestResultTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestUTestMacro.obj `if test -f 'tests/TestUTestMacro.cpp'; then $(CYGPATH_W) 'tests/TestUTestMacro.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestUTestMacro.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestResultTest.o `test -f 'tests/CppUTest/TestResultTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestResultTest.cpp -tests/CppUTestTests-TestUTestStringMacro.o: tests/TestUTestStringMacro.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestUTestStringMacro.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Tpo -c -o tests/CppUTestTests-TestUTestStringMacro.o `test -f 'tests/TestUTestStringMacro.cpp' || echo '$(srcdir)/'`tests/TestUTestStringMacro.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Tpo tests/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestUTestStringMacro.cpp' object='tests/CppUTestTests-TestUTestStringMacro.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestResultTest.obj: tests/CppUTest/TestResultTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestResultTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Tpo -c -o tests/CppUTest/CppUTestTests-TestResultTest.obj `if test -f 'tests/CppUTest/TestResultTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestResultTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestResultTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestResultTest.cpp' object='tests/CppUTest/CppUTestTests-TestResultTest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestUTestStringMacro.o `test -f 'tests/TestUTestStringMacro.cpp' || echo '$(srcdir)/'`tests/TestUTestStringMacro.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestResultTest.obj `if test -f 'tests/CppUTest/TestResultTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestResultTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestResultTest.cpp'; fi` -tests/CppUTestTests-TestUTestStringMacro.obj: tests/TestUTestStringMacro.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-TestUTestStringMacro.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Tpo -c -o tests/CppUTestTests-TestUTestStringMacro.obj `if test -f 'tests/TestUTestStringMacro.cpp'; then $(CYGPATH_W) 'tests/TestUTestStringMacro.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestUTestStringMacro.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Tpo tests/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/TestUTestStringMacro.cpp' object='tests/CppUTestTests-TestUTestStringMacro.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestUTestMacro.o: tests/CppUTest/TestUTestMacro.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestUTestMacro.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Tpo -c -o tests/CppUTest/CppUTestTests-TestUTestMacro.o `test -f 'tests/CppUTest/TestUTestMacro.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestUTestMacro.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestUTestMacro.cpp' object='tests/CppUTest/CppUTestTests-TestUTestMacro.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-TestUTestStringMacro.obj `if test -f 'tests/TestUTestStringMacro.cpp'; then $(CYGPATH_W) 'tests/TestUTestStringMacro.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/TestUTestStringMacro.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestUTestMacro.o `test -f 'tests/CppUTest/TestUTestMacro.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestUTestMacro.cpp -tests/CppUTestTests-UtestTest.o: tests/UtestTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-UtestTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-UtestTest.Tpo -c -o tests/CppUTestTests-UtestTest.o `test -f 'tests/UtestTest.cpp' || echo '$(srcdir)/'`tests/UtestTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-UtestTest.Tpo tests/$(DEPDIR)/CppUTestTests-UtestTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/UtestTest.cpp' object='tests/CppUTestTests-UtestTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestUTestMacro.obj: tests/CppUTest/TestUTestMacro.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestUTestMacro.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Tpo -c -o tests/CppUTest/CppUTestTests-TestUTestMacro.obj `if test -f 'tests/CppUTest/TestUTestMacro.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestUTestMacro.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestUTestMacro.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestUTestMacro.cpp' object='tests/CppUTest/CppUTestTests-TestUTestMacro.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-UtestTest.o `test -f 'tests/UtestTest.cpp' || echo '$(srcdir)/'`tests/UtestTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestUTestMacro.obj `if test -f 'tests/CppUTest/TestUTestMacro.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestUTestMacro.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestUTestMacro.cpp'; fi` -tests/CppUTestTests-UtestTest.obj: tests/UtestTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-UtestTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-UtestTest.Tpo -c -o tests/CppUTestTests-UtestTest.obj `if test -f 'tests/UtestTest.cpp'; then $(CYGPATH_W) 'tests/UtestTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/UtestTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-UtestTest.Tpo tests/$(DEPDIR)/CppUTestTests-UtestTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/UtestTest.cpp' object='tests/CppUTestTests-UtestTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestUTestStringMacro.o: tests/CppUTest/TestUTestStringMacro.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestUTestStringMacro.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Tpo -c -o tests/CppUTest/CppUTestTests-TestUTestStringMacro.o `test -f 'tests/CppUTest/TestUTestStringMacro.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestUTestStringMacro.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestUTestStringMacro.cpp' object='tests/CppUTest/CppUTestTests-TestUTestStringMacro.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-UtestTest.obj `if test -f 'tests/UtestTest.cpp'; then $(CYGPATH_W) 'tests/UtestTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/UtestTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestUTestStringMacro.o `test -f 'tests/CppUTest/TestUTestStringMacro.cpp' || echo '$(srcdir)/'`tests/CppUTest/TestUTestStringMacro.cpp -tests/CppUTestTests-UtestPlatformTest.o: tests/UtestPlatformTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-UtestPlatformTest.o -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Tpo -c -o tests/CppUTestTests-UtestPlatformTest.o `test -f 'tests/UtestPlatformTest.cpp' || echo '$(srcdir)/'`tests/UtestPlatformTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Tpo tests/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/UtestPlatformTest.cpp' object='tests/CppUTestTests-UtestPlatformTest.o' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-TestUTestStringMacro.obj: tests/CppUTest/TestUTestStringMacro.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-TestUTestStringMacro.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Tpo -c -o tests/CppUTest/CppUTestTests-TestUTestStringMacro.obj `if test -f 'tests/CppUTest/TestUTestStringMacro.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestUTestStringMacro.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestUTestStringMacro.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/TestUTestStringMacro.cpp' object='tests/CppUTest/CppUTestTests-TestUTestStringMacro.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-UtestPlatformTest.o `test -f 'tests/UtestPlatformTest.cpp' || echo '$(srcdir)/'`tests/UtestPlatformTest.cpp +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-TestUTestStringMacro.obj `if test -f 'tests/CppUTest/TestUTestStringMacro.cpp'; then $(CYGPATH_W) 'tests/CppUTest/TestUTestStringMacro.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/TestUTestStringMacro.cpp'; fi` -tests/CppUTestTests-UtestPlatformTest.obj: tests/UtestPlatformTest.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTestTests-UtestPlatformTest.obj -MD -MP -MF tests/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Tpo -c -o tests/CppUTestTests-UtestPlatformTest.obj `if test -f 'tests/UtestPlatformTest.cpp'; then $(CYGPATH_W) 'tests/UtestPlatformTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/UtestPlatformTest.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Tpo tests/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/UtestPlatformTest.cpp' object='tests/CppUTestTests-UtestPlatformTest.obj' libtool=no @AMDEPBACKSLASH@ +tests/CppUTest/CppUTestTests-UtestTest.o: tests/CppUTest/UtestTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-UtestTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Tpo -c -o tests/CppUTest/CppUTestTests-UtestTest.o `test -f 'tests/CppUTest/UtestTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/UtestTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/UtestTest.cpp' object='tests/CppUTest/CppUTestTests-UtestTest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTestTests-UtestPlatformTest.obj `if test -f 'tests/UtestPlatformTest.cpp'; then $(CYGPATH_W) 'tests/UtestPlatformTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/UtestPlatformTest.cpp'; fi` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-UtestTest.o `test -f 'tests/CppUTest/UtestTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/UtestTest.cpp + +tests/CppUTest/CppUTestTests-UtestTest.obj: tests/CppUTest/UtestTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-UtestTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Tpo -c -o tests/CppUTest/CppUTestTests-UtestTest.obj `if test -f 'tests/CppUTest/UtestTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/UtestTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/UtestTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/UtestTest.cpp' object='tests/CppUTest/CppUTestTests-UtestTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-UtestTest.obj `if test -f 'tests/CppUTest/UtestTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/UtestTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/UtestTest.cpp'; fi` + +tests/CppUTest/CppUTestTests-UtestPlatformTest.o: tests/CppUTest/UtestPlatformTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-UtestPlatformTest.o -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Tpo -c -o tests/CppUTest/CppUTestTests-UtestPlatformTest.o `test -f 'tests/CppUTest/UtestPlatformTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/UtestPlatformTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/UtestPlatformTest.cpp' object='tests/CppUTest/CppUTestTests-UtestPlatformTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-UtestPlatformTest.o `test -f 'tests/CppUTest/UtestPlatformTest.cpp' || echo '$(srcdir)/'`tests/CppUTest/UtestPlatformTest.cpp + +tests/CppUTest/CppUTestTests-UtestPlatformTest.obj: tests/CppUTest/UtestPlatformTest.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -MT tests/CppUTest/CppUTestTests-UtestPlatformTest.obj -MD -MP -MF tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Tpo -c -o tests/CppUTest/CppUTestTests-UtestPlatformTest.obj `if test -f 'tests/CppUTest/UtestPlatformTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/UtestPlatformTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/UtestPlatformTest.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Tpo tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/CppUTest/UtestPlatformTest.cpp' object='tests/CppUTest/CppUTestTests-UtestPlatformTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CppUTestTests_CPPFLAGS) $(CPPFLAGS) $(CppUTestTests_CXXFLAGS) $(CXXFLAGS) -c -o tests/CppUTest/CppUTestTests-UtestPlatformTest.obj `if test -f 'tests/CppUTest/UtestPlatformTest.cpp'; then $(CYGPATH_W) 'tests/CppUTest/UtestPlatformTest.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/CppUTest/UtestPlatformTest.cpp'; fi` mostlyclean-libtool: -rm -f *.lo @@ -2772,6 +3074,69 @@ distclean-libtool: -rm -f libtool config.lt +install-cmakeDATA: $(cmake_DATA) + @$(NORMAL_INSTALL) + @list='$(cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \ + done + +uninstall-cmakeDATA: + @$(NORMAL_UNINSTALL) + @list='$(cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir) +install-cmakemodulesDATA: $(cmakemodules_DATA) + @$(NORMAL_INSTALL) + @list='$(cmakemodules_DATA)'; test -n "$(cmakemodulesdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakemodulesdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakemodulesdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakemodulesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakemodulesdir)" || exit $$?; \ + done + +uninstall-cmakemodulesDATA: + @$(NORMAL_UNINSTALL) + @list='$(cmakemodules_DATA)'; test -n "$(cmakemodulesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakemodulesdir)'; $(am__uninstall_files_from_dir) +install-cmakescriptsDATA: $(cmakescripts_DATA) + @$(NORMAL_INSTALL) + @list='$(cmakescripts_DATA)'; test -n "$(cmakescriptsdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakescriptsdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakescriptsdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakescriptsdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakescriptsdir)" || exit $$?; \ + done + +uninstall-cmakescriptsDATA: + @$(NORMAL_UNINSTALL) + @list='$(cmakescripts_DATA)'; test -n "$(cmakescriptsdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakescriptsdir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ @@ -3015,7 +3380,7 @@ fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -3065,7 +3430,10 @@ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -3108,7 +3476,7 @@ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -3123,6 +3491,10 @@ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -3134,7 +3506,7 @@ @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -3152,7 +3524,7 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -3162,9 +3534,11 @@ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -3237,7 +3611,7 @@ check: check-am all-am: Makefile $(LIBRARIES) $(DATA) $(HEADERS) config.h installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(include_cpputestdir)" "$(DESTDIR)$(include_cpputestextdir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakemodulesdir)" "$(DESTDIR)$(cmakescriptsdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(include_cpputestdir)" "$(DESTDIR)$(include_cpputestextdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -3277,8 +3651,8 @@ -rm -f src/CppUTestExt/$(am__dirstamp) -rm -f src/Platforms/@CPP_PLATFORM@/$(DEPDIR)/$(am__dirstamp) -rm -f src/Platforms/@CPP_PLATFORM@/$(am__dirstamp) - -rm -f tests/$(DEPDIR)/$(am__dirstamp) - -rm -f tests/$(am__dirstamp) + -rm -f tests/CppUTest/$(DEPDIR)/$(am__dirstamp) + -rm -f tests/CppUTest/$(am__dirstamp) -rm -f tests/CppUTestExt/$(DEPDIR)/$(am__dirstamp) -rm -f tests/CppUTestExt/$(am__dirstamp) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) @@ -3293,7 +3667,106 @@ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf src/CppUTest/$(DEPDIR) src/CppUTestExt/$(DEPDIR) src/Platforms/@CPP_PLATFORM@/$(DEPDIR) tests/$(DEPDIR) tests/CppUTestExt/$(DEPDIR) + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineArguments.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineTestRunner.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-JUnitTestOutput.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakDetector.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakWarningPlugin.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleMutex.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleString.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TeamCityTestOutput.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFailure.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFilter.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestHarness_c.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestMemoryAllocator.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestOutput.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestPlugin.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestRegistry.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestResult.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestTestingFixture.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-Utest.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-CodeMemoryReportFormatter.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportAllocator.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportFormatter.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReporterPlugin.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockActualCall.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCall.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCallsList.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockFailure.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockNamedValue.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupportPlugin.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport_c.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-OrderedTest.Po + -rm -f src/Platforms/@CPP_PLATFORM@/$(DEPDIR)/lib_libCppUTest_a-UtestPlatform.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-AllTests.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-CodeMemoryReporterTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-ExpectedFunctionsListTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GMockTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest1Test.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest2ConvertorTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest_c.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportAllocatorTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportFormatterTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReporterPluginTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockActualCallTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCallTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCheatSheetTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockComparatorCopierTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockExpectedCallTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureReporterForTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockHierarchyTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockNamedValueTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockParameterTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockPluginTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockReturnValueTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockStrictOrderTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupportTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTestCFile.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-local distclean-tags @@ -3310,7 +3783,8 @@ info-am: -install-data-am: install-include_cpputestHEADERS \ +install-data-am: install-cmakeDATA install-cmakemodulesDATA \ + install-cmakescriptsDATA install-include_cpputestHEADERS \ install-include_cpputestextHEADERS install-pkgconfigDATA install-dvi: install-dvi-am @@ -3342,7 +3816,106 @@ maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf src/CppUTest/$(DEPDIR) src/CppUTestExt/$(DEPDIR) src/Platforms/@CPP_PLATFORM@/$(DEPDIR) tests/$(DEPDIR) tests/CppUTestExt/$(DEPDIR) + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineArguments.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-CommandLineTestRunner.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-JUnitTestOutput.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakDetector.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-MemoryLeakWarningPlugin.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleMutex.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleString.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-SimpleStringInternalCache.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TeamCityTestOutput.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFailure.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestFilter.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestHarness_c.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestMemoryAllocator.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestOutput.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestPlugin.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestRegistry.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestResult.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-TestTestingFixture.Po + -rm -f src/CppUTest/$(DEPDIR)/lib_libCppUTest_a-Utest.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-CodeMemoryReportFormatter.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-GTest.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-IEEE754ExceptionsPlugin.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportAllocator.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReportFormatter.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MemoryReporterPlugin.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockActualCall.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCall.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockExpectedCallsList.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockFailure.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockNamedValue.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupportPlugin.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-MockSupport_c.Po + -rm -f src/CppUTestExt/$(DEPDIR)/lib_libCppUTestExt_a-OrderedTest.Po + -rm -f src/Platforms/@CPP_PLATFORM@/$(DEPDIR)/lib_libCppUTest_a-UtestPlatform.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllTests.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFree.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocLetTestFreeTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCFile.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-AllocationInCppFile.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-CheatSheetTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineArgumentsTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-CommandLineTestRunnerTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-CompatabilityTests.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-DummyMemoryLeakDetector.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-JUnitOutputTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakDetectorTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryLeakWarningTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-MemoryOperatorOverloadTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-PluginTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-PreprocessorTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-SetPluginTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleMutexTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringCacheTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-SimpleStringTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TeamCityOutputTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureNaNTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFailureTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestFilterTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestHarness_cTestCFile.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestInstallerTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestMemoryAllocatorTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestOutputTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestRegistryTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestResultTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestMacro.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-TestUTestStringMacro.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestPlatformTest.Po + -rm -f tests/CppUTest/$(DEPDIR)/CppUTestTests-UtestTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-AllTests.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-CodeMemoryReporterTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-ExpectedFunctionsListTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GMockTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest1Test.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-GTest2ConvertorTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-IEEE754PluginTest_c.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportAllocatorTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReportFormatterTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MemoryReporterPluginTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockActualCallTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCallTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockCheatSheetTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockComparatorCopierTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockExpectedCallTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureReporterForTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFailureTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockFakeLongLong.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockHierarchyTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockNamedValueTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockParameterTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockPluginTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockReturnValueTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockStrictOrderTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupportTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-MockSupport_cTestCFile.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest.Po + -rm -f tests/CppUTestExt/$(DEPDIR)/CppUTestExtTests-OrderedTestTest_c.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -3359,24 +3932,26 @@ ps-am: -uninstall-am: uninstall-include_cpputestHEADERS \ +uninstall-am: uninstall-cmakeDATA uninstall-cmakemodulesDATA \ + uninstall-cmakescriptsDATA uninstall-include_cpputestHEADERS \ uninstall-include_cpputestextHEADERS uninstall-libLIBRARIES \ uninstall-pkgconfigDATA .MAKE: all check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \ - check-am clean clean-checkPROGRAMS clean-cscope clean-generic \ - clean-libLIBRARIES clean-libtool cscope cscopelist-am ctags \ - ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-compile distclean-generic distclean-hdr \ - distclean-libtool distclean-local distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am \ - install-include_cpputestHEADERS \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ + check-TESTS check-am clean clean-checkPROGRAMS clean-cscope \ + clean-generic clean-libLIBRARIES clean-libtool cscope \ + cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip dist-zstd distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-local distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-cmakeDATA install-cmakemodulesDATA \ + install-cmakescriptsDATA install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-include_cpputestHEADERS \ install-include_cpputestextHEADERS install-info \ install-info-am install-libLIBRARIES install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ @@ -3384,7 +3959,8 @@ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ - uninstall-am uninstall-include_cpputestHEADERS \ + uninstall-am uninstall-cmakeDATA uninstall-cmakemodulesDATA \ + uninstall-cmakescriptsDATA uninstall-include_cpputestHEADERS \ uninstall-include_cpputestextHEADERS uninstall-libLIBRARIES \ uninstall-pkgconfigDATA @@ -3399,45 +3975,64 @@ ./$(CPPUTEST_TESTS) @INCLUDE_CPPUTEST_EXT_TRUE@ ./$(CPPUTESTEXT_TESTS) +cpputest_build_gtest18: + mkdir -p cpputest_build_gtest18 + cd cpputest_build_gtest18; \ + wget https://github.com/google/googletest/archive/release-1.8.0.zip -O gtest-1.8.0.zip && unzip gtest-1.8.0.zip; \ + cd googletest-release-1.8.0; cmake .; make + cpputest_build_gtest17: mkdir -p cpputest_build_gtest17 cd cpputest_build_gtest17; \ - wget https://googlemock.googlecode.com/files/gmock-1.7.0.zip && unzip gmock-1.7.0.zip - cd cpputest_build_gtest17/gmock-1.7.0; ./configure && make check + wget https://github.com/google/googletest/archive/release-1.7.0.zip -O gtest-1.7.0.zip && unzip gtest-1.7.0.zip; \ + wget https://github.com/google/googlemock/archive/release-1.7.0.zip -O gmock-1.7.0.zip && unzip gmock-1.7.0.zip; \ + mv googletest-release-1.7.0 googlemock-release-1.7.0/gtest; \ + cd googlemock-release-1.7.0; autoreconf -i; ./configure && make cpputest_build_gtest16: mkdir -p cpputest_build_gtest16 cd cpputest_build_gtest16; \ - wget https://googlemock.googlecode.com/files/gmock-1.6.0.zip && unzip gmock-1.6.0.zip - cd cpputest_build_gtest16/gmock-1.6.0; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make check + wget https://github.com/google/googletest/archive/release-1.6.0.zip -O gtest-1.6.0.zip && unzip gtest-1.6.0.zip; \ + wget https://github.com/google/googlemock/archive/release-1.6.0.zip -O gmock-1.6.0.zip && unzip gmock-1.6.0.zip; \ + mv googletest-release-1.6.0 googlemock-release-1.6.0/gtest; \ + cd googlemock-release-1.6.0; autoreconf -i; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make cpputest_build_gtest15: mkdir -p cpputest_build_gtest15 cd cpputest_build_gtest15; \ - wget https://googlemock.googlecode.com/files/gmock-1.5.0.zip && unzip gmock-1.5.0.zip - cd cpputest_build_gtest15/gmock-1.5.0; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make + wget https://github.com/google/googletest/archive/release-1.5.0.zip -O gtest-1.5.0.zip && unzip gtest-1.5.0.zip; \ + wget https://github.com/google/googlemock/archive/release-1.5.0.zip -O gmock-1.5.0.zip && unzip gmock-1.5.0.zip; \ + mv googletest-release-1.5.0 googlemock-release-1.5.0/gtest; \ + cd googlemock-release-1.5.0; autoreconf -i; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make check_gtest15: cpputest_build_gtest15 @echo "Build using gmock 1.5"; - export GMOCK_HOME=`pwd`/cpputest_build_gtest15/gmock-1.5.0; \ - make distclean; $(srcdir)/configure; make check + export GMOCK_HOME=`pwd`/cpputest_build_gtest15/googlemock-release-1.5.0; \ + make distclean; $(srcdir)/configure --enable-std-cpp98; make check check_gtest16: cpputest_build_gtest16 @echo "Build using gmock 1.6"; - export GMOCK_HOME=`pwd`/cpputest_build_gtest16/gmock-1.6.0; \ - make distclean; $(srcdir)/configure; make check + export GMOCK_HOME=`pwd`/cpputest_build_gtest16/googlemock-release-1.6.0; \ + make distclean; $(srcdir)/configure --enable-std-cpp98; make check check_gtest17: cpputest_build_gtest17 @echo "Build using gmock 1.7" - export GMOCK_HOME=`pwd`/cpputest_build_gtest17/gmock-1.7.0; \ - make distclean; $(srcdir)/configure; make check + export GMOCK_HOME=`pwd`/cpputest_build_gtest17/googlemock-release-1.7.0; \ + make distclean; $(srcdir)/configure --enable-std-cpp98; make check + +check_gtest18: cpputest_build_gtest18 + @echo "Build using gmock 1.8" + export GMOCK_HOME=`pwd`/cpputest_build_gtest18/googletest-release-1.8.0/googlemock; \ + export GTEST_HOME=`pwd`/cpputest_build_gtest18/googletest-release-1.8.0/googletest; \ + make distclean; $(srcdir)/configure --enable-std-cpp98; make check remove_gtest_directories: rm -rf cpputest_build_gtest15 rm -rf cpputest_build_gtest16 rm -rf cpputest_build_gtest17 + rm -rf cpputest_build_gtest18 -check_gtest: remove_gtest_directories check_gtest15 check_gtest16 check_gtest17 +check_gtest: remove_gtest_directories check_gtest15 check_gtest16 check_gtest17 check_gtest18 check_basic: @echo "If dash is available, run the configure with dash to find bash-isms and increase portability" @@ -3451,9 +4046,21 @@ @echo "Building without extensions" make distclean; $(srcdir)/configure --disable-extensions; make check + @echo "Building with the Std C++ 98 turned on. Compiler acts differently then." + make distclean; $(srcdir)/configure --enable-std-cpp98; make + @echo "Building with the Std C++ 11 turned on. Compiler acts differently then." make distclean; $(srcdir)/configure --enable-std-cpp11; make + @echo "Building with the Std C++ 14 turned on. Compiler acts differently then." + make distclean; $(srcdir)/configure --enable-std-cpp14; make + + @echo "Building with the Std C++ 17 turned on. Compiler acts differently then." + make distclean; $(srcdir)/configure --enable-std-cpp17; make + + @echo "Building with the Std C++ 20 turned on. Compiler acts differently then." + make distclean; $(srcdir)/configure --enable-std-cpp20; make + @echo "Building without the Standard C library" make distclean; $(srcdir)/configure --disable-std-c; make @@ -3463,6 +4070,9 @@ @echo "Building without memory leak detection" make distclean; $(srcdir)/configure --disable-memory-leak-detection; make check + @echo "Building with address sanitizer" + make distclean; $(srcdir)/configure --enable-sanitize-address; make check + @echo "Building without memory leak detection and without Standard C++" make distclean; $(srcdir)/configure --disable-memory-leak-detection --disable-std-cpp; make check diff -Nru cpputest-3.8/Makefile_using_MakefileWorker cpputest-4.0/Makefile_using_MakefileWorker --- cpputest-3.8/Makefile_using_MakefileWorker 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/Makefile_using_MakefileWorker 2020-05-26 11:24:07.000000000 +0000 @@ -11,14 +11,15 @@ CPPUTEST_HOME = . OLD_MAKE = oldmake +MAKE_CMD = make -f $(CPPUTEST_HOME)/Makefile_using_MakefileWorker CPPUTEST_ENABLE_DEBUG = Y SRC_DIRS = \ src/CppUTest \ src/Platforms/$(CPP_PLATFORM) - + TEST_SRC_DIRS = \ - tests + tests/CppUTest INCLUDE_DIRS =\ include @@ -27,75 +28,63 @@ #these are a sample of the other alternative flag settings .PHONY: test_all -test_all: start test_old_make +test_all: start @echo Building with the default flags. - make clean - $(TIME) make + $(MAKE_CMD) clean + $(TIME) $(MAKE_CMD) ./$(TEST_TARGET) -r - make clean - @echo Building with the STDC++ new disabled. - $(TIME) make CPPUTEST_USE_STD_CPP_LIB=Y extensions - make CPPUTEST_USE_STD_CPP_LIB=Y cleanExtensions + $(MAKE_CMD) clean + @echo Building with the STDC++ new disabled. + $(TIME) $(MAKE_CMD) CPPUTEST_USE_STD_CPP_LIB=Y extensions + $(MAKE_CMD) CPPUTEST_USE_STD_CPP_LIB=Y cleanExtensions @echo Building with Memory Leak Detection disabled - $(TIME) make CPPUTEST_USE_MEM_LEAK_DETECTION=N extensions - make CPPUTEST_USE_MEM_LEAK_DETECTION=N cleanExtensions + $(TIME) $(MAKE_CMD) CPPUTEST_USE_MEM_LEAK_DETECTION=N extensions + $(MAKE_CMD) CPPUTEST_USE_MEM_LEAK_DETECTION=N cleanExtensions @echo Building with Memory Leak Detection disabled and STD C++ disabled - $(TIME) make CPPUTEST_USE_MEM_LEAK_DETECTION=N CPPUTEST_USE_STD_CPP_LIB=Y extensions - make CPPUTEST_USE_MEM_LEAK_DETECTION=N CPPUTEST_USE_STD_CPP_LIB=Y cleanExtensions + $(TIME) $(MAKE_CMD) CPPUTEST_USE_MEM_LEAK_DETECTION=N CPPUTEST_USE_STD_CPP_LIB=Y extensions + $(MAKE_CMD) CPPUTEST_USE_MEM_LEAK_DETECTION=N CPPUTEST_USE_STD_CPP_LIB=Y cleanExtensions @echo Building with debug disabled - $(TIME) make CPPUTEST_ENABLE_DEBUG=N extensions - make CPPUTEST_ENABLE_DEBUG=N cleanExtensions + $(TIME) $(MAKE_CMD) CPPUTEST_ENABLE_DEBUG=N extensions + $(MAKE_CMD) CPPUTEST_ENABLE_DEBUG=N cleanExtensions @echo Building with overridden CXXFLAGS and CFLAGS and CPPFLAGS - $(TIME) make CLFAGS="" CXXFLAGS="" CPPFLAGS="-Iinclude" - make CFLAGS="" CXXFLAGS="" clean + $(TIME) $(MAKE_CMD) CLFAGS="" CXXFLAGS="" CPPFLAGS="-Iinclude" + $(MAKE_CMD) CFLAGS="" CXXFLAGS="" clean @echo Building without Standard C library includes - $(TIME) make CPPUTEST_USE_STD_C_LIB=N all_no_tests - make CPPUTEST_USE_STD_C_LIB=N clean + $(TIME) $(MAKE_CMD) CPPUTEST_USE_STD_C_LIB=N all_no_tests + $(MAKE_CMD) CPPUTEST_USE_STD_C_LIB=N clean @echo Building with a different TARGET_PLATFORM - make TARGET_PLATFORM=real_platform + $(MAKE_CMD) TARGET_PLATFORM=real_platform @echo Building with overridden CXXFLAGS and CFLAGS and memory leak and STDC++ disabled - $(TIME) make CLFAGS="" CXXFLAGS="" CPPFLAGS="-Iinclude -DCPPUTEST_STD_CPP_LIB_DISABLED -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED" - make CFLAGS="" CXXFLAGS="" CPPFLAGS="-DCPPUTEST_STD_CPP_LIB_DISABLED -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED" clean - @echo Building examples - make cleanExamples - $(TIME) make examples - make cleanExamples + $(TIME) $(MAKE_CMD) CLFAGS="" CXXFLAGS="" CPPFLAGS="-Iinclude -DCPPUTEST_STD_CPP_LIB_DISABLED -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED" + $(MAKE_CMD) CFLAGS="" CXXFLAGS="" CPPFLAGS="-DCPPUTEST_STD_CPP_LIB_DISABLED -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED" clean + @echo Building examples + $(MAKE_CMD) cleanExamples + $(TIME) $(MAKE_CMD) examples + $(MAKE_CMD) cleanExamples @echo Testing JUnit output - $(TIME) make + $(TIME) $(MAKE_CMD) $(SILENCE)./$(TEST_TARGET) -ojunit > junit_run_output $(SILENCE)if [ -s junit_run_output ]; then echo "JUnit run has output. Build failed!"; exit 1; fi - make clean - make CPPUTEST_MAP_FILE=map.txt - make clean + $(MAKE_CMD) clean + $(MAKE_CMD) CPPUTEST_MAP_FILE=map.txt + $(MAKE_CMD) clean @echo Testing GCOV usage - $(TIME) make CPPUTEST_USE_GCOV=Y everythingInstall - make gcov - make -f Makefile_CppUTestExt gcov - make -C examples gcov - make cleanEverythingInstall + $(TIME) $(MAKE_CMD) CPPUTEST_USE_GCOV=Y everythingInstall + $(MAKE_CMD) gcov + $(MAKE) -f Makefile_CppUTestExt gcov + $(MAKE) -C examples gcov + $(MAKE_CMD) cleanEverythingInstall @echo Testing VPATH usage - $(TIME) make CPPUTEST_USE_GCOV=Y CPPUTEST_USE_VPATH=Y everythingInstall - make CPPUTEST_USE_VPATH=Y gcov - make CPPUTEST_USE_VPATH=Y -f Makefile_CppUTestExt gcov - make CPPUTEST_USE_VPATH=Y -C examples gcov - make clean cleanExamples + $(TIME) $(MAKE_CMD) CPPUTEST_USE_GCOV=Y CPPUTEST_USE_VPATH=Y everythingInstall + $(MAKE_CMD) CPPUTEST_USE_VPATH=Y gcov + $(MAKE) CPPUTEST_USE_VPATH=Y -f Makefile_CppUTestExt gcov + $(MAKE) CPPUTEST_USE_VPATH=Y -C examples gcov + $(MAKE_CMD) clean cleanExamples @echo Testing VPATH usage - $(TIME) make CPPUTEST_USE_VPATH=Y everythingInstall - make CPPUTEST_USE_VPATH=Y cleanEverythingInstall - make flags - make debug - -HAS_OLD_MAKE = $(shell $(OLD_MAKE) -v 2>/dev/null) - -test_old_make: - $(SILENCE)if [ "$(HAS_OLD_MAKE)" = "" ]; then \ - echo "Old make with the name $(OLD_MAKE) not found. Skipping testing with old make version"; \ - else \ - $(OLD_MAKE) -f Makefile_for_old_make clean && \ - $(OLD_MAKE) -f Makefile_for_old_make && \ - $(OLD_MAKE) -f Makefile_for_old_make extensions && \ - $(OLD_MAKE) -f Makefile_for_old_make clean; \ - fi + $(TIME) $(MAKE_CMD) CPPUTEST_USE_VPATH=Y everythingInstall + $(MAKE_CMD) CPPUTEST_USE_VPATH=Y cleanEverythingInstall + $(MAKE_CMD) flags + $(MAKE_CMD) debug .PHONY: examples examples: $(TEST_TARGET) extensions diff -Nru cpputest-3.8/makeVc6.bat cpputest-4.0/makeVc6.bat --- cpputest-3.8/makeVc6.bat 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/makeVc6.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -rem **** -rem * Command line build - For CppUTest - Run from dsw directory -rem * -rem * A single parameter is supported and it is the last parameter of msdev -rem * for example: -rem * /clean -rem * make sure to use the slash -rem * this needs to be in your path -rem ****PATH=C:\Program Files\Microsoft Visual Studio\VC98\Bin;%PATH% - -msdev CppUTest.dsp /MAKE "CppUTest - Debug" %1 -msdev tests\AllTests.dsp /MAKE "AllTests - Debug" %1 -if "%1" EQU "/clean" goto end -if "%1" EQU "/CLEAN" goto end -tests\Debug\AllTests -:end diff -Nru cpputest-3.8/missing cpputest-4.0/missing --- cpputest-3.8/missing 2016-05-02 05:35:46.000000000 +0000 +++ cpputest-4.0/missing 2020-05-26 11:27:12.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru cpputest-3.8/platforms/CCStudio/CppUTestExtRunAllTests1.pjt cpputest-4.0/platforms/CCStudio/CppUTestExtRunAllTests1.pjt --- cpputest-3.8/platforms/CCStudio/CppUTestExtRunAllTests1.pjt 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/platforms/CCStudio/CppUTestExtRunAllTests1.pjt 2020-05-26 11:24:07.000000000 +0000 @@ -18,6 +18,7 @@ Source="..\..\src\CppUTest\MemoryLeakWarningPlugin.cpp" Source="..\..\src\CppUTest\SimpleMutex.cpp" Source="..\..\src\CppUTest\SimpleString.cpp" +Source="..\..\src\CppUTest\SimpleStringInternalCache.cpp" Source="..\..\src\CppUTest\TeamCityTestOutput.cpp" Source="..\..\src\CppUTest\TestFailure.cpp" Source="..\..\src\CppUTest\TestFilter.cpp" @@ -30,6 +31,7 @@ Source="..\..\src\CppUTest\TestTestingFixture.cpp" Source="..\..\src\CppUTest\Utest.cpp" Source="..\..\src\CppUTestExt\CodeMemoryReportFormatter.cpp" +Source="..\..\src\CppUTestExt\GTest.cpp" Source="..\..\src\CppUTestExt\MemoryReportAllocator.cpp" Source="..\..\src\CppUTestExt\MemoryReporterPlugin.cpp" Source="..\..\src\CppUTestExt\MemoryReportFormatter.cpp" diff -Nru cpputest-3.8/platforms/CCStudio/CppUTestExtRunAllTests2.pjt cpputest-4.0/platforms/CCStudio/CppUTestExtRunAllTests2.pjt --- cpputest-3.8/platforms/CCStudio/CppUTestExtRunAllTests2.pjt 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/platforms/CCStudio/CppUTestExtRunAllTests2.pjt 2020-05-26 11:24:07.000000000 +0000 @@ -18,6 +18,7 @@ Source="..\..\src\CppUTest\MemoryLeakWarningPlugin.cpp" Source="..\..\src\CppUTest\SimpleMutex.cpp" Source="..\..\src\CppUTest\SimpleString.cpp" +Source="..\..\src\CppUTest\SimpleStringInternalCache.cpp" Source="..\..\src\CppUTest\TeamCityTestOutput.cpp" Source="..\..\src\CppUTest\TestFailure.cpp" Source="..\..\src\CppUTest\TestFilter.cpp" @@ -30,6 +31,7 @@ Source="..\..\src\CppUTest\TestTestingFixture.cpp" Source="..\..\src\CppUTest\Utest.cpp" Source="..\..\src\CppUTestExt\CodeMemoryReportFormatter.cpp" +Source="..\..\src\CppUTestExt\GTest.cpp" Source="..\..\src\CppUTestExt\MemoryReportAllocator.cpp" Source="..\..\src\CppUTestExt\MemoryReporterPlugin.cpp" Source="..\..\src\CppUTestExt\MemoryReportFormatter.cpp" @@ -52,6 +54,7 @@ Source="..\..\tests\CppUTestExt\MockSupport_cTest.cpp" Source="..\..\tests\CppUTestExt\MockSupport_cTestCFile.c" Source="..\..\tests\CppUTestExt\OrderedTestTest.cpp" +Source="..\..\tests\CppUTestExt\OrderedTestTest_c.c" Source="C:\CCStudio_v3.3\C2000\cgtools\lib\src\farmem_cpp.cpp" Source="tests\CppUTestExt\AllTestsForTarget.cpp" Source="sim28335.cmd" diff -Nru cpputest-3.8/platforms/CCStudio/CppUTest.pjt cpputest-4.0/platforms/CCStudio/CppUTest.pjt --- cpputest-3.8/platforms/CCStudio/CppUTest.pjt 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/platforms/CCStudio/CppUTest.pjt 2020-05-26 11:24:07.000000000 +0000 @@ -30,6 +30,7 @@ Source="..\..\src\CppUTest\TestTestingFixture.cpp" Source="..\..\src\CppUTest\Utest.cpp" Source="..\..\src\CppUTestExt\CodeMemoryReportFormatter.cpp" +Source="..\..\src\CppUTestExt\GTest.cpp" Source="..\..\src\CppUTestExt\MemoryReportAllocator.cpp" Source="..\..\src\CppUTestExt\MemoryReporterPlugin.cpp" Source="..\..\src\CppUTestExt\MemoryReportFormatter.cpp" diff -Nru cpputest-3.8/platforms/CCStudio/CppUTestRunAllTests1.pjt cpputest-4.0/platforms/CCStudio/CppUTestRunAllTests1.pjt --- cpputest-3.8/platforms/CCStudio/CppUTestRunAllTests1.pjt 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/platforms/CCStudio/CppUTestRunAllTests1.pjt 2020-05-26 11:24:07.000000000 +0000 @@ -18,6 +18,7 @@ Source="..\..\src\CppUTest\MemoryLeakWarningPlugin.cpp" Source="..\..\src\CppUTest\SimpleMutex.cpp" Source="..\..\src\CppUTest\SimpleString.cpp" +Source="..\..\src\CppUTest\SimpleStringInternalCache.cpp" Source="..\..\src\CppUTest\TeamCityTestOutput.cpp" Source="..\..\src\CppUTest\TestFailure.cpp" Source="..\..\src\CppUTest\TestFilter.cpp" @@ -35,6 +36,7 @@ Source="..\..\tests\AllocLetTestFree.c" Source="..\..\tests\AllocLetTestFreeTest.cpp" Source="..\..\tests\CheatSheetTest.cpp" +Source="..\..\tests\CompatabilityTests.cpp" Source="..\..\tests\CommandLineArgumentsTest.cpp" Source="..\..\tests\CommandLineTestRunnerTest.cpp" Source="..\..\tests\JUnitOutputTest.cpp" diff -Nru cpputest-3.8/platforms/CCStudio/CppUTestRunAllTests2.pjt cpputest-4.0/platforms/CCStudio/CppUTestRunAllTests2.pjt --- cpputest-3.8/platforms/CCStudio/CppUTestRunAllTests2.pjt 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/platforms/CCStudio/CppUTestRunAllTests2.pjt 2020-05-26 11:24:07.000000000 +0000 @@ -18,6 +18,7 @@ Source="..\..\src\CppUTest\MemoryLeakWarningPlugin.cpp" Source="..\..\src\CppUTest\SimpleMutex.cpp" Source="..\..\src\CppUTest\SimpleString.cpp" +Source="..\..\src\CppUTest\SimpleStringInternalCache.cpp" Source="..\..\src\CppUTest\TeamCityTestOutput.cpp" Source="..\..\src\CppUTest\TestFailure.cpp" Source="..\..\src\CppUTest\TestFilter.cpp" @@ -31,7 +32,7 @@ Source="..\..\src\CppUTest\Utest.cpp" Source="..\..\src\CppUTestExt\MockSupportPlugin.cpp" Source="..\..\src\Platforms\C2000\UtestPlatform.cpp" -Source="..\..\tests\SimpleStringTest.cpp" +Source="..\..\tests\SimpleStringCacheTest.cpp" Source="..\..\tests\TestFilterTest.cpp" Source="..\..\tests\TestHarness_cTest.cpp" Source="..\..\tests\TestHarness_cTestCFile.c" diff -Nru cpputest-3.8/platforms/Dos/alltests.sh cpputest-4.0/platforms/Dos/alltests.sh --- cpputest-3.8/platforms/Dos/alltests.sh 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/Dos/alltests.sh 2020-05-26 11:24:07.000000000 +0000 @@ -1,13 +1,27 @@ #!/bin/bash + +checkForCppUTestToolsEnvVariable() { + if [ -z "$CPPUTEST_HOME" ] ; then + echo "CPPUTEST_HOME not set. You must set CPPUTEST_HOME to the top level CppUTest directory" + exit 1 + fi + if [ ! -d "$CPPUTEST_HOME" ] ; then + echo "CPPUTEST_HOME not set to a directory. You must set CPPUTEST_HOME to the top level CppUTest directory" + exit 2 + fi +} + +checkForCppUTestToolsEnvVariable + printf "" > exit # so dosbox will run 'external' command 'exit' correctly printf "" >ALLTESTS.LOG for test in `ls *.EXE`; do kb=`ls -lsk ${test} | awk '{print $1}'` printf "Running ${test} (${kb}k) inside DOSBox...\n" - dosbox -conf ../platforms/Dos/dosbox-0.74.conf exit \ + dosbox -conf $CPPUTEST_HOME/platforms/Dos/dosbox-0.74.conf exit \ -c "echo *** ${test} (${kb}k) *****************************>>ALLTESTS.LOG" \ -c "${test}>>ALLTESTS.LOG" \ - -noconsole -exit || exit 1 + -noconsole -exit 1>console_output 2>dosbox_error.log || { printf "error running command!\n"; cat dosbox_error.log; exit 1; } done printf "\n" [ "`cat ALLTESTS.LOG`" ] || { printf "No tests to run!\n"; exit 1; } diff -Nru cpputest-3.8/platforms/Dos/Makefile cpputest-4.0/platforms/Dos/Makefile --- cpputest-3.8/platforms/Dos/Makefile 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/Dos/Makefile 2020-05-26 11:24:07.000000000 +0000 @@ -10,8 +10,8 @@ drive = $(subst $(CYGDRIVE),$(lastword $(subst /, ,$(CYGDRIVE))):/,$(1)) convert_paths = $(if $(CYGDRIVE),$(subst /,$(path_separator),$(call drive,$(1))),$(1)) --include ../platforms/Dos/platform.mk -include ../platforms/Dos/sources.mk +-include $(CPPUTEST_HOME)/platforms/Dos/platform.mk +include $(CPPUTEST_HOME)/platforms/Dos/sources.mk # Disable W013 unreachable code - it overreacts to CHECK_EQUAL macros # Disable W367 conditional expression in if statement is always true - same @@ -29,8 +29,9 @@ .PHONY: all clean -all: CPPU.LIB CPPUX.LIB CPPU1.EXE CPPU2.EXE CPPU3.EXE CPPU4.EXE \ - CPPU5.EXE CPPU6.EXE CPPU7.EXE +all: CPPU.LIB CPPUX.LIB \ + CPPU1.EXE CPPU2.EXE CPPU3.EXE CPPU4.EXE CPPU5.EXE CPPU6.EXE CPPU7.EXE CPPU8.EXE \ + CPPUX1.EXE CPPUX2.EXE CPPUX3.EXE CPPUX4.EXE CPPUX5.EXE CPPUX6.EXE CPPUX7.EXE CPPUX8.EXE CPPUX9.EXE clean: rm -rf ../src/CppUTest/*.o ../src/CppUTestExt/*.o \ diff -Nru cpputest-3.8/platforms/Dos/sources.mk cpputest-4.0/platforms/Dos/sources.mk --- cpputest-3.8/platforms/Dos/sources.mk 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/platforms/Dos/sources.mk 2020-05-26 11:24:07.000000000 +0000 @@ -7,7 +7,7 @@ $(CPPUTEST_HOME)/src/CppUTest/MemoryLeakWarningPlugin.o \ $(CPPUTEST_HOME)/src/CppUTest/SimpleMutex.o \ $(CPPUTEST_HOME)/src/CppUTest/SimpleString.o \ - $(CPPUTEST_HOME)/src/CppUTest/TeamCityTestOutput.o \ + $(CPPUTEST_HOME)/src/CppUTest/SimpleStringInternalCache.o \ $(CPPUTEST_HOME)/src/CppUTest/TestFailure.o \ $(CPPUTEST_HOME)/src/CppUTest/TestFilter.o \ $(CPPUTEST_HOME)/src/CppUTest/TestHarness_c.o \ @@ -18,7 +18,7 @@ $(CPPUTEST_HOME)/src/CppUTest/TestTestingFixture.o \ $(CPPUTEST_HOME)/src/CppUTest/TestResult.o \ $(CPPUTEST_HOME)/src/CppUTest/Utest.o \ - $(CPPUTEST_HOME)/src/Platforms/Dos/UtestPlatform.o \ + $(CPPUTEST_HOME)/src/Platforms/Dos/UtestPlatform.o CPPUX_OBJECTS := \ $(CPPUTEST_HOME)/src/CppUTestExt/CodeMemoryReportFormatter.o \ @@ -34,55 +34,78 @@ $(CPPUTEST_HOME)/src/CppUTestExt/OrderedTest.o \ $(CPPUTEST_HOME)/src/CppUTestExt/MemoryReportFormatter.o \ $(CPPUTEST_HOME)/src/CppUTestExt/MockExpectedCallsList.o \ - $(CPPUTEST_HOME)/src/CppUTestExt/MockSupport.o \ + $(CPPUTEST_HOME)/src/CppUTestExt/MockSupport.o CPPU1_OBJECTS := \ - $(CPPUTEST_HOME)/tests/AllTests.o \ - $(CPPUTEST_HOME)/tests/AllocLetTestFree.o \ - $(CPPUTEST_HOME)/tests/AllocLetTestFreeTest.o \ - $(CPPUTEST_HOME)/tests/CheatSheetTest.o \ - $(CPPUTEST_HOME)/tests/CommandLineArgumentsTest.o \ - $(CPPUTEST_HOME)/tests/CommandLineTestRunnerTest.o \ - $(CPPUTEST_HOME)/tests/JUnitOutputTest.o \ - $(CPPUTEST_HOME)/tests/MemoryLeakWarningTest.o \ - $(CPPUTEST_HOME)/tests/PluginTest.o \ - $(CPPUTEST_HOME)/tests/PreprocessorTest.o \ - $(CPPUTEST_HOME)/tests/SetPluginTest.o \ - $(CPPUTEST_HOME)/tests/SimpleMutexTest.o \ - $(CPPUTEST_HOME)/tests/TeamCityOutputTest.o \ - $(CPPUTEST_HOME)/tests/TestFailureNaNTest.o \ - $(CPPUTEST_HOME)/tests/TestFailureTest.o \ - $(CPPUTEST_HOME)/tests/TestResultTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/AllocLetTestFree.o \ + $(CPPUTEST_HOME)/tests/CppUTest/AllocLetTestFreeTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/CheatSheetTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/CompatabilityTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/CommandLineArgumentsTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/CommandLineTestRunnerTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/JUnitOutputTest.o CPPU2_OBJECTS := \ - $(CPPUTEST_HOME)/tests/AllTests.o \ - $(CPPUTEST_HOME)/tests/MemoryLeakDetectorTest.o \ - $(CPPUTEST_HOME)/tests/SimpleStringTest.o \ - $(CPPUTEST_HOME)/tests/TestOutputTest.o \ - $(CPPUTEST_HOME)/tests/TestRegistryTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/DummyMemoryLeakDetector.o \ + $(CPPUTEST_HOME)/tests/CppUTest/MemoryLeakWarningTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/PluginTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/PreprocessorTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/SetPluginTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/SimpleMutexTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TeamCityOutputTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestFailureNaNTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestFailureTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestResultTest.o \ CPPU3_OBJECTS := \ - $(CPPUTEST_HOME)/tests/AllTests.o \ - $(CPPUTEST_HOME)/tests/AllocationInCFile.o \ - $(CPPUTEST_HOME)/tests/AllocationInCppFile.o \ - $(CPPUTEST_HOME)/tests/MemoryOperatorOverloadTest.o \ - $(CPPUTEST_HOME)/tests/TeamCityOutputTest.o \ - $(CPPUTEST_HOME)/tests/TestFilterTest.o \ - $(CPPUTEST_HOME)/tests/TestHarness_cTest.o \ - $(CPPUTEST_HOME)/tests/TestHarness_cTestCFile.o \ - $(CPPUTEST_HOME)/tests/TestInstallerTest.o \ - $(CPPUTEST_HOME)/tests/TestMemoryAllocatorTest.o \ - $(CPPUTEST_HOME)/tests/TestUTestMacro.o \ - $(CPPUTEST_HOME)/tests/UtestPlatformTest.o \ - $(CPPUTEST_HOME)/tests/UtestTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/MemoryLeakDetectorTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/SimpleStringTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/SimpleStringCacheTest.o CPPU4_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTest/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestOutputTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestRegistryTest.o \ + +CPPU5_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTest/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/AllocationInCFile.o \ + $(CPPUTEST_HOME)/tests/CppUTest/AllocationInCppFile.o \ + $(CPPUTEST_HOME)/tests/CppUTest/MemoryOperatorOverloadTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TeamCityOutputTest.o + +CPPU6_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTest/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestFilterTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestHarness_cTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestHarness_cTestCFile.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestInstallerTest.o + +CPPU7_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTest/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestMemoryAllocatorTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestUTestMacro.o + +CPPU8_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTest/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTest/UtestPlatformTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/UtestTest.o \ + $(CPPUTEST_HOME)/tests/CppUTest/TestUTestStringMacro.o \ + +CPPUX1_OBJECTS := \ $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/ExpectedFunctionsListTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/GMockTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/GTest1Test.o \ - $(CPPUTEST_HOME)/tests/CppUTestExt/GTest2ConvertorTest.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/GTest2ConvertorTest.o + +CPPUX2_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MemoryReportAllocatorTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MemoryReportFormatterTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MemoryReporterPluginTest.o \ @@ -90,35 +113,51 @@ $(CPPUTEST_HOME)/tests/CppUTestExt/MockCheatSheetTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockComparatorCopierTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockExpectedCallTest.o \ - $(CPPUTEST_HOME)/tests/CppUTestExt/MockHierarchyTest.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockHierarchyTest.o -CPPU5_OBJECTS := \ +CPPUX3_OBJECTS := \ $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/CodeMemoryReporterTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/OrderedTestTest.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/OrderedTestTest_c.o \ + +CPPUX4_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockReturnValueTest.o \ - $(CPPUTEST_HOME)/tests/CppUTestExt/MockNamedValueTest.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockNamedValueTest.o + +CPPUX5_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockPluginTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockSupport_cTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockSupport_cTestCFile.o \ -CPPU6_OBJECTS := \ +CPPUX6_OBJECTS := \ $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/ExpectedFunctionsListTest.o \ - $(CPPUTEST_HOME)/tests/CppUTestExt/MockCallTest.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockCallTest.o + +CPPUX7_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockComparatorCopierTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockHierarchyTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockParameterTest.o \ - $(CPPUTEST_HOME)/tests/TestUTestStringMacro.o \ - CPPU7_OBJECTS := \ +CPPUX8_OBJECTS := \ $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/IEEE754PluginTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/IEEE754PluginTest_c.o \ - $(CPPUTEST_HOME)/tests/CppUTestExt/MockComparatorCopierTest.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockComparatorCopierTest.o + +CPPUX9_OBJECTS := \ + $(CPPUTEST_HOME)/tests/CppUTestExt/AllTests.o \ + $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureReporterForTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockFailureTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockHierarchyTest.o \ $(CPPUTEST_HOME)/tests/CppUTestExt/MockPluginTest.o \ diff -Nru cpputest-3.8/platforms/Eclipse-Cygwin/.project cpputest-4.0/platforms/Eclipse-Cygwin/.project --- cpputest-3.8/platforms/Eclipse-Cygwin/.project 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/Eclipse-Cygwin/.project 2020-05-26 11:24:07.000000000 +0000 @@ -40,11 +40,6 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/.travis.yml - .travis_github_deployer.yml - 1 - PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/.travis_github_deployer.yml - - AUTHORS 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/AUTHORS @@ -390,11 +385,6 @@ PARENT-2-PROJECT_LOC/cpputest_build/Makefile - docs/WalkThrough_VS21010.docx - 1 - PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/docs/WalkThrough_VS21010.docx - - examples/.cdtproject 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/examples/.cdtproject @@ -730,6 +720,11 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/CheatSheetTest.cpp + tests/CompatabilityTests.cpp + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/CompatabilityTests.cpp + + tests/CommandLineArgumentsTest.cpp 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/CommandLineArgumentsTest.cpp @@ -790,6 +785,11 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/SetPluginTest.cpp + tests/SimpleStringCacheTest.cpp + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/SimpleStringCacheTest.cpp + + tests/SimpleStringTest.cpp 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/SimpleStringTest.cpp @@ -1020,6 +1020,11 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/include/CppUTest/SimpleString.h + include/CppUTest/SimpleStringInternalCache.h + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/include/CppUTest/SimpleStringInternalCache.h + + include/CppUTest/StandardCLibrary.h 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/include/CppUTest/StandardCLibrary.h @@ -1095,6 +1100,11 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/include/CppUTestExt/GMock.h + include/CppUTestExt/GTestSupport.h + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/include/CppUTestExt/GTestSupport.h + + include/CppUTestExt/GTest.h 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/include/CppUTestExt/GTest.h @@ -1504,11 +1514,16 @@ 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/src/CppUTest/MemoryLeakWarningPlugin.cpp - + src/CppUTest/SimpleString.cpp 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/src/CppUTest/SimpleString.cpp + src/CppUTest/SimpleStringInternalCache.cpp + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/src/CppUTest/SimpleStringInternalCache.cpp + src/CppUTest/TestFailure.cpp 1 @@ -1565,6 +1580,11 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/src/CppUTestExt/CodeMemoryReportFormatter.cpp + src/CppUTestExt/GTest.cpp + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/src/CppUTestExt/GTest.cpp + + src/CppUTestExt/MemoryReportAllocator.cpp 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/src/CppUTestExt/MemoryReportAllocator.cpp @@ -1765,6 +1785,16 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/CppUTestExt/OrderedTestTest.cpp + tests/CppUTestExt/OrderedTestTest_c.c + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/CppUTestExt/OrderedTestTest_c.c + + + tests/CppUTestExt/OrderedTestTest.h + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/CppUTestExt/OrderedTestTest.h + + tests/Debug/AllTests.bsc 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/AllTests.bsc @@ -1855,6 +1885,16 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/CodeMemoryReportFormatterTest.sbr + tests/Debug/CompatabilityTests.obj + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/CompatabilityTests.obj + + + tests/Debug/CompatabilityTests.sbr + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/CompatabilityTests.sbr + + tests/Debug/CommandLineArgumentsTest.obj 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/CommandLineArgumentsTest.obj @@ -2065,6 +2105,16 @@ PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/OrderedTestTest.sbr + tests/Debug/OrderedTestTest_c.obj + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/OrderedTestTest_c.obj + + + tests/Debug/OrderedTestTest_c.sbr + 1 + PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/OrderedTestTest_c.sbr + + tests/Debug/PluginTest.obj 1 PARENT-2-ECLIPSE_HOME/00_Dev/05_CppUTest/cpputest/tests/Debug/PluginTest.obj diff -Nru cpputest-3.8/platforms/Eclipse-Cygwin/README.md cpputest-4.0/platforms/Eclipse-Cygwin/README.md --- cpputest-3.8/platforms/Eclipse-Cygwin/README.md 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/Eclipse-Cygwin/README.md 2020-05-26 11:24:07.000000000 +0000 @@ -1,21 +1,21 @@ -##Using the Eclipse-Cygwin Project +## Using the Eclipse-Cygwin Project This project is for use on the Windows platform. These are the steps required for using it. (If you only wish to compile the CppUTest libraries, it is recommended that you use the method described at http://cpputest.github.io, rather than setting up Eclipse). -###Preparation -####1. Install Cygwin +### Preparation +#### 1. Install Cygwin You need to have Cygwin installed, with at least the Gnu C\C++ compiler, make, autotools and libtool. Please follow the instructions at http://cpputest.github.io to build CppUTest from the Cygwin bash prompt. -####2. Set your PATH +#### 2. Set your PATH Next, you need to add the path to your Cygwin binaries to your Windows system path, e.g. ```dos C:\\Cygwin\bin ``` -####3. Install Eclipse CDT +#### 3. Install Eclipse CDT Use your existing Eclipse CDT (Juno, Kepler, ...) or unpack the release to your system drive. You may use the 32 bit version as it will work on all systems. Unless you have a specific reason, you do not require the 64 bit version. You may need to install or update your Java JRE and add it to your system path. The JRE needs to match, e.g. 32 bit Eclipse requires the 32 bit JRE. -####4. Install the C/C++Unit plugin +#### 4. Install the C/C++Unit plugin Open Eclipse. Accept the default workspace for now (you may want to set a more appropriate workspace location later on). Then install the "C/C++ Unit Test" plugin: "Help"->"Install New Software"-> work with "Kepler - http://download.eclipse.org/releases/kepler". @@ -30,20 +30,20 @@ [x] Gcov Integration ``` -####5. Add the CppUTest plugin +#### 5. Add the CppUTest plugin Clone the [CppUTest Eclipse Test Runner](https://github.com/tcmak/CppUTestEclipseJunoTestRunner) and add it to Eclipse following the instructions there. -###Import this project into Eclipse +### Import this project into Eclipse In Eclipse you can't simply "open" a project - you have to first import it into the workspace: * File->Import...->General->Existing Projects into workspace * [Next >]->Select root directory: `/Platforms/Eclipse-Cygwin` * Make sure that `[ ] Copy projects into workspace` is **NOT** ticked. * Click Finish. -###Compile and run tests +### Compile and run tests Before you can compile CppUTest in Eclipse, you must configure it using Automake. Instructions can be found at http://cpputest.github.io/. Once you have done this, select a configuration (Libraries, Check, CppUTestTests or CppUTestExtTests) via Project->BuildConfiguration->Set Active>. The 'Check' configuration will build the libraries along with all tests and run the tests. -###Working with the C/C++ Unit plugin +### Working with the C/C++ Unit plugin Make sure your unit test executable has been built and exists, e.g. cpputest_build/CppUTestTests.exe. The first time you run tests using the plugin, you need to select them via @@ -56,10 +56,10 @@ This is an example of what a successful test run would look like: ![Successful Test Run](https://raw.githubusercontent.com/cpputest/cpputest.github.io/master/images/eclipse-testrunner-01.png) You can select and rerun individual tests in the upper pane, and error messages for failed tests will appear in the lower pane. -###Troubleshooting -####Problem: I am getting no test results... +### Troubleshooting +#### Problem: I am getting no test results... ...but you know your tests should have run, and you did not receive any error message. -#####Possible Reason: +##### Possible Reason: This can happen if the Cygwin-generated binary can't find the Cygwin DLLs. (If you were to run your test executable at the Windows cmd prompt, you would see a Windows error message box to that effect). Since no error message is displayed in the console via stderr, this leaves the test runner ignorant of what happenend -#####Solution: +##### Solution: You need to add /Cygwin/bin to your system PATH variable. Then you must restart Eclipse. diff -Nru cpputest-3.8/platforms/iar/CppUTest.dep cpputest-4.0/platforms/iar/CppUTest.dep --- cpputest-3.8/platforms/iar/CppUTest.dep 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTest.dep 1970-01-01 00:00:00.000000000 +0000 @@ -1,557 +0,0 @@ - - - - 2 - 1004061121 - - Debug - - $PROJ_DIR$\Debug\Obj\TestFailure.o - $PROJ_DIR$\Debug\Obj\SimpleString.o - $PROJ_DIR$\Debug\Obj\TestFilter.o - $PROJ_DIR$\Debug\Obj\MemoryLeakWarningPlugin.o - $PROJ_DIR$\Debug\Obj\TestMemoryAllocator.o - $PROJ_DIR$\Debug\Obj\TestHarness_c.o - $PROJ_DIR$\Debug\Obj\SimpleMutex.o - $PROJ_DIR$\Debug\Obj\CommandLineArguments.pbi - $PROJ_DIR$\Debug\Obj\UtestPlatform.o - $PROJ_DIR$\Debug\Obj\TestPlugin.o - $PROJ_DIR$\Debug\Obj\TestOutput.o - $PROJ_DIR$\Debug\Obj\TestRegistry.o - $PROJ_DIR$\Debug\Obj\TestResult.o - $PROJ_DIR$\Debug\Obj\Utest.o - $PROJ_DIR$\Debug\Obj\JUnitTestOutput.pbi - $PROJ_DIR$\Debug\Obj\CommandLineTestRunner.pbi - $PROJ_DIR$\Debug\Obj\MemoryLeakDetector.pbi - $PROJ_DIR$\Debug\Obj\MemoryLeakWarningPlugin.pbi - $PROJ_DIR$\Debug\Obj\SimpleMutex.pbi - $PROJ_DIR$\Debug\Obj\SimpleString.pbi - $PROJ_DIR$\Debug\Obj\TestFailure.pbi - $PROJ_DIR$\Debug\Obj\TestFilter.pbi - $PROJ_DIR$\Debug\Obj\TestHarness_c.pbi - $PROJ_DIR$\Debug\Obj\TestMemoryAllocator.pbi - $PROJ_DIR$\Debug\Obj\TestOutput.pbi - $PROJ_DIR$\Debug\Obj\TestPlugin.pbi - $PROJ_DIR$\Debug\Obj\TestRegistry.pbi - $PROJ_DIR$\Debug\Obj\TestResult.pbi - $PROJ_DIR$\Debug\Obj\UtestPlatform.pbi - $PROJ_DIR$\..\..\include\CppUTest\JUnitTestOutput.h - $PROJ_DIR$\..\..\include\CppUTest\CommandLineTestRunner.h - $PROJ_DIR$\..\..\include\CppUTest\TestRegistry.h - $PROJ_DIR$\..\..\include\CppUTest\TestMemoryAllocator.h - $PROJ_DIR$\..\..\include\CppUTest\SimpleMutex.h - $PROJ_DIR$\..\..\include\CppUTest\MemoryLeakDetector.h - $PROJ_DIR$\..\..\include\CppUTest\TestHarness_c.h - $TOOLKIT_DIR$\inc\c\setjmp.h - $PROJ_DIR$\..\..\src\CppUTest\JUnitTestOutput.cpp - $PROJ_DIR$\..\..\src\CppUTest\CommandLineTestRunner.cpp - $PROJ_DIR$\..\..\src\CppUTest\CommandLineArguments.cpp - $PROJ_DIR$\..\..\src\CppUTest\MemoryLeakDetector.cpp - $PROJ_DIR$\..\..\src\CppUTest\MemoryLeakWarningPlugin.cpp - $PROJ_DIR$\..\..\src\CppUTest\SimpleMutex.cpp - $PROJ_DIR$\..\..\src\CppUTest\SimpleString.cpp - $PROJ_DIR$\..\..\src\CppUTest\TestFailure.cpp - $PROJ_DIR$\..\..\src\CppUTest\TestFilter.cpp - $PROJ_DIR$\..\..\src\CppUTest\TestHarness_c.cpp - $PROJ_DIR$\..\..\src\CppUTest\TestMemoryAllocator.cpp - $PROJ_DIR$\..\..\src\CppUTest\TestOutput.cpp - $PROJ_DIR$\..\..\src\CppUTest\TestPlugin.cpp - $PROJ_DIR$\..\..\src\CppUTest\TestRegistry.cpp - $PROJ_DIR$\..\..\src\CppUTest\TestResult.cpp - $PROJ_DIR$\..\..\src\Platforms\Iar\UtestPlatform.cpp - $PROJ_DIR$\..\..\src\CppUTest\Utest.cpp - $PROJ_DIR$\Debug\Obj\CommandLineTestRunner.o - $PROJ_DIR$\Debug\Obj\CommandLineArguments.o - $PROJ_DIR$\Debug\Obj\MemoryLeakDetector.o - $PROJ_DIR$\Debug\Obj\JUnitTestOutput.o - $PROJ_DIR$\Debug\Obj\Utest.pbi - $PROJ_DIR$\Debug\Exe\CppUTest.a - $PROJ_DIR$\Debug\Obj\CppUTest.pbd - $TOOLKIT_DIR$\inc\cpp\xlocinfo - $TOOLKIT_DIR$\inc\c\xencoding_limits.h - $TOOLKIT_DIR$\inc\c\cmath - $TOOLKIT_DIR$\inc\c\yvals.h - $TOOLKIT_DIR$\inc\c\ycheck.h - $TOOLKIT_DIR$\inc\c\ysizet.h - $TOOLKIT_DIR$\inc\c\cstdlib - $PROJ_DIR$\..\..\include\CppUTest\StandardCLibrary.h - $TOOLKIT_DIR$\inc\c\ymath.h - $PROJ_DIR$\..\..\include\CppUTest\CppUTestConfig.h - $PROJ_DIR$\..\..\include\CppUTest\TestResult.h - $TOOLKIT_DIR$\inc\c\math.h - $TOOLKIT_DIR$\inc\cpp\xiosbase - $TOOLKIT_DIR$\inc\cpp\xlocale - $TOOLKIT_DIR$\inc\cpp\utility - $PROJ_DIR$\..\..\include\CppUTest\SimpleString.h - $TOOLKIT_DIR$\inc\c\DLib_Defaults.h - $TOOLKIT_DIR$\inc\c\DLib_Product.h - $PROJ_DIR$\..\..\include\CppUTest\PlatformSpecificFunctions.h - $TOOLKIT_DIR$\inc\c\cstring - $PROJ_DIR$\..\..\include\CppUTest\PlatformSpecificFunctions_c.h - $TOOLKIT_DIR$\inc\c\ystdio.h - $PROJ_DIR$\..\..\include\CppUTest\UtestMacros.h - $TOOLKIT_DIR$\inc\c\stddef.h - $TOOLKIT_DIR$\inc\cpp\iosfwd - $TOOLKIT_DIR$\inc\cpp\xstddef - $TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h - $PROJ_DIR$\..\..\include\CppUTest\TestPlugin.h - $TOOLKIT_DIR$\inc\c\DLib_Product_string.h - $TOOLKIT_DIR$\inc\c\stdlib.h - $TOOLKIT_DIR$\inc\c\stdio.h - $PROJ_DIR$\..\..\include\CppUTest\CommandLineArguments.h - $TOOLKIT_DIR$\inc\cpp\string - $TOOLKIT_DIR$\inc\c\ctype.h - $TOOLKIT_DIR$\inc\cpp\typeinfo - $TOOLKIT_DIR$\inc\c\wchar.h - $TOOLKIT_DIR$\inc\cpp\xstring - $TOOLKIT_DIR$\inc\cpp\xutility - $TOOLKIT_DIR$\inc\cpp\exception - $PROJ_DIR$\..\..\include\CppUTest\TestFailure.h - $TOOLKIT_DIR$\inc\c\xlocaleuse.h - $TOOLKIT_DIR$\inc\cpp\ios - $TOOLKIT_DIR$\inc\cpp\memory - $PROJ_DIR$\..\..\include\CppUTest\MemoryLeakWarningPlugin.h - $PROJ_DIR$\..\..\include\CppUTest\Utest.h - $TOOLKIT_DIR$\inc\c\climits - $TOOLKIT_DIR$\inc\c\DLib_Threads.h - $TOOLKIT_DIR$\inc\cpp\istream - $TOOLKIT_DIR$\inc\cpp\ostream - $TOOLKIT_DIR$\inc\c\cstdio - $TOOLKIT_DIR$\inc\cpp\xlocnum - $TOOLKIT_DIR$\inc\c\cstddef - $TOOLKIT_DIR$\inc\c\clocale - $TOOLKIT_DIR$\inc\cpp\streambuf - $TOOLKIT_DIR$\inc\c\limits.h - $TOOLKIT_DIR$\inc\c\xtgmath.h - $TOOLKIT_DIR$\inc\cpp\stdexcept - $TOOLKIT_DIR$\inc\cpp\xdebug - $TOOLKIT_DIR$\inc\cpp\new - $TOOLKIT_DIR$\inc\c\string.h - $TOOLKIT_DIR$\inc\c\cwchar - $TOOLKIT_DIR$\inc\cpp\xmemory - $TOOLKIT_DIR$\inc\c\ctime - $TOOLKIT_DIR$\inc\c\xtls.h - $TOOLKIT_DIR$\inc\c\xmtx.h - $TOOLKIT_DIR$\inc\c\xlocale.h - $PROJ_DIR$\..\..\include\CppUTest\TestHarness.h - $TOOLKIT_DIR$\inc\c\cctype - $PROJ_DIR$\..\..\include\CppUTest\TestOutput.h - $TOOLKIT_DIR$\inc\c\time.h - $PROJ_DIR$\..\..\include\CppUTest\MemoryLeakDetectorNewMacros.h - $TOOLKIT_DIR$\inc\c\xlocale_c.h - $TOOLKIT_DIR$\inc\c\locale.h - $TOOLKIT_DIR$\inc\c\xlocale_lconv.h - $PROJ_DIR$\..\..\include\CppUTest\TestFilter.h - - - [ROOT_NODE] - - - IARCHIVE - 59 - - - - - $PROJ_DIR$\..\..\src\CppUTest\JUnitTestOutput.cpp - - - BICOMP - 14 - - - ICCARM - 57 - - - - - BICOMP - 78 121 132 70 106 64 65 66 90 77 109 114 112 79 71 62 111 118 120 122 97 134 81 83 88 68 84 87 108 102 110 115 116 117 113 99 86 119 67 133 131 29 100 105 76 104 107 93 63 72 69 91 82 73 74 80 95 61 89 98 75 85 96 128 123 130 129 127 94 126 124 101 125 103 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 29 129 79 81 - - - - - $PROJ_DIR$\..\..\src\CppUTest\CommandLineTestRunner.cpp - - - BICOMP - 15 - - - ICCARM - 54 - - - - - BICOMP - 65 102 64 76 108 117 99 135 31 70 104 107 110 115 116 113 86 119 129 105 100 67 90 62 109 111 106 114 66 118 120 112 122 121 80 94 101 96 103 30 29 83 71 88 68 84 77 87 78 93 63 72 69 91 82 73 74 95 61 89 97 98 75 85 126 124 125 127 128 123 132 133 134 130 131 92 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 30 129 92 135 29 31 - - - - - $PROJ_DIR$\..\..\src\CppUTest\CommandLineArguments.cpp - - - BICOMP - 7 - - - ICCARM - 55 - - - - - BICOMP - 61 65 66 62 63 64 67 71 69 73 74 75 70 77 78 76 68 72 82 80 84 85 86 81 79 83 88 90 87 93 91 95 89 97 98 99 94 101 96 103 92 105 100 104 107 108 109 102 111 106 110 114 115 116 117 118 113 120 112 122 119 121 126 124 125 129 127 128 123 132 133 134 130 131 135 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 92 129 135 79 81 - - - - - $PROJ_DIR$\..\..\src\CppUTest\MemoryLeakDetector.cpp - - - BICOMP - 16 - - - ICCARM - 56 - - - - - BICOMP - 64 65 120 105 90 111 122 81 62 106 118 124 33 100 67 107 109 114 66 112 113 126 125 88 32 70 76 104 108 102 110 115 116 117 99 86 98 80 121 34 79 83 71 68 84 77 87 78 93 63 72 69 91 82 73 74 95 61 89 97 75 85 94 101 96 103 127 119 128 123 132 133 134 130 131 129 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 34 32 79 129 81 33 - - - - - $PROJ_DIR$\..\..\src\CppUTest\MemoryLeakWarningPlugin.cpp - - - BICOMP - 17 - - - ICCARM - 3 - - - - - BICOMP - 105 64 111 122 65 120 81 106 118 124 79 100 67 87 109 114 66 112 113 126 125 88 34 70 76 104 77 62 78 108 102 110 115 116 117 99 86 119 80 121 32 33 83 71 68 84 90 107 93 63 72 69 91 82 73 74 95 61 89 97 98 75 85 94 101 96 103 127 128 123 132 133 134 130 131 129 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 34 32 79 129 81 33 - - - - - $PROJ_DIR$\..\..\src\CppUTest\SimpleMutex.cpp - - - BICOMP - 18 - - - ICCARM - 6 - - - - - BICOMP - 112 65 66 109 114 64 71 87 106 121 70 90 62 111 118 120 122 81 83 88 68 84 77 78 108 102 110 115 116 117 113 99 86 119 96 80 94 101 76 103 33 105 100 104 67 107 93 63 72 69 91 82 73 74 95 61 89 97 98 75 85 126 124 125 127 128 123 132 133 134 130 131 79 129 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 33 79 129 81 - - - - - $PROJ_DIR$\..\..\src\CppUTest\SimpleString.cpp - - - BICOMP - 19 - - - ICCARM - 1 - - - - - BICOMP - 68 64 65 67 98 130 88 90 87 83 84 62 93 91 95 89 97 128 79 71 70 66 77 78 76 63 72 69 82 73 74 80 61 75 110 96 123 122 129 32 105 100 104 107 108 109 102 111 106 114 115 116 117 118 113 120 99 86 112 119 121 132 133 134 131 127 85 94 126 124 101 125 103 81 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 79 129 81 32 - - - - - $PROJ_DIR$\..\..\src\CppUTest\TestFailure.cpp - - - BICOMP - 20 - - - ICCARM - 0 - - - - - BICOMP - 66 65 95 89 97 70 93 91 79 71 87 64 67 98 85 86 81 129 83 88 68 84 90 77 62 78 76 63 72 69 82 73 74 80 61 75 99 94 101 96 100 105 104 107 108 109 102 111 106 110 114 115 116 117 118 113 120 112 122 119 121 126 124 125 103 127 128 123 132 133 134 130 131 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 129 79 81 - - - - - $PROJ_DIR$\..\..\src\CppUTest\TestFilter.cpp - - - BICOMP - 21 - - - ICCARM - 2 - - - - - BICOMP - 121 107 64 67 76 63 98 65 69 91 80 66 68 72 95 89 97 113 126 124 125 135 70 84 90 77 62 93 82 73 74 61 75 85 86 99 94 101 96 87 78 108 109 102 111 106 110 114 115 116 117 118 120 112 122 119 128 123 132 133 134 130 - - - ICCARM - 70 68 84 65 64 77 87 78 62 107 66 67 90 135 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 - - - - - $PROJ_DIR$\..\..\src\CppUTest\TestHarness_c.cpp - - - BICOMP - 22 - - - ICCARM - 5 - - - - - BICOMP - 68 76 64 84 65 77 72 88 90 78 82 80 66 85 35 83 62 63 69 73 74 61 67 75 86 32 71 70 87 93 91 95 89 97 98 99 94 101 96 103 34 79 105 100 104 107 108 109 102 111 106 110 114 115 116 117 118 113 120 112 122 119 121 126 124 125 81 127 128 123 132 133 134 130 131 129 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 34 32 79 129 81 35 - - - - - $PROJ_DIR$\..\..\src\CppUTest\TestMemoryAllocator.cpp - - - BICOMP - 23 - - - ICCARM - 4 - - - - - BICOMP - 64 68 67 98 124 88 90 87 65 83 84 66 93 91 95 89 97 113 126 125 79 71 70 77 62 78 76 63 72 69 82 73 74 80 61 75 121 32 34 105 100 104 107 108 109 102 111 106 110 114 115 116 117 118 120 99 86 112 122 119 85 94 101 96 103 129 127 128 123 132 133 134 130 131 81 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 32 79 129 81 34 - - - - - $PROJ_DIR$\..\..\src\CppUTest\TestOutput.cpp - - - BICOMP - 24 - - - ICCARM - 10 - - - - - BICOMP - 83 84 69 73 74 75 121 65 62 63 64 61 67 88 68 90 77 78 76 72 82 80 66 81 79 71 70 87 93 91 95 89 97 98 113 126 124 125 129 105 100 104 107 108 109 102 111 106 110 114 115 116 117 118 120 99 86 112 122 119 85 94 101 96 103 127 128 123 132 133 134 130 131 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 129 79 81 - - - - - $PROJ_DIR$\..\..\src\CppUTest\TestPlugin.cpp - - - BICOMP - 25 - - - ICCARM - 9 - - - - - BICOMP - 80 63 64 67 71 107 61 66 65 69 73 74 75 103 70 76 68 72 82 84 85 86 99 94 101 96 83 88 90 93 91 95 89 97 98 105 100 104 77 62 87 78 108 109 102 111 106 110 114 115 116 117 118 113 120 112 122 119 121 126 124 125 127 128 123 132 133 134 130 131 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 - - - - - $PROJ_DIR$\..\..\src\CppUTest\TestRegistry.cpp - - - BICOMP - 26 - - - ICCARM - 11 - - - - - BICOMP - 64 102 65 105 96 66 108 117 99 94 101 76 100 67 107 110 115 116 113 86 119 80 103 70 104 109 111 106 114 118 120 112 122 121 31 83 71 88 68 84 90 77 62 87 78 93 63 72 69 91 82 73 74 95 61 89 97 98 75 85 126 124 125 135 127 128 123 132 133 134 130 131 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 31 135 - - - - - $PROJ_DIR$\..\..\src\CppUTest\TestResult.cpp - - - BICOMP - 27 - - - ICCARM - 12 - - - - - BICOMP - 65 106 62 118 121 70 90 111 120 122 79 71 66 87 64 109 114 112 81 100 83 88 68 84 77 78 108 102 110 115 116 117 113 99 86 119 126 124 125 129 105 76 104 67 107 93 63 72 69 91 82 73 74 80 95 61 89 97 98 75 85 94 101 96 103 127 128 123 132 133 134 130 131 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 129 79 81 - - - - - $PROJ_DIR$\..\..\src\Platforms\Iar\UtestPlatform.cpp - - - BICOMP - 28 - - - ICCARM - 8 - - - - - BICOMP - 100 74 108 67 73 80 133 62 116 127 66 64 65 102 120 113 81 36 89 101 96 105 90 110 115 118 98 94 107 82 124 125 70 76 104 109 111 106 114 97 121 134 88 91 72 79 77 87 78 126 132 69 83 71 68 84 93 63 117 75 85 86 99 130 103 95 61 112 122 119 128 123 131 129 - - - ICCARM - 130 65 64 77 87 78 62 107 66 91 82 90 36 120 89 94 126 124 125 101 132 96 72 69 116 127 70 68 84 67 105 76 93 108 109 102 111 106 115 63 110 114 73 74 80 117 99 86 112 97 122 119 98 75 85 121 95 118 61 128 113 133 134 123 83 71 100 88 104 131 103 79 129 81 - - - - - $PROJ_DIR$\..\..\src\CppUTest\Utest.cpp - - - BICOMP - 58 - - - ICCARM - 13 - - - - - BICOMP - 98 65 64 67 88 90 66 68 76 80 81 83 84 93 91 95 89 97 121 135 79 71 70 107 62 63 72 69 82 73 74 61 75 113 126 124 125 31 129 105 100 104 77 87 78 108 109 102 111 106 110 114 115 116 117 118 120 99 86 112 122 119 85 94 101 96 103 127 128 123 132 133 134 130 131 - - - ICCARM - 127 70 68 84 65 64 77 87 78 62 107 66 67 90 105 76 93 108 109 102 111 106 115 63 72 69 116 110 91 82 114 73 74 80 120 89 117 99 86 112 97 122 119 98 75 85 121 96 95 118 61 128 94 126 124 125 101 132 113 133 134 123 130 83 71 100 88 104 131 103 31 135 79 129 81 - - - - - - Release - - - [MULTI_TOOL] - ILINK - - - - - diff -Nru cpputest-3.8/platforms/iar/CppUTest.ewd cpputest-4.0/platforms/iar/CppUTest.ewd --- cpputest-3.8/platforms/iar/CppUTest.ewd 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTest.ewd 2020-05-26 11:24:07.000000000 +0000 @@ -12,7 +12,7 @@ C-SPY 2 - 26 + 28 1 1 - + + @@ -278,18 +282,47 @@ - CMSISDAP_ID + CADI_ID 2 - 2 + 0 1 1 + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 1 + + + @@ -520,15 +561,15 @@ IJET_ID 2 - 6 + 8 1 1 + + JLINK_ID 2 - 15 + 16 1 1 + @@ -847,10 +900,6 @@ 0 - - - - - - - - @@ -1193,7 +1195,7 @@ STLINK_ID 2 - 2 + 3 1 1 + + + + + + + + + + + + + + + + + + @@ -1253,10 +1328,10 @@ - XDS100_ID + TIFET_ID 2 - 2 + 1 1 1 + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 1 + + + @@ -1292,50 +1429,181 @@ LogFile $PROJ_DIR$\cspycomm.log - - - - - $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin - 0 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin 0 @@ -1360,10 +1628,6 @@ 0 - $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin - 1 - - $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin 0 @@ -1379,7 +1643,7 @@ C-SPY 2 - 26 + 28 1 0 - @@ -1574,6 +1834,14 @@ OCMulticoreSlaveConfiguration + + @@ -1645,18 +1913,47 @@ - CMSISDAP_ID + CADI_ID 2 - 2 + 0 1 0 + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 0 + + + @@ -1887,15 +2192,15 @@ IJET_ID 2 - 6 + 8 1 0 + + JLINK_ID 2 - 15 + 16 1 0 + @@ -2214,10 +2531,6 @@ 0 - - - - - - - - @@ -2560,7 +2826,7 @@ STLINK_ID 2 - 2 + 3 1 0 + + + + + + + + + + + + + + + + + + @@ -2620,10 +2959,10 @@ - XDS100_ID + TIFET_ID 2 - 2 + 1 1 0 + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 0 + + + + @@ -2659,6 +3060,133 @@ LogFile $PROJ_DIR$\cspycomm.log + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2667,6 +3195,10 @@ 0 + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin 0 @@ -2727,10 +3259,6 @@ 0 - $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin - 1 - - $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin 0 diff -Nru cpputest-3.8/platforms/iar/CppUTest.ewp cpputest-4.0/platforms/iar/CppUTest.ewp --- cpputest-3.8/platforms/iar/CppUTest.ewp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTest.ewp 2020-05-26 11:24:07.000000000 +0000 @@ -12,7 +12,7 @@ General 3 - 22 + 24 1 1 - @@ -59,11 +54,6 @@ 1 - @@ -87,7 +77,7 @@ - + + + + + + @@ -631,7 +644,7 @@ ILINK 0 - 16 + 17 1 1 + @@ -934,7 +951,7 @@ @@ -954,7 +971,7 @@ General 3 - 22 + 24 1 0 - @@ -1001,11 +1013,6 @@ 0 - @@ -1029,7 +1036,7 @@ - + + + + + + @@ -1573,7 +1603,7 @@ ILINK 0 - 16 + 17 1 0 + @@ -1912,6 +1946,12 @@ $PROJ_DIR$\..\..\src\CppUTest\SimpleString.cpp + $PROJ_DIR$\..\..\src\CppUTest\SimpleStringInternalCache.cpp + + + $PROJ_DIR$\..\..\src\CppUTest\TeamCityTestOutput.cpp + + $PROJ_DIR$\..\..\src\CppUTest\TestFailure.cpp @@ -1936,6 +1976,9 @@ $PROJ_DIR$\..\..\src\CppUTest\TestResult.cpp + $PROJ_DIR$\..\..\src\CppUTest\TestTestingFixture.cpp + + $PROJ_DIR$\..\..\src\CppUTest\Utest.cpp diff -Nru cpputest-3.8/platforms/iar/CppUTest.ewt cpputest-4.0/platforms/iar/CppUTest.ewt --- cpputest-3.8/platforms/iar/CppUTest.ewt 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTest.ewt 1970-01-01 00:00:00.000000000 +0000 @@ -1,2176 +0,0 @@ - - - - 2 - - Debug - - ARM - - 1 - - C-STAT - 1 - - 1 - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RuntimeChecking - 0 - - 2 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - Release - - ARM - - 0 - - C-STAT - 1 - - 1 - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RuntimeChecking - 0 - - 2 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - src - - CppUTest - - $PROJ_DIR$\src\CppUTest\CommandLineArguments.cpp - - - $PROJ_DIR$\src\CppUTest\CommandLineTestRunner.cpp - - - $PROJ_DIR$\src\CppUTest\JUnitTestOutput.cpp - - - $PROJ_DIR$\src\CppUTest\MemoryLeakDetector.cpp - - - $PROJ_DIR$\src\CppUTest\MemoryLeakWarningPlugin.cpp - - - $PROJ_DIR$\src\CppUTest\SimpleMutex.cpp - - - $PROJ_DIR$\src\CppUTest\SimpleString.cpp - - - $PROJ_DIR$\src\CppUTest\TestFailure.cpp - - - $PROJ_DIR$\src\CppUTest\TestFilter.cpp - - - $PROJ_DIR$\src\CppUTest\TestHarness_c.cpp - - - $PROJ_DIR$\src\CppUTest\TestMemoryAllocator.cpp - - - $PROJ_DIR$\src\CppUTest\TestOutput.cpp - - - $PROJ_DIR$\src\CppUTest\TestPlugin.cpp - - - $PROJ_DIR$\src\CppUTest\TestRegistry.cpp - - - $PROJ_DIR$\src\CppUTest\TestResult.cpp - - - $PROJ_DIR$\src\CppUTest\Utest.cpp - - - - Platforms - - Iar - - $PROJ_DIR$\src\Platforms\Iar\UtestPlatform.cpp - - - - - - - diff -Nru cpputest-3.8/platforms/iar/CppUTest.eww cpputest-4.0/platforms/iar/CppUTest.eww --- cpputest-3.8/platforms/iar/CppUTest.eww 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTest.eww 2020-05-26 11:24:07.000000000 +0000 @@ -5,6 +5,12 @@ $WS_DIR$\CppUTest.ewp + $WS_DIR$\CppUTestExt.ewp + + + $WS_DIR$\CppUTestExtTest.ewp + + $WS_DIR$\CppUTestTest.ewp diff -Nru cpputest-3.8/platforms/iar/CppUTestExt.ewp cpputest-4.0/platforms/iar/CppUTestExt.ewp --- cpputest-3.8/platforms/iar/CppUTestExt.ewp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTestExt.ewp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,1985 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 24 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + src + + CppUTestExt + + $PROJ_DIR$\..\..\src\CppUTestExt\CodeMemoryReportFormatter.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\GTest.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\IEEE754ExceptionsPlugin.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MemoryReportAllocator.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MemoryReporterPlugin.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MemoryReportFormatter.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MockActualCall.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MockExpectedCall.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MockExpectedCallsList.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MockFailure.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MockNamedValue.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MockSupport.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MockSupport_c.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\MockSupportPlugin.cpp + + + $PROJ_DIR$\..\..\src\CppUTestExt\OrderedTest.cpp + + + + Platforms + + Iar + + $PROJ_DIR$\..\..\src\Platforms\Iar\UtestPlatform.cpp + + + + + + + diff -Nru cpputest-3.8/platforms/iar/CppUTestExtTest.ewp cpputest-4.0/platforms/iar/CppUTestExtTest.ewp --- cpputest-3.8/platforms/iar/CppUTestExtTest.ewp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTestExtTest.ewp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,2037 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 24 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + tests + + failing + + + passing + + $PROJ_DIR$\..\..\tests\CppUTestExt\CodeMemoryReporterTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\ExpectedFunctionsListTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\GMockTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\GTest1Test.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\GTest2ConvertorTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\IEEE754PluginTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\IEEE754PluginTest_c.c + + + $PROJ_DIR$\..\..\tests\CppUTestExt\IEEE754PluginTest_c.h + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MemoryReportAllocatorTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MemoryReporterPluginTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MemoryReportFormatterTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockActualCallTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockCallTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockCheatSheetTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockComparatorCopierTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockExpectedCallTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockFailureReporterForTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockFailureReporterForTest.h + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockFailureTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockHierarchyTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockNamedValueTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockParameterTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockPluginTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockReturnValueTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockStrictOrderTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockSupport_cTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockSupport_cTestCFile.c + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockSupport_cTestCFile.h + + + $PROJ_DIR$\..\..\tests\CppUTestExt\MockSupportTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\OrderedTestTest.cpp + + + $PROJ_DIR$\..\..\tests\CppUTestExt\OrderedTestTest_c.c + + + $PROJ_DIR$\..\..\tests\CppUTestExt\OrderedTestTest.h + + + + warnings + + + $PROJ_DIR$\tests\CppUTestExt\AllTests.cpp + + + + + diff -Nru cpputest-3.8/platforms/iar/CppUTestExtTest.icf cpputest-4.0/platforms/iar/CppUTestExtTest.icf --- cpputest-3.8/platforms/iar/CppUTestExtTest.icf 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTestExtTest.icf 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,72 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_1.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x00000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_IROM1_start__ = 0x00000080; +define symbol __ICFEDIT_region_IROM1_end__ = 0x0009FFFF; +define symbol __ICFEDIT_region_IROM2_start__ = 0x0; +define symbol __ICFEDIT_region_IROM2_end__ = 0x0; +define symbol __ICFEDIT_region_EROM1_start__ = 0x0; +define symbol __ICFEDIT_region_EROM1_end__ = 0x0; +define symbol __ICFEDIT_region_EROM2_start__ = 0x0; +define symbol __ICFEDIT_region_EROM2_end__ = 0x0; +define symbol __ICFEDIT_region_EROM3_start__ = 0x0; +define symbol __ICFEDIT_region_EROM3_end__ = 0x0; +define symbol __ICFEDIT_region_IRAM1_start__ = 0x00100000; +define symbol __ICFEDIT_region_IRAM1_end__ = 0x001FFFFF; +define symbol __ICFEDIT_region_IRAM2_start__ = 0x0; +define symbol __ICFEDIT_region_IRAM2_end__ = 0x0; +define symbol __ICFEDIT_region_ERAM1_start__ = 0x0; +define symbol __ICFEDIT_region_ERAM1_end__ = 0x0; +define symbol __ICFEDIT_region_ERAM2_start__ = 0x0; +define symbol __ICFEDIT_region_ERAM2_end__ = 0x0; +define symbol __ICFEDIT_region_ERAM3_start__ = 0x0; +define symbol __ICFEDIT_region_ERAM3_end__ = 0x0; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x600; +define symbol __ICFEDIT_size_svcstack__ = 0x100; +define symbol __ICFEDIT_size_irqstack__ = 0x100; +define symbol __ICFEDIT_size_fiqstack__ = 0x100; +define symbol __ICFEDIT_size_undstack__ = 0x100; +define symbol __ICFEDIT_size_abtstack__ = 0x100; +define symbol __ICFEDIT_size_heap__ = 0x8000; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region IROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__] + | mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__]; +define region EROM_region = mem:[from __ICFEDIT_region_EROM1_start__ to __ICFEDIT_region_EROM1_end__] + | mem:[from __ICFEDIT_region_EROM2_start__ to __ICFEDIT_region_EROM2_end__] + | mem:[from __ICFEDIT_region_EROM3_start__ to __ICFEDIT_region_EROM3_end__]; +define region IRAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__] + | mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__]; +define region ERAM_region = mem:[from __ICFEDIT_region_ERAM1_start__ to __ICFEDIT_region_ERAM1_end__] + | mem:[from __ICFEDIT_region_ERAM2_start__ to __ICFEDIT_region_ERAM2_end__] + | mem:[from __ICFEDIT_region_ERAM3_start__ to __ICFEDIT_region_ERAM3_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; +define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; +define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; +define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; +define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +do not initialize { section .noinit }; +initialize by copy { readwrite }; +if (isdefinedsymbol(__USE_DLIB_PERTHREAD)) +{ + // Required in a multi-threaded application + initialize by copy with packing = none { section __DLIB_PERTHREAD }; +} + +place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; + +place in IROM_region { readonly }; +place in EROM_region { readonly section application_specific_ro }; +place in IRAM_region { readwrite, + block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, + block UND_STACK, block ABT_STACK, block HEAP }; +place in ERAM_region { readwrite section application_specific_rw }; \ No newline at end of file diff -Nru cpputest-3.8/platforms/iar/CppUTestTest.dep cpputest-4.0/platforms/iar/CppUTestTest.dep --- cpputest-3.8/platforms/iar/CppUTestTest.dep 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTestTest.dep 1970-01-01 00:00:00.000000000 +0000 @@ -1,1228 +0,0 @@ - - - - 2 - 1731071481 - - Debug - - $TOOLKIT_DIR$\inc\c\time.h - $TOOLKIT_DIR$\inc\c\limits.h - $TOOLKIT_DIR$\inc\c\xtgmath.h - $TOOLKIT_DIR$\inc\cpp\stdexcept - $TOOLKIT_DIR$\inc\cpp\xdebug - $TOOLKIT_DIR$\inc\cpp\xmemory - $TOOLKIT_DIR$\inc\c\string.h - $TOOLKIT_DIR$\inc\cpp\xutility - $TOOLKIT_DIR$\inc\cpp\utility - $TOOLKIT_DIR$\inc\c\xmtx.h - $TOOLKIT_DIR$\inc\c\xlocale.h - $PROJ_DIR$\..\..\include\CppUTest\TestHarness.h - $PROJ_DIR$\Debug\Obj\AllTests.pbi - $PROJ_DIR$\Debug\Obj\AllTests.o - $TOOLKIT_DIR$\inc\c\DLib_Defaults.h - $TOOLKIT_DIR$\inc\c\clocale - $TOOLKIT_DIR$\inc\c\stdlib.h - $PROJ_DIR$\..\..\include\CppUTest\PlatformSpecificFunctions_c.h - $TOOLKIT_DIR$\inc\c\DLib_Product.h - $TOOLKIT_DIR$\inc\cpp\istream - $TOOLKIT_DIR$\inc\cpp\ostream - $TOOLKIT_DIR$\inc\c\cstddef - $TOOLKIT_DIR$\inc\cpp\xlocnum - $TOOLKIT_DIR$\inc\c\cwchar - $TOOLKIT_DIR$\inc\cpp\streambuf - $TOOLKIT_DIR$\inc\c\xtls.h - $PROJ_DIR$\..\..\include\CppUTest\TestFailure.h - $TOOLKIT_DIR$\inc\cpp\new - $TOOLKIT_DIR$\inc\c\DLib_Threads.h - $TOOLKIT_DIR$\inc\c\ctype.h - $TOOLKIT_DIR$\inc\cpp\memory - $PROJ_DIR$\..\..\include\CppUTest\MemoryLeakDetector.h - $PROJ_DIR$\..\..\include\CppUTest\SimpleString.h - $PROJ_DIR$\..\..\include\CppUTest\Utest.h - $PROJ_DIR$\..\..\include\CppUTest\CppUTestConfig.h - $PROJ_DIR$\..\..\include\CppUTest\PlatformSpecificFunctions.h - $PROJ_DIR$\..\..\include\CppUTest\StandardCLibrary.h - $PROJ_DIR$\..\..\include\CppUTest\MemoryLeakWarningPlugin.h - $TOOLKIT_DIR$\inc\c\cmath - $TOOLKIT_DIR$\inc\c\math.h - $TOOLKIT_DIR$\inc\c\ymath.h - $TOOLKIT_DIR$\inc\cpp\ios - $TOOLKIT_DIR$\inc\c\ystdio.h - $PROJ_DIR$\..\..\include\CppUTest\UtestMacros.h - $TOOLKIT_DIR$\inc\cpp\xiosbase - $TOOLKIT_DIR$\inc\cpp\xlocale - $TOOLKIT_DIR$\inc\cpp\xlocinfo - $TOOLKIT_DIR$\inc\c\stddef.h - $TOOLKIT_DIR$\inc\c\xencoding_limits.h - $TOOLKIT_DIR$\inc\cpp\iosfwd - $TOOLKIT_DIR$\inc\cpp\xstddef - $TOOLKIT_DIR$\inc\c\DLib_Config_Normal.h - $TOOLKIT_DIR$\inc\c\cstdio - $PROJ_DIR$\..\..\include\CppUTest\TestResult.h - $PROJ_DIR$\..\..\include\CppUTest\TestPlugin.h - $PROJ_DIR$\Debug\Obj\tests.o - $TOOLKIT_DIR$\inc\c\cstdlib - $PROJ_DIR$\..\..\tests\UtestPlatformTest.cpp - $PROJ_DIR$\..\..\tests\UtestTest.cpp - $PROJ_DIR$\..\..\tests\tests.cpp - $TOOLKIT_DIR$\inc\c\wchar.h - $TOOLKIT_DIR$\inc\cpp\xstring - $TOOLKIT_DIR$\inc\cpp\typeinfo - $TOOLKIT_DIR$\inc\cpp\exception - $TOOLKIT_DIR$\inc\cpp\string - $PROJ_DIR$\..\..\include\CppUTest\TestMemoryAllocator.h - $TOOLKIT_DIR$\inc\c\ysizet.h - $PROJ_DIR$\Debug\Obj\AllocationInCppFile.o - $PROJ_DIR$\Debug\Obj\AllocLetTestFreeTest.o - $PROJ_DIR$\Debug\Obj\AllocationInCFile.o - $TOOLKIT_DIR$\lib\m7M_tls.a - $TOOLKIT_DIR$\lib\rt7M_tl.a - $PROJ_DIR$\CppUTestTest.icf - $TOOLKIT_DIR$\lib\shb_l.a - $TOOLKIT_DIR$\lib\dlpp7M_tl_nc.a - $PROJ_DIR$\Debug\Exe\CppUTest.a - $TOOLKIT_DIR$\lib\dl7M_tln.a - $PROJ_DIR$\..\..\include\CppUTest\JUnitTestOutput.h - $PROJ_DIR$\..\..\tests\AllocationInCppFile.cpp - $PROJ_DIR$\..\..\tests\AllocationInCFile.c - $PROJ_DIR$\..\..\tests\AllocLetTestFree.c - $PROJ_DIR$\..\..\tests\MemoryOperatorOverloadTest.cpp - $PROJ_DIR$\..\..\include\CppUTest\SimpleMutex.h - $PROJ_DIR$\..\..\tests\TestResultTest.cpp - $PROJ_DIR$\..\..\tests\TestRegistryTest.cpp - $PROJ_DIR$\..\..\tests\TestUTestMacro.cpp - $TOOLKIT_DIR$\inc\c\climits - $PROJ_DIR$\..\..\tests\AllTests.cpp - $PROJ_DIR$\..\..\tests\SimpleStringTest.cpp - $TOOLKIT_DIR$\inc\c\cctype - $TOOLKIT_DIR$\inc\c\ctime - $TOOLKIT_DIR$\inc\c\xlocale_c.h - $PROJ_DIR$\..\..\include\CppUTest\MemoryLeakDetectorNewMacros.h - $TOOLKIT_DIR$\inc\c\locale.h - $TOOLKIT_DIR$\inc\c\xlocale_lconv.h - $PROJ_DIR$\..\..\include\CppUTest\TestOutput.h - $TOOLKIT_DIR$\inc\c\DLib_Product_string.h - $PROJ_DIR$\Debug\Exe\CppUTestTest.out - $PROJ_DIR$\Debug\Obj\UtestPlatformTest.pbi - $TOOLKIT_DIR$\inc\c\yvals.h - $PROJ_DIR$\Debug\Obj\CppUTestTest.pbd - $PROJ_DIR$\Debug\Obj\tests.pbi - $TOOLKIT_DIR$\inc\c\stdio.h - $TOOLKIT_DIR$\inc\c\cstring - $PROJ_DIR$\Debug\Obj\UtestPlatformTest.o - $PROJ_DIR$\Debug\Obj\UtestTest.pbi - $PROJ_DIR$\Debug\Obj\SimpleStringTest.pbi - $PROJ_DIR$\Debug\Obj\SimpleStringTest.o - $PROJ_DIR$\Debug\Obj\UtestTest.o - $TOOLKIT_DIR$\inc\c\xlocaleuse.h - $TOOLKIT_DIR$\inc\c\ycheck.h - $PROJ_DIR$\..\..\include\CppUTest\TestRegistry.h - $PROJ_DIR$\..\..\include\CppUTest\TestTestingFixture.h - $PROJ_DIR$\..\..\include\CppUTest\TestFilter.h - $PROJ_DIR$\..\..\include\CppUTest\CommandLineTestRunner.h - $PROJ_DIR$\..\..\include\CppUTest\CommandLineArguments.h - $PROJ_DIR$\..\..\tests\SetPluginTest.cpp - $PROJ_DIR$\..\..\tests\PreprocessorTest.cpp - $PROJ_DIR$\..\..\tests\SimpleMutexTest.cpp - $PROJ_DIR$\..\..\tests\TestFailureNaNTest.cpp - $PROJ_DIR$\..\..\tests\TestFailureTest.cpp - $PROJ_DIR$\..\..\tests\TestHarness_cTest.cpp - $PROJ_DIR$\..\..\tests\TestFilterTest.cpp - $PROJ_DIR$\..\..\tests\TestOutputTest.cpp - $PROJ_DIR$\..\..\tests\TestHarness_cTestCFile.c - $PROJ_DIR$\..\..\tests\TestInstallerTest.cpp - $PROJ_DIR$\..\..\tests\TestMemoryAllocatorTest.cpp - $PROJ_DIR$\Debug\Obj\TestFailureNaNTest.o - $PROJ_DIR$\Debug\Obj\TestHarness_cTestCFile.o - $PROJ_DIR$\Debug\Obj\TestFailureTest.o - $PROJ_DIR$\..\..\tests\AllocLetTestFreeTest.cpp - $PROJ_DIR$\..\..\tests\CheatSheetTest.cpp - $PROJ_DIR$\..\..\tests\CommandLineTestRunnerTest.cpp - $PROJ_DIR$\..\..\tests\CommandLineArgumentsTest.cpp - $PROJ_DIR$\..\..\tests\MemoryLeakWarningTest.cpp - $PROJ_DIR$\..\..\tests\JUnitOutputTest.cpp - $PROJ_DIR$\..\..\tests\MemoryLeakDetectorTest.cpp - $PROJ_DIR$\..\..\tests\PluginTest.cpp - $PROJ_DIR$\..\..\include\CppUTest\TestHarness_c.h - $PROJ_DIR$\Debug\Obj\CheatSheetTest.pbi - $PROJ_DIR$\Debug\Obj\MemoryOperatorOverloadTest.o - $PROJ_DIR$\..\..\tests\AllocLetTestFree.h - $PROJ_DIR$\..\..\tests\AllocationInCppFile.h - $PROJ_DIR$\Debug\Obj\CommandLineArgumentsTest.pbi - $PROJ_DIR$\Debug\Obj\CommandLineTestRunnerTest.pbi - $PROJ_DIR$\Debug\Obj\MemoryLeakWarningTest.o - $PROJ_DIR$\Debug\Obj\JUnitOutputTest.o - $PROJ_DIR$\Debug\Obj\JUnitOutputTest.pbi - $PROJ_DIR$\Debug\Obj\MemoryOperatorOverloadTest.pbi - $PROJ_DIR$\Debug\Obj\MemoryLeakDetectorTest.pbi - $PROJ_DIR$\Debug\Obj\MemoryLeakWarningTest.pbi - $PROJ_DIR$\Debug\Obj\MemoryLeakDetectorTest.o - $PROJ_DIR$\Debug\Obj\AllocLetTestFree.pbi - $PROJ_DIR$\Debug\Obj\AllocationInCFile.pbi - $PROJ_DIR$\Debug\Obj\AllocLetTestFree.o - $PROJ_DIR$\Debug\Obj\AllocationInCppFile.pbi - $PROJ_DIR$\Debug\Obj\AllocLetTestFreeTest.pbi - $PROJ_DIR$\Debug\Obj\CommandLineTestRunnerTest.o - $PROJ_DIR$\Debug\Obj\CheatSheetTest.o - $PROJ_DIR$\Debug\Obj\CommandLineArgumentsTest.o - $PROJ_DIR$\..\..\include\CppUTest\MemoryLeakDetectorMallocMacros.h - $PROJ_DIR$\..\..\tests\AllocationInCFile.h - $PROJ_DIR$\Debug\Obj\SetPluginTest.o - $PROJ_DIR$\Debug\Obj\SimpleMutexTest.o - $PROJ_DIR$\Debug\Obj\CheatSheetTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestInstallerTest.pbi - $PROJ_DIR$\Debug\Obj\TestRegistryTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestOutputTest.o - $PROJ_DIR$\Debug\Obj\PreprocessorTest.pbi - $PROJ_DIR$\Debug\Obj\PreprocessorTest.o - $PROJ_DIR$\Debug\Obj\SetPluginTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestUTestMacro.pbi - $PROJ_DIR$\Debug\Obj\JUnitOutputTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestUTestMacro.o - $PROJ_DIR$\Debug\Obj\TestRegistryTest.o - $PROJ_DIR$\Debug\Obj\TestResultTest.pbi - $PROJ_DIR$\Debug\Obj\SetPluginTest.pbi - $PROJ_DIR$\Debug\Obj\CommandLineArgumentsTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestInstallerTest.o - $PROJ_DIR$\Debug\Obj\PluginTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestMemoryAllocatorTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestRegistryTest.pbi - $PROJ_DIR$\Debug\Obj\SimpleMutexTest.pbi - $PROJ_DIR$\Debug\Obj\MemoryLeakWarningTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestFailureNaNTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestHarness_cTestCFile.__cstat.et - $PROJ_DIR$\Debug\Obj\TestResultTest.o - $PROJ_DIR$\Debug\Obj\CommandLineTestRunnerTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestHarness_cTest.__cstat.et - $PROJ_DIR$\Debug\Obj\AllocationInCppFile.__cstat.et - $PROJ_DIR$\Debug\Obj\TestInstallerTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestMemoryAllocatorTest.o - $PROJ_DIR$\Debug\Obj\AllocLetTestFreeTest.__cstat.et - $PROJ_DIR$\Debug\Obj\MemoryLeakDetectorTest.__cstat.et - $PROJ_DIR$\Debug\Obj\AllocationInCFile.__cstat.et - $PROJ_DIR$\Debug\Obj\TestFailureTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestResultTest.__cstat.et - $PROJ_DIR$\Debug\Obj\PluginTest.pbi - $PROJ_DIR$\Debug\Obj\PreprocessorTest.__cstat.et - $PROJ_DIR$\Debug\Obj\MemoryOperatorOverloadTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestOutputTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestOutputTest.pbi - $PROJ_DIR$\Debug\Obj\SimpleMutexTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestFilterTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestUTestMacro.__cstat.et - $PROJ_DIR$\Debug\Obj\AllocLetTestFree.__cstat.et - $PROJ_DIR$\Debug\Obj\TestMemoryAllocatorTest.pbi - $PROJ_DIR$\Debug\Obj\PluginTest.o - $PROJ_DIR$\Debug\Obj\SimpleStringTest.__cstat.et - $PROJ_DIR$\Debug\Obj\AllTests.__cstat.et - $PROJ_DIR$\Debug\Obj\UtestPlatformTest.__cstat.et - $PROJ_DIR$\Debug\Obj\UtestTest.__cstat.et - $PROJ_DIR$\Debug\Obj\TestHarness_cTest.pbi - $PROJ_DIR$\Debug\Obj\TestHarness_cTest.o - $PROJ_DIR$\Debug\Obj\TestFilterTest.o - $PROJ_DIR$\Debug\Obj\TestFilterTest.pbi - $PROJ_DIR$\Debug\Obj\TestFailureTest.pbi - $PROJ_DIR$\Debug\Obj\TestHarness_cTestCFile.pbi - $PROJ_DIR$\Debug\Obj\TestFailureNaNTest.pbi - $PROJ_DIR$\tests\AllTests.cpp - - - $PROJ_DIR$\..\..\tests\UtestPlatformTest.cpp - - - BICOMP - 98 - - - ICCARM - 104 - - - __cstat - 210 - - - - - BICOMP - 110 52 1 99 27 60 28 15 95 32 2 50 63 29 109 17 34 37 66 19 41 3 103 30 112 113 33 26 56 20 22 86 24 4 6 21 5 23 11 35 115 43 53 54 36 47 16 14 48 51 18 64 38 39 40 102 42 44 45 62 46 96 61 7 8 49 10 25 9 114 89 90 91 93 94 0 92 111 - - - ICCARM - 114 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 95 115 113 112 111 35 17 - - - - - $PROJ_DIR$\..\..\tests\UtestTest.cpp - - - BICOMP - 105 - - - ICCARM - 108 - - - __cstat - 211 - - - - - BICOMP - 66 14 36 102 64 110 54 16 18 62 96 61 99 95 17 43 47 48 56 7 103 23 113 112 53 34 51 32 38 39 40 42 44 45 46 8 49 50 15 10 25 9 35 33 26 37 28 19 20 41 22 86 52 24 1 2 3 4 6 63 21 5 27 29 109 60 30 11 89 90 91 93 94 0 92 111 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 95 112 111 113 35 17 - - - - - $PROJ_DIR$\..\..\tests\tests.cpp - - - BICOMP - 101 - - - ICCARM - 55 - - - - - $PROJ_DIR$\..\..\tests\AllocationInCppFile.cpp - - - BICOMP - 155 - - - ICCARM - 67 - - - __cstat - 189 - - - - - BICOMP - 24 20 66 102 47 110 99 18 0 36 16 27 52 62 89 30 34 14 48 86 96 22 2 90 142 64 56 28 51 23 42 60 41 44 45 103 46 63 5 61 91 93 94 92 50 21 7 8 1 49 6 19 38 39 40 3 4 15 29 10 25 109 9 - - - ICCARM - 92 34 36 47 110 99 14 51 18 48 28 66 56 16 27 63 50 21 30 5 7 86 1 8 49 52 102 42 103 6 96 23 60 64 19 20 41 22 38 39 40 2 24 44 45 3 61 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 142 - - - - - $PROJ_DIR$\..\..\tests\AllocationInCFile.c - - - BICOMP - 153 - - - ICCARM - 69 - - - __cstat - 194 - - - - - BICOMP - 110 47 99 36 14 18 34 48 51 160 16 66 28 161 - - - ICCARM - 161 160 34 36 47 110 99 14 51 18 48 28 66 16 - - - - - $PROJ_DIR$\..\..\tests\AllocLetTestFree.c - - - BICOMP - 152 - - - ICCARM - 154 - - - __cstat - 205 - - - - - BICOMP - 110 99 14 18 16 36 66 48 51 34 47 28 141 - - - ICCARM - 36 34 47 110 99 14 51 18 48 28 66 16 141 - - - - - $PROJ_DIR$\..\..\tests\MemoryOperatorOverloadTest.cpp - - - BICOMP - 148 - - - ICCARM - 140 - - - __cstat - 199 - - - - - BICOMP - 99 7 92 56 110 36 138 54 16 51 0 30 113 111 43 47 66 64 102 62 96 61 89 17 31 112 53 34 14 48 18 32 38 39 40 42 44 45 103 46 8 49 52 60 90 65 95 35 142 161 33 26 37 28 19 20 41 22 86 24 1 2 3 4 15 6 63 50 21 5 27 23 91 93 94 11 29 10 25 109 9 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 65 31 95 111 113 35 17 112 142 138 161 - - - - - $PROJ_DIR$\..\..\tests\TestResultTest.cpp - - - BICOMP - 175 - - - ICCARM - 186 - - - __cstat - 196 - - - - - BICOMP - 99 86 26 56 66 23 20 24 110 21 33 16 48 22 4 6 5 17 95 34 32 37 28 19 41 52 1 2 3 15 63 50 27 60 10 25 9 54 35 43 53 36 47 14 51 18 64 38 39 40 102 42 44 45 103 62 46 96 61 7 8 49 29 109 30 11 89 90 91 93 94 0 92 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 35 95 17 - - - - - $PROJ_DIR$\..\..\tests\TestRegistryTest.cpp - - - BICOMP - 181 - - - ICCARM - 174 - - - __cstat - 166 - - - - - BICOMP - 14 21 34 110 103 20 24 18 66 86 99 23 30 53 48 22 4 6 5 63 29 109 60 32 95 43 54 36 47 16 51 19 41 52 1 2 3 15 50 27 111 33 26 37 56 28 64 38 39 40 102 42 44 45 62 46 96 61 7 8 49 10 25 9 113 11 89 90 91 93 94 0 92 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 111 113 95 - - - - - $PROJ_DIR$\..\..\tests\TestUTestMacro.cpp - - - BICOMP - 171 - - - ICCARM - 173 - - - __cstat - 204 - - - - - BICOMP - 56 110 48 99 66 7 53 0 34 14 18 64 102 62 96 61 89 112 43 54 36 47 16 51 32 38 39 40 42 44 45 103 46 8 52 60 90 5 111 95 33 26 37 28 19 20 41 22 86 24 1 2 3 4 15 6 63 50 21 27 23 91 93 94 92 113 11 49 29 10 25 109 9 30 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 95 112 111 113 - - - - - $PROJ_DIR$\..\..\tests\AllTests.cpp - - - BICOMP - 12 - - - ICCARM - 13 - - - __cstat - 209 - - - - - BICOMP - 95 20 24 110 99 53 14 21 66 18 86 23 11 34 48 22 4 6 5 115 43 54 36 47 16 51 19 41 52 1 2 3 15 63 50 27 60 10 25 9 113 33 32 26 37 56 28 64 38 39 40 102 42 44 45 103 62 46 96 61 7 8 49 29 109 30 114 89 90 91 93 94 0 92 - - - ICCARM - 114 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 95 115 113 - - - - - $PROJ_DIR$\..\..\tests\SimpleStringTest.cpp - - - BICOMP - 106 - - - ICCARM - 107 - - - __cstat - 208 - - - - - BICOMP - 66 86 99 30 33 20 24 110 21 7 103 31 26 56 16 48 22 4 6 5 63 29 109 60 32 35 34 37 28 19 41 52 1 2 3 15 50 8 49 65 43 53 54 36 47 14 51 18 64 38 39 40 102 42 44 45 62 46 96 61 27 23 10 25 9 17 11 89 90 91 93 94 0 92 95 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 35 95 17 65 31 - - - - - $PROJ_DIR$\Debug\Exe\CppUTestTest.out - - - ILINK - 72 69 67 154 68 13 158 159 157 146 151 145 140 207 169 162 163 107 127 129 214 213 128 178 191 167 174 186 173 104 108 75 73 71 74 70 76 - - - - - $PROJ_DIR$\..\..\tests\SetPluginTest.cpp - - - BICOMP - 176 - - - ICCARM - 162 - - - __cstat - 170 - - - - - BICOMP - 4 99 27 48 86 110 32 16 22 6 5 66 56 92 34 37 51 20 24 21 23 93 95 33 26 14 18 19 41 52 1 2 3 15 63 50 60 61 91 94 111 54 43 53 36 47 28 64 38 39 40 102 42 44 45 103 62 46 96 7 8 49 89 90 0 11 29 10 25 109 9 30 113 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 111 113 95 - - - - - $PROJ_DIR$\..\..\tests\PreprocessorTest.cpp - - - BICOMP - 168 - - - ICCARM - 169 - - - __cstat - 198 - - - - - BICOMP - 23 28 99 66 56 7 53 110 103 34 64 102 62 96 61 15 10 109 60 32 27 43 54 36 47 16 38 39 40 42 44 45 46 8 49 50 63 29 33 26 37 14 48 51 18 19 20 41 22 86 52 24 1 2 3 4 6 21 5 89 90 25 9 11 91 93 94 0 92 30 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 - - - - - $PROJ_DIR$\..\..\tests\SimpleMutexTest.cpp - - - BICOMP - 182 - - - ICCARM - 163 - - - __cstat - 202 - - - - - BICOMP - 66 62 96 61 110 99 53 64 102 34 51 56 7 103 17 35 43 54 36 47 16 14 48 18 32 38 39 40 42 44 45 46 8 49 50 63 29 109 60 30 82 33 26 37 28 19 20 41 22 86 52 24 1 2 3 4 15 6 21 5 27 23 10 25 9 11 89 90 91 93 94 0 92 95 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 82 35 95 17 - - - - - $PROJ_DIR$\..\..\tests\TestFailureNaNTest.cpp - - - BICOMP - 218 - - - ICCARM - 127 - - - __cstat - 184 - - - - - BICOMP - 99 103 51 110 34 56 7 66 17 53 64 102 62 96 61 23 35 43 54 36 47 16 14 48 18 32 38 39 40 42 44 45 46 8 49 50 15 10 25 9 95 33 26 37 28 19 20 41 22 86 52 24 1 2 3 4 6 63 21 5 27 60 29 109 30 11 89 90 91 93 94 0 92 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 95 35 17 - - - - - $PROJ_DIR$\..\..\tests\TestFailureTest.cpp - - - BICOMP - 216 - - - ICCARM - 129 - - - __cstat - 195 - - - - - BICOMP - 32 36 110 99 47 14 39 93 54 16 18 42 103 66 49 50 43 48 38 40 44 45 46 56 8 92 27 53 34 51 64 102 62 96 61 7 91 94 95 33 26 37 28 19 20 41 22 86 52 24 1 2 3 4 15 6 63 21 5 23 60 89 90 0 11 29 10 25 109 9 30 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 95 - - - - - $PROJ_DIR$\..\..\tests\TestHarness_cTest.cpp - - - BICOMP - 212 - - - ICCARM - 213 - - - __cstat - 188 - - - - - BICOMP - 99 36 33 10 9 16 66 32 39 3 63 110 15 54 112 47 28 26 38 40 50 27 25 111 31 34 37 64 56 86 4 6 21 5 103 23 113 95 11 35 14 48 51 18 43 53 19 20 41 22 52 24 1 2 102 42 44 45 62 46 96 61 7 8 49 29 109 60 30 138 89 90 91 93 94 0 92 17 - - - ICCARM - 138 34 36 47 110 99 14 51 18 48 28 66 56 16 11 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 111 113 95 112 35 17 31 - - - - - $PROJ_DIR$\..\..\tests\TestFilterTest.cpp - - - BICOMP - 215 - - - ICCARM - 214 - - - __cstat - 203 - - - - - BICOMP - 2 50 53 110 52 66 48 1 15 27 60 90 34 14 18 99 19 41 3 63 89 64 43 54 36 47 16 51 20 22 86 24 4 6 21 5 23 56 61 10 25 9 113 33 32 26 37 28 38 39 40 102 42 44 45 103 62 46 96 7 8 49 29 109 11 91 93 94 0 92 30 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 113 - - - - - $PROJ_DIR$\..\..\tests\TestOutputTest.cpp - - - BICOMP - 201 - - - ICCARM - 167 - - - __cstat - 200 - - - - - BICOMP - 62 43 96 61 47 110 48 23 16 64 102 54 36 14 18 56 99 7 103 66 17 53 34 51 32 38 39 40 42 44 45 46 8 15 10 25 9 95 35 33 26 37 28 19 20 41 22 86 52 24 1 2 3 4 6 63 50 21 5 27 49 29 109 60 30 11 89 90 91 93 94 0 92 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 95 35 17 - - - - - $PROJ_DIR$\..\..\tests\TestHarness_cTestCFile.c - - - BICOMP - 217 - - - ICCARM - 128 - - - __cstat - 185 - - - - - BICOMP - 47 48 28 99 66 36 110 34 14 17 16 51 18 138 - - - ICCARM - 138 34 36 47 110 99 14 51 18 48 28 66 16 17 - - - - - $PROJ_DIR$\..\..\tests\TestInstallerTest.cpp - - - BICOMP - 165 - - - ICCARM - 178 - - - __cstat - 190 - - - - - BICOMP - 99 86 51 54 16 110 66 23 90 32 36 20 24 21 64 43 47 22 4 6 5 53 34 14 48 18 19 41 52 1 2 3 15 63 50 27 60 89 0 111 33 26 37 56 28 38 39 40 102 42 44 45 103 62 46 96 61 7 8 49 91 93 94 92 11 29 10 25 109 9 30 113 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 111 113 - - - - - $PROJ_DIR$\..\..\tests\TestMemoryAllocatorTest.cpp - - - BICOMP - 206 - - - ICCARM - 191 - - - __cstat - 180 - - - - - BICOMP - 44 51 8 40 45 54 16 99 110 36 38 46 56 23 43 47 32 39 42 103 66 49 35 112 53 34 14 48 18 64 102 62 96 61 7 15 10 25 9 111 65 33 26 37 28 19 20 41 22 86 52 24 1 2 3 4 6 63 50 21 5 27 29 109 60 30 95 113 11 89 90 91 93 94 0 92 17 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 65 35 95 17 112 111 113 - - - - - $PROJ_DIR$\..\..\tests\AllocLetTestFreeTest.cpp - - - BICOMP - 156 - - - ICCARM - 68 - - - __cstat - 192 - - - - - BICOMP - 20 24 110 21 61 34 66 86 99 23 53 22 4 6 5 56 109 60 32 27 11 47 16 28 43 54 19 41 52 1 2 3 15 63 50 89 90 141 36 14 48 51 18 33 26 37 64 38 39 40 102 42 44 45 103 62 46 96 7 8 49 29 10 25 9 91 93 94 0 92 30 - - - ICCARM - 36 34 47 110 99 14 51 18 48 28 66 56 16 141 11 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 - - - - - $PROJ_DIR$\..\..\tests\CheatSheetTest.cpp - - - BICOMP - 139 - - - ICCARM - 158 - - - __cstat - 164 - - - - - BICOMP - 110 26 56 99 103 28 7 23 33 66 64 102 62 96 61 15 10 109 60 32 27 11 34 37 36 38 39 40 42 44 45 46 47 8 49 50 63 29 43 53 54 16 14 48 51 18 19 20 41 22 86 52 24 1 2 3 4 6 21 5 89 90 25 9 91 93 94 0 92 30 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 - - - - - $PROJ_DIR$\..\..\tests\CommandLineTestRunnerTest.cpp - - - BICOMP - 144 - - - ICCARM - 157 - - - __cstat - 187 - - - - - BICOMP - 25 48 99 33 28 62 96 61 110 16 64 102 32 54 26 56 7 15 10 9 17 111 35 34 37 36 38 39 40 42 44 45 103 46 66 47 8 23 95 114 112 77 43 53 14 51 18 19 20 41 22 86 52 24 1 2 3 4 6 63 50 21 5 27 49 29 109 60 30 113 11 89 90 91 93 94 0 92 115 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 114 95 115 113 111 112 77 35 17 - - - - - $PROJ_DIR$\..\..\tests\CommandLineArgumentsTest.cpp - - - BICOMP - 143 - - - ICCARM - 159 - - - __cstat - 177 - - - - - BICOMP - 66 46 110 38 99 56 32 43 47 40 44 45 8 93 54 36 16 39 42 103 49 50 92 27 111 53 34 28 64 102 62 96 61 7 91 94 113 115 33 26 37 14 48 51 18 19 20 41 22 86 52 24 1 2 3 4 15 6 63 21 5 23 60 89 90 0 11 29 10 25 109 9 30 95 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 115 95 113 111 - - - - - $PROJ_DIR$\..\..\tests\MemoryLeakWarningTest.cpp - - - BICOMP - 150 - - - ICCARM - 145 - - - __cstat - 183 - - - - - BICOMP - 32 36 92 110 99 47 14 39 52 82 54 16 18 42 103 66 49 64 17 31 43 48 38 40 44 45 46 56 8 60 90 95 112 53 34 51 102 62 96 61 7 89 0 113 111 37 65 138 33 26 28 19 20 41 22 86 24 1 2 3 4 15 6 63 50 21 5 27 23 91 93 94 11 29 10 25 109 9 30 35 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 111 113 95 31 65 112 138 82 35 17 - - - - - $PROJ_DIR$\..\..\tests\JUnitOutputTest.cpp - - - BICOMP - 147 - - - ICCARM - 146 - - - __cstat - 172 - - - - - BICOMP - 42 110 16 50 91 34 54 49 103 66 36 32 99 39 47 43 38 40 44 45 46 56 8 61 94 17 53 28 64 102 62 96 7 93 92 27 77 35 33 26 37 14 48 51 18 19 20 41 22 86 52 24 1 2 3 4 15 6 63 21 5 23 60 89 90 0 95 11 29 10 25 109 9 30 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 77 95 35 17 - - - - - $PROJ_DIR$\..\..\tests\MemoryLeakDetectorTest.cpp - - - BICOMP - 149 - - - ICCARM - 151 - - - __cstat - 193 - - - - - BICOMP - 47 16 102 99 43 64 25 110 48 62 96 61 17 54 36 51 56 7 15 10 9 65 53 34 66 14 18 32 38 39 40 42 44 45 103 46 8 49 23 31 35 33 26 37 28 19 20 41 22 86 52 24 1 2 3 4 6 63 50 21 5 27 29 109 60 30 11 89 90 91 93 94 0 92 95 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 31 65 35 95 17 - - - - - $PROJ_DIR$\..\..\tests\PluginTest.cpp - - - BICOMP - 197 - - - ICCARM - 207 - - - __cstat - 179 - - - - - BICOMP - 99 110 48 56 7 60 33 103 63 29 109 32 26 14 18 66 64 102 62 96 61 30 95 34 37 51 36 38 39 40 42 44 45 46 47 8 49 50 111 112 43 53 54 16 28 19 20 41 22 86 52 24 1 2 3 4 15 6 21 5 27 23 10 25 9 113 11 89 90 91 93 94 0 92 - - - ICCARM - 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 111 113 95 112 - - - - - [ROOT_NODE] - - - ILINK - 97 - - - - - $PROJ_DIR$\tests\AllTests.cpp - - - BICOMP - 12 - - - ICCARM - 13 - - - - - BICOMP - 40 45 95 44 8 99 53 66 38 46 56 110 11 34 32 36 39 42 103 47 49 50 23 115 43 54 16 28 48 64 102 62 96 61 7 15 10 25 9 113 33 26 37 14 51 18 19 20 41 22 86 52 24 1 2 3 4 6 63 21 5 27 60 29 109 30 114 89 90 91 93 94 0 92 - - - ICCARM - 114 11 34 36 47 110 99 14 51 18 48 28 66 56 16 33 32 64 19 20 41 22 86 1 38 39 40 2 52 102 42 24 44 45 103 6 96 3 63 50 21 61 5 27 7 8 49 23 60 62 4 46 89 29 10 25 9 109 91 15 93 94 90 0 43 53 26 54 37 92 30 95 115 113 - - - - - $PROJ_DIR$\..\..\tests\UtestPlatformTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\UtestTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\AllocationInCppFile.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\AllocationInCFile.c - C-STAT - - - $PROJ_DIR$\..\..\tests\AllocLetTestFree.c - C-STAT - - - $PROJ_DIR$\..\..\tests\MemoryOperatorOverloadTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestResultTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestRegistryTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestUTestMacro.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\AllTests.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\SimpleStringTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\SetPluginTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\PreprocessorTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\SimpleMutexTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestFailureNaNTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestFailureTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestHarness_cTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestFilterTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestOutputTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestHarness_cTestCFile.c - C-STAT - - - $PROJ_DIR$\..\..\tests\TestInstallerTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\TestMemoryAllocatorTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\AllocLetTestFreeTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\CheatSheetTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\CommandLineTestRunnerTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\CommandLineArgumentsTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\MemoryLeakWarningTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\JUnitOutputTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\MemoryLeakDetectorTest.cpp - C-STAT - - - $PROJ_DIR$\..\..\tests\PluginTest.cpp - C-STAT - - - - Release - - - [MULTI_TOOL] - ILINK - - - [REBUILD_ALL] - - - - - diff -Nru cpputest-3.8/platforms/iar/CppUTestTest.ewd cpputest-4.0/platforms/iar/CppUTestTest.ewd --- cpputest-3.8/platforms/iar/CppUTestTest.ewd 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTestTest.ewd 2020-05-26 11:24:07.000000000 +0000 @@ -12,7 +12,7 @@ C-SPY 2 - 26 + 28 1 1 - + + @@ -278,18 +282,47 @@ - CMSISDAP_ID + CADI_ID 2 - 2 + 0 1 1 + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 1 + + + @@ -520,15 +561,15 @@ IJET_ID 2 - 6 + 8 1 1 + + JLINK_ID 2 - 15 + 16 1 1 + @@ -847,10 +900,6 @@ 0 - - - - - - - - @@ -1193,7 +1195,7 @@ STLINK_ID 2 - 2 + 3 1 1 + + + + + + + + + + + + + + + + + + @@ -1253,10 +1328,10 @@ - XDS100_ID + TIFET_ID 2 - 2 + 1 1 1 + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 1 + + + @@ -1292,50 +1429,181 @@ LogFile $PROJ_DIR$\cspycomm.log - - - - - $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin - 0 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin 0 @@ -1360,10 +1628,6 @@ 0 - $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin - 1 - - $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin 0 @@ -1379,7 +1643,7 @@ C-SPY 2 - 26 + 28 1 0 - @@ -1574,6 +1834,14 @@ OCMulticoreSlaveConfiguration + + @@ -1645,18 +1913,47 @@ - CMSISDAP_ID + CADI_ID 2 - 2 + 0 1 0 + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 0 + + + @@ -1887,15 +2192,15 @@ IJET_ID 2 - 6 + 8 1 0 + + JLINK_ID 2 - 15 + 16 1 0 + @@ -2214,10 +2531,6 @@ 0 - - - - - - - - @@ -2560,7 +2826,7 @@ STLINK_ID 2 - 2 + 3 1 0 + + + + + + + + + + + + + + + + + + @@ -2620,10 +2959,10 @@ - XDS100_ID + TIFET_ID 2 - 2 + 1 1 0 + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 0 + + + + @@ -2659,6 +3060,133 @@ LogFile $PROJ_DIR$\cspycomm.log + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2667,6 +3195,10 @@ 0 + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin 0 @@ -2727,10 +3259,6 @@ 0 - $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin - 1 - - $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin 0 diff -Nru cpputest-3.8/platforms/iar/CppUTestTest.ewp cpputest-4.0/platforms/iar/CppUTestTest.ewp --- cpputest-3.8/platforms/iar/CppUTestTest.ewp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTestTest.ewp 2020-05-26 11:24:07.000000000 +0000 @@ -12,7 +12,7 @@ General 3 - 22 + 24 1 1 - @@ -59,11 +54,6 @@ 0 - @@ -87,7 +77,7 @@ - + + + + + + @@ -631,7 +644,7 @@ ILINK 0 - 16 + 17 1 1 + @@ -954,7 +971,7 @@ General 3 - 22 + 24 1 0 - @@ -1001,11 +1013,6 @@ 0 - @@ -1029,7 +1036,7 @@ - + + + + + + @@ -1573,7 +1603,7 @@ ILINK 0 - 16 + 17 1 0 + @@ -1894,91 +1928,100 @@ passing - $PROJ_DIR$\..\..\tests\AllocationInCFile.c + $PROJ_DIR$\..\..\tests\CppUTest\AllocationInCFile.c + + + $PROJ_DIR$\..\..\tests\CppUTest\AllocationInCppFile.cpp + + + $PROJ_DIR$\..\..\tests\CppUTest\AllocLetTestFree.c + + + $PROJ_DIR$\..\..\tests\CppUTest\AllocLetTestFreeTest.cpp - $PROJ_DIR$\..\..\tests\AllocationInCppFile.cpp + $PROJ_DIR$\..\..\tests\CppUTest\CheatSheetTest.cpp - $PROJ_DIR$\..\..\tests\AllocLetTestFree.c + $PROJ_DIR$\..\..\tests\CppUTest\CompatabilityTests.cpp - $PROJ_DIR$\..\..\tests\AllocLetTestFreeTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\CommandLineArgumentsTest.cpp - $PROJ_DIR$\..\..\tests\CheatSheetTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\CommandLineTestRunnerTest.cpp - $PROJ_DIR$\..\..\tests\CommandLineArgumentsTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\JUnitOutputTest.cpp - $PROJ_DIR$\..\..\tests\CommandLineTestRunnerTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\MemoryLeakDetectorTest.cpp - $PROJ_DIR$\..\..\tests\JUnitOutputTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\MemoryLeakWarningTest.cpp - $PROJ_DIR$\..\..\tests\MemoryLeakDetectorTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\MemoryOperatorOverloadTest.cpp - $PROJ_DIR$\..\..\tests\MemoryLeakWarningTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\PluginTest.cpp - $PROJ_DIR$\..\..\tests\MemoryOperatorOverloadTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\PreprocessorTest.cpp - $PROJ_DIR$\..\..\tests\PluginTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\SetPluginTest.cpp - $PROJ_DIR$\..\..\tests\PreprocessorTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\SimpleMutexTest.cpp - $PROJ_DIR$\..\..\tests\SetPluginTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\SimpleStringTest.cpp - $PROJ_DIR$\..\..\tests\SimpleMutexTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TeamCityOutputTest.cpp - $PROJ_DIR$\..\..\tests\SimpleStringTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestFailureNaNTest.cpp - $PROJ_DIR$\..\..\tests\TestFailureNaNTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestFailureTest.cpp - $PROJ_DIR$\..\..\tests\TestFailureTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestFilterTest.cpp - $PROJ_DIR$\..\..\tests\TestFilterTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestHarness_cTest.cpp - $PROJ_DIR$\..\..\tests\TestHarness_cTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestHarness_cTestCFile.c - $PROJ_DIR$\..\..\tests\TestHarness_cTestCFile.c + $PROJ_DIR$\..\..\tests\CppUTest\TestInstallerTest.cpp - $PROJ_DIR$\..\..\tests\TestInstallerTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestMemoryAllocatorTest.cpp - $PROJ_DIR$\..\..\tests\TestMemoryAllocatorTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestOutputTest.cpp - $PROJ_DIR$\..\..\tests\TestOutputTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestRegistryTest.cpp - $PROJ_DIR$\..\..\tests\TestRegistryTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestResultTest.cpp - $PROJ_DIR$\..\..\tests\TestResultTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestUTestMacro.cpp - $PROJ_DIR$\..\..\tests\TestUTestMacro.cpp + $PROJ_DIR$\..\..\tests\CppUTest\TestUTestStringMacro.cpp - $PROJ_DIR$\..\..\tests\UtestPlatformTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\UtestPlatformTest.cpp - $PROJ_DIR$\..\..\tests\UtestTest.cpp + $PROJ_DIR$\..\..\tests\CppUTest\UtestTest.cpp diff -Nru cpputest-3.8/platforms/iar/CppUTestTest.ewt cpputest-4.0/platforms/iar/CppUTestTest.ewt --- cpputest-3.8/platforms/iar/CppUTestTest.ewt 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTestTest.ewt 1970-01-01 00:00:00.000000000 +0000 @@ -1,2215 +0,0 @@ - - - - 2 - - Debug - - ARM - - 1 - - C-STAT - 1 - - 1 - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RuntimeChecking - 0 - - 2 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - Release - - ARM - - 0 - - C-STAT - 1 - - 1 - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RuntimeChecking - 0 - - 2 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - tests - - failing - - - passing - - $PROJ_DIR$\..\..\tests\AllocationInCFile.c - - - $PROJ_DIR$\..\..\tests\AllocationInCppFile.cpp - - - $PROJ_DIR$\..\..\tests\AllocLetTestFree.c - - - $PROJ_DIR$\..\..\tests\AllocLetTestFreeTest.cpp - - - $PROJ_DIR$\..\..\tests\CheatSheetTest.cpp - - - $PROJ_DIR$\..\..\tests\CommandLineArgumentsTest.cpp - - - $PROJ_DIR$\..\..\tests\CommandLineTestRunnerTest.cpp - - - $PROJ_DIR$\..\..\tests\JUnitOutputTest.cpp - - - $PROJ_DIR$\..\..\tests\MemoryLeakDetectorTest.cpp - - - $PROJ_DIR$\..\..\tests\MemoryLeakWarningTest.cpp - - - $PROJ_DIR$\..\..\tests\MemoryOperatorOverloadTest.cpp - - - $PROJ_DIR$\..\..\tests\PluginTest.cpp - - - $PROJ_DIR$\..\..\tests\PreprocessorTest.cpp - - - $PROJ_DIR$\..\..\tests\SetPluginTest.cpp - - - $PROJ_DIR$\..\..\tests\SimpleMutexTest.cpp - - - $PROJ_DIR$\..\..\tests\SimpleStringTest.cpp - - - $PROJ_DIR$\..\..\tests\TestFailureNaNTest.cpp - - - $PROJ_DIR$\..\..\tests\TestFailureTest.cpp - - - $PROJ_DIR$\..\..\tests\TestFilterTest.cpp - - - $PROJ_DIR$\..\..\tests\TestHarness_cTest.cpp - - - $PROJ_DIR$\..\..\tests\TestHarness_cTestCFile.c - - - $PROJ_DIR$\..\..\tests\TestInstallerTest.cpp - - - $PROJ_DIR$\..\..\tests\TestMemoryAllocatorTest.cpp - - - $PROJ_DIR$\..\..\tests\TestOutputTest.cpp - - - $PROJ_DIR$\..\..\tests\TestRegistryTest.cpp - - - $PROJ_DIR$\..\..\tests\TestResultTest.cpp - - - $PROJ_DIR$\..\..\tests\TestUTestMacro.cpp - - - $PROJ_DIR$\..\..\tests\UtestPlatformTest.cpp - - - $PROJ_DIR$\..\..\tests\UtestTest.cpp - - - - warnings - - - $PROJ_DIR$\tests\AllTests.cpp - - - - - diff -Nru cpputest-3.8/platforms/iar/CppUTestTest.icf cpputest-4.0/platforms/iar/CppUTestTest.icf --- cpputest-3.8/platforms/iar/CppUTestTest.icf 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/platforms/iar/CppUTestTest.icf 2020-05-26 11:24:07.000000000 +0000 @@ -5,7 +5,7 @@ define symbol __ICFEDIT_intvec_start__ = 0x00000000; /*-Memory Regions-*/ define symbol __ICFEDIT_region_IROM1_start__ = 0x00000080; -define symbol __ICFEDIT_region_IROM1_end__ = 0x0007FFFF; +define symbol __ICFEDIT_region_IROM1_end__ = 0x0009FFFF; define symbol __ICFEDIT_region_IROM2_start__ = 0x0; define symbol __ICFEDIT_region_IROM2_end__ = 0x0; define symbol __ICFEDIT_region_EROM1_start__ = 0x0; diff -Nru cpputest-3.8/platforms/iar/tests/CppUTestExt/AllTests.cpp cpputest-4.0/platforms/iar/tests/CppUTestExt/AllTests.cpp --- cpputest-3.8/platforms/iar/tests/CppUTestExt/AllTests.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/platforms/iar/tests/CppUTestExt/AllTests.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/CommandLineTestRunner.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTestExt/MemoryReporterPlugin.h" +#include "CppUTestExt/MockSupportPlugin.h" + +#ifdef CPPUTEST_INCLUDE_GTEST_TESTS +#include "CppUTestExt/GTestConvertor.h" +#endif + +int main(int ac, const char** av) +{ + const char * av_override[] = {"exe", "-v"}; +#ifdef CPPUTEST_INCLUDE_GTEST_TESTS + GTestConvertor convertor; + convertor.addAllGTestToTestRegistry(); +#endif + + MemoryReporterPlugin plugin; + MockSupportPlugin mockPlugin; + TestRegistry::getCurrentRegistry()->installPlugin(&plugin); + TestRegistry::getCurrentRegistry()->installPlugin(&mockPlugin); + +#ifndef GMOCK_RENAME_MAIN + int rv = CommandLineTestRunner::RunAllTests(2, av_override); +#else + /* Don't have any memory leak detector when running the Google Test tests */ + + testing::GMOCK_FLAG(verbose) = testing::internal::kWarningVerbosity; + + ConsoleTestOutput output; + CommandLineTestRunner runner(ac, av, &output, TestRegistry::getCurrentRegistry()); + return runner.runAllTestsMain(); +#endif + + //Exiting from main causes IAR simulator to issue out-of-bounds memory access warnings. + volatile int wait = 1; + while (wait){} + return rv; +} + diff -Nru cpputest-3.8/README_InstallCppUTest.txt cpputest-4.0/README_InstallCppUTest.txt --- cpputest-3.8/README_InstallCppUTest.txt 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/README_InstallCppUTest.txt 2020-05-26 11:24:07.000000000 +0000 @@ -1,10 +1,10 @@ 1. Unzip into , resulting in - /CppUTest/ + /CppUTest/ + + MAKE SURE DOES NOT HAVE SPACES IN IT + MAKE SURE DOES NOT HAVE SPACES IN IT + MAKE SURE DOES NOT HAVE SPACES IN IT - MAKE SURE DOES NOT HAVE SPACES IN IT - MAKE SURE DOES NOT HAVE SPACES IN IT - MAKE SURE DOES NOT HAVE SPACES IN IT - 2. Build CppUTest and examples 2a. For unix/gcc (including cygwin) @@ -12,59 +12,49 @@ > ../configure > make > make tdd # This is to run the CppUTest unit tests - + 2b. For Microsoft Visual C++ V6 - Double click /CppUTest/CppUTest.dsw - Run without debugging, see the test results in the command window - Exit MS Visual C++ - - To run the examples: - Double click /CppUTest/example/CppUTestExample.dsw - Run without debugging, see the test results in the command window - You should define the environment variable CPP_U_TEST to point to CppUTest - to run these. - - NOTE: To create your own project, you need to have CppUTest and your project - compiled with the same compile and link settings + We couldn't install the compiler anymore. We removed the project files. + You will need to make your own 2c. For ARMCC from Keil MDK-ARM (building CppUTest library only) > make all -C platforms/armcc Please see README and Makefile in platforms/armcc to adjust options, default CPU architecture is ARM7TDMI and default CPU execution mode is THUMB. - + 3c. For Microsoft Visual Studio 2008 Double click /CppUTest/CppUTest.sln - + If Visual studio reports that the solution file was created with a newer version of Visual Studio, then try 3d - + Then press control-F5 to "Start without debugging" - + See CppUTest build and run its tests. - + 3d. For Older Microsoft Visual Studio .NET Double click /CppUTest/CppUTest.dsw Allow VS.NET to convert the files by clicking "yes to all" Run without debugging, see the test results in the command window Exit MS VS.NET - + Allow VS.NET to convert the files by clicking "yes to all" Run without debugging, see the test results in the command window - - NOTE: To create your own project, you need to have CppUTest and your project + + NOTE: To create your own project, you need to have CppUTest and your project compiled with the same compile and link settings - -4. to setup the support scripts. These scripts work in various unix systems + +4. to setup the support scripts. These scripts work in various unix systems and cygwin. (these are quite handy) If you are using windows install some tool like cygwin, msys or MKSToolkit to run these scripts. > cd /CppUTest > ./scripts/InstallScripts.sh -This command adds some symbolic links to /usr/local/bin, so you have +This command adds some symbolic links to /usr/local/bin, so you have to run it as root. sudo ./InstallScripts.sh - + MSYS - http://www.mingw.org/msys.shtml CYGWIN - http://www.cygwin.com/ MKSToolkit - http://mkstoolkit.com/ diff -Nru cpputest-3.8/README.md cpputest-4.0/README.md --- cpputest-3.8/README.md 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/README.md 2020-05-26 11:24:07.000000000 +0000 @@ -14,18 +14,22 @@ Coverage: [![Coverage Status](https://coveralls.io/repos/cpputest/cpputest/badge.svg?branch=master&service=github)](https://coveralls.io/github/cpputest/cpputest?branch=master) +Slack channel: +[Join if link not expired](https://join.slack.com/t/cpputest/shared_invite/zt-dvhne8z8-i_sOcxMF3oYvjoN~qpwiDw) + ## Getting Started You'll need to do the following to get started: Building from source (unix-based, cygwin, MacOSX): -* Download latest version -* autogen.sh -* configure +* git clone git://github.com/cpputest/cpputest.git +* cd cpputest_build +* autoreconf .. -i +* ../configure * make -* make check -* You can use "make install" if you want to install CppUTest system-wide + +You can use `make install` if you want to install CppUTest system-wide You can also use CMake, which also works for Windows Visual Studio. @@ -35,7 +39,7 @@ Then to get started, you'll need to do the following: * Add the include path to the Makefile. Something like: - * CPPFLAGS += -I(CPPUTEST_HOME)/include + * CPPFLAGS += -I$(CPPUTEST_HOME)/include * Add the memory leak macros to your Makefile (needed for additional debug info!). Something like: * CXXFLAGS += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorNewMacros.h * CFLAGS += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorMallocMacros.h @@ -57,8 +61,10 @@ ## Command line switches +* -h help, shows the latest help, including the parameters we've implemented after updating this README page. * -v verbose, print each test name as it runs * -r# repeat the tests some number of times, default is one, default if # is not specified is 2. This is handy if you are experiencing memory leaks related to statics and caches. +* -s# random shuffle the test execution order. # is an integer used for seeding the random number generator. # is optional, and if omitted, the seed value is chosen automatically, which results in a different order every time. The seed value is printed to console to make it possible to reproduce a previously generated execution order. Handy for detecting problems related to dependencies between tests. * -g group only run test whose group contains the substring group * -n name only run test whose name contains the substring name @@ -90,14 +96,15 @@ * BYTES_EQUAL(expected, actual) - Compares two numbers, eight bits wide * POINTERS_EQUAL(expected, actual) - Compares two const void * * DOUBLES_EQUAL(expected, actual, tolerance) - Compares two doubles within some tolerance +* ENUMS_EQUAL_INT(excepted, actual) - Compares two enums which their underlying type is int +* ENUMS_EQUAL_TYPE(underlying_type, excepted, actual) - Compares two enums which they have the same underlying type * FAIL(text) - always fails * TEST_EXIT - Exit the test without failure - useful for contract testing (implementing an assert fake) Customize CHECK_EQUAL to work with your types that support operator==() -* Create the function: -** SimpleString StringFrom (const yourType&) +* Create the function: `SimpleString StringFrom(const yourType&)` The Extensions directory has a few of these. @@ -153,10 +160,8 @@ int main(int ac, char** av) { - return CommandLineTestRunner::RunAllTests(ac, av); + return RUN_ALL_TESTS(ac, av); } - -IMPORT_TEST_GROUP(ClassName) ``` ## Example Test @@ -177,7 +182,7 @@ { delete className; } -} +}; TEST(ClassName, Create) { @@ -195,5 +200,26 @@ Test files. See scripts/README.TXT +## Integration as external CMake project + +Sometimes you want to use CppUTest in your project without installing it to your system or for having control over the version you are using. This little snippet get the wanted version from Github and builds it as a library. +```cmake +# CppUTest +include(FetchContent) +FetchContent_Declare( + CppUTest + GIT_REPOSITORY https://github.com/cpputest/cpputest.git + GIT_TAG latest-passing-build # or use release tag, eg. v3.8 +) +# Set this to ON if you want to have the CppUTests in your project as well. +set(TESTS OFF CACHE BOOL "Switch off CppUTest Test build") +FetchContent_MakeAvailable(CppUTest) +``` +It can be used then like so: + +```cmake +add_executable(run_tests UnitTest1.cpp UnitTest2.cpp) +target_link_libraries(run_tests PRIVATE CppUTest CppUTestExt) +``` diff -Nru cpputest-3.8/README_UsersOfPriorVersions.txt cpputest-4.0/README_UsersOfPriorVersions.txt --- cpputest-3.8/README_UsersOfPriorVersions.txt 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/README_UsersOfPriorVersions.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -If you were a user of CppTestTools you will have a few changes to make. - -CppUTest is the unit test harness from CppTestTools -CppFit is the FIT implementaions from CppTestTools - (CppFit is a separate download) - -Sorry, this is not a complete set of instructions for converting, but -here are some suggestions. - -In each test file - change namespace for SetUp and TearDown to TEST_GROUP(GroupName) - (GroupName is the class name by convention) - delete IMPORT_TEST_GROUP - (TEST_GROUP has this built in now) - #include "UnitTestHarness/somefile.h" should be - #include "CppUTest/somefile.h" - -Your Makefiles have to change: - Change DOTO to OBJS - Replace CPP_TEST_TOOLS with CPP_U_TEST - Replace MakefileHelpers with build - Change -I$(CPP_TEST_TOOLS) to -I$(CPP_U_TEST)/include\ - For libraries using fixtures add -I$(CPP_FIT)/include - Add the RunAllTests.sh script to your AllTests directory - - - \ No newline at end of file diff -Nru cpputest-3.8/scripts/appveyor_ci_build.ps1 cpputest-4.0/scripts/appveyor_ci_build.ps1 --- cpputest-3.8/scripts/appveyor_ci_build.ps1 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/scripts/appveyor_ci_build.ps1 2020-05-26 11:24:07.000000000 +0000 @@ -27,7 +27,7 @@ $cygwin_directory = (. "${cygwin_bin}\cygpath.exe" (Resolve-Path $directory)) $command_wrapped = "${cygwin_bin}\bash.exe --login -c 'cd $cygwin_directory ; $command'" - + Write-Host "Executing <$command> in <$cygwin_directory>" Invoke-Expression $command_wrapped @@ -73,10 +73,18 @@ { $mingw_path = Get-MinGWBin + if ($env:Platform -like 'MinGWClang*') + { + $toolchain_filename = Get-ClangToolchainFilename + $toolchain_path = (Join-Path (Split-Path $MyInvocation.MyCommand.Path) "..\cmake\$toolchain_filename") + $toolchain = "-DCMAKE_TOOLCHAIN_FILE=$toolchain_path" + } + # Add mingw to the path Add-PathFolder $mingw_path - Invoke-BuildCommand "cmake -G 'MinGW Makefiles' .." 'cpputest_build' + Invoke-BuildCommand "cmake --version" + Invoke-BuildCommand "cmake -G 'MinGW Makefiles' -DCMAKE_CXX_STANDARD=17 $toolchain .." 'cpputest_build' Invoke-BuildCommand "mingw32-make all" 'cpputest_build' Remove-PathFolder $mingw_path diff -Nru cpputest-3.8/scripts/appveyor_ci_test.ps1 cpputest-4.0/scripts/appveyor_ci_test.ps1 --- cpputest-3.8/scripts/appveyor_ci_test.ps1 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/scripts/appveyor_ci_test.ps1 2020-05-26 11:24:07.000000000 +0000 @@ -37,8 +37,12 @@ { # Run tests and output the results using junit $TestCommand = "$executable -ojunit" - Write-Host $TestCommand + Write-Host $TestCommand -NoNewline Invoke-Expression $TestCommand + Write-Host " - return code: $LASTEXITCODE" + if ($LASTEXITCODE -lt 0) { + Write-Error "Runtime Exception during test execution" + } } function Invoke-CygwinTests($executable) @@ -94,10 +98,10 @@ { $mingw_path = Get-MinGWBin - Add-PathFolder $mingw_path - Invoke-Tests '.\cpputest_build\tests\CppUTestTests.exe' + Set-Path "$mingw_path;C:\Windows;C:\Windows\System32" + Invoke-Tests '.\cpputest_build\tests\CppUTest\CppUTestTests.exe' Invoke-Tests '.\cpputest_build\tests\CppUTestExt\CppUTestExtTests.exe' - Remove-PathFolder $mingw_path + Restore-Path } default diff -Nru cpputest-3.8/scripts/appveyor_helpers.ps1 cpputest-4.0/scripts/appveyor_helpers.ps1 --- cpputest-3.8/scripts/appveyor_helpers.ps1 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/scripts/appveyor_helpers.ps1 2020-05-26 11:24:07.000000000 +0000 @@ -18,6 +18,16 @@ } } +# Helper function to provide the toolchain file for clang +function Get-ClangToolchainFilename() { + if ($env:Platform -like '*64') { + Write-Output 'clang+mingw-win64.toolchain.cmake' + } + else { + Write-Output 'clang+mingw-win32.toolchain.cmake' + } +} + # Helper function to provide the bin-folder path to cygwin function Get-CygwinBin() { if ($env:Platform -like '*64') { @@ -74,3 +84,13 @@ $env:Path = $pathFolders -join ";" } +function Set-Path($newPath) +{ + $env:RestorePath = $env:Path + $env:Path = $newPath +} + +function Restore-Path() +{ + $env:Path = $env:RestorePath +} diff -Nru cpputest-3.8/scripts/create_docker_images_and_containers cpputest-4.0/scripts/create_docker_images_and_containers --- cpputest-3.8/scripts/create_docker_images_and_containers 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/scripts/create_docker_images_and_containers 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,37 @@ +#!/bin/bash +#$1 is the container name + +checkForCppUTestToolsEnvVariable() { + if [ -z "$CPPUTEST_HOME" ] ; then + echo "CPPUTEST_HOME not set. You must set CPPUTEST_HOME to the top level CppUTest directory" + exit 1 + fi + if [ ! -d "$CPPUTEST_HOME" ] ; then + echo "CPPUTEST_HOME not set to a directory. You must set CPPUTEST_HOME to the top level CppUTest directory" + exit 2 + fi +} + +checkForImageNameParameter() { + if [ -z "$container" ] ; then + echo "Container name parameter not set. Check the docker directory. It should be the extension of the Dockerfile. e.g. ubuntu" + exit 1 + fi + if [ ! -f "$CPPUTEST_HOME/docker/Dockerfile.$container" ] ; then + echo "The Dockerfile docker/Dockerfile.$container doesn't exist. Typo?" + exit 2 + fi +} + + +container=$1 +checkForCppUTestToolsEnvVariable +checkForImageNameParameter + +docker build -f $CPPUTEST_HOME/docker/Dockerfile.$container --tag cpputest/$container:latest . +docker container rm cpputest_$container +docker create -it -v$CPPUTEST_HOME:/cpputest -e "CPPUTEST_HOME=/cpputest" --name cpputest_$container cpputest/$container:latest + +echo "You can run your container through: docker start -i cpputest_. E.g. docker start -i cpputest_$container" + + diff -Nru cpputest-3.8/scripts/InstallScripts.sh cpputest-4.0/scripts/InstallScripts.sh --- cpputest-3.8/scripts/InstallScripts.sh 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/scripts/InstallScripts.sh 2020-05-26 11:24:07.000000000 +0000 @@ -3,7 +3,8 @@ if [[ $FirstLetter == "/" ]] ; then CPPUTEST_HOME=${0%/scripts/*} else - CPPUTEST_HOME="$(pwd)/${0%/scripts/*}" + file=$(pwd)/${0} + CPPUTEST_HOME="${file%/scripts/*}" fi EXE_DIR=${EXE_DIR:-/usr/local/bin} diff -Nru cpputest-3.8/scripts/README.txt cpputest-4.0/scripts/README.txt --- cpputest-3.8/scripts/README.txt 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/scripts/README.txt 2020-05-26 11:24:07.000000000 +0000 @@ -1,5 +1,5 @@ The New*.sh scripts are helpful for creating the initial files for a new class... - NewClass.sh - for TTDing a new C++ class + NewClass.sh - for TDDing a new C++ class NewInterface.sh - for TDDing a new interface along with its Mock NewCModule.sh - for TDDing a C module NewCmiModule.sh - for TDDing a C module where there will be multiple diff -Nru cpputest-3.8/scripts/templates/ProjectTemplate/Project.cproject cpputest-4.0/scripts/templates/ProjectTemplate/Project.cproject --- cpputest-3.8/scripts/templates/ProjectTemplate/Project.cproject 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/scripts/templates/ProjectTemplate/Project.cproject 2020-05-26 11:24:07.000000000 +0000 @@ -30,6 +30,7 @@ @@ -37,12 +38,14 @@ diff -Nru cpputest-3.8/scripts/travis_ci_after.sh cpputest-4.0/scripts/travis_ci_after.sh --- cpputest-3.8/scripts/travis_ci_after.sh 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/scripts/travis_ci_after.sh 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,11 @@ +#!/bin/bash +# Script run in the travis CI +set -ex + +FILE="./test-suite.log" + +if [ -f $FILE ]; then + cat $FILE +else + echo "$FILE not found." +fi diff -Nru cpputest-3.8/scripts/travis_ci_build.sh cpputest-4.0/scripts/travis_ci_build.sh --- cpputest-3.8/scripts/travis_ci_build.sh 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/scripts/travis_ci_build.sh 2020-05-26 11:24:07.000000000 +0000 @@ -2,51 +2,53 @@ # Script run in the travis CI set -ex +if [ "x$CPPUTEST_HOME" = "x" ] ; then + export CPPUTEST_HOME=$TRAVIS_BUILD_DIR +fi + if [ "x$BUILD" = "xautotools" ]; then autoreconf -i .. ../configure - echo "CONFIGURATION DONE. Compiling now." - make check_all - - make dist - make dist-zip + make tdd +fi - if [ "x$CXX" = "xg++" ]; then - echo "Deploy please" -# gem install travis_github_deployer -# cd .. && travis_github_deployer -v || exit 1 - fi; +if [ "x$BUILD" = "xmakefileworker" ]; then + make -C $CPPUTEST_HOME -f Makefile_using_MakefileWorker test_all fi if [ "x$BUILD" = "xcmake" ]; then - cmake .. -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE - make - ctest -V + BUILD_ARGS=("-DWERROR=ON") - if [ "x$CXX" != "xg++" ]; then - cmake .. -DC++11=ON -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE - make - ctest -V + if [ -n "$CPP_STD" ]; then + BUILD_ARGS+=("-DCMAKE_CXX_STANDARD=$CPP_STD") fi + + cmake --version + cmake "${BUILD_ARGS[@]}" .. + make + ctest -V fi if [ "x$BUILD" = "xautotools_gtest" ]; then autoreconf -i .. ../configure - make check_gtest fi if [ "x$BUILD" = "xcmake_gtest" ]; then - wget https://googlemock.googlecode.com/files/gmock-1.6.0.zip + pwd + wget https://github.com/google/googletest/archive/release-1.6.0.zip -O gtest-1.6.0.zip && unzip gtest-1.6.0.zip; + wget https://github.com/google/googlemock/archive/release-1.6.0.zip -O gmock-1.6.0.zip && unzip gmock-1.6.0.zip; + unzip gtest-1.6.0.zip -d $TRAVIS_BUILD_DIR unzip gmock-1.6.0.zip -d $TRAVIS_BUILD_DIR - cd $TRAVIS_BUILD_DIR/gmock-1.6.0 - ./configure && make + cd $TRAVIS_BUILD_DIR + mv googletest-release-1.6.0 googlemock-release-1.6.0/gtest + cd googlemock-release-1.6.0 + autoreconf -i; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make cd - - - export GMOCK_HOME=$TRAVIS_BUILD_DIR/gmock-1.6.0 - export GTEST_HOME=$TRAVIS_BUILD_DIR/gmock-1.6.0/gtest - cmake .. -DGMOCK=ON + export GMOCK_HOME=$TRAVIS_BUILD_DIR/googlemock-release-1.6.0 + export GTEST_HOME=$TRAVIS_BUILD_DIR/googlemock-release-1.6.0/gtest + cmake . -DGMOCK=ON make ctest -V fi @@ -62,25 +64,115 @@ fi if [ "x$BUILD" = "xcmake_coverage" ]; then - pip install cpp-coveralls --user `whoami` + pip install --user cpp-coveralls gcovr - cmake .. -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCOVERAGE=ON -DLONGLONG=ON + cmake .. -DCMAKE_BUILD_TYPE=Debug -DC++11=ON -DCOVERAGE=ON -DLONGLONG=ON make ctest coveralls -b . -r .. -i "src" -i "include" --gcov-options="-lbc" || true fi +if [ "x$BUILD" = "xautotools_cmake_install_test" ]; then + autoreconf -i .. + ../configure + rm -rf install_autotools + mkdir -p install_autotools + make DESTDIR=install_autotools install + + cmake .. + rm -rf install_cmake + mkdir -p install_cmake + make DESTDIR=install_cmake install + + # Hack: autotools cannot make CMake package. We cached and copied them. Here we check they are still the same + for cmakefile in CppUTestConfig.cmake CppUTestConfigVersion.cmake CppUTestTargets-relwithdebinfo.cmake CppUTestTargets.cmake; do + cat install_autotools/usr/local/lib/CppUTest/cmake/$cmakefile + cat install_cmake/usr/local/lib/CppUTest/cmake/$cmakefile + diff -Bw install_autotools/usr/local/lib/CppUTest/cmake/$cmakefile install_cmake/usr/local/lib/CppUTest/cmake/$cmakefile || exit 1 + done + + export INSTALL_DIFF=`diff -rwBq install_autotools install_cmake -X CppUTestGeneratedConfig.h -X libCppUTest.a -X libCppUTestExt.a` + if [ "x$INSTALL_DIFF" != "x" ]; then + echo "FAILED: CMake install and Autotools install is not the same!\n" + echo "Difference\n" + echo "-------------------------------\n" + echo "$INSTALL_DIFF" + echo "-------------------------------\n" + exit 1; + fi +fi + +if [ "x$BUILD" = "xdocker_ubuntu_autotools" ]; then + $CPPUTEST_HOME/scripts/create_docker_images_and_containers ubuntu + docker start -i cpputest_ubuntu +fi + +if [ "x$BUILD" = "xdocker_ubuntu_dos" ]; then + $CPPUTEST_HOME/scripts/create_docker_images_and_containers dos + docker start -i cpputest_dos +fi + if [ "x$BUILD" = "xmake_dos" ]; then - wget ftp://ftp.openwatcom.org/pub/open-watcom-c-linux-1.9 -O /tmp/watcom.zip - mkdir -p watcom && unzip -aqd watcom /tmp/watcom.zip && chmod -R +x watcom/binl + if [ ! -d watcom ]; then + git clone https://github.com/cpputest/watcom-compiler.git watcom + fi export PATH=$PATH:$PWD/watcom/binl export WATCOM=$PWD/watcom - export CPPUTEST_HOME=$TRAVIS_BUILD_DIR export CC=wcl export CXX=wcl $CC --version - make -f ../platforms/Dos/Makefile || exit 1 - ../platforms/Dos/alltests.sh || exit 1 - fi + make -f $CPPUTEST_HOME/platforms/Dos/Makefile clean + make -f $CPPUTEST_HOME/platforms/Dos/Makefile + $CPPUTEST_HOME/platforms/Dos/alltests.sh +fi +if [ "x$BUILD" = "xextensive_check" ]; then + autoreconf -i .. + ../configure + make check_all +fi + +if [ "x$BUILD" = "xautotools_dist" ]; then + autoreconf -i .. + ../configure + + if [ "x$TRAVIS_OS_NAME" = "xosx" ]; then + COPYFILE_DISABLE=1 make dist VERSION=latest + COPYFILE_DISABLE=1 make dist-zip VERSION=latest + else + make dist VERSION=latest + make dist-zip VERSION=latest + fi +fi + +if [ "x$BUILD" = "xautotools_install_and_test_examples" ]; then + autoreconf -i .. + ../configure + + make tdd + sudo make install + make -C $CPPUTEST_HOME/examples -f $CPPUTEST_HOME/examples/Makefile_ExamplesWithCppUTestInstalled.mk +fi + +if [ "x$BUILD" = "xvc_windows" ]; then + export PATH=$MSBUILD_PATH:$PATH + cmake .. + MSBuild.exe ALL_BUILD.vcxproj + ./tests/CppUTest/CppUTestTests.exe + ./tests/CppUTestExt/CppUTestExtTests.exe +fi + +if [ "x$BUILD" = "xcmake_windows" ]; then + choco install make + BUILD_ARGS=("-DWERROR=ON") + + if [ -n "$CPP_STD" ]; then + BUILD_ARGS+=("-DCMAKE_CXX_STANDARD=$CPP_STD") + fi + + cmake --version + cmake -G 'Unix Makefiles' "${BUILD_ARGS[@]}" .. + make + ctest -V +fi diff -Nru cpputest-3.8/src/CppUTest/CMakeIntegration-README.md cpputest-4.0/src/CppUTest/CMakeIntegration-README.md --- cpputest-3.8/src/CppUTest/CMakeIntegration-README.md 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/src/CppUTest/CMakeIntegration-README.md 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,24 @@ +It is possible to integrate CppUTest as a sub-module of an enclosing CMake +project. This may be useful if CppUTest is being built for a target platform +other than that of the development host. The following is an example how an +external project can refer to this CMakeLists.txt to build CppUTest as a +library and include it as a target dependency. + +```cmake +cmake_minimum_required(VERSION 3.7) +project(trying_CppUtest) + +SET(CppUTestRootDirectory /path/to/cpputest) + +# Either set CPP_PLATFORM to one of the provided platforms under +# ${CppUTestRootDirectory}/src/Platforms/, or provide a project-specific +# platform.cpp (as shown below) +add_subdirectory(${CppUTestRootDirectory}/src/CppUTest CppUTest) +target_sources(CppUTest + PRIVATE + ${PROJECT_SOURCE_DIR}/UtestPlatform.cpp +) + +add_executable(trying_CppUtest main.cpp) +target_link_libraries(trying_CppUtest CppUTest) +``` diff -Nru cpputest-3.8/src/CppUTest/CMakeLists.txt cpputest-4.0/src/CppUTest/CMakeLists.txt --- cpputest-3.8/src/CppUTest/CMakeLists.txt 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTest/CMakeLists.txt 2020-05-26 11:24:07.000000000 +0000 @@ -1,10 +1,11 @@ -set(CppUTest_src +add_library(CppUTest CommandLineArguments.cpp MemoryLeakWarningPlugin.cpp TestHarness_c.cpp TestRegistry.cpp CommandLineTestRunner.cpp SimpleString.cpp + SimpleStringInternalCache.cpp TestMemoryAllocator.cpp TestResult.cpp JUnitTestOutput.cpp @@ -17,7 +18,21 @@ TestTestingFixture.cpp SimpleMutex.cpp Utest.cpp - ../Platforms/${CPP_PLATFORM}/UtestPlatform.cpp +) + +#[[Set CPP_PLATFORM in a parent CMakeLists.txt if reusing one of the provided platforms, else supply the missing definitions]] +if (CPP_PLATFORM) + target_sources(CppUTest + PRIVATE + ../Platforms/${CPP_PLATFORM}/UtestPlatform.cpp + ) +endif(CPP_PLATFORM) + +#[[Arrange for the include directory to be added to the include paths of any CMake target depending on CppUTest.]] +target_include_directories(CppUTest + PUBLIC + $ + $ ) set(CppUTest_headers @@ -29,6 +44,7 @@ ${CppUTestRootDirectory}/include/CppUTest/TestOutput.h ${CppUTestRootDirectory}/include/CppUTest/CppUTestConfig.h ${CppUTestRootDirectory}/include/CppUTest/SimpleString.h + ${CppUTestRootDirectory}/include/CppUTest/SimpleStringInternalCache.h ${CppUTestRootDirectory}/include/CppUTest/TestPlugin.h ${CppUTestRootDirectory}/include/CppUTest/JUnitTestOutput.h ${CppUTestRootDirectory}/include/CppUTest/TeamCityTestOutput.h @@ -46,15 +62,18 @@ ${CppUTestRootDirectory}/include/CppUTest/MemoryLeakWarningPlugin.h ${CppUTestRootDirectory}/include/CppUTest/TestHarness_c.h ${CppUTestRootDirectory}/include/CppUTest/UtestMacros.h + ${CppUTestRootDirectory}/include/CppUTest/SimpleMutex.h ) -add_library(CppUTest STATIC ${CppUTest_src} ${CppUTest_headers}) +set_target_properties(CppUTest PROPERTIES + PUBLIC_HEADER "${CppUTest_headers}") + if (WIN32) target_link_libraries(CppUTest winmm.lib) endif (WIN32) -install(FILES ${CppUTest_headers} DESTINATION include/CppUTest) install(TARGETS CppUTest EXPORT CppUTestTargets - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/CppUTest" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/CppUTest") diff -Nru cpputest-3.8/src/CppUTest/CommandLineArguments.cpp cpputest-4.0/src/CppUTest/CommandLineArguments.cpp --- cpputest-3.8/src/CppUTest/CommandLineArguments.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/CommandLineArguments.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -29,8 +29,8 @@ #include "CppUTest/CommandLineArguments.h" #include "CppUTest/PlatformSpecificFunctions.h" -CommandLineArguments::CommandLineArguments(int ac, const char** av) : - ac_(ac), av_(av), verbose_(false), color_(false), runTestsAsSeperateProcess_(false), listTestGroupNames_(false), listTestGroupAndCaseNames_(false), runIgnored_(false), repeat_(1), groupFilters_(NULL), nameFilters_(NULL), outputType_(OUTPUT_ECLIPSE) +CommandLineArguments::CommandLineArguments(int ac, const char *const *av) : + ac_(ac), av_(av), needHelp_(false), verbose_(false), veryVerbose_(false), color_(false), runTestsAsSeperateProcess_(false), listTestGroupNames_(false), listTestGroupAndCaseNames_(false), runIgnored_(false), reversing_(false), shuffling_(false), shufflingPreSeeded_(false), repeat_(1), shuffleSeed_(0), groupFilters_(NULLPTR), nameFilters_(NULLPTR), outputType_(OUTPUT_ECLIPSE) { } @@ -54,26 +54,34 @@ for (int i = 1; i < ac_; i++) { SimpleString argument = av_[i]; - if (argument == "-v") verbose_ = true; + if (argument == "-h") { + needHelp_ = true; + correctParameters = false; + } + else if (argument == "-v") verbose_ = true; + else if (argument == "-vv") veryVerbose_ = true; else if (argument == "-c") color_ = true; else if (argument == "-p") runTestsAsSeperateProcess_ = true; + else if (argument == "-b") reversing_ = true; else if (argument == "-lg") listTestGroupNames_ = true; else if (argument == "-ln") listTestGroupAndCaseNames_ = true; else if (argument == "-ri") runIgnored_ = true; - else if (argument.startsWith("-r")) SetRepeatCount(ac_, av_, i); - else if (argument.startsWith("-g")) AddGroupFilter(ac_, av_, i); - else if (argument.startsWith("-sg")) AddStrictGroupFilter(ac_, av_, i); - else if (argument.startsWith("-xg")) AddExcludeGroupFilter(ac_, av_, i); - else if (argument.startsWith("-xsg")) AddExcludeStrictGroupFilter(ac_, av_, i); - else if (argument.startsWith("-n")) AddNameFilter(ac_, av_, i); - else if (argument.startsWith("-sn")) AddStrictNameFilter(ac_, av_, i); - else if (argument.startsWith("-xn")) AddExcludeNameFilter(ac_, av_, i); - else if (argument.startsWith("-xsn")) AddExcludeStrictNameFilter(ac_, av_, i); - else if (argument.startsWith("TEST(")) AddTestToRunBasedOnVerboseOutput(ac_, av_, i, "TEST("); - else if (argument.startsWith("IGNORE_TEST(")) AddTestToRunBasedOnVerboseOutput(ac_, av_, i, "IGNORE_TEST("); - else if (argument.startsWith("-o")) correctParameters = SetOutputType(ac_, av_, i); + else if (argument.startsWith("-r")) setRepeatCount(ac_, av_, i); + else if (argument.startsWith("-g")) addGroupFilter(ac_, av_, i); + else if (argument.startsWith("-t")) correctParameters = addGroupDotNameFilter(ac_, av_, i); + else if (argument.startsWith("-sg")) addStrictGroupFilter(ac_, av_, i); + else if (argument.startsWith("-xg")) addExcludeGroupFilter(ac_, av_, i); + else if (argument.startsWith("-xsg")) addExcludeStrictGroupFilter(ac_, av_, i); + else if (argument.startsWith("-n")) addNameFilter(ac_, av_, i); + else if (argument.startsWith("-sn")) addStrictNameFilter(ac_, av_, i); + else if (argument.startsWith("-xn")) addExcludeNameFilter(ac_, av_, i); + else if (argument.startsWith("-xsn")) addExcludeStrictNameFilter(ac_, av_, i); + else if (argument.startsWith("-s")) correctParameters = setShuffle(ac_, av_, i); + else if (argument.startsWith("TEST(")) addTestToRunBasedOnVerboseOutput(ac_, av_, i, "TEST("); + else if (argument.startsWith("IGNORE_TEST(")) addTestToRunBasedOnVerboseOutput(ac_, av_, i, "IGNORE_TEST("); + else if (argument.startsWith("-o")) correctParameters = setOutputType(ac_, av_, i); else if (argument.startsWith("-p")) correctParameters = plugin->parseAllArguments(ac_, av_, i); - else if (argument.startsWith("-k")) SetPackageName(ac_, av_, i); + else if (argument.startsWith("-k")) setPackageName(ac_, av_, i); else correctParameters = false; if (correctParameters == false) { @@ -85,7 +93,53 @@ const char* CommandLineArguments::usage() const { - return "usage [-v] [-c] [-p] [-lg] [-ln] [-ri] [-r#] [-g|sg|xg|xsg groupName]... [-n|sn|xn|xsn testName]... [\"TEST(groupName, testName)\"]... [-o{normal, junit, teamcity}] [-k packageName]\n"; + return "use -h for more extensive help\nusage [-h] [-v] [-vv] [-c] [-p] [-lg] [-ln] [-ri] [-r#]\n" + " [-g|sg|xg|xsg groupName]... [-n|sn|xn|xsn testName]... [-t groupName.testName]...\n" + " [-b] [-s [randomizerSeed>0]] [\"TEST(groupName, testName)\"]... [-o{normal, junit, teamcity}] [-k packageName]\n"; +} + +const char* CommandLineArguments::help() const +{ + return + "Thanks for using CppUTest.\n" + "\n" + "Options that do not run tests but query:\n" + " -h - this wonderful help screen. Joy!\n" + " -lg - print a list of group names, separated by spaces\n" + " -ln - print a list of test names in the form of group.name, separated by spaces\n" + "\n" + "Options that change the output format:\n" + " -c - colorize output, print green if OK, or red if failed\n" + " -v - verbose, print each test name as it runs\n" + " -vv - very verbose, print internal information during test run\n" + "\n" + "Options that change the output location:\n" + " -oteamcity - output to xml files (as the name suggests, for TeamCity)\n" + " -ojunit - output to JUnit ant plugin style xml files (for CI systems)\n" + " -k package name - Add a package name in JUnit output (for classification in CI systems)\n" + "\n" + "\n" + "Options that control which tests are run:\n" + " -g group - only run test whose group contains the substring group\n" + " -n name - only run test whose name contains the substring name\n" + " -t group.name - only run test whose name contains the substring group and name\n" + " -sg group - only run test whose group exactly matches the string group\n" + " -sn name - only run test whose name exactly matches the string name\n" + " -xg group - exclude tests whose group contains the substring group (v3.8)\n" + " -xn name - exclude tests whose name contains the substring name (v3.8)\n" + " TEST(group,name) - only run test whose group and name matches the strings group and name.\n" + " This can be used to copy-paste output from the -v option on the command line.\n" + "\n" + "Options that control how the tests are run:\n" + " -p - run tests in a separate process.\n" + " -b - run the tests backwards, reversing the normal way\n" + " -s [seed] - shuffle tests randomly. Seed is optional\n" + " -r# - repeat the tests some number (#) of times, or twice if # is not specified.\n"; +} + +bool CommandLineArguments::needHelp() const +{ + return needHelp_; } bool CommandLineArguments::isVerbose() const @@ -93,6 +147,11 @@ return verbose_; } +bool CommandLineArguments::isVeryVerbose() const +{ + return veryVerbose_; +} + bool CommandLineArguments::isColor() const { return color_; @@ -119,11 +178,26 @@ } -int CommandLineArguments::getRepeatCount() const +size_t CommandLineArguments::getRepeatCount() const { return repeat_; } +bool CommandLineArguments::isReversing() const +{ + return reversing_; +} + +bool CommandLineArguments::isShuffling() const +{ + return shuffling_; +} + +size_t CommandLineArguments::getShuffleSeed() const +{ + return shuffleSeed_; +} + const TestFilter* CommandLineArguments::getGroupFilters() const { return groupFilters_; @@ -134,14 +208,14 @@ return nameFilters_; } -void CommandLineArguments::SetRepeatCount(int ac, const char** av, int& i) +void CommandLineArguments::setRepeatCount(int ac, const char *const *av, int& i) { repeat_ = 0; SimpleString repeatParameter(av[i]); - if (repeatParameter.size() > 2) repeat_ = SimpleString::AtoI(av[i] + 2); + if (repeatParameter.size() > 2) repeat_ = (size_t) (SimpleString::AtoI(av[i] + 2)); else if (i + 1 < ac) { - repeat_ = SimpleString::AtoI(av[i + 1]); + repeat_ = (size_t) (SimpleString::AtoI(av[i + 1])); if (repeat_ != 0) i++; } @@ -149,7 +223,29 @@ } -SimpleString CommandLineArguments::getParameterField(int ac, const char** av, int& i, const SimpleString& parameterName) +bool CommandLineArguments::setShuffle(int ac, const char * const *av, int& i) +{ + shuffling_ = true; + shuffleSeed_ = (unsigned int)GetPlatformSpecificTimeInMillis(); + if (shuffleSeed_ == 0) shuffleSeed_++; + + SimpleString shuffleParameter = av[i]; + if (shuffleParameter.size() > 2) { + shufflingPreSeeded_ = true; + shuffleSeed_ = SimpleString::AtoU(av[i] + 2); + } else if (i + 1 < ac) { + unsigned int parsedParameter = SimpleString::AtoU(av[i + 1]); + if (parsedParameter != 0) + { + shufflingPreSeeded_ = true; + shuffleSeed_ = parsedParameter; + i++; + } + } + return (shuffleSeed_ != 0); +} + +SimpleString CommandLineArguments::getParameterField(int ac, const char * const *av, int& i, const SimpleString& parameterName) { size_t parameterLength = parameterName.size(); SimpleString parameter(av[i]); @@ -158,27 +254,40 @@ return ""; } -void CommandLineArguments::AddGroupFilter(int ac, const char** av, int& i) +void CommandLineArguments::addGroupFilter(int ac, const char *const *av, int& i) { TestFilter* groupFilter = new TestFilter(getParameterField(ac, av, i, "-g")); groupFilters_ = groupFilter->add(groupFilters_); } -void CommandLineArguments::AddStrictGroupFilter(int ac, const char** av, int& i) +bool CommandLineArguments::addGroupDotNameFilter(int ac, const char *const *av, int& i) +{ + SimpleString groupDotName = getParameterField(ac, av, i, "-t"); + SimpleStringCollection collection; + groupDotName.split(".", collection); + + if (collection.size() != 2) return false; + + groupFilters_ = (new TestFilter(collection[0].subString(0, collection[0].size()-1)))->add(groupFilters_); + nameFilters_ = (new TestFilter(collection[1]))->add(nameFilters_); + return true; +} + +void CommandLineArguments::addStrictGroupFilter(int ac, const char *const *av, int& i) { TestFilter* groupFilter = new TestFilter(getParameterField(ac, av, i, "-sg")); groupFilter->strictMatching(); groupFilters_ = groupFilter->add(groupFilters_); } -void CommandLineArguments::AddExcludeGroupFilter(int ac, const char** av, int& i) +void CommandLineArguments::addExcludeGroupFilter(int ac, const char *const *av, int& i) { TestFilter* groupFilter = new TestFilter(getParameterField(ac, av, i, "-xg")); groupFilter->invertMatching(); groupFilters_ = groupFilter->add(groupFilters_); } -void CommandLineArguments::AddExcludeStrictGroupFilter(int ac, const char** av, int& i) +void CommandLineArguments::addExcludeStrictGroupFilter(int ac, const char *const *av, int& i) { TestFilter* groupFilter = new TestFilter(getParameterField(ac, av, i, "-xsg")); groupFilter->strictMatching(); @@ -186,27 +295,27 @@ groupFilters_ = groupFilter->add(groupFilters_); } -void CommandLineArguments::AddNameFilter(int ac, const char** av, int& i) +void CommandLineArguments::addNameFilter(int ac, const char *const *av, int& i) { TestFilter* nameFilter = new TestFilter(getParameterField(ac, av, i, "-n")); nameFilters_ = nameFilter->add(nameFilters_); } -void CommandLineArguments::AddStrictNameFilter(int ac, const char** av, int& index) +void CommandLineArguments::addStrictNameFilter(int ac, const char *const *av, int& index) { TestFilter* nameFilter = new TestFilter(getParameterField(ac, av, index, "-sn")); nameFilter->strictMatching(); nameFilters_= nameFilter->add(nameFilters_); } -void CommandLineArguments::AddExcludeNameFilter(int ac, const char** av, int& index) +void CommandLineArguments::addExcludeNameFilter(int ac, const char *const *av, int& index) { TestFilter* nameFilter = new TestFilter(getParameterField(ac, av, index, "-xn")); nameFilter->invertMatching(); nameFilters_= nameFilter->add(nameFilters_); } -void CommandLineArguments::AddExcludeStrictNameFilter(int ac, const char** av, int& index) +void CommandLineArguments::addExcludeStrictNameFilter(int ac, const char *const *av, int& index) { TestFilter* nameFilter = new TestFilter(getParameterField(ac, av, index, "-xsn")); nameFilter->invertMatching(); @@ -214,11 +323,11 @@ nameFilters_= nameFilter->add(nameFilters_); } -void CommandLineArguments::AddTestToRunBasedOnVerboseOutput(int ac, const char** av, int& index, const char* parameterName) +void CommandLineArguments::addTestToRunBasedOnVerboseOutput(int ac, const char *const *av, int& index, const char* parameterName) { SimpleString wholename = getParameterField(ac, av, index, parameterName); SimpleString testname = wholename.subStringFromTill(',', ')'); - testname = testname.subString(2, testname.size()); + testname = testname.subString(2); TestFilter* namefilter = new TestFilter(testname); TestFilter* groupfilter = new TestFilter(wholename.subStringFromTill(wholename.at(0), ',')); namefilter->strictMatching(); @@ -227,7 +336,7 @@ nameFilters_ = namefilter->add(nameFilters_); } -void CommandLineArguments::SetPackageName(int ac, const char** av, int& i) +void CommandLineArguments::setPackageName(int ac, const char *const *av, int& i) { SimpleString packageName = getParameterField(ac, av, i, "-k"); if (packageName.size() == 0) return; @@ -235,7 +344,7 @@ packageName_ = packageName; } -bool CommandLineArguments::SetOutputType(int ac, const char** av, int& i) +bool CommandLineArguments::setOutputType(int ac, const char *const *av, int& i) { SimpleString outputType = getParameterField(ac, av, i, "-o"); if (outputType.size() == 0) return false; diff -Nru cpputest-3.8/src/CppUTest/CommandLineTestRunner.cpp cpputest-4.0/src/CppUTest/CommandLineTestRunner.cpp --- cpputest-3.8/src/CppUTest/CommandLineTestRunner.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/CommandLineTestRunner.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -29,15 +29,16 @@ #include "CppUTest/CommandLineTestRunner.h" #include "CppUTest/TestOutput.h" #include "CppUTest/JUnitTestOutput.h" +#include "CppUTest/PlatformSpecificFunctions.h" #include "CppUTest/TeamCityTestOutput.h" #include "CppUTest/TestRegistry.h" int CommandLineTestRunner::RunAllTests(int ac, char** av) { - return RunAllTests(ac, (const char**) av); + return RunAllTests(ac, (const char *const *) av); } -int CommandLineTestRunner::RunAllTests(int ac, const char** av) +int CommandLineTestRunner::RunAllTests(int ac, const char *const *av) { int result = 0; ConsoleTestOutput backupOutput; @@ -58,8 +59,8 @@ return result; } -CommandLineTestRunner::CommandLineTestRunner(int ac, const char** av, TestRegistry* registry) : - output_(NULL), arguments_(NULL), registry_(registry) +CommandLineTestRunner::CommandLineTestRunner(int ac, const char *const *av, TestRegistry* registry) : + output_(NULLPTR), arguments_(NULLPTR), registry_(registry) { arguments_ = new CommandLineArguments(ac, av); } @@ -72,7 +73,7 @@ int CommandLineTestRunner::runAllTestsMain() { - int testResult = 0; + int testResult = 1; SetPointerPlugin pPlugin(DEF_PLUGIN_SET_POINTER); registry_->installPlugin(&pPlugin); @@ -88,8 +89,9 @@ { registry_->setGroupFilters(arguments_->getGroupFilters()); registry_->setNameFilters(arguments_->getNameFilters()); - - if (arguments_->isVerbose()) output_->verbose(); + + if (arguments_->isVerbose()) output_->verbose(TestOutput::level_verbose); + if (arguments_->isVeryVerbose()) output_->verbose(TestOutput::level_veryVerbose); if (arguments_->isColor()) output_->color(); if (arguments_->runTestsInSeperateProcess()) registry_->setRunTestsInSeperateProcess(); if (arguments_->isRunIgnored()) registry_->setRunIgnored(); @@ -98,9 +100,10 @@ int CommandLineTestRunner::runAllTests() { initializeTestRun(); - int loopCount = 0; - int failureCount = 0; - int repeat_ = arguments_->getRepeatCount(); + size_t loopCount = 0; + size_t failedTestCount = 0; + size_t failedExecutionCount = 0; + size_t repeatCount = arguments_->getRepeatCount(); if (arguments_->isListingTestGroupNames()) { @@ -116,14 +119,29 @@ return 0; } - while (loopCount++ < repeat_) { - output_->printTestRun(loopCount, repeat_); + if (arguments_->isReversing()) + registry_->reverseTests(); + + if (arguments_->isShuffling()) + { + output_->print("Test order shuffling enabled with seed: "); + output_->print(arguments_->getShuffleSeed()); + output_->print("\n"); + } + while (loopCount++ < repeatCount) { + + if (arguments_->isShuffling()) + registry_->shuffleTests(arguments_->getShuffleSeed()); + + output_->printTestRun(loopCount, repeatCount); TestResult tr(*output_); registry_->runAllTests(tr); - failureCount += tr.getFailureCount(); + failedTestCount += tr.getFailureCount(); + if (tr.isFailure()) { + failedExecutionCount++; + } } - - return failureCount; + return (int) (failedTestCount != 0 ? failedTestCount : failedExecutionCount); } TestOutput* CommandLineTestRunner::createTeamCityOutput() @@ -134,7 +152,7 @@ TestOutput* CommandLineTestRunner::createJUnitOutput(const SimpleString& packageName) { JUnitTestOutput* junitOutput = new JUnitTestOutput; - if (junitOutput != NULL) { + if (junitOutput != NULLPTR) { junitOutput->setPackageName(packageName); } return junitOutput; @@ -157,7 +175,7 @@ { if (!arguments_->parse(plugin)) { output_ = createConsoleOutput(); - output_->print(arguments_->usage()); + output_->print((arguments_->needHelp()) ? arguments_->help() : arguments_->usage()); return false; } diff -Nru cpputest-3.8/src/CppUTest/JUnitTestOutput.cpp cpputest-4.0/src/CppUTest/JUnitTestOutput.cpp --- cpputest-3.8/src/CppUTest/JUnitTestOutput.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/JUnitTestOutput.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -34,28 +34,32 @@ struct JUnitTestCaseResultNode { JUnitTestCaseResultNode() : - execTime_(0), failure_(0), ignored_(false), next_(0) + execTime_(0), failure_(NULLPTR), ignored_(false), lineNumber_ (0), checkCount_ (0), next_(NULLPTR) { } SimpleString name_; - long execTime_; + size_t execTime_; TestFailure* failure_; bool ignored_; + SimpleString file_; + size_t lineNumber_; + size_t checkCount_; JUnitTestCaseResultNode* next_; }; struct JUnitTestGroupResult { JUnitTestGroupResult() : - testCount_(0), failureCount_(0), startTime_(0), groupExecTime_(0), head_(0), tail_(0) + testCount_(0), failureCount_(0), totalCheckCount_(0), startTime_(0), groupExecTime_(0), head_(NULLPTR), tail_(NULLPTR) { } - int testCount_; - int failureCount_; - long startTime_; - long groupExecTime_; + size_t testCount_; + size_t failureCount_; + size_t totalCheckCount_; + size_t startTime_; + size_t groupExecTime_; SimpleString group_; JUnitTestCaseResultNode* head_; JUnitTestCaseResultNode* tail_; @@ -66,6 +70,7 @@ JUnitTestGroupResult results_; PlatformSpecificFile file_; SimpleString package_; + SimpleString stdOutput_; }; JUnitTestOutput::JUnitTestOutput() : @@ -87,13 +92,12 @@ JUnitTestCaseResultNode* cur = impl_->results_.head_; while (cur) { JUnitTestCaseResultNode* tmp = cur->next_; - ; delete cur->failure_; delete cur; cur = tmp; } - impl_->results_.head_ = 0; - impl_->results_.tail_ = 0; + impl_->results_.head_ = NULLPTR; + impl_->results_.tail_ = NULLPTR; } void JUnitTestOutput::printTestsStarted() @@ -106,8 +110,8 @@ void JUnitTestOutput::printCurrentTestEnded(const TestResult& result) { - impl_->results_.tail_->execTime_ - = result.getCurrentTestTotalExecutionTime(); + impl_->results_.tail_->execTime_ = result.getCurrentTestTotalExecutionTime(); + impl_->results_.tail_->checkCount_ = result.getCheckCount(); } void JUnitTestOutput::printTestsEnded(const TestResult& /*result*/) @@ -125,9 +129,9 @@ { impl_->results_.testCount_++; impl_->results_.group_ = test.getGroup(); - impl_->results_.startTime_ = GetPlatformSpecificTimeInMillis(); + impl_->results_.startTime_ = (size_t) GetPlatformSpecificTimeInMillis(); - if (impl_->results_.tail_ == 0) { + if (impl_->results_.tail_ == NULLPTR) { impl_->results_.head_ = impl_->results_.tail_ = new JUnitTestCaseResultNode; } @@ -136,6 +140,8 @@ impl_->results_.tail_ = impl_->results_.tail_->next_; } impl_->results_.tail_->name_ = test.getName(); + impl_->results_.tail_->file_ = test.getFile(); + impl_->results_.tail_->lineNumber_ = test.getLineNumber(); if (!test.willRun()) { impl_->results_.tail_->ignored_ = true; } @@ -144,15 +150,29 @@ SimpleString JUnitTestOutput::createFileName(const SimpleString& group) { SimpleString fileName = "cpputest_"; + if (!impl_->package_.isEmpty()) { + fileName += impl_->package_; + fileName += "_"; + } fileName += group; - fileName.replace('/', '_'); - fileName += ".xml"; - return fileName; + return encodeFileName(fileName) + ".xml"; +} + +SimpleString JUnitTestOutput::encodeFileName(const SimpleString& fileName) +{ + // special character list based on: https://en.wikipedia.org/wiki/Filename + static const char* const forbiddenCharacters = "/\\?%*:|\"<>"; + + SimpleString result = fileName; + for (const char* sym = forbiddenCharacters; *sym; ++sym) { + result.replace(*sym, '_'); + } + return result; } void JUnitTestOutput::setPackageName(const SimpleString& package) { - if (impl_ != NULL) { + if (impl_ != NULLPTR) { impl_->package_ = package; } } @@ -168,9 +188,9 @@ buf = StringFromFormat( "\n", - impl_->results_.failureCount_, + (int)impl_->results_.failureCount_, impl_->results_.group_.asCharString(), - impl_->results_.testCount_, + (int) impl_->results_.testCount_, (int) (impl_->results_.groupExecTime_ / 1000), (int) (impl_->results_.groupExecTime_ % 1000), GetPlatformSpecificTimeString()); writeToFile(buf.asCharString()); @@ -182,18 +202,36 @@ writeToFile("\n"); } +SimpleString JUnitTestOutput::encodeXmlText(const SimpleString& textbody) +{ + SimpleString buf = textbody.asCharString(); + buf.replace("&", "&"); + buf.replace("\"", """); + buf.replace("<", "<"); + buf.replace(">", ">"); + buf.replace("\n", "{newline}"); + return buf; +} + void JUnitTestOutput::writeTestCases() { JUnitTestCaseResultNode* cur = impl_->results_.head_; + while (cur) { SimpleString buf = StringFromFormat( - "\n", + "\n", impl_->package_.asCharString(), - impl_->package_.isEmpty() == true ? "" : ".", + impl_->package_.isEmpty() ? "" : ".", impl_->results_.group_.asCharString(), - cur->name_.asCharString(), (int) (cur->execTime_ / 1000), (int)(cur->execTime_ % 1000)); + cur->name_.asCharString(), + (int) (cur->checkCount_ - impl_->results_.totalCheckCount_), + (int) (cur->execTime_ / 1000), (int)(cur->execTime_ % 1000), + cur->file_.asCharString(), + (int) cur->lineNumber_); writeToFile(buf.asCharString()); + impl_->results_.totalCheckCount_ = cur->checkCount_; + if (cur->failure_) { writeFailure(cur); } @@ -207,25 +245,23 @@ void JUnitTestOutput::writeFailure(JUnitTestCaseResultNode* node) { - SimpleString message = node->failure_->getMessage().asCharString(); - message.replace('"', '\''); - message.replace('<', '['); - message.replace('>', ']'); - message.replace("&", "&"); - message.replace("\n", "{newline}"); SimpleString buf = StringFromFormat( "\n", node->failure_->getFileName().asCharString(), - node->failure_->getFailureLineNumber(), message.asCharString()); + (int) node->failure_->getFailureLineNumber(), + encodeXmlText(node->failure_->getMessage()).asCharString()); writeToFile(buf.asCharString()); writeToFile("\n"); } + void JUnitTestOutput::writeFileEnding() { - writeToFile("\n"); + writeToFile(""); + writeToFile(encodeXmlText(impl_->stdOutput_)); + writeToFile("\n"); writeToFile("\n"); - writeToFile(""); + writeToFile("\n"); } void JUnitTestOutput::writeTestGroupToFile() @@ -245,14 +281,19 @@ { } -void JUnitTestOutput::print(const char*) +void JUnitTestOutput::print(const char *output) { + impl_->stdOutput_ += output; } void JUnitTestOutput::print(long) { } +void JUnitTestOutput::print(size_t) +{ +} + void JUnitTestOutput::flush() { } @@ -261,7 +302,7 @@ void JUnitTestOutput::printFailure(const TestFailure& failure) { - if (impl_->results_.tail_->failure_ == 0) { + if (impl_->results_.tail_->failure_ == NULLPTR) { impl_->results_.failureCount_++; impl_->results_.tail_->failure_ = new TestFailure(failure); } diff -Nru cpputest-3.8/src/CppUTest/MemoryLeakDetector.cpp cpputest-4.0/src/CppUTest/MemoryLeakDetector.cpp --- cpputest-3.8/src/CppUTest/MemoryLeakDetector.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/MemoryLeakDetector.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,7 +30,9 @@ #include "CppUTest/PlatformSpecificFunctions.h" #include "CppUTest/SimpleMutex.h" -#define UNKNOWN ((char*)("")) +static const char* UNKNOWN = ""; + +static const char GuardBytes[] = {'B','A','S'}; SimpleStringBuffer::SimpleStringBuffer() : positions_filled_(0), write_limit_(SIMPLE_STRING_BUFFER_LEN-1) @@ -46,13 +48,12 @@ void SimpleStringBuffer::add(const char* format, ...) { - int count = 0; - size_t positions_left = write_limit_ - positions_filled_; - if (positions_left <= 0) return; + const size_t positions_left = write_limit_ - positions_filled_; + if (positions_left == 0) return; va_list arguments; va_start(arguments, format); - count = PlatformSpecificVSNprintf(buffer_ + positions_filled_, positions_left+1, format, arguments); + const int count = PlatformSpecificVSNprintf(buffer_ + positions_filled_, positions_left+1, format, arguments); if (count > 0) positions_filled_ += (size_t) count; if (positions_filled_ > write_limit_) positions_filled_ = write_limit_; va_end(arguments); @@ -63,7 +64,7 @@ const unsigned char* byteMemory = (const unsigned char*)memory; const size_t maxLineBytes = 16; size_t currentPos = 0; - size_t p; + size_t p; while (currentPos < memorySize) { add(" %04lx: ", (unsigned long) currentPos); @@ -134,14 +135,14 @@ { } -void MemoryLeakOutputStringBuffer::addAllocationLocation(const char* allocationFile, int allocationLineNumber, size_t allocationSize, TestMemoryAllocator* allocator) +void MemoryLeakOutputStringBuffer::addAllocationLocation(const char* allocationFile, size_t allocationLineNumber, size_t allocationSize, TestMemoryAllocator* allocator) { - outputBuffer_.add(" allocated at file: %s line: %d size: %lu type: %s\n", allocationFile, allocationLineNumber, (unsigned long) allocationSize, allocator->alloc_name()); + outputBuffer_.add(" allocated at file: %s line: %d size: %lu type: %s\n", allocationFile, (int) allocationLineNumber, (unsigned long) allocationSize, allocator->alloc_name()); } -void MemoryLeakOutputStringBuffer::addDeallocationLocation(const char* freeFile, int freeLineNumber, TestMemoryAllocator* allocator) +void MemoryLeakOutputStringBuffer::addDeallocationLocation(const char* freeFile, size_t freeLineNumber, TestMemoryAllocator* allocator) { - outputBuffer_.add(" deallocated at file: %s line: %d type: %s\n", freeFile, freeLineNumber, allocator->free_name()); + outputBuffer_.add(" deallocated at file: %s line: %d type: %s\n", freeFile, (int) freeLineNumber, allocator->free_name()); } void MemoryLeakOutputStringBuffer::addNoMemoryLeaksMessage() @@ -168,7 +169,7 @@ total_leaks_++; outputBuffer_.add("Alloc num (%u) Leak size: %lu Allocated at: %s and line: %d. Type: \"%s\"\n\tMemory: <%p> Content:\n", - leak->number_, (unsigned long) leak->size_, leak->file_, leak->line_, leak->allocator_->alloc_name(), (void*) leak->memory_); + leak->number_, (unsigned long) leak->size_, leak->file_, (int) leak->line_, leak->allocator_->alloc_name(), (void*) leak->memory_); outputBuffer_.addMemoryDump(leak->memory_, leak->size_); if (SimpleString::StrCmp(leak->allocator_->alloc_name(), (const char*) "malloc") == 0) @@ -205,9 +206,9 @@ outputBuffer_.add(MEM_LEAK_TOO_MUCH); } -void MemoryLeakOutputStringBuffer::addMemoryLeakFooter(int amountOfLeaks) +void MemoryLeakOutputStringBuffer::addMemoryLeakFooter(size_t amountOfLeaks) { - outputBuffer_.add("%s %d\n", MEM_LEAK_FOOTER, amountOfLeaks); + outputBuffer_.add("%s %d\n", MEM_LEAK_FOOTER, (int) amountOfLeaks); } void MemoryLeakOutputStringBuffer::addWarningForUsingMalloc() @@ -215,22 +216,22 @@ outputBuffer_.add(MEM_LEAK_ADDITION_MALLOC_WARNING); } -void MemoryLeakOutputStringBuffer::reportDeallocateNonAllocatedMemoryFailure(const char* freeFile, int freeLine, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter) +void MemoryLeakOutputStringBuffer::reportDeallocateNonAllocatedMemoryFailure(const char* freeFile, size_t freeLine, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter) { reportFailure("Deallocating non-allocated memory\n", "", 0, 0, NullUnknownAllocator::defaultAllocator(), freeFile, freeLine, freeAllocator, reporter); } -void MemoryLeakOutputStringBuffer::reportAllocationDeallocationMismatchFailure(MemoryLeakDetectorNode* node, const char* freeFile, int freeLineNumber, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter) +void MemoryLeakOutputStringBuffer::reportAllocationDeallocationMismatchFailure(MemoryLeakDetectorNode* node, const char* freeFile, size_t freeLineNumber, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter) { reportFailure("Allocation/deallocation type mismatch\n", node->file_, node->line_, node->size_, node->allocator_, freeFile, freeLineNumber, freeAllocator, reporter); } -void MemoryLeakOutputStringBuffer::reportMemoryCorruptionFailure(MemoryLeakDetectorNode* node, const char* freeFile, int freeLineNumber, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter) +void MemoryLeakOutputStringBuffer::reportMemoryCorruptionFailure(MemoryLeakDetectorNode* node, const char* freeFile, size_t freeLineNumber, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter) { reportFailure("Memory corruption (written out of bounds?)\n", node->file_, node->line_, node->size_, node->allocator_, freeFile, freeLineNumber, freeAllocator, reporter); } -void MemoryLeakOutputStringBuffer::reportFailure(const char* message, const char* allocFile, int allocLine, size_t allocSize, TestMemoryAllocator* allocAllocator, const char* freeFile, int freeLine, +void MemoryLeakOutputStringBuffer::reportFailure(const char* message, const char* allocFile, size_t allocLine, size_t allocSize, TestMemoryAllocator* allocAllocator, const char* freeFile, size_t freeLine, TestMemoryAllocator* freeAllocator, MemoryLeakFailure* reporter) { outputBuffer_.add("%s", message); @@ -252,13 +253,14 @@ //////////////////////// -void MemoryLeakDetectorNode::init(char* memory, unsigned number, size_t size, TestMemoryAllocator* allocator, MemLeakPeriod period, const char* file, int line) +void MemoryLeakDetectorNode::init(char* memory, unsigned number, size_t size, TestMemoryAllocator* allocator, MemLeakPeriod period, unsigned char allocation_stage, const char* file, size_t line) { number_ = number; memory_ = memory; size_ = size; allocator_ = allocator; period_ = period; + allocation_stage_ = allocation_stage; file_ = file; line_ = line; } @@ -270,10 +272,15 @@ return period == mem_leak_period_all || node->period_ == period || (node->period_ != mem_leak_period_disabled && period == mem_leak_period_enabled); } +bool MemoryLeakDetectorList::isInAllocationStage(MemoryLeakDetectorNode* node, unsigned char allocation_stage) +{ + return node->allocation_stage_ == allocation_stage; +} + void MemoryLeakDetectorList::clearAllAccounting(MemLeakPeriod period) { MemoryLeakDetectorNode* cur = head_; - MemoryLeakDetectorNode* prev = 0; + MemoryLeakDetectorNode* prev = NULLPTR; while (cur) { if (isInPeriod(cur, period)) { @@ -301,7 +308,7 @@ MemoryLeakDetectorNode* MemoryLeakDetectorList::removeNode(char* memory) { MemoryLeakDetectorNode* cur = head_; - MemoryLeakDetectorNode* prev = 0; + MemoryLeakDetectorNode* prev = NULLPTR; while (cur) { if (cur->memory_ == memory) { if (prev) { @@ -316,7 +323,7 @@ prev = cur; cur = cur->next_; } - return 0; + return NULLPTR; } MemoryLeakDetectorNode* MemoryLeakDetectorList::retrieveNode(char* memory) @@ -327,14 +334,21 @@ return cur; cur = cur->next_; } - return NULL; + return NULLPTR; } MemoryLeakDetectorNode* MemoryLeakDetectorList::getLeakFrom(MemoryLeakDetectorNode* node, MemLeakPeriod period) { for (MemoryLeakDetectorNode* cur = node; cur; cur = cur->next_) if (isInPeriod(cur, period)) return cur; - return 0; + return NULLPTR; +} + +MemoryLeakDetectorNode* MemoryLeakDetectorList::getLeakForAllocationStageFrom(MemoryLeakDetectorNode* node, unsigned char allocation_stage) +{ + for (MemoryLeakDetectorNode* cur = node; cur; cur = cur->next_) + if (isInAllocationStage(cur, allocation_stage)) return cur; + return NULLPTR; } MemoryLeakDetectorNode* MemoryLeakDetectorList::getFirstLeak(MemLeakPeriod period) @@ -342,14 +356,26 @@ return getLeakFrom(head_, period); } +MemoryLeakDetectorNode* MemoryLeakDetectorList::getFirstLeakForAllocationStage(unsigned char allocation_stage) +{ + return getLeakForAllocationStageFrom(head_, allocation_stage); +} + MemoryLeakDetectorNode* MemoryLeakDetectorList::getNextLeak(MemoryLeakDetectorNode* node, MemLeakPeriod period) { return getLeakFrom(node->next_, period); } -int MemoryLeakDetectorList::getTotalLeaks(MemLeakPeriod period) +MemoryLeakDetectorNode* MemoryLeakDetectorList::getNextLeakForAllocationStage(MemoryLeakDetectorNode* node, unsigned char allocation_stage) { - int total_leaks = 0; + return getLeakForAllocationStageFrom(node->next_, allocation_stage); +} + + + +size_t MemoryLeakDetectorList::getTotalLeaks(MemLeakPeriod period) +{ + size_t total_leaks = 0; for (MemoryLeakDetectorNode* node = head_; node; node = node->next_) { if (isInPeriod(node, period)) total_leaks++; } @@ -384,9 +410,9 @@ return table_[hash(memory)].retrieveNode(memory); } -int MemoryLeakDetectorTable::getTotalLeaks(MemLeakPeriod period) +size_t MemoryLeakDetectorTable::getTotalLeaks(MemLeakPeriod period) { - int total_leaks = 0; + size_t total_leaks = 0; for (int i = 0; i < hash_prime; i++) total_leaks += table_[i].getTotalLeaks(period); return total_leaks; @@ -398,7 +424,16 @@ MemoryLeakDetectorNode* node = table_[i].getFirstLeak(period); if (node) return node; } - return 0; + return NULLPTR; +} + +MemoryLeakDetectorNode* MemoryLeakDetectorTable::getFirstLeakForAllocationStage(unsigned char allocation_stage) +{ + for (int i = 0; i < hash_prime; i++) { + MemoryLeakDetectorNode* node = table_[i].getFirstLeakForAllocationStage(allocation_stage); + if (node) return node; + } + return NULLPTR; } MemoryLeakDetectorNode* MemoryLeakDetectorTable::getNextLeak(MemoryLeakDetectorNode* leak, MemLeakPeriod period) @@ -411,7 +446,20 @@ node = table_[i].getFirstLeak(period); if (node) return node; } - return 0; + return NULLPTR; +} + +MemoryLeakDetectorNode* MemoryLeakDetectorTable::getNextLeakForAllocationStage(MemoryLeakDetectorNode* leak, unsigned char allocation_stage) +{ + unsigned long i = hash(leak->memory_); + MemoryLeakDetectorNode* node = table_[i].getNextLeakForAllocationStage(leak, allocation_stage); + if (node) return node; + + for (++i; i < hash_prime; i++) { + node = table_[i].getFirstLeakForAllocationStage(allocation_stage); + if (node) return node; + } + return NULLPTR; } ///////////////////////////////////////////////////////////// @@ -421,6 +469,7 @@ doAllocationTypeChecking_ = true; allocationSequenceNumber_ = 1; current_period_ = mem_leak_period_disabled; + current_allocation_stage_ = 0; reporter_ = reporter; mutex_ = new SimpleMutex; } @@ -449,6 +498,11 @@ current_period_ = mem_leak_period_enabled; } +unsigned char MemoryLeakDetector::getCurrentAllocationStage() const +{ + return current_allocation_stage_; +} + void MemoryLeakDetector::enable() { current_period_ = mem_leak_period_enabled; @@ -474,6 +528,16 @@ return allocationSequenceNumber_; } +void MemoryLeakDetector::increaseAllocationStage() +{ + current_allocation_stage_++; +} + +void MemoryLeakDetector::decreaseAllocationStage() +{ + current_allocation_stage_--; +} + SimpleMutex *MemoryLeakDetector::getMutex() { return mutex_; @@ -481,7 +545,11 @@ static size_t calculateVoidPointerAlignedSize(size_t size) { +#ifndef CPPUTEST_DISABLE_MEM_CORRUPTION_CHECK return (sizeof(void*) - (size % sizeof(void*))) + size; +#else + return size; +#endif } size_t MemoryLeakDetector::sizeOfMemoryWithCorruptionInfo(size_t size) @@ -494,17 +562,17 @@ return (MemoryLeakDetectorNode*) (void*) (memory + sizeOfMemoryWithCorruptionInfo(memory_size)); } -void MemoryLeakDetector::storeLeakInformation(MemoryLeakDetectorNode * node, char *new_memory, size_t size, TestMemoryAllocator *allocator, const char *file, int line) +void MemoryLeakDetector::storeLeakInformation(MemoryLeakDetectorNode * node, char *new_memory, size_t size, TestMemoryAllocator *allocator, const char *file, size_t line) { - node->init(new_memory, allocationSequenceNumber_++, size, allocator, current_period_, file, line); + node->init(new_memory, allocationSequenceNumber_++, size, allocator, current_period_, current_allocation_stage_, file, line); addMemoryCorruptionInformation(node->memory_ + node->size_); memoryTable_.addNewNode(node); } -char* MemoryLeakDetector::reallocateMemoryAndLeakInformation(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, int line, bool allocatNodesSeperately) +char* MemoryLeakDetector::reallocateMemoryAndLeakInformation(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, size_t line, bool allocatNodesSeperately) { char* new_memory = reallocateMemoryWithAccountingInformation(allocator, memory, size, file, line, allocatNodesSeperately); - if (new_memory == NULL) return NULL; + if (new_memory == NULLPTR) return NULLPTR; MemoryLeakDetectorNode *node = createMemoryLeakAccountingInformation(allocator, size, new_memory, allocatNodesSeperately); storeLeakInformation(node, new_memory, size, allocator, file, line); @@ -513,21 +581,25 @@ void MemoryLeakDetector::invalidateMemory(char* memory) { +#ifndef CPPUTEST_DISABLE_HEAP_POISON MemoryLeakDetectorNode* node = memoryTable_.retrieveNode(memory); if (node) PlatformSpecificMemset(memory, 0xCD, node->size_); +#endif } void MemoryLeakDetector::addMemoryCorruptionInformation(char* memory) { - memory[0] = 'B'; - memory[1] = 'A'; - memory[2] = 'S'; + for (size_t i=0; iisOfEqualType(alloc_allocator); } -void MemoryLeakDetector::checkForCorruption(MemoryLeakDetectorNode* node, const char* file, int line, TestMemoryAllocator* allocator, bool allocateNodesSeperately) +void MemoryLeakDetector::checkForCorruption(MemoryLeakDetectorNode* node, const char* file, size_t line, TestMemoryAllocator* allocator, bool allocateNodesSeperately) { - if (!matchingAllocation(node->allocator_, allocator)) - outputBuffer_.reportAllocationDeallocationMismatchFailure(node, file, line, allocator, reporter_); + if (!matchingAllocation(node->allocator_->actualAllocator(), allocator->actualAllocator())) + outputBuffer_.reportAllocationDeallocationMismatchFailure(node, file, line, allocator->actualAllocator(), reporter_); else if (!validMemoryCorruptionInformation(node->memory_ + node->size_)) - outputBuffer_.reportMemoryCorruptionFailure(node, file, line, allocator, reporter_); + outputBuffer_.reportMemoryCorruptionFailure(node, file, line, allocator->actualAllocator(), reporter_); else if (allocateNodesSeperately) allocator->freeMemoryLeakNode((char*) node); } @@ -552,13 +624,13 @@ return allocMemory(allocator, size, UNKNOWN, 0, allocatNodesSeperately); } -char* MemoryLeakDetector::allocateMemoryWithAccountingInformation(TestMemoryAllocator* allocator, size_t size, const char* file, int line, bool allocatNodesSeperately) +char* MemoryLeakDetector::allocateMemoryWithAccountingInformation(TestMemoryAllocator* allocator, size_t size, const char* file, size_t line, bool allocatNodesSeperately) { if (allocatNodesSeperately) return allocator->alloc_memory(sizeOfMemoryWithCorruptionInfo(size), file, line); else return allocator->alloc_memory(sizeOfMemoryWithCorruptionInfo(size) + sizeof(MemoryLeakDetectorNode), file, line); } -char* MemoryLeakDetector::reallocateMemoryWithAccountingInformation(TestMemoryAllocator* /*allocator*/, char* memory, size_t size, const char* /*file*/, int /*line*/, bool allocatNodesSeperately) +char* MemoryLeakDetector::reallocateMemoryWithAccountingInformation(TestMemoryAllocator* /*allocator*/, char* memory, size_t size, const char* /*file*/, size_t /*line*/, bool allocatNodesSeperately) { if (allocatNodesSeperately) return (char*) PlatformSpecificRealloc(memory, sizeOfMemoryWithCorruptionInfo(size)); else return (char*) PlatformSpecificRealloc(memory, sizeOfMemoryWithCorruptionInfo(size) + sizeof(MemoryLeakDetectorNode)); @@ -570,8 +642,11 @@ else return getNodeFromMemoryPointer(memory, size); } -char* MemoryLeakDetector::allocMemory(TestMemoryAllocator* allocator, size_t size, const char* file, int line, bool allocatNodesSeperately) +char* MemoryLeakDetector::allocMemory(TestMemoryAllocator* allocator, size_t size, const char* file, size_t line, bool allocatNodesSeperately) { +#ifdef CPPUTEST_DISABLE_MEM_CORRUPTION_CHECK + allocatNodesSeperately = true; +#endif /* With malloc, it is harder to guarantee that the allocator free is called. * This is because operator new is overloaded via linker symbols, but malloc just via #defines. * If the same allocation is used and the wrong free is called, it will deallocate the memory leak information @@ -580,7 +655,7 @@ */ char* memory = allocateMemoryWithAccountingInformation(allocator, size, file, line, allocatNodesSeperately); - if (memory == NULL) return NULL; + if (memory == NULLPTR) return NULLPTR; MemoryLeakDetectorNode* node = createMemoryLeakAccountingInformation(allocator, size, memory, allocatNodesSeperately); storeLeakInformation(node, memory, size, allocator, file, line); @@ -593,18 +668,22 @@ if (allocatNodesSeperately) allocator->freeMemoryLeakNode( (char*) node); } -void MemoryLeakDetector::deallocMemory(TestMemoryAllocator* allocator, void* memory, const char* file, int line, bool allocatNodesSeperately) +void MemoryLeakDetector::deallocMemory(TestMemoryAllocator* allocator, void* memory, const char* file, size_t line, bool allocatNodesSeperately) { - if (memory == 0) return; + if (memory == NULLPTR) return; MemoryLeakDetectorNode* node = memoryTable_.removeNode((char*) memory); - if (node == NULL) { + if (node == NULLPTR) { outputBuffer_.reportDeallocateNonAllocatedMemoryFailure(file, line, allocator, reporter_); return; } +#ifdef CPPUTEST_DISABLE_MEM_CORRUPTION_CHECK + allocatNodesSeperately = true; +#endif if (!allocator->hasBeenDestroyed()) { + size_t size = node->size_; checkForCorruption(node, file, line, allocator, allocatNodesSeperately); - allocator->free_memory((char*) memory, file, line); + allocator->free_memory((char*) memory, size, file, line); } } @@ -613,13 +692,28 @@ deallocMemory(allocator, (char*) memory, UNKNOWN, 0, allocatNodesSeperately); } -char* MemoryLeakDetector::reallocMemory(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, int line, bool allocatNodesSeperately) +void MemoryLeakDetector::deallocAllMemoryInCurrentAllocationStage() +{ + char* memory = NULLPTR; + MemoryLeakDetectorNode* node = memoryTable_.getFirstLeakForAllocationStage(current_allocation_stage_); + while (node) { + memory = node->memory_; + TestMemoryAllocator* allocator = node->allocator_; + node = memoryTable_.getNextLeakForAllocationStage(node, current_allocation_stage_); + deallocMemory(allocator, memory, __FILE__, __LINE__); + } +} + +char* MemoryLeakDetector::reallocMemory(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, size_t line, bool allocatNodesSeperately) { +#ifdef CPPUTEST_DISABLE_MEM_CORRUPTION_CHECK + allocatNodesSeperately = true; +#endif if (memory) { MemoryLeakDetectorNode* node = memoryTable_.removeNode(memory); - if (node == NULL) { + if (node == NULLPTR) { outputBuffer_.reportDeallocateNonAllocatedMemoryFailure(file, line, allocator, reporter_); - return NULL; + return NULLPTR; } checkForCorruption(node, file, line, allocator, allocatNodesSeperately); } @@ -656,7 +750,7 @@ } } -int MemoryLeakDetector::totalMemoryLeaks(MemLeakPeriod period) +size_t MemoryLeakDetector::totalMemoryLeaks(MemLeakPeriod period) { return memoryTable_.getTotalLeaks(period); } diff -Nru cpputest-3.8/src/CppUTest/MemoryLeakWarningPlugin.cpp cpputest-4.0/src/CppUTest/MemoryLeakWarningPlugin.cpp --- cpputest-3.8/src/CppUTest/MemoryLeakWarningPlugin.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTest/MemoryLeakWarningPlugin.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -44,80 +44,83 @@ ScopedMutexLock lock; }; -static void* threadsafe_mem_leak_malloc(size_t size, const char* file, int line) +static void* threadsafe_mem_leak_malloc(size_t size, const char* file, size_t line) { MemLeakScopedMutex lock; return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentMallocAllocator(), size, file, line, true); } -static void threadsafe_mem_leak_free(void* buffer, const char* file, int line) +static void threadsafe_mem_leak_free(void* buffer, const char* file, size_t line) { MemLeakScopedMutex lock; MemoryLeakWarningPlugin::getGlobalDetector()->invalidateMemory((char*) buffer); MemoryLeakWarningPlugin::getGlobalDetector()->deallocMemory(getCurrentMallocAllocator(), (char*) buffer, file, line, true); } -static void* threadsafe_mem_leak_realloc(void* memory, size_t size, const char* file, int line) +static void* threadsafe_mem_leak_realloc(void* memory, size_t size, const char* file, size_t line) { MemLeakScopedMutex lock; return MemoryLeakWarningPlugin::getGlobalDetector()->reallocMemory(getCurrentMallocAllocator(), (char*) memory, size, file, line, true); } -static void* mem_leak_malloc(size_t size, const char* file, int line) +static void* mem_leak_malloc(size_t size, const char* file, size_t line) { return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentMallocAllocator(), size, file, line, true); } -static void mem_leak_free(void* buffer, const char* file, int line) +static void mem_leak_free(void* buffer, const char* file, size_t line) { MemoryLeakWarningPlugin::getGlobalDetector()->invalidateMemory((char*) buffer); MemoryLeakWarningPlugin::getGlobalDetector()->deallocMemory(getCurrentMallocAllocator(), (char*) buffer, file, line, true); } -static void* mem_leak_realloc(void* memory, size_t size, const char* file, int line) +static void* mem_leak_realloc(void* memory, size_t size, const char* file, size_t line) { return MemoryLeakWarningPlugin::getGlobalDetector()->reallocMemory(getCurrentMallocAllocator(), (char*) memory, size, file, line, true); } #endif -static void* normal_malloc(size_t size, const char*, int) +static void* normal_malloc(size_t size, const char*, size_t) { return PlatformSpecificMalloc(size); } -static void* normal_realloc(void* memory, size_t size, const char*, int) +static void* normal_realloc(void* memory, size_t size, const char*, size_t) { return PlatformSpecificRealloc(memory, size); } -static void normal_free(void* buffer, const char*, int) +static void normal_free(void* buffer, const char*, size_t) { PlatformSpecificFree(buffer); } #if CPPUTEST_USE_MEM_LEAK_DETECTION -static void *(*malloc_fptr)(size_t size, const char* file, int line) = mem_leak_malloc; -static void (*free_fptr)(void* mem, const char* file, int line) = mem_leak_free; -static void*(*realloc_fptr)(void* memory, size_t size, const char* file, int line) = mem_leak_realloc; +static void *(*malloc_fptr)(size_t size, const char* file, size_t line) = mem_leak_malloc; +static void (*free_fptr)(void* mem, const char* file, size_t line) = mem_leak_free; +static void*(*realloc_fptr)(void* memory, size_t size, const char* file, size_t line) = mem_leak_realloc; +static void *(*saved_malloc_fptr)(size_t size, const char* file, size_t line) = mem_leak_malloc; +static void (*saved_free_fptr)(void* mem, const char* file, size_t line) = mem_leak_free; +static void*(*saved_realloc_fptr)(void* memory, size_t size, const char* file, size_t line) = mem_leak_realloc; #else -static void *(*malloc_fptr)(size_t size, const char* file, int line) = normal_malloc; -static void (*free_fptr)(void* mem, const char* file, int line) = normal_free; -static void*(*realloc_fptr)(void* memory, size_t size, const char* file, int line) = normal_realloc; +static void *(*malloc_fptr)(size_t size, const char* file, size_t line) = normal_malloc; +static void (*free_fptr)(void* mem, const char* file, size_t line) = normal_free; +static void*(*realloc_fptr)(void* memory, size_t size, const char* file, size_t line) = normal_realloc; #endif -void* cpputest_malloc_location_with_leak_detection(size_t size, const char* file, int line) +void* cpputest_malloc_location_with_leak_detection(size_t size, const char* file, size_t line) { return malloc_fptr(size, file, line); } -void* cpputest_realloc_location_with_leak_detection(void* memory, size_t size, const char* file, int line) +void* cpputest_realloc_location_with_leak_detection(void* memory, size_t size, const char* file, size_t line) { return realloc_fptr(memory, size, file, line); } -void cpputest_free_location_with_leak_detection(void* buffer, const char* file, int line) +void cpputest_free_location_with_leak_detection(void* buffer, const char* file, size_t line) { free_fptr(buffer, file, line); } @@ -128,7 +131,7 @@ #undef new #if CPPUTEST_USE_STD_CPP_LIB -#define UT_THROW_BAD_ALLOC_WHEN_NULL(memory) if (memory == NULL) throw std::bad_alloc(); +#define UT_THROW_BAD_ALLOC_WHEN_NULL(memory) if (memory == NULLPTR) throw std::bad_alloc() #else #define UT_THROW_BAD_ALLOC_WHEN_NULL(memory) #endif @@ -147,10 +150,10 @@ return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewAllocator(), size); } -static void* threadsafe_mem_leak_operator_new_debug (size_t size, const char* file, int line) UT_THROW(std::bad_alloc) +static void* threadsafe_mem_leak_operator_new_debug (size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) { MemLeakScopedMutex lock; - void *memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewAllocator(), size, (char*) file, line); + void *memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewAllocator(), size, file, line); UT_THROW_BAD_ALLOC_WHEN_NULL(memory); return memory; } @@ -169,10 +172,10 @@ return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewArrayAllocator(), size); } -static void* threadsafe_mem_leak_operator_new_array_debug (size_t size, const char* file, int line) UT_THROW(std::bad_alloc) +static void* threadsafe_mem_leak_operator_new_array_debug (size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) { MemLeakScopedMutex lock; - void* memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewArrayAllocator(), size, (char*) file, line); + void* memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewArrayAllocator(), size, file, line); UT_THROW_BAD_ALLOC_WHEN_NULL(memory); return memory; } @@ -204,9 +207,9 @@ return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewAllocator(), size); } -static void* mem_leak_operator_new_debug (size_t size, const char* file, int line) UT_THROW(std::bad_alloc) +static void* mem_leak_operator_new_debug (size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) { - void *memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewAllocator(), size, (char*) file, line); + void *memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewAllocator(), size, file, line); UT_THROW_BAD_ALLOC_WHEN_NULL(memory); return memory; } @@ -223,9 +226,9 @@ return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewArrayAllocator(), size); } -static void* mem_leak_operator_new_array_debug (size_t size, const char* file, int line) UT_THROW(std::bad_alloc) +static void* mem_leak_operator_new_array_debug (size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) { - void* memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewArrayAllocator(), size, (char*) file, line); + void* memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewArrayAllocator(), size, file, line); UT_THROW_BAD_ALLOC_WHEN_NULL(memory); return memory; } @@ -254,7 +257,7 @@ return PlatformSpecificMalloc(size); } -static void* normal_operator_new_debug (size_t size, const char* /*file*/, int /*line*/) UT_THROW(std::bad_alloc) +static void* normal_operator_new_debug (size_t size, const char* /*file*/, size_t /*line*/) UT_THROW(std::bad_alloc) { void* memory = PlatformSpecificMalloc(size); UT_THROW_BAD_ALLOC_WHEN_NULL(memory); @@ -273,7 +276,7 @@ return PlatformSpecificMalloc(size); } -static void* normal_operator_new_array_debug (size_t size, const char* /*file*/, int /*line*/) UT_THROW(std::bad_alloc) +static void* normal_operator_new_array_debug (size_t size, const char* /*file*/, size_t /*line*/) UT_THROW(std::bad_alloc) { void* memory = PlatformSpecificMalloc(size); UT_THROW_BAD_ALLOC_WHEN_NULL(memory); @@ -292,19 +295,29 @@ static void *(*operator_new_fptr)(size_t size) UT_THROW(std::bad_alloc) = mem_leak_operator_new; static void *(*operator_new_nothrow_fptr)(size_t size) UT_NOTHROW = mem_leak_operator_new_nothrow; -static void *(*operator_new_debug_fptr)(size_t size, const char* file, int line) UT_THROW(std::bad_alloc) = mem_leak_operator_new_debug; +static void *(*operator_new_debug_fptr)(size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) = mem_leak_operator_new_debug; static void *(*operator_new_array_fptr)(size_t size) UT_THROW(std::bad_alloc) = mem_leak_operator_new_array; static void *(*operator_new_array_nothrow_fptr)(size_t size) UT_NOTHROW = mem_leak_operator_new_array_nothrow; -static void *(*operator_new_array_debug_fptr)(size_t size, const char* file, int line) UT_THROW(std::bad_alloc) = mem_leak_operator_new_array_debug; +static void *(*operator_new_array_debug_fptr)(size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) = mem_leak_operator_new_array_debug; static void (*operator_delete_fptr)(void* mem) UT_NOTHROW = mem_leak_operator_delete; static void (*operator_delete_array_fptr)(void* mem) UT_NOTHROW = mem_leak_operator_delete_array; +static void *(*saved_operator_new_fptr)(size_t size) UT_THROW(std::bad_alloc) = mem_leak_operator_new; +static void *(*saved_operator_new_nothrow_fptr)(size_t size) UT_NOTHROW = mem_leak_operator_new_nothrow; +static void *(*saved_operator_new_debug_fptr)(size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) = mem_leak_operator_new_debug; +static void *(*saved_operator_new_array_fptr)(size_t size) UT_THROW(std::bad_alloc) = mem_leak_operator_new_array; +static void *(*saved_operator_new_array_nothrow_fptr)(size_t size) UT_NOTHROW = mem_leak_operator_new_array_nothrow; +static void *(*saved_operator_new_array_debug_fptr)(size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) = mem_leak_operator_new_array_debug; +static void (*saved_operator_delete_fptr)(void* mem) UT_NOTHROW = mem_leak_operator_delete; +static void (*saved_operator_delete_array_fptr)(void* mem) UT_NOTHROW = mem_leak_operator_delete_array; +static int save_counter = 0; + void* operator new(size_t size) UT_THROW(std::bad_alloc) { return operator_new_fptr(size); } -void* operator new(size_t size, const char* file, int line) UT_THROW(std::bad_alloc) +void* operator new(size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) { return operator_new_debug_fptr(size, file, line); } @@ -314,22 +327,24 @@ operator_delete_fptr(mem); } -void operator delete(void* mem, const char*, int) UT_NOTHROW +void operator delete(void* mem, const char*, size_t) UT_NOTHROW { operator_delete_fptr(mem); } +#if __cplusplus >= 201402L void operator delete (void* mem, size_t) UT_NOTHROW { operator_delete_fptr(mem); } +#endif void* operator new[](size_t size) UT_THROW(std::bad_alloc) { return operator_new_array_fptr(size); } -void* operator new [](size_t size, const char* file, int line) UT_THROW(std::bad_alloc) +void* operator new [](size_t size, const char* file, size_t line) UT_THROW(std::bad_alloc) { return operator_new_array_debug_fptr(size, file, line); } @@ -339,15 +354,17 @@ operator_delete_array_fptr(mem); } -void operator delete[](void* mem, const char*, int) UT_NOTHROW +void operator delete[](void* mem, const char*, size_t) UT_NOTHROW { operator_delete_array_fptr(mem); } +#if __cplusplus >= 201402L void operator delete[] (void* mem, size_t) UT_NOTHROW { operator_delete_array_fptr(mem); } +#endif #if CPPUTEST_USE_STD_CPP_LIB @@ -356,11 +373,21 @@ return operator_new_nothrow_fptr(size); } +void operator delete(void* mem, const std::nothrow_t&) UT_NOTHROW +{ + operator_delete_fptr(mem); +} + void* operator new[](size_t size, const std::nothrow_t&) UT_NOTHROW { return operator_new_array_nothrow_fptr(size); } +void operator delete[](void* mem, const std::nothrow_t&) UT_NOTHROW +{ + operator_delete_array_fptr(mem); +} + #else /* Have a similar method. This avoid unused operator_new_nothrow_fptr warning */ @@ -399,7 +426,7 @@ #endif } -void MemoryLeakWarningPlugin::turnOnNewDeleteOverloads() +void MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads() { #if CPPUTEST_USE_MEM_LEAK_DETECTION operator_new_fptr = mem_leak_operator_new; @@ -416,15 +443,6 @@ #endif } -bool MemoryLeakWarningPlugin::areNewDeleteOverloaded() -{ -#if CPPUTEST_USE_MEM_LEAK_DETECTION - return operator_new_fptr == mem_leak_operator_new; -#else - return false; -#endif -} - void MemoryLeakWarningPlugin::turnOnThreadSafeNewDeleteOverloads() { #if CPPUTEST_USE_MEM_LEAK_DETECTION @@ -442,6 +460,52 @@ #endif } +bool MemoryLeakWarningPlugin::areNewDeleteOverloaded() +{ +#if CPPUTEST_USE_MEM_LEAK_DETECTION + return operator_new_fptr == mem_leak_operator_new || operator_new_fptr == threadsafe_mem_leak_operator_new; +#else + return false; +#endif +} + +void MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads() +{ +#if CPPUTEST_USE_MEM_LEAK_DETECTION + if (++save_counter > 1) return; + saved_operator_new_fptr = operator_new_fptr; + saved_operator_new_nothrow_fptr = operator_new_nothrow_fptr; + saved_operator_new_debug_fptr = operator_new_debug_fptr; + saved_operator_new_array_fptr = operator_new_array_fptr; + saved_operator_new_array_nothrow_fptr = operator_new_array_nothrow_fptr; + saved_operator_new_array_debug_fptr = operator_new_array_debug_fptr; + saved_operator_delete_fptr = operator_delete_fptr; + saved_operator_delete_array_fptr = operator_delete_array_fptr; + saved_malloc_fptr = malloc_fptr; + saved_realloc_fptr = realloc_fptr; + saved_free_fptr = free_fptr; + turnOffNewDeleteOverloads(); +#endif +} + +void MemoryLeakWarningPlugin::restoreNewDeleteOverloads() +{ +#if CPPUTEST_USE_MEM_LEAK_DETECTION + if (--save_counter > 0) return; + operator_new_fptr = saved_operator_new_fptr; + operator_new_nothrow_fptr = saved_operator_new_nothrow_fptr; + operator_new_debug_fptr = saved_operator_new_debug_fptr; + operator_new_array_fptr = saved_operator_new_array_fptr; + operator_new_array_nothrow_fptr = saved_operator_new_array_nothrow_fptr; + operator_new_array_debug_fptr = saved_operator_new_array_debug_fptr; + operator_delete_fptr = saved_operator_delete_fptr; + operator_delete_array_fptr = saved_operator_delete_array_fptr; + malloc_fptr = saved_malloc_fptr; + realloc_fptr = saved_realloc_fptr; + free_fptr = saved_free_fptr; +#endif +} + void crash_on_allocation_number(unsigned alloc_number) { static CrashOnAllocationAllocator crashAllocator; @@ -454,30 +518,29 @@ class MemoryLeakWarningReporter: public MemoryLeakFailure { public: - virtual ~MemoryLeakWarningReporter() + virtual ~MemoryLeakWarningReporter() _destructor_override { } - virtual void fail(char* fail_string) + virtual void fail(char* fail_string) _override { UtestShell* currentTest = UtestShell::getCurrent(); currentTest->failWith(FailFailure(currentTest, currentTest->getName().asCharString(), currentTest->getLineNumber(), fail_string), TestTerminatorWithoutExceptions()); } // LCOV_EXCL_LINE }; -static MemoryLeakFailure* globalReporter = 0; -static MemoryLeakDetector* globalDetector = 0; +static MemoryLeakFailure* globalReporter = NULLPTR; +static MemoryLeakDetector* globalDetector = NULLPTR; MemoryLeakDetector* MemoryLeakWarningPlugin::getGlobalDetector() { - if (globalDetector == 0) { - bool newDeleteOverloaded = areNewDeleteOverloaded(); - turnOffNewDeleteOverloads(); + if (globalDetector == NULLPTR) { + saveAndDisableNewDeleteOverloads(); globalReporter = new MemoryLeakWarningReporter; globalDetector = new MemoryLeakDetector(globalReporter); - if (newDeleteOverloaded) turnOnNewDeleteOverloads(); + restoreNewDeleteOverloads(); } return globalDetector; } @@ -503,11 +566,11 @@ turnOffNewDeleteOverloads(); delete globalDetector; delete globalReporter; - globalDetector = NULL; + globalDetector = NULLPTR; } -MemoryLeakWarningPlugin* MemoryLeakWarningPlugin::firstPlugin_ = 0; +MemoryLeakWarningPlugin* MemoryLeakWarningPlugin::firstPlugin_ = NULLPTR; MemoryLeakWarningPlugin* MemoryLeakWarningPlugin::getFirstPlugin() { @@ -524,7 +587,7 @@ ignoreAllWarnings_ = true; } -void MemoryLeakWarningPlugin::expectLeaksInTest(int n) +void MemoryLeakWarningPlugin::expectLeaksInTest(size_t n) { expectedLeaks_ = n; } @@ -532,7 +595,7 @@ MemoryLeakWarningPlugin::MemoryLeakWarningPlugin(const SimpleString& name, MemoryLeakDetector* localDetector) : TestPlugin(name), ignoreAllWarnings_(false), destroyGlobalDetectorAndTurnOfMemoryLeakDetectionInDestructor_(false), expectedLeaks_(0) { - if (firstPlugin_ == 0) firstPlugin_ = this; + if (firstPlugin_ == NULLPTR) firstPlugin_ = this; if (localDetector) memLeakDetector_ = localDetector; else memLeakDetector_ = getGlobalDetector(); @@ -557,20 +620,24 @@ void MemoryLeakWarningPlugin::postTestAction(UtestShell& test, TestResult& result) { memLeakDetector_->stopChecking(); - int leaks = memLeakDetector_->totalMemoryLeaks(mem_leak_period_checking); + size_t leaks = memLeakDetector_->totalMemoryLeaks(mem_leak_period_checking); if (!ignoreAllWarnings_ && expectedLeaks_ != leaks && failureCount_ == result.getFailureCount()) { - TestFailure f(&test, memLeakDetector_->report(mem_leak_period_checking)); - result.addFailure(f); + if(MemoryLeakWarningPlugin::areNewDeleteOverloaded()) { + TestFailure f(&test, memLeakDetector_->report(mem_leak_period_checking)); + result.addFailure(f); + } else if(expectedLeaks_ > 0) { + result.print(StringFromFormat("Warning: Expected %d leak(s), but leak detection was disabled", (int) expectedLeaks_).asCharString()); + } } memLeakDetector_->markCheckingPeriodLeaksAsNonCheckingPeriod(); ignoreAllWarnings_ = false; expectedLeaks_ = 0; } -const char* MemoryLeakWarningPlugin::FinalReport(int toBeDeletedLeaks) +const char* MemoryLeakWarningPlugin::FinalReport(size_t toBeDeletedLeaks) { - int leaks = memLeakDetector_->totalMemoryLeaks(mem_leak_period_enabled); + size_t leaks = memLeakDetector_->totalMemoryLeaks(mem_leak_period_enabled); if (leaks != toBeDeletedLeaks) return memLeakDetector_->report(mem_leak_period_enabled); return ""; } diff -Nru cpputest-3.8/src/CppUTest/SimpleString.cpp cpputest-4.0/src/CppUTest/SimpleString.cpp --- cpputest-3.8/src/CppUTest/SimpleString.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTest/SimpleString.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,11 +30,83 @@ #include "CppUTest/PlatformSpecificFunctions.h" #include "CppUTest/TestMemoryAllocator.h" -TestMemoryAllocator* SimpleString::stringAllocator_ = NULL; +GlobalSimpleStringAllocatorStash::GlobalSimpleStringAllocatorStash() + : originalAllocator_(NULLPTR) +{ +} + +void GlobalSimpleStringAllocatorStash::save() +{ + originalAllocator_ = SimpleString::getStringAllocator(); +} + +void GlobalSimpleStringAllocatorStash::restore() +{ + SimpleString::setStringAllocator(originalAllocator_); +} + + +GlobalSimpleStringMemoryAccountant::GlobalSimpleStringMemoryAccountant() + : allocator_(NULLPTR) +{ + accountant_ = new MemoryAccountant(); +} + +GlobalSimpleStringMemoryAccountant::~GlobalSimpleStringMemoryAccountant() +{ + restoreAllocator(); + + delete accountant_; + delete allocator_; +} + +void GlobalSimpleStringMemoryAccountant::restoreAllocator() +{ + if (SimpleString::getStringAllocator() == allocator_) + SimpleString::setStringAllocator(allocator_->originalAllocator()); +} + +void GlobalSimpleStringMemoryAccountant::useCacheSizes(size_t cacheSizes[], size_t length) +{ + accountant_->useCacheSizes(cacheSizes, length); +} + +void GlobalSimpleStringMemoryAccountant::start() +{ + if (allocator_ != NULLPTR) + return; + + allocator_ = new AccountingTestMemoryAllocator(*accountant_, SimpleString::getStringAllocator()); + + SimpleString::setStringAllocator(allocator_); +} + +void GlobalSimpleStringMemoryAccountant::stop() +{ + if (allocator_ == NULLPTR) + FAIL("Global SimpleString allocator stopped without starting"); + + if (SimpleString::getStringAllocator() != allocator_) + FAIL("GlobalStrimpleStringMemoryAccountant: allocator has changed between start and stop!"); + + restoreAllocator(); +} + +SimpleString GlobalSimpleStringMemoryAccountant::report() +{ + return accountant_->report(); +} + +AccountingTestMemoryAllocator* GlobalSimpleStringMemoryAccountant::getAllocator() +{ + return allocator_; +} + +TestMemoryAllocator* SimpleString::stringAllocator_ = NULLPTR; TestMemoryAllocator* SimpleString::getStringAllocator() { - if (stringAllocator_ == NULL) + if (stringAllocator_ == NULLPTR) return defaultNewArrayAllocator(); return stringAllocator_; } @@ -45,14 +117,14 @@ } /* Avoid using the memory leak detector INSIDE SimpleString as its used inside the detector */ -char* SimpleString::allocStringBuffer(size_t _size, const char* file, int line) +char* SimpleString::allocStringBuffer(size_t _size, const char* file, size_t line) { return getStringAllocator()->alloc_memory(_size, file, line); } -void SimpleString::deallocStringBuffer(char* str, const char* file, int line) +void SimpleString::deallocStringBuffer(char* str, size_t size, const char* file, size_t line) { - getStringAllocator()->free_memory(str, file, line); + getStringAllocator()->free_memory(str, size, file, line); } char* SimpleString::getEmptyString() const @@ -62,6 +134,20 @@ return empty; } +// does not support + or - prefixes +unsigned SimpleString::AtoU(const char* str) +{ + while (isSpace(*str)) str++; + + unsigned result = 0; + for(; isDigit(*str) && *str >= '0'; str++) + { + result *= 10; + result += static_cast(*str - '0'); + } + return result; +} + int SimpleString::AtoI(const char* str) { while (isSpace(*str)) str++; @@ -80,9 +166,11 @@ int SimpleString::StrCmp(const char* s1, const char* s2) { - while(*s1 && *s1 == *s2) - s1++, s2++; - return *(unsigned char *) s1 - *(unsigned char *) s2; + while(*s1 && *s1 == *s2) { + ++s1; + ++s2; + } + return *(const unsigned char *) s1 - *(const unsigned char *) s2; } size_t SimpleString::StrLen(const char* str) @@ -95,29 +183,31 @@ int SimpleString::StrNCmp(const char* s1, const char* s2, size_t n) { while (n && *s1 && *s1 == *s2) { - n--, s1++, s2++; + --n; + ++s1; + ++s2; } - return n ? *(unsigned char *) s1 - *(unsigned char *) s2 : 0; + return n ? *(const unsigned char *) s1 - *(const unsigned char *) s2 : 0; } char* SimpleString::StrNCpy(char* s1, const char* s2, size_t n) { char* result = s1; - if((NULL == s1) || (0 == n)) return result; + if((NULLPTR == s1) || (0 == n)) return result; while ((*s1++ = *s2++) && --n != 0) ; return result; } -char* SimpleString::StrStr(const char* s1, const char* s2) +const char* SimpleString::StrStr(const char* s1, const char* s2) { - if(!*s2) return (char*) s1; + if(!*s2) return s1; for (; *s1; s1++) if (StrNCmp(s1, s2, StrLen(s2)) == 0) - return (char*) s1; - return NULL; + return s1; + return NULLPTR; } char SimpleString::ToLower(char ch) @@ -131,28 +221,87 @@ const unsigned char* p2 = (const unsigned char*) s2; while (n--) - if (*p1 != *p2) + if (*p1 != *p2) { return *p1 - *p2; - else - p1++, p2++; + } else { + ++p1; + ++p2; + } return 0; } -SimpleString::SimpleString(const char *otherBuffer) +void SimpleString::deallocateInternalBuffer() { - if (otherBuffer == 0) { - buffer_ = getEmptyString(); - } - else { - buffer_ = copyToNewBuffer(otherBuffer); + if (buffer_) { + deallocStringBuffer(buffer_, bufferSize_, __FILE__, __LINE__); + buffer_ = NULLPTR; + bufferSize_ = 0; } } +void SimpleString::setInternalBufferAsEmptyString() +{ + deallocateInternalBuffer(); + + bufferSize_ = 1; + buffer_ = getEmptyString(); +} + +void SimpleString::copyBufferToNewInternalBuffer(const char* otherBuffer, size_t bufferSize) +{ + deallocateInternalBuffer(); + + bufferSize_ = bufferSize; + buffer_ = copyToNewBuffer(otherBuffer, bufferSize_); +} + +void SimpleString::setInternalBufferToNewBuffer(size_t bufferSize) +{ + deallocateInternalBuffer(); + + bufferSize_ = bufferSize; + buffer_ = allocStringBuffer(bufferSize_, __FILE__, __LINE__); + buffer_[0] = '\0'; +} + +void SimpleString::setInternalBufferTo(char* buffer, size_t bufferSize) +{ + deallocateInternalBuffer(); + + bufferSize_ = bufferSize; + buffer_ = buffer; +} + +void SimpleString::copyBufferToNewInternalBuffer(const SimpleString& otherBuffer) +{ + copyBufferToNewInternalBuffer(otherBuffer.buffer_, otherBuffer.size() + 1); +} + +void SimpleString::copyBufferToNewInternalBuffer(const char* otherBuffer) +{ + copyBufferToNewInternalBuffer(otherBuffer, StrLen(otherBuffer) + 1); +} + +const char* SimpleString::getBuffer() const +{ + return buffer_; +} + +SimpleString::SimpleString(const char *otherBuffer) + : buffer_(NULLPTR), bufferSize_(0) +{ + if (otherBuffer == NULLPTR) + setInternalBufferAsEmptyString(); + else + copyBufferToNewInternalBuffer(otherBuffer); +} + SimpleString::SimpleString(const char *other, size_t repeatCount) + : buffer_(NULLPTR), bufferSize_(0) { size_t otherStringLength = StrLen(other); - size_t len = otherStringLength * repeatCount + 1; - buffer_ = allocStringBuffer(len, __FILE__, __LINE__); + setInternalBufferToNewBuffer(otherStringLength * repeatCount + 1); + char* next = buffer_; for (size_t i = 0; i < repeatCount; i++) { StrNCpy(next, other, otherStringLength + 1); @@ -162,22 +311,21 @@ } SimpleString::SimpleString(const SimpleString& other) + : buffer_(NULLPTR), bufferSize_(0) { - buffer_ = copyToNewBuffer(other.buffer_); + copyBufferToNewInternalBuffer(other.getBuffer()); } SimpleString& SimpleString::operator=(const SimpleString& other) { - if (this != &other) { - deallocStringBuffer(buffer_, __FILE__, __LINE__); - buffer_ = copyToNewBuffer(other.buffer_); - } + if (this != &other) + copyBufferToNewInternalBuffer(other); return *this; } bool SimpleString::contains(const SimpleString& other) const { - return StrStr(buffer_, other.buffer_) != 0; + return StrStr(getBuffer(), other.getBuffer()) != NULLPTR; } bool SimpleString::containsNoCase(const SimpleString& other) const @@ -187,28 +335,30 @@ bool SimpleString::startsWith(const SimpleString& other) const { - if (StrLen(other.buffer_) == 0) return true; + if (other.size() == 0) return true; else if (size() == 0) return false; - else return StrStr(buffer_, other.buffer_) == buffer_; + else return StrStr(getBuffer(), other.getBuffer()) == getBuffer(); } bool SimpleString::endsWith(const SimpleString& other) const { - size_t buffer_length = size(); - size_t other_buffer_length = StrLen(other.buffer_); - if (other_buffer_length == 0) return true; - if (buffer_length == 0) return false; - if (buffer_length < other_buffer_length) return false; - return StrCmp(buffer_ + buffer_length - other_buffer_length, other.buffer_) == 0; + size_t length = size(); + size_t other_length = other.size(); + + if (other_length == 0) return true; + if (length == 0) return false; + if (length < other_length) return false; + + return StrCmp(getBuffer() + length - other_length, other.getBuffer()) == 0; } size_t SimpleString::count(const SimpleString& substr) const { size_t num = 0; - char* str = buffer_; - while (*str && (str = StrStr(str, substr.buffer_))) { - num++; + const char* str = getBuffer(); + while (*str && (str = StrStr(str, substr.getBuffer()))) { str++; + num++; } return num; } @@ -219,11 +369,11 @@ size_t extraEndToken = (endsWith(delimiter)) ? 0 : 1U; col.allocate(num + extraEndToken); - char* str = buffer_; - char* prev; + const char* str = getBuffer(); + const char* prev; for (size_t i = 0; i < num; ++i) { prev = str; - str = StrStr(str, delimiter.buffer_) + 1; + str = StrStr(str, delimiter.getBuffer()) + 1; col[i] = SimpleString(prev).subString(0, size_t (str - prev)); } if (extraEndToken) { @@ -235,13 +385,16 @@ { size_t s = size(); for (size_t i = 0; i < s; i++) { - if (buffer_[i] == to) buffer_[i] = with; + if (getBuffer()[i] == to) buffer_[i] = with; } } void SimpleString::replace(const char* to, const char* with) { size_t c = count(to); + if (c == 0) { + return; + } size_t len = size(); size_t tolen = StrLen(to); size_t withlen = StrLen(with); @@ -251,25 +404,22 @@ if (newsize > 1) { char* newbuf = allocStringBuffer(newsize, __FILE__, __LINE__); for (size_t i = 0, j = 0; i < len;) { - if (StrNCmp(&buffer_[i], to, tolen) == 0) { + if (StrNCmp(&getBuffer()[i], to, tolen) == 0) { StrNCpy(&newbuf[j], with, withlen + 1); j += withlen; i += tolen; } else { - newbuf[j] = buffer_[i]; + newbuf[j] = getBuffer()[i]; j++; i++; } } - deallocStringBuffer(buffer_, __FILE__, __LINE__); - buffer_ = newbuf; - buffer_[newsize - 1] = '\0'; - } - else { - deallocStringBuffer(buffer_, __FILE__, __LINE__); - buffer_ = getEmptyString(); + newbuf[newsize - 1] = '\0'; + setInternalBufferTo(newbuf, newsize); } + else + setInternalBufferAsEmptyString(); } SimpleString SimpleString::lowerCase() const @@ -278,19 +428,19 @@ size_t str_size = str.size(); for (size_t i = 0; i < str_size; i++) - str.buffer_[i] = ToLower(str.buffer_[i]); + str.buffer_[i] = ToLower(str.getBuffer()[i]); return str; } const char *SimpleString::asCharString() const { - return buffer_; + return getBuffer(); } size_t SimpleString::size() const { - return StrLen(buffer_); + return StrLen(getBuffer()); } bool SimpleString::isEmpty() const @@ -298,10 +448,9 @@ return size() == 0; } - SimpleString::~SimpleString() { - deallocStringBuffer(buffer_, __FILE__, __LINE__); + deallocateInternalBuffer(); } bool operator==(const SimpleString& left, const SimpleString& right) @@ -322,14 +471,14 @@ SimpleString SimpleString::operator+(const SimpleString& rhs) const { - SimpleString t(buffer_); - t += rhs.buffer_; + SimpleString t(getBuffer()); + t += rhs.getBuffer(); return t; } SimpleString& SimpleString::operator+=(const SimpleString& rhs) { - return operator+=(rhs.buffer_); + return operator+=(rhs.getBuffer()); } SimpleString& SimpleString::operator+=(const char* rhs) @@ -337,10 +486,10 @@ size_t originalSize = this->size(); size_t additionalStringSize = StrLen(rhs) + 1; size_t sizeOfNewString = originalSize + additionalStringSize; - char* tbuffer = copyToNewBuffer(this->buffer_, sizeOfNewString); + char* tbuffer = copyToNewBuffer(this->getBuffer(), sizeOfNewString); StrNCpy(tbuffer + originalSize, rhs, additionalStringSize); - deallocStringBuffer(this->buffer_, __FILE__, __LINE__); - this->buffer_ = tbuffer; + + setInternalBufferTo(tbuffer, sizeOfNewString); return *this; } @@ -361,7 +510,7 @@ { if (beginPos > size()-1) return ""; - SimpleString newString = buffer_ + beginPos; + SimpleString newString = getBuffer() + beginPos; if (newString.size() > amount) newString.buffer_[amount] = '\0'; @@ -376,7 +525,7 @@ char SimpleString::at(size_t pos) const { - return buffer_[pos]; + return getBuffer()[pos]; } size_t SimpleString::find(char ch) const @@ -388,7 +537,7 @@ { size_t length = size(); for (size_t i = starting_position; i < length; i++) - if (buffer_[i] == ch) return i; + if (at(i) == ch) return i; return npos; } @@ -405,21 +554,20 @@ char* SimpleString::copyToNewBuffer(const char* bufferToCopy, size_t bufferSize) { - if(bufferSize == 0) bufferSize = StrLen(bufferToCopy) + 1; - char* newBuffer = allocStringBuffer(bufferSize, __FILE__, __LINE__); StrNCpy(newBuffer, bufferToCopy, bufferSize); newBuffer[bufferSize-1] = '\0'; return newBuffer; } + void SimpleString::copyToBuffer(char* bufferToCopy, size_t bufferSize) const { - if (bufferToCopy == NULL || bufferSize == 0) return; + if (bufferToCopy == NULLPTR || bufferSize == 0) return; - size_t sizeToCopy = (bufferSize-1 < size()) ? bufferSize : size(); + size_t sizeToCopy = (bufferSize-1 < size()) ? (bufferSize-1) : size(); - StrNCpy(bufferToCopy, buffer_, sizeToCopy); + StrNCpy(bufferToCopy, getBuffer(), sizeToCopy); bufferToCopy[sizeToCopy] = '\0'; } @@ -478,6 +626,11 @@ return StringFromFormat("%lx", value); } +SimpleString HexStringFrom(int value) +{ + return StringFromFormat("%x", value); +} + SimpleString HexStringFrom(signed char value) { SimpleString result = StringFromFormat("%x", value); @@ -493,6 +646,54 @@ return StringFromFormat("%lx", value); } +SimpleString HexStringFrom(unsigned int value) +{ + return StringFromFormat("%x", value); +} + +SimpleString BracketsFormattedHexStringFrom(int value) +{ + return BracketsFormattedHexString(HexStringFrom(value)); +} + +SimpleString BracketsFormattedHexStringFrom(unsigned int value) +{ + return BracketsFormattedHexString(HexStringFrom(value)); +} + +SimpleString BracketsFormattedHexStringFrom(long value) +{ + return BracketsFormattedHexString(HexStringFrom(value)); +} + + +SimpleString BracketsFormattedHexStringFrom(unsigned long value) +{ + return BracketsFormattedHexString(HexStringFrom(value)); +} + +SimpleString BracketsFormattedHexStringFrom(signed char value) +{ + return BracketsFormattedHexString(HexStringFrom(value)); +} + +SimpleString BracketsFormattedHexString(SimpleString hexString) +{ + return SimpleString("(0x") + hexString + ")" ; +} + +/* + * ARM compiler has only partial support for C++11. + * Specifically nullptr_t is not officially supported + */ +#if __cplusplus > 199711L && !defined __arm__ && CPPUTEST_USE_STD_CPP_LIB +SimpleString StringFrom(const std::nullptr_t value) +{ + (void) value; + return "(null)"; +} +#endif + #ifdef CPPUTEST_USE_LONG_LONG SimpleString StringFrom(cpputest_longlong value) @@ -502,7 +703,7 @@ SimpleString StringFrom(cpputest_ulonglong value) { - return StringFromFormat("%llu (0x%llx)", value, value); + return StringFromFormat("%llu", value); } SimpleString HexStringFrom(cpputest_longlong value) @@ -525,6 +726,17 @@ return HexStringFrom((cpputest_ulonglong) value); } +SimpleString BracketsFormattedHexStringFrom(cpputest_longlong value) +{ + return BracketsFormattedHexString(HexStringFrom(value)); +} + + +SimpleString BracketsFormattedHexStringFrom(cpputest_ulonglong value) +{ + return BracketsFormattedHexString(HexStringFrom(value)); +} + #else /* CPPUTEST_USE_LONG_LONG */ static long convertPointerToLongValue(const void* value) @@ -579,6 +791,17 @@ return StringFromFormat("%lx", convertFunctionPointerToLongValue(value)); } +SimpleString BracketsFormattedHexStringFrom(cpputest_longlong) +{ + return ""; +} + + +SimpleString BracketsFormattedHexStringFrom(cpputest_ulonglong) +{ + return ""; +} + #endif /* CPPUTEST_USE_LONG_LONG */ SimpleString StringFrom(double value, int precision) @@ -614,7 +837,7 @@ SimpleString StringFrom(unsigned int i) { - return StringFromFormat("%10u (0x%08x)", i, i); + return StringFromFormat("%u", i); } #if CPPUTEST_USE_STD_CPP_LIB @@ -630,14 +853,9 @@ SimpleString StringFrom(unsigned long i) { - return StringFromFormat("%lu (0x%lx)", i, i); + return StringFromFormat("%lu", i); } -//Kludge to get a va_copy in VC++ V6 -#ifndef va_copy -#define va_copy(copy, original) copy = original; -#endif - SimpleString VStringFromFormat(const char* format, va_list args) { va_list argsCopy; @@ -659,7 +877,7 @@ PlatformSpecificVSNprintf(newBuffer, newBufferSize, format, argsCopy); resultString = SimpleString(newBuffer); - SimpleString::deallocStringBuffer(newBuffer, __FILE__, __LINE__); + SimpleString::deallocStringBuffer(newBuffer, newBufferSize, __FILE__, __LINE__); } va_end(argsCopy); return resultString; @@ -746,7 +964,7 @@ SimpleStringCollection::SimpleStringCollection() { - collection_ = 0; + collection_ = NULLPTR; size_ = 0; } diff -Nru cpputest-3.8/src/CppUTest/SimpleStringInternalCache.cpp cpputest-4.0/src/CppUTest/SimpleStringInternalCache.cpp --- cpputest-3.8/src/CppUTest/SimpleStringInternalCache.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/src/CppUTest/SimpleStringInternalCache.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/SimpleStringInternalCache.h" + +struct SimpleStringMemoryBlock +{ + SimpleStringMemoryBlock* next_; + char* memory_; +}; + +struct SimpleStringInternalCacheNode +{ + size_t size_; + SimpleStringMemoryBlock* freeMemoryHead_; + SimpleStringMemoryBlock* usedMemoryHead_; +}; + +SimpleStringInternalCache::SimpleStringInternalCache() + : allocator_(defaultMallocAllocator()), cache_(NULLPTR), nonCachedAllocations_(NULLPTR), hasWarnedAboutDeallocations(false) +{ + cache_ = createInternalCacheNodes(); +} + +SimpleStringInternalCache::~SimpleStringInternalCache() +{ + allocator_ = defaultMallocAllocator(); + destroyInternalCacheNode(cache_); +} + +void SimpleStringInternalCache::setAllocator(TestMemoryAllocator* allocator) +{ + allocator_ = allocator; +} + +SimpleStringInternalCacheNode* SimpleStringInternalCache::createInternalCacheNodes() +{ + SimpleStringInternalCacheNode* node = (SimpleStringInternalCacheNode*) (void*) allocator_->alloc_memory(sizeof(SimpleStringInternalCacheNode) * amountOfInternalCacheNodes, __FILE__, __LINE__); + + for (int i = 0; i < amountOfInternalCacheNodes; i++) { + node[i].freeMemoryHead_ = NULLPTR; + node[i].usedMemoryHead_ = NULLPTR; + } + node[0].size_ = 32; + node[1].size_ = 64; + node[2].size_ = 96; + node[3].size_ = 128; + node[4].size_ = 256; + return node; +} + +bool SimpleStringInternalCache::isCached(size_t size) +{ + return size <= 256; +} + +size_t SimpleStringInternalCache::getIndexForCache(size_t size) +{ + for (size_t i = 0; i < amountOfInternalCacheNodes; i++) + if (size <= cache_[i].size_) + return i; + return 0; // LCOV_EXCL_LINE +} + +SimpleStringInternalCacheNode* SimpleStringInternalCache::getCacheNodeFromSize(size_t size) +{ + size_t index = getIndexForCache(size); + return &cache_[index]; +} + +void SimpleStringInternalCache::destroyInternalCacheNode(SimpleStringInternalCacheNode * node) +{ + allocator_->free_memory((char*) node, sizeof(SimpleStringInternalCacheNode) * amountOfInternalCacheNodes, __FILE__, __LINE__); +} + +SimpleStringMemoryBlock* SimpleStringInternalCache::createSimpleStringMemoryBlock(size_t size, SimpleStringMemoryBlock* next) +{ + SimpleStringMemoryBlock* block = (SimpleStringMemoryBlock*) (void*) allocator_->alloc_memory(sizeof(SimpleStringMemoryBlock) , __FILE__, __LINE__); + block->memory_ = allocator_->alloc_memory(size , __FILE__, __LINE__); + block->next_ = next; + return block; +} + +void SimpleStringInternalCache::destroySimpleStringMemoryBlock(SimpleStringMemoryBlock * block, size_t size) +{ + allocator_->free_memory(block->memory_, size, __FILE__, __LINE__); + allocator_->free_memory((char*) block, sizeof(SimpleStringMemoryBlock), __FILE__, __LINE__); +} + +void SimpleStringInternalCache::destroySimpleStringMemoryBlockList(SimpleStringMemoryBlock * block, size_t size) +{ + SimpleStringMemoryBlock* current = block; + while (current) { + SimpleStringMemoryBlock* next = current->next_; + destroySimpleStringMemoryBlock(current, size); + current = next; + } +} + +SimpleStringMemoryBlock* SimpleStringInternalCache::addToSimpleStringMemoryBlockList(SimpleStringMemoryBlock* newBlock, SimpleStringMemoryBlock* previousHead) +{ + newBlock->next_ = previousHead; + return newBlock; +} + +bool SimpleStringInternalCache::hasFreeBlocksOfSize(size_t size) +{ + return getCacheNodeFromSize(size)->freeMemoryHead_ != NULLPTR; +} + +SimpleStringMemoryBlock* SimpleStringInternalCache::reserveCachedBlockFrom(SimpleStringInternalCacheNode* node) +{ + SimpleStringMemoryBlock* block = node->freeMemoryHead_; + node->freeMemoryHead_ = block->next_; + node->usedMemoryHead_ = addToSimpleStringMemoryBlockList(block, node->usedMemoryHead_); + return block; +} + +SimpleStringMemoryBlock* SimpleStringInternalCache::allocateNewCacheBlockFrom(SimpleStringInternalCacheNode* node) +{ + SimpleStringMemoryBlock* block = createSimpleStringMemoryBlock(node->size_, node->usedMemoryHead_); + node->usedMemoryHead_ = addToSimpleStringMemoryBlockList(block, node->usedMemoryHead_); + return block; +} + +void SimpleStringInternalCache::printDeallocatingUnknownMemory(char* memory) +{ + if (!hasWarnedAboutDeallocations) { + hasWarnedAboutDeallocations = true; + UtestShell::getCurrent()->print(StringFromFormat("\nWARNING: Attempting to deallocate a String buffer that was allocated while not caching. Ignoring it!\n" + "This is likely due statics and will cause problems.\n" + "Only warning once to avoid recursive warnings.\n" + "String we are deallocating: \"%s\"\n", memory).asCharString(), __FILE__, __LINE__); + } +} + +void SimpleStringInternalCache::releaseCachedBlockFrom(char* memory, SimpleStringInternalCacheNode* node) +{ + if (node->usedMemoryHead_ && node->usedMemoryHead_->memory_ == memory) { + SimpleStringMemoryBlock* block = node->usedMemoryHead_; + node->usedMemoryHead_ = node->usedMemoryHead_->next_; + node->freeMemoryHead_ = addToSimpleStringMemoryBlockList(block, node->freeMemoryHead_); + return; + } + + for (SimpleStringMemoryBlock* block = node->usedMemoryHead_; block; block = block->next_) { + if (block->next_ && block->next_->memory_ == memory) { + SimpleStringMemoryBlock* blockToFree = block->next_; + block->next_ = block->next_->next_; + node->freeMemoryHead_ = addToSimpleStringMemoryBlockList(blockToFree, node->freeMemoryHead_); + return; + } + } + printDeallocatingUnknownMemory(memory); + +} + +void SimpleStringInternalCache::releaseNonCachedMemory(char* memory, size_t size) +{ + if (nonCachedAllocations_ && nonCachedAllocations_->memory_ == memory) { + SimpleStringMemoryBlock* block = nonCachedAllocations_; + nonCachedAllocations_ = block->next_; + destroySimpleStringMemoryBlock(block, size); + return; + } + + for (SimpleStringMemoryBlock* block = nonCachedAllocations_; block; block = block->next_) { + if (block->next_ && block->next_->memory_ == memory) { + SimpleStringMemoryBlock* blockToFree = block->next_; + block->next_ = block->next_->next_; + destroySimpleStringMemoryBlock(blockToFree, size); + return; + } + } + + printDeallocatingUnknownMemory(memory); +} + +char* SimpleStringInternalCache::alloc(size_t size) +{ + if (isCached(size)) { + if (hasFreeBlocksOfSize(size)) + return reserveCachedBlockFrom(getCacheNodeFromSize(size))->memory_; + else + return allocateNewCacheBlockFrom(getCacheNodeFromSize(size))->memory_; + } + + nonCachedAllocations_ = createSimpleStringMemoryBlock(size, nonCachedAllocations_); + return nonCachedAllocations_->memory_; +} + +void SimpleStringInternalCache::dealloc(char* memory, size_t size) +{ + if (isCached(size)) { + size_t index = getIndexForCache(size); + SimpleStringInternalCacheNode* cacheNode = &cache_[index]; + releaseCachedBlockFrom(memory, cacheNode); + return; + } + releaseNonCachedMemory(memory, size); +} + +void SimpleStringInternalCache::clearCache() +{ + for (size_t i = 0; i < amountOfInternalCacheNodes; i++) { + destroySimpleStringMemoryBlockList(cache_[i].freeMemoryHead_, cache_[i].size_); + cache_[i].freeMemoryHead_ = NULLPTR; + } +} + +void SimpleStringInternalCache::clearAllIncludingCurrentlyUsedMemory() +{ + for (size_t i = 0; i < amountOfInternalCacheNodes; i++) { + destroySimpleStringMemoryBlockList(cache_[i].freeMemoryHead_, cache_[i].size_); + destroySimpleStringMemoryBlockList(cache_[i].usedMemoryHead_, cache_[i].size_); + cache_[i].freeMemoryHead_ = NULLPTR; + cache_[i].usedMemoryHead_ = NULLPTR; + } + + destroySimpleStringMemoryBlockList(nonCachedAllocations_, 0); + nonCachedAllocations_ = NULLPTR; +} + +GlobalSimpleStringCache::GlobalSimpleStringCache() +{ + allocator_ = new SimpleStringCacheAllocator(cache_, SimpleString::getStringAllocator()); + SimpleString::setStringAllocator(allocator_); +} + +GlobalSimpleStringCache::~GlobalSimpleStringCache() +{ + SimpleString::setStringAllocator(allocator_->originalAllocator()); + cache_.clearAllIncludingCurrentlyUsedMemory(); + delete allocator_; +} + +TestMemoryAllocator* GlobalSimpleStringCache::getAllocator() +{ + return allocator_; +} + +SimpleStringCacheAllocator::SimpleStringCacheAllocator(SimpleStringInternalCache& cache, TestMemoryAllocator* origAllocator) + : cache_(cache), originalAllocator_(origAllocator) +{ + cache_.setAllocator(origAllocator); +} + +SimpleStringCacheAllocator::~SimpleStringCacheAllocator() +{ + cache_.setAllocator(NULLPTR); +} + +char* SimpleStringCacheAllocator::alloc_memory(size_t size, const char*, size_t) +{ + return cache_.alloc(size); +} + +void SimpleStringCacheAllocator::free_memory(char* memory, size_t size, const char*, size_t) +{ + cache_.dealloc(memory, size); +} + +const char* SimpleStringCacheAllocator::name() const +{ + return "SimpleStringCacheAllocator"; +} + +const char* SimpleStringCacheAllocator::alloc_name() const +{ + return originalAllocator_->alloc_name(); +} + +const char* SimpleStringCacheAllocator::free_name() const +{ + return originalAllocator_->free_name(); +} + +TestMemoryAllocator* SimpleStringCacheAllocator::actualAllocator() +{ + return originalAllocator_->actualAllocator(); +} + +TestMemoryAllocator* SimpleStringCacheAllocator::originalAllocator() +{ + return originalAllocator_; +} + diff -Nru cpputest-3.8/src/CppUTest/TeamCityTestOutput.cpp cpputest-4.0/src/CppUTest/TeamCityTestOutput.cpp --- cpputest-3.8/src/CppUTest/TeamCityTestOutput.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TeamCityTestOutput.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -1,7 +1,7 @@ #include "CppUTest/TestHarness.h" #include "CppUTest/TeamCityTestOutput.h" -TeamCityTestOutput::TeamCityTestOutput() : currtest_(0), currGroup_() +TeamCityTestOutput::TeamCityTestOutput() : currtest_(NULLPTR), currGroup_() { } @@ -12,11 +12,11 @@ void TeamCityTestOutput::printCurrentTestStarted(const UtestShell& test) { print("##teamcity[testStarted name='"); - print(test.getName().asCharString()); + printEscaped(test.getName().asCharString()); print("']\n"); if (!test.willRun()) { print("##teamcity[testIgnored name='"); - print(test.getName().asCharString()); + printEscaped(test.getName().asCharString()); print("']\n"); } currtest_ = &test; @@ -28,7 +28,7 @@ return; print("##teamcity[testFinished name='"); - print(currtest_->getName().asCharString()); + printEscaped(currtest_->getName().asCharString()); print("' duration='"); print(res.getCurrentTestTotalExecutionTime()); print("']\n"); @@ -38,7 +38,7 @@ { currGroup_ = test.getGroup(); print("##teamcity[testSuiteStarted name='"); - print(currGroup_.asCharString()); + printEscaped(currGroup_.asCharString()); print("']\n"); } @@ -48,7 +48,7 @@ return; print("##teamcity[testSuiteFinished name='"); - print(currGroup_.asCharString()); + printEscaped(currGroup_.asCharString()); print("']\n"); } @@ -80,7 +80,7 @@ void TeamCityTestOutput::printFailure(const TestFailure& failure) { print("##teamcity[testFailed name='"); - print(failure.getTestNameOnly().asCharString()); + printEscaped(failure.getTestNameOnly().asCharString()); print("' message='"); if (failure.isOutsideTestFile() || failure.isInHelperFunction()) { print("TEST failed ("); @@ -90,7 +90,7 @@ print("): "); } - print(failure.getFileName().asCharString()); + printEscaped(failure.getFileName().asCharString()); print(":"); print(failure.getFailureLineNumber()); diff -Nru cpputest-3.8/src/CppUTest/TestFailure.cpp cpputest-4.0/src/CppUTest/TestFailure.cpp --- cpputest-3.8/src/CppUTest/TestFailure.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestFailure.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -60,7 +60,7 @@ } -TestFailure::TestFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& theMessage) : +TestFailure::TestFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& theMessage) : testName_(test->getFormattedName()), testNameOnly_(test->getName()), fileName_(fileName), lineNumber_(lineNumber), testFileName_(test->getFile()), testLineNumber_(test->getLineNumber()), message_(theMessage) { } @@ -70,7 +70,7 @@ { } -TestFailure::TestFailure(UtestShell* test, const char* fileName, int lineNum) : +TestFailure::TestFailure(UtestShell* test, const char* fileName, size_t lineNum) : testName_(test->getFormattedName()), testNameOnly_(test->getName()), fileName_(fileName), lineNumber_(lineNum), testFileName_(test->getFile()), testLineNumber_(test->getLineNumber()), message_("no message") { } @@ -105,12 +105,12 @@ return testNameOnly_; } -int TestFailure::getFailureLineNumber() const +size_t TestFailure::getFailureLineNumber() const { return lineNumber_; } -int TestFailure::getTestLineNumber() const +size_t TestFailure::getTestLineNumber() const { return testLineNumber_; } @@ -162,14 +162,18 @@ SimpleString userMessage = ""; if (!text.isEmpty()) { - userMessage += "Message: "; + //This is a kludge to turn off "Message: " for this case. + //I don't think "Message: " adds anything, as you get to see the + //message. I propose we remove "Message: " lead in + if (!text.startsWith("LONGS_EQUAL")) + userMessage += "Message: "; userMessage += text; userMessage += "\n\t"; } return userMessage; } -EqualsFailure::EqualsFailure(UtestShell* test, const char* fileName, int lineNumber, const char* expected, const char* actual, const SimpleString& text) : +EqualsFailure::EqualsFailure(UtestShell* test, const char* fileName, size_t lineNumber, const char* expected, const char* actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); @@ -177,7 +181,7 @@ message_ += createButWasString(StringFromOrNull(expected), StringFromOrNull(actual)); } -EqualsFailure::EqualsFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text) +EqualsFailure::EqualsFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); @@ -185,7 +189,7 @@ message_ += createButWasString(expected, actual); } -DoublesEqualFailure::DoublesEqualFailure(UtestShell* test, const char* fileName, int lineNumber, double expected, double actual, double threshold, const SimpleString& text) +DoublesEqualFailure::DoublesEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, double expected, double actual, double threshold, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); @@ -199,7 +203,7 @@ message_ += "\n\tCannot make comparisons with Nan"; } -CheckEqualFailure::CheckEqualFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text) +CheckEqualFailure::CheckEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); @@ -212,7 +216,17 @@ } -ContainsFailure::ContainsFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text) +ComparisonFailure::ComparisonFailure(UtestShell *test, const char *fileName, size_t lineNumber, const SimpleString& checkString, const SimpleString &comparisonString, const SimpleString &text) +: TestFailure(test, fileName, lineNumber) +{ + message_ = createUserText(text); + message_ += checkString; + message_ += "("; + message_ += comparisonString; + message_ += ") failed"; +} + +ContainsFailure::ContainsFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& expected, const SimpleString& actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); @@ -220,7 +234,7 @@ message_ += StringFromFormat("actual <%s>\n\tdid not contain <%s>", actual.asCharString(), expected.asCharString()); } -CheckFailure::CheckFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& checkString, const SimpleString& conditionString, const SimpleString& text) +CheckFailure::CheckFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& checkString, const SimpleString& conditionString, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); @@ -231,102 +245,88 @@ message_ += ") failed"; } -FailFailure::FailFailure(UtestShell* test, const char* fileName, int lineNumber, const SimpleString& message) : TestFailure(test, fileName, lineNumber) +FailFailure::FailFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& message) : TestFailure(test, fileName, lineNumber) { message_ = message; } -LongsEqualFailure::LongsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, long expected, long actual, const SimpleString& text) +LongsEqualFailure::LongsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, long expected, long actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); SimpleString aDecimal = StringFrom(actual); - SimpleString aHex = HexStringFrom(actual); SimpleString eDecimal = StringFrom(expected); - SimpleString eHex = HexStringFrom(expected); SimpleString::padStringsToSameLength(aDecimal, eDecimal, ' '); - SimpleString::padStringsToSameLength(aHex, eHex, '0'); - SimpleString actualReported = aDecimal + " 0x" + aHex; - SimpleString expectedReported = eDecimal + " 0x" + eHex; + SimpleString actualReported = aDecimal + " " + BracketsFormattedHexStringFrom(actual); + SimpleString expectedReported = eDecimal + " " + BracketsFormattedHexStringFrom(expected); message_ += createButWasString(expectedReported, actualReported); } -UnsignedLongsEqualFailure::UnsignedLongsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, unsigned long expected, unsigned long actual, const SimpleString& text) +UnsignedLongsEqualFailure::UnsignedLongsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, unsigned long expected, unsigned long actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); SimpleString aDecimal = StringFrom(actual); - SimpleString aHex = HexStringFrom(actual); SimpleString eDecimal = StringFrom(expected); - SimpleString eHex = HexStringFrom(expected); SimpleString::padStringsToSameLength(aDecimal, eDecimal, ' '); - SimpleString::padStringsToSameLength(aHex, eHex, '0'); - SimpleString actualReported = aDecimal + " 0x" + aHex; - SimpleString expectedReported = eDecimal + " 0x" + eHex; + SimpleString actualReported = aDecimal + " " + BracketsFormattedHexStringFrom(actual); + SimpleString expectedReported = eDecimal + " " + BracketsFormattedHexStringFrom(expected); + message_ += createButWasString(expectedReported, actualReported); } -LongLongsEqualFailure::LongLongsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, cpputest_longlong expected, cpputest_longlong actual, const SimpleString& text) +LongLongsEqualFailure::LongLongsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, cpputest_longlong expected, cpputest_longlong actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); SimpleString aDecimal = StringFrom(actual); - SimpleString aHex = HexStringFrom(actual); SimpleString eDecimal = StringFrom(expected); - SimpleString eHex = HexStringFrom(expected); SimpleString::padStringsToSameLength(aDecimal, eDecimal, ' '); - SimpleString::padStringsToSameLength(aHex, eHex, '0'); - SimpleString actualReported = aDecimal + " 0x" + aHex; - SimpleString expectedReported = eDecimal + " 0x" + eHex; + SimpleString actualReported = aDecimal + " " + BracketsFormattedHexStringFrom(actual); + SimpleString expectedReported = eDecimal + " " + BracketsFormattedHexStringFrom(expected); message_ += createButWasString(expectedReported, actualReported); } -UnsignedLongLongsEqualFailure::UnsignedLongLongsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, cpputest_ulonglong expected, cpputest_ulonglong actual, const SimpleString& text) +UnsignedLongLongsEqualFailure::UnsignedLongLongsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, cpputest_ulonglong expected, cpputest_ulonglong actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); SimpleString aDecimal = StringFrom(actual); - SimpleString aHex = HexStringFrom(actual); SimpleString eDecimal = StringFrom(expected); - SimpleString eHex = HexStringFrom(expected); SimpleString::padStringsToSameLength(aDecimal, eDecimal, ' '); - SimpleString::padStringsToSameLength(aHex, eHex, '0'); - SimpleString actualReported = aDecimal + " 0x" + aHex; - SimpleString expectedReported = eDecimal + " 0x" + eHex; + SimpleString actualReported = aDecimal + " " + BracketsFormattedHexStringFrom(actual); + SimpleString expectedReported = eDecimal + " " + BracketsFormattedHexStringFrom(expected); message_ += createButWasString(expectedReported, actualReported); } -SignedBytesEqualFailure::SignedBytesEqualFailure (UtestShell* test, const char* fileName, int lineNumber, signed char expected, signed char actual, const SimpleString& text) +SignedBytesEqualFailure::SignedBytesEqualFailure (UtestShell* test, const char* fileName, size_t lineNumber, signed char expected, signed char actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); SimpleString aDecimal = StringFrom((int)actual); - SimpleString aHex = HexStringFrom(actual); SimpleString eDecimal = StringFrom((int)expected); - SimpleString eHex = HexStringFrom(expected); SimpleString::padStringsToSameLength(aDecimal, eDecimal, ' '); - SimpleString::padStringsToSameLength(aHex, eHex, '0'); - SimpleString actualReported = aDecimal + " 0x" + aHex; - SimpleString expectedReported = eDecimal + " 0x" + eHex; + SimpleString actualReported = aDecimal + " " + BracketsFormattedHexStringFrom(actual); + SimpleString expectedReported = eDecimal + " " + BracketsFormattedHexStringFrom(expected); message_ += createButWasString(expectedReported, actualReported); } -StringEqualFailure::StringEqualFailure(UtestShell* test, const char* fileName, int lineNumber, const char* expected, const char* actual, const SimpleString& text) +StringEqualFailure::StringEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, const char* expected, const char* actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); @@ -341,7 +341,7 @@ } } -StringEqualNoCaseFailure::StringEqualNoCaseFailure(UtestShell* test, const char* fileName, int lineNumber, const char* expected, const char* actual, const SimpleString& text) +StringEqualNoCaseFailure::StringEqualNoCaseFailure(UtestShell* test, const char* fileName, size_t lineNumber, const char* expected, const char* actual, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); @@ -356,7 +356,7 @@ } } -BinaryEqualFailure::BinaryEqualFailure(UtestShell* test, const char* fileName, int lineNumber, const unsigned char* expected, +BinaryEqualFailure::BinaryEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, const unsigned char* expected, const unsigned char* actual, size_t size, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { @@ -372,7 +372,7 @@ } } -BitsEqualFailure::BitsEqualFailure(UtestShell* test, const char* fileName, int lineNumber, unsigned long expected, unsigned long actual, +BitsEqualFailure::BitsEqualFailure(UtestShell* test, const char* fileName, size_t lineNumber, unsigned long expected, unsigned long actual, unsigned long mask, size_t byteCount, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { @@ -381,11 +381,11 @@ message_ += createButWasString(StringFromMaskedBits(expected, mask, byteCount), StringFromMaskedBits(actual, mask, byteCount)); } -FeatureUnsupportedFailure::FeatureUnsupportedFailure(UtestShell* test, const char* fileName, int lineNumber, +FeatureUnsupportedFailure::FeatureUnsupportedFailure(UtestShell* test, const char* fileName, size_t lineNumber, const SimpleString& featureName, const SimpleString& text) : TestFailure(test, fileName, lineNumber) { message_ = createUserText(text); - message_ += StringFromFormat("The feature \"%s\" is not supported in this environment or with the feature set selected when building the library.", featureName.asCharString());; + message_ += StringFromFormat("The feature \"%s\" is not supported in this environment or with the feature set selected when building the library.", featureName.asCharString()); } diff -Nru cpputest-3.8/src/CppUTest/TestFilter.cpp cpputest-4.0/src/CppUTest/TestFilter.cpp --- cpputest-3.8/src/CppUTest/TestFilter.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestFilter.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -28,16 +28,16 @@ #include "CppUTest/CppUTestConfig.h" #include "CppUTest/TestFilter.h" -TestFilter::TestFilter() : strictMatching_(false), invertMatching_(false), next_(NULL) +TestFilter::TestFilter() : strictMatching_(false), invertMatching_(false), next_(NULLPTR) { } -TestFilter::TestFilter(const SimpleString& filter) : strictMatching_(false), invertMatching_(false), next_(NULL) +TestFilter::TestFilter(const SimpleString& filter) : strictMatching_(false), invertMatching_(false), next_(NULLPTR) { filter_ = filter; } -TestFilter::TestFilter(const char* filter) : strictMatching_(false), invertMatching_(false), next_(NULL) +TestFilter::TestFilter(const char* filter) : strictMatching_(false), invertMatching_(false), next_(NULLPTR) { filter_ = filter; } diff -Nru cpputest-3.8/src/CppUTest/TestHarness_c.cpp cpputest-4.0/src/CppUTest/TestHarness_c.cpp --- cpputest-3.8/src/CppUTest/TestHarness_c.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestHarness_c.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -34,60 +34,89 @@ extern "C" { +void CHECK_EQUAL_C_BOOL_LOCATION(int expected, int actual, const char* text, const char* fileName, size_t lineNumber) +{ + UtestShell::getCurrent()->assertEquals(!!expected != !!actual, expected ? "true" : "false", actual ? "true" : "false", text, fileName, lineNumber, TestTerminatorWithoutExceptions()); +} + +void CHECK_EQUAL_C_INT_LOCATION(int expected, int actual, const char* text, const char* fileName, size_t lineNumber) +{ + UtestShell::getCurrent()->assertLongsEqual((long)expected, (long)actual, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); +} -void CHECK_EQUAL_C_INT_LOCATION(int expected, int actual, const char* fileName, int lineNumber) +void CHECK_EQUAL_C_UINT_LOCATION(unsigned int expected, unsigned int actual, const char* text, const char* fileName, size_t lineNumber) { - UtestShell::getCurrent()->assertLongsEqual((long)expected, (long)actual, NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertUnsignedLongsEqual((unsigned long)expected, (unsigned long)actual, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } -void CHECK_EQUAL_C_REAL_LOCATION(double expected, double actual, double threshold, const char* fileName, int lineNumber) +void CHECK_EQUAL_C_LONG_LOCATION(long expected, long actual, const char* text, const char* fileName, size_t lineNumber) { - UtestShell::getCurrent()->assertDoublesEqual(expected, actual, threshold, NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertLongsEqual(expected, actual, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } -void CHECK_EQUAL_C_CHAR_LOCATION(char expected, char actual, const char* fileName, int lineNumber) +void CHECK_EQUAL_C_ULONG_LOCATION(unsigned long expected, unsigned long actual, const char* text, const char* fileName, size_t lineNumber) { - UtestShell::getCurrent()->assertEquals(((expected) != (actual)), StringFrom(expected).asCharString(), StringFrom(actual).asCharString(), NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertUnsignedLongsEqual(expected, actual, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } -extern void CHECK_EQUAL_C_UBYTE_LOCATION(unsigned char expected, unsigned char actual, const char* fileName, int lineNumber)\ +void CHECK_EQUAL_C_LONGLONG_LOCATION(cpputest_longlong expected, cpputest_longlong actual, const char* text, const char* fileName, size_t lineNumber) { - UtestShell::getCurrent()->assertEquals(((expected) != (actual)),StringFrom((int)expected).asCharString(), StringFrom((int) actual).asCharString(), NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertLongLongsEqual(expected, actual, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } -void CHECK_EQUAL_C_SBYTE_LOCATION(char signed expected, signed char actual, const char* fileName, int lineNumber) +void CHECK_EQUAL_C_ULONGLONG_LOCATION(cpputest_ulonglong expected, cpputest_ulonglong actual, const char* text, const char* fileName, size_t lineNumber) { - UtestShell::getCurrent()->assertEquals(((expected) != (actual)),StringFrom((int)expected).asCharString(), StringFrom((int) actual).asCharString(), NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertUnsignedLongLongsEqual(expected, actual, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } -void CHECK_EQUAL_C_STRING_LOCATION(const char* expected, const char* actual, const char* fileName, int lineNumber) +void CHECK_EQUAL_C_REAL_LOCATION(double expected, double actual, double threshold, const char* text, const char* fileName, size_t lineNumber) { - UtestShell::getCurrent()->assertCstrEqual(expected, actual, NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertDoublesEqual(expected, actual, threshold, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } -void CHECK_EQUAL_C_POINTER_LOCATION(const void* expected, const void* actual, const char* fileName, int lineNumber) +void CHECK_EQUAL_C_CHAR_LOCATION(char expected, char actual, const char* text, const char* fileName, size_t lineNumber) { - UtestShell::getCurrent()->assertPointersEqual(expected, actual, NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertEquals(((expected) != (actual)), StringFrom(expected).asCharString(), StringFrom(actual).asCharString(), text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } -extern void CHECK_EQUAL_C_BITS_LOCATION(unsigned int expected, unsigned int actual, unsigned int mask, size_t size, const char* fileName, int lineNumber) +extern void CHECK_EQUAL_C_UBYTE_LOCATION(unsigned char expected, unsigned char actual, const char* text, const char* fileName, size_t lineNumber)\ { - UtestShell::getCurrent()->assertBitsEqual(expected, actual, mask, size, NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertEquals(((expected) != (actual)),StringFrom((int)expected).asCharString(), StringFrom((int) actual).asCharString(), text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } -void FAIL_TEXT_C_LOCATION(const char* text, const char* fileName, int lineNumber) +void CHECK_EQUAL_C_SBYTE_LOCATION(char signed expected, signed char actual, const char* text, const char* fileName, size_t lineNumber) +{ + UtestShell::getCurrent()->assertEquals(((expected) != (actual)),StringFrom((int)expected).asCharString(), StringFrom((int) actual).asCharString(), text, fileName, lineNumber, TestTerminatorWithoutExceptions()); +} + +void CHECK_EQUAL_C_STRING_LOCATION(const char* expected, const char* actual, const char* text, const char* fileName, size_t lineNumber) +{ + UtestShell::getCurrent()->assertCstrEqual(expected, actual, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); +} + +void CHECK_EQUAL_C_POINTER_LOCATION(const void* expected, const void* actual, const char* text, const char* fileName, size_t lineNumber) +{ + UtestShell::getCurrent()->assertPointersEqual(expected, actual, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); +} + +extern void CHECK_EQUAL_C_BITS_LOCATION(unsigned int expected, unsigned int actual, unsigned int mask, size_t size, const char* text, const char* fileName, size_t lineNumber) +{ + UtestShell::getCurrent()->assertBitsEqual(expected, actual, mask, size, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); +} + +void FAIL_TEXT_C_LOCATION(const char* text, const char* fileName, size_t lineNumber) { UtestShell::getCurrent()->fail(text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } // LCOV_EXCL_LINE -void FAIL_C_LOCATION(const char* fileName, int lineNumber) +void FAIL_C_LOCATION(const char* fileName, size_t lineNumber) { UtestShell::getCurrent()->fail("", fileName, lineNumber, TestTerminatorWithoutExceptions()); } // LCOV_EXCL_LINE -void CHECK_C_LOCATION(int condition, const char* conditionString, const char* fileName, int lineNumber) +void CHECK_C_LOCATION(int condition, const char* conditionString, const char* text, const char* fileName, size_t lineNumber) { - UtestShell::getCurrent()->assertTrue(condition != 0, "CHECK_C", conditionString, NULL, fileName, lineNumber, TestTerminatorWithoutExceptions()); + UtestShell::getCurrent()->assertTrue(condition != 0, "CHECK_C", conditionString, text, fileName, lineNumber, TestTerminatorWithoutExceptions()); } enum { NO_COUNTDOWN = -1, OUT_OF_MEMORRY = 0 }; @@ -104,15 +133,20 @@ return malloc_count; } +static TestMemoryAllocator* originalAllocator = NULLPTR; + void cpputest_malloc_set_out_of_memory() { + if (originalAllocator == NULLPTR) + originalAllocator = getCurrentMallocAllocator(); setCurrentMallocAllocator(NullUnknownAllocator::defaultAllocator()); } void cpputest_malloc_set_not_out_of_memory() { malloc_out_of_memory_counter = NO_COUNTDOWN; - setCurrentMallocAllocatorToDefault(); + setCurrentMallocAllocator(originalAllocator); + originalAllocator = NULLPTR; } void cpputest_malloc_set_out_of_memory_countdown(int count) @@ -127,6 +161,16 @@ return cpputest_malloc_location(size, "", 0); } +char* cpputest_strdup(const char* str) +{ + return cpputest_strdup_location(str, "", 0); +} + +char* cpputest_strndup(const char* str, size_t n) +{ + return cpputest_strndup_location(str, n, "", 0); +} + void* cpputest_calloc(size_t num, size_t size) { return cpputest_calloc_location(num, size, "", 0); @@ -156,14 +200,44 @@ cpputest_malloc_set_out_of_memory(); } -void* cpputest_malloc_location(size_t size, const char* file, int line) +void* cpputest_malloc_location(size_t size, const char* file, size_t line) { countdown(); malloc_count++; return cpputest_malloc_location_with_leak_detection(size, file, line); } -void* cpputest_calloc_location(size_t num, size_t size, const char* file, int line) +static size_t test_harness_c_strlen(const char * str) +{ + size_t n = 0; + while (*str++) n++; + return n; +} + +static char* strdup_alloc(const char * str, size_t size, const char* file, size_t line) +{ + char* result = (char*) cpputest_malloc_location(size, file, line); + PlatformSpecificMemCpy(result, str, size); + result[size-1] = '\0'; + return result; +} + +char* cpputest_strdup_location(const char * str, const char* file, size_t line) +{ + size_t length = 1 + test_harness_c_strlen(str); + return strdup_alloc(str, length, file, line); +} + +char* cpputest_strndup_location(const char * str, size_t n, const char* file, size_t line) +{ + size_t length = test_harness_c_strlen(str); + length = length < n ? length : n; + length = length + 1; + return strdup_alloc(str, length, file, line); +} + + +void* cpputest_calloc_location(size_t num, size_t size, const char* file, size_t line) { void* mem = cpputest_malloc_location(num * size, file, line); if (mem) @@ -171,12 +245,12 @@ return mem; } -void* cpputest_realloc_location(void* memory, size_t size, const char* file, int line) +void* cpputest_realloc_location(void* memory, size_t size, const char* file, size_t line) { return cpputest_realloc_location_with_leak_detection(memory, size, file, line); } -void cpputest_free_location(void* buffer, const char* file, int line) +void cpputest_free_location(void* buffer, const char* file, size_t line) { cpputest_free_location_with_leak_detection(buffer, file, line); } diff -Nru cpputest-3.8/src/CppUTest/TestMemoryAllocator.cpp cpputest-4.0/src/CppUTest/TestMemoryAllocator.cpp --- cpputest-3.8/src/CppUTest/TestMemoryAllocator.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestMemoryAllocator.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -33,14 +33,14 @@ static char* checkedMalloc(size_t size) { char* mem = (char*) PlatformSpecificMalloc(size); - if (mem == 0) + if (mem == NULLPTR) FAIL("malloc returned null pointer"); return mem; } -static TestMemoryAllocator* currentNewAllocator = 0; -static TestMemoryAllocator* currentNewArrayAllocator = 0; -static TestMemoryAllocator* currentMallocAllocator = 0; +static TestMemoryAllocator* currentNewAllocator = NULLPTR; +static TestMemoryAllocator* currentNewArrayAllocator = NULLPTR; +static TestMemoryAllocator* currentMallocAllocator = NULLPTR; void setCurrentNewAllocator(TestMemoryAllocator* allocator) { @@ -49,7 +49,7 @@ TestMemoryAllocator* getCurrentNewAllocator() { - if (currentNewAllocator == 0) setCurrentNewAllocatorToDefault(); + if (currentNewAllocator == NULLPTR) setCurrentNewAllocatorToDefault(); return currentNewAllocator; } @@ -71,7 +71,7 @@ TestMemoryAllocator* getCurrentNewArrayAllocator() { - if (currentNewArrayAllocator == 0) setCurrentNewArrayAllocatorToDefault(); + if (currentNewArrayAllocator == NULLPTR) setCurrentNewArrayAllocatorToDefault(); return currentNewArrayAllocator; } @@ -93,7 +93,7 @@ TestMemoryAllocator* getCurrentMallocAllocator() { - if (currentMallocAllocator == 0) setCurrentMallocAllocatorToDefault(); + if (currentMallocAllocator == NULLPTR) setCurrentMallocAllocatorToDefault(); return currentMallocAllocator; } @@ -110,6 +110,25 @@ ///////////////////////////////////////////// +GlobalMemoryAllocatorStash::GlobalMemoryAllocatorStash() + : originalMallocAllocator(NULLPTR), originalNewAllocator(NULLPTR), originalNewArrayAllocator(NULLPTR) +{ +} + +void GlobalMemoryAllocatorStash::save() +{ + originalMallocAllocator = getCurrentMallocAllocator(); + originalNewAllocator = getCurrentNewAllocator(); + originalNewArrayAllocator = getCurrentNewArrayAllocator(); +} + +void GlobalMemoryAllocatorStash::restore() +{ + if (originalMallocAllocator) setCurrentMallocAllocator(originalMallocAllocator); + if (originalNewAllocator) setCurrentNewAllocator(originalNewAllocator); + if (originalNewArrayAllocator) setCurrentNewArrayAllocator(originalNewArrayAllocator); +} + TestMemoryAllocator::TestMemoryAllocator(const char* name_str, const char* alloc_name_str, const char* free_name_str) : name_(name_str), alloc_name_(alloc_name_str), free_name_(free_name_str), hasBeenDestroyed_(false) { @@ -137,43 +156,92 @@ void TestMemoryAllocator::freeMemoryLeakNode(char* memory) { - free_memory(memory, "MemoryLeakNode", 1); + free_memory(memory, 0, "MemoryLeakNode", 1); } -char* TestMemoryAllocator::alloc_memory(size_t size, const char*, int) +char* TestMemoryAllocator::alloc_memory(size_t size, const char*, size_t) { return checkedMalloc(size); } -void TestMemoryAllocator::free_memory(char* memory, const char*, int) +void TestMemoryAllocator::free_memory(char* memory, size_t, const char*, size_t) { PlatformSpecificFree(memory); } -const char* TestMemoryAllocator::name() + +const char* TestMemoryAllocator::name() const { return name_; } -const char* TestMemoryAllocator::alloc_name() +const char* TestMemoryAllocator::alloc_name() const { return alloc_name_; } -const char* TestMemoryAllocator::free_name() +const char* TestMemoryAllocator::free_name() const { return free_name_; } +TestMemoryAllocator* TestMemoryAllocator::actualAllocator() +{ + return this; +} + +MemoryLeakAllocator::MemoryLeakAllocator(TestMemoryAllocator* originalAllocator) + : originalAllocator_(originalAllocator) +{ +} + +MemoryLeakAllocator::~MemoryLeakAllocator() +{ +} + +char* MemoryLeakAllocator::alloc_memory(size_t size, const char* file, size_t line) +{ + return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(originalAllocator_, size, file, line); +} + +void MemoryLeakAllocator::free_memory(char* memory, size_t, const char* file, size_t line) +{ + MemoryLeakWarningPlugin::getGlobalDetector()->deallocMemory(originalAllocator_, memory, file, line); +} + +const char* MemoryLeakAllocator::name() const +{ + return "MemoryLeakAllocator"; +} + +const char* MemoryLeakAllocator::alloc_name() const +{ + return originalAllocator_->alloc_name(); +} + +const char* MemoryLeakAllocator::free_name() const +{ + return originalAllocator_->free_name(); +} + +TestMemoryAllocator* MemoryLeakAllocator::actualAllocator() +{ + return originalAllocator_->actualAllocator(); +} + CrashOnAllocationAllocator::CrashOnAllocationAllocator() : allocationToCrashOn_(0) { } +CrashOnAllocationAllocator::~CrashOnAllocationAllocator() +{ +} + void CrashOnAllocationAllocator::setNumberToCrashOn(unsigned allocationToCrashOn) { allocationToCrashOn_ = allocationToCrashOn; } -char* CrashOnAllocationAllocator::alloc_memory(size_t size, const char* file, int line) +char* CrashOnAllocationAllocator::alloc_memory(size_t size, const char* file, size_t line) { if (MemoryLeakWarningPlugin::getGlobalDetector()->getCurrentAllocationNumber() == allocationToCrashOn_) UT_CRASH(); @@ -182,12 +250,16 @@ } -char* NullUnknownAllocator::alloc_memory(size_t /*size*/, const char*, int) +NullUnknownAllocator::~NullUnknownAllocator() { - return 0; } -void NullUnknownAllocator::free_memory(char* /*memory*/, const char*, int) +char* NullUnknownAllocator::alloc_memory(size_t /*size*/, const char*, size_t) +{ + return NULLPTR; +} + +void NullUnknownAllocator::free_memory(char* /*memory*/, size_t, const char*, size_t) { } @@ -209,7 +281,7 @@ int allocNumberToFail_; int actualAllocNumber_; const char* file_; - int line_; + size_t line_; LocationToFailAllocNode* next_; void failAtAllocNumber(int number, LocationToFailAllocNode* next) @@ -218,7 +290,7 @@ allocNumberToFail_ = number; } - void failNthAllocAt(int allocationNumber, const char* file, int line, LocationToFailAllocNode* next) + void failNthAllocAt(int allocationNumber, const char* file, size_t line, LocationToFailAllocNode* next) { init(next); allocNumberToFail_ = allocationNumber; @@ -226,7 +298,7 @@ line_ = line; } - bool shouldFail(int allocationNumber, const char* file, int line) + bool shouldFail(int allocationNumber, const char* file, size_t line) { if (file_ && SimpleString::StrCmp(file, file_) == 0 && line == line_) { actualAllocNumber_++; @@ -238,19 +310,23 @@ } private: - void init(LocationToFailAllocNode* next = NULL) + void init(LocationToFailAllocNode* next = NULLPTR) { allocNumberToFail_ = 0; actualAllocNumber_ = 0; - file_ = NULL; + file_ = NULLPTR; line_ = 0; next_ = next; } }; +FailableMemoryAllocator::~FailableMemoryAllocator() +{ +} + FailableMemoryAllocator::FailableMemoryAllocator(const char* name_str, const char* alloc_name_str, const char* free_name_str) -: TestMemoryAllocator(name_str, alloc_name_str, free_name_str), head_(NULL), currentAllocNumber_(0) +: TestMemoryAllocator(name_str, alloc_name_str, free_name_str), head_(NULLPTR), currentAllocNumber_(0) { } @@ -261,26 +337,26 @@ head_ = newNode; } -void FailableMemoryAllocator::failNthAllocAt(int allocationNumber, const char* file, int line) +void FailableMemoryAllocator::failNthAllocAt(int allocationNumber, const char* file, size_t line) { LocationToFailAllocNode* newNode = (LocationToFailAllocNode*) (void*) allocMemoryLeakNode(sizeof(LocationToFailAllocNode)); newNode->failNthAllocAt(allocationNumber, file, line, head_); head_ = newNode; } -char* FailableMemoryAllocator::alloc_memory(size_t size, const char* file, int line) +char* FailableMemoryAllocator::alloc_memory(size_t size, const char* file, size_t line) { currentAllocNumber_++; LocationToFailAllocNode* current = head_; - LocationToFailAllocNode* previous = NULL; + LocationToFailAllocNode* previous = NULLPTR; while (current) { if (current->shouldFail(currentAllocNumber_, file, line)) { if (previous) previous->next_ = current->next_; else head_ = current->next_; - free_memory((char*) current, __FILE__, __LINE__); - return NULL; + free_memory((char*) current, size, __FILE__, __LINE__); + return NULLPTR; } previous = current; current = current->next_; @@ -295,17 +371,16 @@ void FailableMemoryAllocator::checkAllFailedAllocsWereDone() { - if (head_) { - UtestShell* currentTest = UtestShell::getCurrent(); - SimpleString failText; - if (head_->file_) - failText = StringFromFormat("Expected failing alloc at %s:%d was never done", head_->file_, head_->line_); - else - failText = StringFromFormat("Expected allocation number %d was never done", head_->allocNumberToFail_); + if (head_) { + UtestShell* currentTest = UtestShell::getCurrent(); + SimpleString failText; + if (head_->file_) + failText = StringFromFormat("Expected failing alloc at %s:%d was never done", head_->file_, (int) head_->line_); + else + failText = StringFromFormat("Expected allocation number %d was never done", (int) head_->allocNumberToFail_); - currentTest->failWith(FailFailure(currentTest, currentTest->getName().asCharString(), - currentTest->getLineNumber(), failText), TestTerminatorWithoutExceptions()); - } + currentTest->failWith(FailFailure(currentTest, currentTest->getName().asCharString(), currentTest->getLineNumber(), failText)); + } } void FailableMemoryAllocator::clearFailedAllocs() @@ -313,9 +388,405 @@ LocationToFailAllocNode* current = head_; while (current) { head_ = current->next_; - free_memory((char*) current, __FILE__, __LINE__); + free_memory((char*) current, 0, __FILE__, __LINE__); current = head_; } currentAllocNumber_ = 0; } +struct MemoryAccountantAllocationNode +{ + size_t size_; + size_t allocations_; + size_t deallocations_; + size_t maxAllocations_; + size_t currentAllocations_; + MemoryAccountantAllocationNode* next_; +}; + +MemoryAccountantAllocationNode* MemoryAccountant::createNewAccountantAllocationNode(size_t size, MemoryAccountantAllocationNode* next) const +{ + MemoryAccountantAllocationNode* node = (MemoryAccountantAllocationNode*) (void*) allocator_->alloc_memory(sizeof(MemoryAccountantAllocationNode), __FILE__, __LINE__); + node->size_ = size; + node->allocations_ = 0; + node->deallocations_ = 0; + node->maxAllocations_ = 0; + node->currentAllocations_ = 0; + node->next_ = next; + return node; +} + +void MemoryAccountant::destroyAccountantAllocationNode(MemoryAccountantAllocationNode* node) const +{ + allocator_->free_memory((char*) node, sizeof(node), __FILE__, __LINE__); +} + +MemoryAccountant::MemoryAccountant() + : head_(NULLPTR), allocator_(defaultMallocAllocator()), useCacheSizes_(false) +{ +} + +MemoryAccountant::~MemoryAccountant() +{ + clear(); +} + +void MemoryAccountant::createCacheSizeNodes(size_t sizes[], size_t length) +{ + for (size_t i = 0; i < length; i++) + findOrCreateNodeOfSize(sizes[i]); + + if (head_ == NULLPTR) + head_ = createNewAccountantAllocationNode(0, NULLPTR); + else { + for (MemoryAccountantAllocationNode* lastNode = head_; lastNode; lastNode = lastNode->next_) { + if (lastNode->next_ == NULLPTR) { + lastNode->next_ = createNewAccountantAllocationNode(0, NULLPTR); + break; + } + } + } +} + + +void MemoryAccountant::useCacheSizes(size_t sizes[], size_t length) +{ + if (head_) + FAIL("MemoryAccountant: Cannot set cache sizes as allocations already occured!"); + + createCacheSizeNodes(sizes, length); + useCacheSizes_ = true; +} + +void MemoryAccountant::setAllocator(TestMemoryAllocator* allocator) +{ + allocator_ = allocator; +} + +void MemoryAccountant::clear() +{ + MemoryAccountantAllocationNode* node = head_; + MemoryAccountantAllocationNode* to_be_deleted = NULLPTR; + while (node) { + to_be_deleted = node; + node = node->next_; + destroyAccountantAllocationNode(to_be_deleted); + } + head_ = NULLPTR; +} + +MemoryAccountantAllocationNode* MemoryAccountant::findNodeOfSize(size_t size) const +{ + if (useCacheSizes_) { + for (MemoryAccountantAllocationNode* node = head_; node; node = node->next_) { + if (size > node->size_ && node->next_ == NULLPTR) + return node; + else if (size <= node->size_ && !(node->next_->size_ != 0 && node->next_->size_ <= size)) + return node; + } + } + else + for (MemoryAccountantAllocationNode* node = head_; node; node = node->next_) + if (node->size_ == size) + return node; + return NULLPTR; +} + +MemoryAccountantAllocationNode* MemoryAccountant::findOrCreateNodeOfSize(size_t size) +{ + if (useCacheSizes_) + return findNodeOfSize(size); + + if (head_ && head_->size_ > size) + head_ = createNewAccountantAllocationNode(size, head_); + + for (MemoryAccountantAllocationNode* node = head_; node; node = node->next_) { + if (node->size_ == size) + return node; + if (node->next_ == NULLPTR || node->next_->size_ > size) + node->next_ = createNewAccountantAllocationNode(size, node->next_); + } + head_ = createNewAccountantAllocationNode(size, head_); + return head_; +} + +void MemoryAccountant::alloc(size_t size) +{ + MemoryAccountantAllocationNode* node = findOrCreateNodeOfSize(size); + node->allocations_++; + node->currentAllocations_++; + node->maxAllocations_ = (node->currentAllocations_ > node->maxAllocations_) ? node->currentAllocations_ : node->maxAllocations_; +} + +void MemoryAccountant::dealloc(size_t size) +{ + MemoryAccountantAllocationNode* node = findOrCreateNodeOfSize(size); + node->deallocations_++; + if (node->currentAllocations_) + node->currentAllocations_--; +} + +size_t MemoryAccountant::totalAllocationsOfSize(size_t size) const +{ + MemoryAccountantAllocationNode* node = findNodeOfSize(size); + if (node) + return node->allocations_; + return 0; +} + +size_t MemoryAccountant::totalDeallocationsOfSize(size_t size) const +{ + MemoryAccountantAllocationNode* node = findNodeOfSize(size); + if (node) + return node->deallocations_; + return 0; +} + +size_t MemoryAccountant::maximumAllocationAtATimeOfSize(size_t size) const +{ + MemoryAccountantAllocationNode* node = findNodeOfSize(size); + if (node) + return node->maxAllocations_; + return 0; +} + +size_t MemoryAccountant::totalAllocations() const +{ + size_t theTotalAllocations = 0; + + for (MemoryAccountantAllocationNode* node = head_; node; node = node->next_) + theTotalAllocations += node->allocations_; + + return theTotalAllocations; +} + +size_t MemoryAccountant::totalDeallocations() const +{ + size_t theTotalDeallocations = 0; + + for (MemoryAccountantAllocationNode* node = head_; node; node = node->next_) + theTotalDeallocations += node->deallocations_; + + return theTotalDeallocations; +} + +SimpleString MemoryAccountant::reportNoAllocations() const +{ + return SimpleString("CppUTest Memory Accountant has not noticed any allocations or deallocations. Sorry\n"); +} + +SimpleString MemoryAccountant::reportTitle() const +{ + if (useCacheSizes_) + return "CppUTest Memory Accountant report (with cache sizes):\n"; + return "CppUTest Memory Accountant report:\n"; +} + +SimpleString MemoryAccountant::reportHeader() const +{ + if (useCacheSizes_) + return "Cache size # allocations # deallocations max # allocations at one time\n"; + return "Allocation size # allocations # deallocations max # allocations at one time\n"; +} + +#define MEMORY_ACCOUNTANT_ROW_FORMAT "%s %5d %5d %5d\n" + +SimpleString MemoryAccountant::reportFooter() const +{ + return SimpleString(" Thank you for your business\n"); +} + +SimpleString MemoryAccountant::stringSize(size_t size) const +{ + return (size == 0) ? "other" : StringFromFormat("%5d", (int) size); +} + +SimpleString MemoryAccountant::report() const +{ + if (head_ == NULLPTR) + return reportNoAllocations(); + + SimpleString accountantReport = reportTitle() + reportHeader(); + + for (MemoryAccountantAllocationNode* node = head_; node; node = node->next_) + accountantReport += StringFromFormat(MEMORY_ACCOUNTANT_ROW_FORMAT, stringSize(node->size_).asCharString(), (int) node->allocations_, (int) node->deallocations_, (int) node->maxAllocations_); + + return accountantReport + reportFooter(); +} + +AccountingTestMemoryAllocator::AccountingTestMemoryAllocator(MemoryAccountant& accountant, TestMemoryAllocator* origAllocator) + : accountant_(accountant), originalAllocator_(origAllocator), head_(NULLPTR) +{ +} + +AccountingTestMemoryAllocator::~AccountingTestMemoryAllocator() +{ +} + +struct AccountingTestMemoryAllocatorMemoryNode +{ + char* memory_; + size_t size_; + AccountingTestMemoryAllocatorMemoryNode* next_; +}; + +void AccountingTestMemoryAllocator::addMemoryToMemoryTrackingToKeepTrackOfSize(char* memory, size_t size) +{ + AccountingTestMemoryAllocatorMemoryNode* node = (AccountingTestMemoryAllocatorMemoryNode*) (void*) originalAllocator_->alloc_memory(sizeof(AccountingTestMemoryAllocatorMemoryNode), __FILE__, __LINE__); + node->memory_ = memory; + node->size_ = size; + node->next_ = head_; + head_ = node; +} + +size_t AccountingTestMemoryAllocator::removeNextNodeAndReturnSize(AccountingTestMemoryAllocatorMemoryNode* node) +{ + AccountingTestMemoryAllocatorMemoryNode* foundNode = node->next_; + node->next_ = node->next_->next_; + + size_t size = foundNode->size_; + originalAllocator_->free_memory((char*) foundNode, size, __FILE__, __LINE__); + return size; +} + +size_t AccountingTestMemoryAllocator::removeHeadAndReturnSize() +{ + AccountingTestMemoryAllocatorMemoryNode* foundNode = head_; + head_ = head_->next_; + + size_t size = foundNode->size_; + originalAllocator_->free_memory((char*) foundNode, size, __FILE__, __LINE__); + return size; +} + +size_t AccountingTestMemoryAllocator::removeMemoryFromTrackingAndReturnAllocatedSize(char* memory) +{ + if (head_ && head_->memory_ == memory) + return removeHeadAndReturnSize(); + + for (AccountingTestMemoryAllocatorMemoryNode* node = head_; node; node = node->next_) { + if (node->next_ && node->next_->memory_ == memory) + return removeNextNodeAndReturnSize(node); + } + + return 0; +} + +char* AccountingTestMemoryAllocator::alloc_memory(size_t size, const char* file, size_t line) +{ + accountant_.alloc(size); + char* memory = originalAllocator_->alloc_memory(size, file, line); + addMemoryToMemoryTrackingToKeepTrackOfSize(memory, size); + return memory; +} + +void AccountingTestMemoryAllocator::free_memory(char* memory, size_t, const char* file, size_t line) +{ + size_t size = removeMemoryFromTrackingAndReturnAllocatedSize(memory); + accountant_.dealloc(size); + originalAllocator_->free_memory(memory, size, file, line); +} + +TestMemoryAllocator* AccountingTestMemoryAllocator::actualAllocator() +{ + return originalAllocator_->actualAllocator(); +} + +TestMemoryAllocator* AccountingTestMemoryAllocator::originalAllocator() +{ + return originalAllocator_; +} + +const char* AccountingTestMemoryAllocator::alloc_name() const +{ + return originalAllocator_->alloc_name(); +} + +const char* AccountingTestMemoryAllocator::free_name() const +{ + return originalAllocator_->free_name(); +} + +GlobalMemoryAccountant::GlobalMemoryAccountant() + : mallocAllocator_(NULLPTR), newAllocator_(NULLPTR), newArrayAllocator_(NULLPTR) +{ +} + +GlobalMemoryAccountant::~GlobalMemoryAccountant() +{ + restoreMemoryAllocators(); + delete mallocAllocator_; + delete newAllocator_; + delete newArrayAllocator_; +} + +void GlobalMemoryAccountant::useCacheSizes(size_t sizes[], size_t length) +{ + accountant_.useCacheSizes(sizes, length); +} + +void GlobalMemoryAccountant::start() +{ + if (mallocAllocator_ != NULLPTR) + FAIL("Global allocator start called twice!"); + + mallocAllocator_ = new AccountingTestMemoryAllocator(accountant_, getCurrentMallocAllocator()); + newAllocator_ = new AccountingTestMemoryAllocator(accountant_, getCurrentNewAllocator()); + newArrayAllocator_ = new AccountingTestMemoryAllocator(accountant_, getCurrentNewArrayAllocator()); + + accountant_.setAllocator(getCurrentMallocAllocator()); + + setCurrentMallocAllocator(mallocAllocator_); + setCurrentNewAllocator(newAllocator_); + setCurrentNewArrayAllocator(newArrayAllocator_); +} + +void GlobalMemoryAccountant::restoreMemoryAllocators() +{ + if (getCurrentMallocAllocator() == mallocAllocator_) + setCurrentMallocAllocator(mallocAllocator_->originalAllocator()); + + if (getCurrentNewAllocator() == newAllocator_) + setCurrentNewAllocator(newAllocator_->originalAllocator()); + + if (getCurrentNewArrayAllocator() == newArrayAllocator_) + setCurrentNewArrayAllocator(newArrayAllocator_->originalAllocator()); +} + +void GlobalMemoryAccountant::stop() +{ + if (mallocAllocator_ == NULLPTR) + FAIL("GlobalMemoryAccount: Stop called without starting"); + + if (getCurrentMallocAllocator() != mallocAllocator_) + FAIL("GlobalMemoryAccountant: Malloc memory allocator has been changed while accounting for memory"); + + if (getCurrentNewAllocator() != newAllocator_) + FAIL("GlobalMemoryAccountant: New memory allocator has been changed while accounting for memory"); + + if (getCurrentNewArrayAllocator() != newArrayAllocator_) + FAIL("GlobalMemoryAccountant: New Array memory allocator has been changed while accounting for memory"); + + restoreMemoryAllocators(); +} + +SimpleString GlobalMemoryAccountant::report() +{ + return accountant_.report(); +} + +TestMemoryAllocator* GlobalMemoryAccountant::getMallocAllocator() +{ + return mallocAllocator_; +} + +TestMemoryAllocator* GlobalMemoryAccountant::getNewAllocator() +{ + return newAllocator_; +} + +TestMemoryAllocator* GlobalMemoryAccountant::getNewArrayAllocator() +{ + return newArrayAllocator_; +} + diff -Nru cpputest-3.8/src/CppUTest/TestOutput.cpp cpputest-4.0/src/CppUTest/TestOutput.cpp --- cpputest-3.8/src/CppUTest/TestOutput.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestOutput.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -24,7 +24,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include "CppUTest/TestHarness.h" #include "CppUTest/TestOutput.h" #include "CppUTest/PlatformSpecificFunctions.h" @@ -45,7 +44,7 @@ TestOutput::TestOutput() : - dotCount_(0), verbose_(false), color_(false), progressIndication_(".") + dotCount_(0), verbose_(level_quiet), color_(false), progressIndication_(".") { } @@ -53,9 +52,9 @@ { } -void TestOutput::verbose() +void TestOutput::verbose(VerbosityLevel level) { - verbose_ = true; + verbose_ = level; } void TestOutput::color() @@ -73,6 +72,11 @@ print(StringFrom(n).asCharString()); } +void TestOutput::print(size_t n) +{ + print(StringFrom(n).asCharString()); +} + void TestOutput::printDouble(double d) { print(StringFrom(d).asCharString()); @@ -92,7 +96,7 @@ void TestOutput::printCurrentTestStarted(const UtestShell& test) { - if (verbose_) print(test.getFormattedName().asCharString()); + if (verbose_ > level_quiet) print(test.getFormattedName().asCharString()); if (test.willRun()) { setProgressIndicator("."); @@ -104,7 +108,7 @@ void TestOutput::printCurrentTestEnded(const TestResult& res) { - if (verbose_) { + if (verbose_ > level_quiet) { print(" - "); print(res.getCurrentTestTotalExecutionTime()); print(" ms\n"); @@ -140,13 +144,20 @@ void TestOutput::printTestsEnded(const TestResult& result) { print("\n"); - if (result.getFailureCount() > 0) { + const bool isFailure = result.isFailure(); + const size_t failureCount = result.getFailureCount(); + if (isFailure) { if (color_) { print("\033[31;1m"); } print("Errors ("); - print(result.getFailureCount()); - print(" failures, "); + if (failureCount > 0) { + print(failureCount); + print(" failures, "); + } + else { + print("ran nothing, "); + } } else { if (color_) { @@ -169,10 +180,16 @@ if (color_) { print("\033[m"); } + if (isFailure && failureCount == 0) { + print("\nNote: test run failed because no tests were run or ignored. Assuming something went wrong. " + "This often happens because of linking errors or typos in test filter."); + } print("\n\n"); + + dotCount_ = 0; } -void TestOutput::printTestRun(int number, int total) +void TestOutput::printTestRun(size_t number, size_t total) { if (total > 1) { print("Test run "); @@ -220,7 +237,7 @@ print("\n\n"); } -void TestOutput::printErrorInFileOnLineFormattedForWorkingEnvironment(SimpleString file, int lineNumber) +void TestOutput::printErrorInFileOnLineFormattedForWorkingEnvironment(SimpleString file, size_t lineNumber) { if (TestOutput::getWorkingEnvironment() == TestOutput::visualStudio) printVisualStudioErrorInFileOnLine(file, lineNumber); @@ -228,7 +245,7 @@ printEclipseErrorInFileOnLine(file, lineNumber); } -void TestOutput::printEclipseErrorInFileOnLine(SimpleString file, int lineNumber) +void TestOutput::printEclipseErrorInFileOnLine(SimpleString file, size_t lineNumber) { print("\n"); print(file.asCharString()); @@ -238,7 +255,7 @@ print(" error:"); } -void TestOutput::printVisualStudioErrorInFileOnLine(SimpleString file, int lineNumber) +void TestOutput::printVisualStudioErrorInFileOnLine(SimpleString file, size_t lineNumber) { print("\n"); print(file.asCharString()); @@ -248,6 +265,13 @@ print(" error:"); } +void TestOutput::printVeryVerbose(const char* str) +{ + if(verbose_ == level_veryVerbose) + printBuffer(str); +} + + void ConsoleTestOutput::printBuffer(const char* s) { while (*s) { @@ -267,7 +291,7 @@ } CompositeTestOutput::CompositeTestOutput() - : outputOne_(NULL), outputTwo_(NULL) + : outputOne_(NULLPTR), outputTwo_(NULLPTR) { } @@ -325,10 +349,10 @@ if (outputTwo_) outputTwo_->printCurrentGroupEnded(res); } -void CompositeTestOutput::verbose() +void CompositeTestOutput::verbose(VerbosityLevel level) { - if (outputOne_) outputOne_->verbose(); - if (outputTwo_) outputTwo_->verbose(); + if (outputOne_) outputOne_->verbose(level); + if (outputTwo_) outputTwo_->verbose(level); } void CompositeTestOutput::color() @@ -353,6 +377,12 @@ { if (outputOne_) outputOne_->print(number); if (outputTwo_) outputTwo_->print(number); +} + +void CompositeTestOutput::print(size_t number) +{ + if (outputOne_) outputOne_->print(number); + if (outputTwo_) outputTwo_->print(number); } void CompositeTestOutput::printDouble(double number) diff -Nru cpputest-3.8/src/CppUTest/TestPlugin.cpp cpputest-4.0/src/CppUTest/TestPlugin.cpp --- cpputest-3.8/src/CppUTest/TestPlugin.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestPlugin.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -62,10 +62,10 @@ bool TestPlugin::parseAllArguments(int ac, char** av, int index) { - return parseAllArguments(ac, const_cast (av), index); + return parseAllArguments(ac, const_cast (av), index); } -bool TestPlugin::parseAllArguments(int ac, const char** av, int index) +bool TestPlugin::parseAllArguments(int ac, const char *const *av, int index) { if (parseArguments(ac, av, index)) return true; if (next_) return next_->parseAllArguments(ac, av, index); @@ -90,7 +90,7 @@ } TestPlugin* TestPlugin::removePluginByName(const SimpleString& name) { - TestPlugin* removed = 0; + TestPlugin* removed = NULLPTR; if (next_ && next_->getName() == name) { removed = next_; next_ = next_->next_; @@ -150,7 +150,7 @@ //////// NullPlugin NullTestPlugin::NullTestPlugin() : - TestPlugin(0) + TestPlugin(NULLPTR) { } diff -Nru cpputest-3.8/src/CppUTest/TestRegistry.cpp cpputest-4.0/src/CppUTest/TestRegistry.cpp --- cpputest-3.8/src/CppUTest/TestRegistry.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestRegistry.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -27,10 +27,10 @@ #include "CppUTest/TestHarness.h" #include "CppUTest/TestRegistry.h" +#include "CppUTest/PlatformSpecificFunctions.h" TestRegistry::TestRegistry() : - tests_(NULL), nameFilters_(NULL), groupFilters_(NULL), firstPlugin_(NullTestPlugin::instance()), runInSeperateProcess_(false), currentRepetition_(0), runIgnored_(false) - + tests_(NULLPTR), nameFilters_(NULLPTR), groupFilters_(NULLPTR), firstPlugin_(NullTestPlugin::instance()), runInSeperateProcess_(false), currentRepetition_(0), runIgnored_(false) { } @@ -48,7 +48,7 @@ bool groupStart = true; result.testsStarted(); - for (UtestShell *test = tests_; test != NULL; test = test->getNext()) { + for (UtestShell *test = tests_; test != NULLPTR; test = test->getNext()) { if (runInSeperateProcess_) test->setRunInSeperateProcess(); if (runIgnored_) test->setRunIgnored(); @@ -77,7 +77,7 @@ { SimpleString groupList; - for (UtestShell *test = tests_; test != NULL; test = test->getNext()) { + for (UtestShell *test = tests_; test != NULLPTR; test = test->getNext()) { SimpleString gname; gname += "#"; gname += test->getGroup(); @@ -100,7 +100,7 @@ { SimpleString groupAndNameList; - for (UtestShell *test = tests_; test != NULL; test = test->getNext()) { + for (UtestShell *test = tests_; test != NULLPTR; test = test->getNext()) { if (testShouldRun(test, result)) { SimpleString groupAndName; groupAndName += "#"; @@ -128,17 +128,17 @@ return (!test || !test->getNext() || test->getGroup() != test->getNext()->getGroup()); } -int TestRegistry::countTests() +size_t TestRegistry::countTests() { return tests_ ? tests_->countTests() : 0; } -TestRegistry* TestRegistry::currentRegistry_ = 0; +TestRegistry* TestRegistry::currentRegistry_ = NULLPTR; TestRegistry* TestRegistry::getCurrentRegistry() { static TestRegistry registry; - return (currentRegistry_ == 0) ? ®istry : currentRegistry_; + return (currentRegistry_ == NULLPTR) ? ®istry : currentRegistry_; } void TestRegistry::setCurrentRegistry(TestRegistry* registry) @@ -148,7 +148,7 @@ void TestRegistry::unDoLastAddTest() { - tests_ = tests_ ? tests_->getNext() : NULL; + tests_ = tests_ ? tests_->getNext() : NULLPTR; } @@ -227,6 +227,20 @@ return tests_; } +void TestRegistry::shuffleTests(size_t seed) +{ + UtestShellPointerArray array(getFirstTest()); + array.shuffle(seed); + tests_ = array.getFirstTest(); +} + +void TestRegistry::reverseTests() +{ + UtestShellPointerArray array(getFirstTest()); + array.reverse(); + tests_ = array.getFirstTest(); +} + UtestShell* TestRegistry::getTestWithNext(UtestShell* test) { UtestShell* current = tests_; @@ -243,7 +257,7 @@ return current; current = current->getNext(); } - return NULL; + return NULLPTR; } UtestShell* TestRegistry::findTestWithGroup(const SimpleString& group) @@ -254,6 +268,6 @@ return current; current = current->getNext(); } - return NULL; + return NULLPTR; } diff -Nru cpputest-3.8/src/CppUTest/TestResult.cpp cpputest-4.0/src/CppUTest/TestResult.cpp --- cpputest-3.8/src/CppUTest/TestResult.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestResult.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -44,19 +44,19 @@ void TestResult::currentGroupStarted(UtestShell* test) { output_.printCurrentGroupStarted(*test); - currentGroupTimeStarted_ = GetPlatformSpecificTimeInMillis(); + currentGroupTimeStarted_ = (size_t) GetPlatformSpecificTimeInMillis(); } void TestResult::currentGroupEnded(UtestShell* /*test*/) { - currentGroupTotalExecutionTime_ = GetPlatformSpecificTimeInMillis() - currentGroupTimeStarted_; + currentGroupTotalExecutionTime_ = (size_t) GetPlatformSpecificTimeInMillis() - currentGroupTimeStarted_; output_.printCurrentGroupEnded(*this); } void TestResult::currentTestStarted(UtestShell* test) { output_.printCurrentTestStarted(*test); - currentTestTimeStarted_ = GetPlatformSpecificTimeInMillis(); + currentTestTimeStarted_ = (size_t) GetPlatformSpecificTimeInMillis(); } void TestResult::print(const char* text) @@ -64,9 +64,14 @@ output_.print(text); } +void TestResult::printVeryVerbose(const char* text) +{ + output_.printVeryVerbose(text); +} + void TestResult::currentTestEnded(UtestShell* /*test*/) { - currentTestTotalExecutionTime_ = GetPlatformSpecificTimeInMillis() - currentTestTimeStarted_; + currentTestTotalExecutionTime_ = (size_t) GetPlatformSpecificTimeInMillis() - currentTestTimeStarted_; output_.printCurrentTestEnded(*this); } @@ -104,33 +109,33 @@ void TestResult::testsStarted() { - timeStarted_ = GetPlatformSpecificTimeInMillis(); + timeStarted_ = (size_t) GetPlatformSpecificTimeInMillis(); output_.printTestsStarted(); } void TestResult::testsEnded() { - long timeEnded = GetPlatformSpecificTimeInMillis(); + size_t timeEnded = (size_t) GetPlatformSpecificTimeInMillis(); totalExecutionTime_ = timeEnded - timeStarted_; output_.printTestsEnded(*this); } -long TestResult::getTotalExecutionTime() const +size_t TestResult::getTotalExecutionTime() const { return totalExecutionTime_; } -void TestResult::setTotalExecutionTime(long exTime) +void TestResult::setTotalExecutionTime(size_t exTime) { totalExecutionTime_ = exTime; } -long TestResult::getCurrentTestTotalExecutionTime() const +size_t TestResult::getCurrentTestTotalExecutionTime() const { return currentTestTotalExecutionTime_; } -long TestResult::getCurrentGroupTotalExecutionTime() const +size_t TestResult::getCurrentGroupTotalExecutionTime() const { return currentGroupTotalExecutionTime_; } diff -Nru cpputest-3.8/src/CppUTest/TestTestingFixture.cpp cpputest-4.0/src/CppUTest/TestTestingFixture.cpp --- cpputest-3.8/src/CppUTest/TestTestingFixture.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTest/TestTestingFixture.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,19 +30,165 @@ bool TestTestingFixture::lineOfCodeExecutedAfterCheck = false; +TestTestingFixture::TestTestingFixture() +{ + output_ = new StringBufferTestOutput(); + result_ = new TestResult(*output_); + genTest_ = new ExecFunctionTestShell(); + registry_ = new TestRegistry(); + ownsExecFunction_ = false; + + registry_->setCurrentRegistry(registry_); + registry_->addTest(genTest_); + + lineOfCodeExecutedAfterCheck = false; +} + +void TestTestingFixture::flushOutputAndResetResult() +{ + output_->flush(); + delete result_; + result_ = new TestResult(*output_); +} + +TestTestingFixture::~TestTestingFixture() +{ + registry_->setCurrentRegistry(NULLPTR); + clearExecFunction(); + delete registry_; + delete result_; + delete output_; + delete genTest_; +} + +void TestTestingFixture::clearExecFunction() +{ + if (genTest_->testFunction_ && ownsExecFunction_) + delete genTest_->testFunction_; +} + +void TestTestingFixture::addTest(UtestShell * test) +{ + registry_->addTest(test); +} + +void TestTestingFixture::setTestFunction(void(*testFunction)()) +{ + clearExecFunction(); + + genTest_->testFunction_ = new ExecFunctionWithoutParameters(testFunction); + ownsExecFunction_ = true; +} + +void TestTestingFixture::setTestFunction(ExecFunction* testFunction) +{ + clearExecFunction(); + + genTest_->testFunction_ = testFunction; + + ownsExecFunction_ = false; +} + +void TestTestingFixture::setSetup(void(*setupFunction)()) +{ + genTest_->setup_ = setupFunction; +} + +void TestTestingFixture::setTeardown(void(*teardownFunction)()) +{ + genTest_->teardown_ = teardownFunction; +} + +void TestTestingFixture::installPlugin(TestPlugin* plugin) +{ + registry_->installPlugin(plugin); +} + +void TestTestingFixture::setRunTestsInSeperateProcess() +{ + registry_->setRunTestsInSeperateProcess(); +} + +void TestTestingFixture::setOutputVerbose() +{ + output_->verbose(TestOutput::level_verbose); +} + +void TestTestingFixture::runTestWithMethod(void(*method)()) +{ + setTestFunction(method); + runAllTests(); +} + +void TestTestingFixture::runAllTests() +{ + registry_->runAllTests(*result_); +} + +size_t TestTestingFixture::getFailureCount() +{ + return result_->getFailureCount(); +} + +size_t TestTestingFixture::getCheckCount() +{ + return result_->getCheckCount(); +} + +size_t TestTestingFixture::getTestCount() +{ + return result_->getTestCount(); +} + +size_t TestTestingFixture::getIgnoreCount() +{ + return result_->getIgnoredCount(); +} + +TestRegistry* TestTestingFixture::getRegistry() +{ + return registry_; +} + +bool TestTestingFixture::hasTestFailed() +{ + return genTest_->hasFailed(); +} + +void TestTestingFixture::assertPrintContains(const SimpleString& contains) +{ + STRCMP_CONTAINS(contains.asCharString(), getOutput().asCharString()); +} + +void TestTestingFixture::assertPrintContainsNot(const SimpleString& contains) +{ + CHECK(! getOutput().contains(contains)); +} + + +const SimpleString& TestTestingFixture::getOutput() +{ + return output_->getOutput(); +} + +size_t TestTestingFixture::getRunCount() +{ + return result_->getRunCount(); +} + void TestTestingFixture::lineExecutedAfterCheck() { - lineOfCodeExecutedAfterCheck = true; + lineOfCodeExecutedAfterCheck = true; } -void TestTestingFixture::checkTestFailsWithProperTestLocation(const char* text, const char* file, int line) +void TestTestingFixture::checkTestFailsWithProperTestLocation(const char* text, const char* file, size_t line) { - if (getFailureCount() != 1) - FAIL_LOCATION(StringFromFormat("Expected one test failure, but got %d amount of test failures", getFailureCount()).asCharString(), file, line); + if (getFailureCount() != 1) + FAIL_LOCATION(StringFromFormat("Expected one test failure, but got %d amount of test failures", (int) getFailureCount()).asCharString(), file, line); - STRCMP_CONTAINS_LOCATION(text, output_->getOutput().asCharString(), "", file, line); + STRCMP_CONTAINS_LOCATION(text, output_->getOutput().asCharString(), "", file, line); - if (lineOfCodeExecutedAfterCheck) - FAIL_LOCATION("The test should jump/throw on failure and not execute the next line. However, the next line was executed.", file, line) + if (lineOfCodeExecutedAfterCheck) + FAIL_LOCATION("The test should jump/throw on failure and not execute the next line. However, the next line was executed.", file, line); } diff -Nru cpputest-3.8/src/CppUTest/Utest.cpp cpputest-4.0/src/CppUTest/Utest.cpp --- cpputest-3.8/src/CppUTest/Utest.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTest/Utest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -55,7 +55,7 @@ { return defaultTestResult; } - virtual ~OutsideTestRunnerUTest() + virtual ~OutsideTestRunnerUTest() _destructor_override { } private: @@ -132,16 +132,16 @@ /******************************** */ UtestShell::UtestShell() : - group_("UndefinedTestGroup"), name_("UndefinedTest"), file_("UndefinedFile"), lineNumber_(0), next_(NULL), isRunAsSeperateProcess_(false), hasFailed_(false) + group_("UndefinedTestGroup"), name_("UndefinedTest"), file_("UndefinedFile"), lineNumber_(0), next_(NULLPTR), isRunAsSeperateProcess_(false), hasFailed_(false) { } -UtestShell::UtestShell(const char* groupName, const char* testName, const char* fileName, int lineNumber) : - group_(groupName), name_(testName), file_(fileName), lineNumber_(lineNumber), next_(NULL), isRunAsSeperateProcess_(false), hasFailed_(false) +UtestShell::UtestShell(const char* groupName, const char* testName, const char* fileName, size_t lineNumber) : + group_(groupName), name_(testName), file_(fileName), lineNumber_(lineNumber), next_(NULLPTR), isRunAsSeperateProcess_(false), hasFailed_(false) { } -UtestShell::UtestShell(const char* groupName, const char* testName, const char* fileName, int lineNumber, UtestShell* nextTest) : +UtestShell::UtestShell(const char* groupName, const char* testName, const char* fileName, size_t lineNumber, UtestShell* nextTest) : group_(groupName), name_(testName), file_(fileName), lineNumber_(lineNumber), next_(nextTest), isRunAsSeperateProcess_(false), hasFailed_(false) { } @@ -153,7 +153,7 @@ // LCOV_EXCL_START - actually covered but not in .gcno due to race condition static void defaultCrashMethod() { - UtestShell* ptr = (UtestShell*) 0x0; ptr->countTests(); + UtestShell* ptr = (UtestShell*) NULLPTR; ptr->countTests(); } // LCOV_EXCL_STOP @@ -177,6 +177,7 @@ void UtestShell::runOneTest(TestPlugin* plugin, TestResult& result) { hasFailed_ = false; + result.countRun(); HelperTestRunInfo runInfo(this, plugin, &result); if (isRunInSeperateProcess()) PlatformSpecificSetJmp(helperDoRunOneTestSeperateProcess, &runInfo); @@ -196,24 +197,35 @@ void UtestShell::runOneTestInCurrentProcess(TestPlugin* plugin, TestResult& result) { + result.printVeryVerbose("\n-- before runAllPreTestAction: "); plugin->runAllPreTestAction(*this, result); + result.printVeryVerbose("\n-- after runAllPreTestAction: "); //save test context, so that test class can be tested UtestShell* savedTest = UtestShell::getCurrent(); TestResult* savedResult = UtestShell::getTestResult(); - result.countRun(); UtestShell::setTestResult(&result); UtestShell::setCurrentTest(this); + result.printVeryVerbose("\n---- before createTest: "); Utest* testToRun = createTest(); + result.printVeryVerbose("\n---- after createTest: "); + + result.printVeryVerbose("\n------ before runTest: "); testToRun->run(); - destroyTest(testToRun); + result.printVeryVerbose("\n------ after runTest: "); UtestShell::setCurrentTest(savedTest); UtestShell::setTestResult(savedResult); + result.printVeryVerbose("\n---- before destroyTest: "); + destroyTest(testToRun); + result.printVeryVerbose("\n---- after destroyTest: "); + + result.printVeryVerbose("\n-- before runAllPostTestAction: "); plugin->runAllPostTestAction(*this, result); + result.printVeryVerbose("\n-- after runAllPostTestAction: "); } UtestShell *UtestShell::getNext() const @@ -227,7 +239,7 @@ return this; } -int UtestShell::countTests() +size_t UtestShell::countTests() { return next_ ? next_->countTests() + 1 : 1; } @@ -295,7 +307,7 @@ file_ = fileName; } -void UtestShell::setLineNumber(int lineNumber) +void UtestShell::setLineNumber(size_t lineNumber) { lineNumber_ = lineNumber; } @@ -315,16 +327,16 @@ return SimpleString(file_); } -int UtestShell::getLineNumber() const +size_t UtestShell::getLineNumber() const { return lineNumber_; } bool UtestShell::match(const char* target, const TestFilter* filters) const { - if(filters == NULL) return true; + if(filters == NULLPTR) return true; - for(; filters != NULL; filters = filters->getNext()) + for(; filters != NULLPTR; filters = filters->getNext()) if(filters->match(target)) return true; return false; @@ -352,84 +364,84 @@ terminator.exitCurrentTest(); } // LCOV_EXCL_LINE -void UtestShell::assertTrue(bool condition, const char *checkString, const char *conditionString, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertTrue(bool condition, const char *checkString, const char *conditionString, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if (!condition) failWith(CheckFailure(this, fileName, lineNumber, checkString, conditionString, text), testTerminator); } -void UtestShell::fail(const char *text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::fail(const char *text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); failWith(FailFailure(this, fileName, lineNumber, text), testTerminator); } // LCOV_EXCL_LINE -void UtestShell::assertCstrEqual(const char* expected, const char* actual, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertCstrEqual(const char* expected, const char* actual, const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); - if (actual == 0 && expected == 0) return; - if (actual == 0 || expected == 0) + if (actual == NULLPTR && expected == NULLPTR) return; + if (actual == NULLPTR || expected == NULLPTR) failWith(StringEqualFailure(this, fileName, lineNumber, expected, actual, text), testTerminator); if (SimpleString::StrCmp(expected, actual) != 0) failWith(StringEqualFailure(this, fileName, lineNumber, expected, actual, text), testTerminator); } -void UtestShell::assertCstrNEqual(const char* expected, const char* actual, size_t length, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertCstrNEqual(const char* expected, const char* actual, size_t length, const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); - if (actual == 0 && expected == 0) return; - if (actual == 0 || expected == 0) + if (actual == NULLPTR && expected == NULLPTR) return; + if (actual == NULLPTR || expected == NULLPTR) failWith(StringEqualFailure(this, fileName, lineNumber, expected, actual, text), testTerminator); if (SimpleString::StrNCmp(expected, actual, length) != 0) failWith(StringEqualFailure(this, fileName, lineNumber, expected, actual, text), testTerminator); } -void UtestShell::assertCstrNoCaseEqual(const char* expected, const char* actual, const char* text, const char* fileName, int lineNumber) +void UtestShell::assertCstrNoCaseEqual(const char* expected, const char* actual, const char* text, const char* fileName, size_t lineNumber) { getTestResult()->countCheck(); - if (actual == 0 && expected == 0) return; - if (actual == 0 || expected == 0) + if (actual == NULLPTR && expected == NULLPTR) return; + if (actual == NULLPTR || expected == NULLPTR) failWith(StringEqualNoCaseFailure(this, fileName, lineNumber, expected, actual, text)); if (!SimpleString(expected).equalsNoCase(actual)) failWith(StringEqualNoCaseFailure(this, fileName, lineNumber, expected, actual, text)); } -void UtestShell::assertCstrContains(const char* expected, const char* actual, const char* text, const char* fileName, int lineNumber) +void UtestShell::assertCstrContains(const char* expected, const char* actual, const char* text, const char* fileName, size_t lineNumber) { getTestResult()->countCheck(); - if (actual == 0 && expected == 0) return; - if(actual == 0 || expected == 0) + if (actual == NULLPTR && expected == NULLPTR) return; + if (actual == NULLPTR || expected == NULLPTR) failWith(ContainsFailure(this, fileName, lineNumber, expected, actual, text)); if (!SimpleString(actual).contains(expected)) failWith(ContainsFailure(this, fileName, lineNumber, expected, actual, text)); } -void UtestShell::assertCstrNoCaseContains(const char* expected, const char* actual, const char* text, const char* fileName, int lineNumber) +void UtestShell::assertCstrNoCaseContains(const char* expected, const char* actual, const char* text, const char* fileName, size_t lineNumber) { getTestResult()->countCheck(); - if (actual == 0 && expected == 0) return; - if(actual == 0 || expected == 0) + if (actual == NULLPTR && expected == NULLPTR) return; + if (actual == NULLPTR || expected == NULLPTR) failWith(ContainsFailure(this, fileName, lineNumber, expected, actual, text)); if (!SimpleString(actual).containsNoCase(expected)) failWith(ContainsFailure(this, fileName, lineNumber, expected, actual, text)); } -void UtestShell::assertLongsEqual(long expected, long actual, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertLongsEqual(long expected, long actual, const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if (expected != actual) failWith(LongsEqualFailure (this, fileName, lineNumber, expected, actual, text), testTerminator); } -void UtestShell::assertUnsignedLongsEqual(unsigned long expected, unsigned long actual, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertUnsignedLongsEqual(unsigned long expected, unsigned long actual, const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if (expected != actual) failWith(UnsignedLongsEqualFailure (this, fileName, lineNumber, expected, actual, text), testTerminator); } -void UtestShell::assertLongLongsEqual(cpputest_longlong expected, cpputest_longlong actual, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertLongLongsEqual(cpputest_longlong expected, cpputest_longlong actual, const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); #ifdef CPPUTEST_USE_LONG_LONG @@ -442,7 +454,7 @@ #endif } -void UtestShell::assertUnsignedLongLongsEqual(cpputest_ulonglong expected, cpputest_ulonglong actual, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertUnsignedLongLongsEqual(cpputest_ulonglong expected, cpputest_ulonglong actual, const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); #ifdef CPPUTEST_USE_LONG_LONG @@ -455,60 +467,67 @@ #endif } -void UtestShell::assertSignedBytesEqual(signed char expected, signed char actual, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertSignedBytesEqual(signed char expected, signed char actual, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if (expected != actual) failWith(SignedBytesEqualFailure (this, fileName, lineNumber, expected, actual, text), testTerminator); } -void UtestShell::assertPointersEqual(const void* expected, const void* actual, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertPointersEqual(const void* expected, const void* actual, const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if (expected != actual) failWith(EqualsFailure(this, fileName, lineNumber, StringFrom(expected), StringFrom(actual), text), testTerminator); } -void UtestShell::assertFunctionPointersEqual(void (*expected)(), void (*actual)(), const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertFunctionPointersEqual(void (*expected)(), void (*actual)(), const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if (expected != actual) failWith(EqualsFailure(this, fileName, lineNumber, StringFrom(expected), StringFrom(actual), text), testTerminator); } -void UtestShell::assertDoublesEqual(double expected, double actual, double threshold, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertDoublesEqual(double expected, double actual, double threshold, const char* text, const char* fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if (!doubles_equal(expected, actual, threshold)) failWith(DoublesEqualFailure(this, fileName, lineNumber, expected, actual, threshold, text), testTerminator); } -void UtestShell::assertBinaryEqual(const void *expected, const void *actual, size_t length, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertBinaryEqual(const void *expected, const void *actual, size_t length, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); - if (actual == 0 && expected == 0) return; - if (actual == 0 || expected == 0) + if (length == 0) return; + if (actual == NULLPTR && expected == NULLPTR) return; + if (actual == NULLPTR || expected == NULLPTR) failWith(BinaryEqualFailure(this, fileName, lineNumber, (const unsigned char *) expected, (const unsigned char *) actual, length, text), testTerminator); if (SimpleString::MemCmp(expected, actual, length) != 0) failWith(BinaryEqualFailure(this, fileName, lineNumber, (const unsigned char *) expected, (const unsigned char *) actual, length, text), testTerminator); } -void UtestShell::assertBitsEqual(unsigned long expected, unsigned long actual, unsigned long mask, size_t byteCount, const char* text, const char *fileName, int lineNumber, const TestTerminator& testTerminator) +void UtestShell::assertBitsEqual(unsigned long expected, unsigned long actual, unsigned long mask, size_t byteCount, const char* text, const char *fileName, size_t lineNumber, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if ((expected & mask) != (actual & mask)) failWith(BitsEqualFailure(this, fileName, lineNumber, expected, actual, mask, byteCount, text), testTerminator); } -void UtestShell::assertEquals(bool failed, const char* expected, const char* actual, const char* text, const char* file, int line, const TestTerminator& testTerminator) +void UtestShell::assertEquals(bool failed, const char* expected, const char* actual, const char* text, const char* file, size_t line, const TestTerminator& testTerminator) { getTestResult()->countCheck(); if (failed) failWith(CheckEqualFailure(this, file, line, expected, actual, text), testTerminator); } +void UtestShell::assertCompare(bool comparison, const char *checkString, const char *comparisonString, const char *text, const char *fileName, size_t lineNumber, const TestTerminator &testTerminator) +{ + getTestResult()->countCheck(); + if (!comparison) + failWith(ComparisonFailure(this, fileName, lineNumber, checkString, comparisonString, text), testTerminator); +} -void UtestShell::print(const char *text, const char* fileName, int lineNumber) +void UtestShell::print(const char *text, const char* fileName, size_t lineNumber) { SimpleString stringToPrint = "\n"; stringToPrint += fileName; @@ -519,13 +538,18 @@ getTestResult()->print(stringToPrint.asCharString()); } -void UtestShell::print(const SimpleString& text, const char* fileName, int lineNumber) +void UtestShell::print(const SimpleString& text, const char* fileName, size_t lineNumber) { print(text.asCharString(), fileName, lineNumber); } -TestResult* UtestShell::testResult_ = NULL; -UtestShell* UtestShell::currentTest_ = NULL; +void UtestShell::printVeryVerbose(const char* text) +{ + getTestResult()->printVeryVerbose(text); +} + +TestResult* UtestShell::testResult_ = NULLPTR; +UtestShell* UtestShell::currentTest_ = NULLPTR; void UtestShell::setTestResult(TestResult* result) { @@ -539,14 +563,14 @@ TestResult* UtestShell::getTestResult() { - if (testResult_ == NULL) + if (testResult_ == NULLPTR) return &OutsideTestRunnerUTest::instance().getTestResult(); return testResult_; } UtestShell* UtestShell::getCurrent() { - if (currentTest_ == NULL) + if (currentTest_ == NULLPTR) return &OutsideTestRunnerUTest::instance(); return currentTest_; } @@ -570,9 +594,17 @@ void Utest::run() { + UtestShell* current = UtestShell::getCurrent(); + int jumpResult = 0; try { - if (PlatformSpecificSetJmp(helperDoTestSetup, this)) { + current->printVeryVerbose("\n-------- before setup: "); + jumpResult = PlatformSpecificSetJmp(helperDoTestSetup, this); + current->printVeryVerbose("\n-------- after setup: "); + + if (jumpResult) { + current->printVeryVerbose("\n---------- before body: "); PlatformSpecificSetJmp(helperDoTestBody, this); + current->printVeryVerbose("\n---------- after body: "); } } catch (CppUTestFailedException&) @@ -581,7 +613,9 @@ } try { + current->printVeryVerbose("\n-------- before teardown: "); PlatformSpecificSetJmp(helperDoTestTeardown, this); + current->printVeryVerbose("\n-------- after teardown: "); } catch (CppUTestFailedException&) { @@ -642,6 +676,31 @@ { } +//////////////////// ExecFunction +// +ExecFunction::ExecFunction() +{ +} + +ExecFunction::~ExecFunction() +{ +} + +ExecFunctionWithoutParameters::ExecFunctionWithoutParameters(void(*testFunction)()) + : testFunction_(testFunction) +{ +} + +ExecFunctionWithoutParameters::~ExecFunctionWithoutParameters() +{ +} + +void ExecFunctionWithoutParameters::exec() +{ + if (testFunction_) + testFunction_(); +} + //////////////////// ExecFunctionTest ExecFunctionTest::ExecFunctionTest(ExecFunctionTestShell* shell) @@ -651,7 +710,7 @@ void ExecFunctionTest::testBody() { - if (shell_->testFunction_) shell_->testFunction_(); + if (shell_->testFunction_) shell_->testFunction_->exec(); } void ExecFunctionTest::setup() @@ -669,7 +728,7 @@ { } -IgnoredUtestShell::IgnoredUtestShell(const char* groupName, const char* testName, const char* fileName, int lineNumber) : +IgnoredUtestShell::IgnoredUtestShell(const char* groupName, const char* testName, const char* fileName, size_t lineNumber) : UtestShell(groupName, testName, fileName, lineNumber), runIgnored_(false) { } @@ -708,10 +767,89 @@ runIgnored_ = true; } +//////////////////// UtestShellPointerArray + +UtestShellPointerArray::UtestShellPointerArray(UtestShell* firstTest) + : arrayOfTests_(NULLPTR), count_(0) +{ + count_ = (firstTest) ? firstTest->countTests() : 0; + if (count_ == 0) return; + + arrayOfTests_ = new UtestShell*[count_]; + + UtestShell*currentTest = firstTest; + for (size_t i = 0; i < count_; i++) + { + arrayOfTests_[i] = currentTest; + currentTest = currentTest->getNext(); + } +} + +UtestShellPointerArray::~UtestShellPointerArray() +{ + delete [] arrayOfTests_; +} + +void UtestShellPointerArray::swap(size_t index1, size_t index2) +{ + UtestShell* e2 = arrayOfTests_[index2]; + UtestShell* e1 = arrayOfTests_[index1]; + arrayOfTests_[index1] = e2; + arrayOfTests_[index2] = e1; +} + +void UtestShellPointerArray::shuffle(size_t seed) +{ + if (count_ == 0) return; + + PlatformSpecificSrand((unsigned int) seed); + + for (size_t i = count_ - 1; i >= 1; --i) + { + if (count_ == 0) return; + + const size_t j = ((size_t)PlatformSpecificRand()) % (i + 1); // distribution biased by modulo, but good enough for shuffling + swap(i, j); + } + relinkTestsInOrder(); +} + +void UtestShellPointerArray::reverse() +{ + if (count_ == 0) return; + + size_t halfCount = count_ / 2; + for (size_t i = 0; i < halfCount; i++) + { + size_t j = count_ - i - 1; + swap(i, j); + } + relinkTestsInOrder(); +} + +void UtestShellPointerArray::relinkTestsInOrder() +{ + UtestShell *tests = NULLPTR; + for (size_t i = 0; i < count_; i++) + tests = arrayOfTests_[count_ - i - 1]->addTest(tests); +} + +UtestShell* UtestShellPointerArray::getFirstTest() const +{ + return get(0); +} + +UtestShell* UtestShellPointerArray::get(size_t index) const +{ + if (index >= count_) return NULLPTR; + return arrayOfTests_[index]; +} + + ////////////// TestInstaller //////////// -TestInstaller::TestInstaller(UtestShell& shell, const char* groupName, const char* testName, const char* fileName, int lineNumber) +TestInstaller::TestInstaller(UtestShell& shell, const char* groupName, const char* testName, const char* fileName, size_t lineNumber) { shell.setGroupName(groupName); shell.setTestName(testName); diff -Nru cpputest-3.8/src/CppUTestExt/CMakeLists.txt cpputest-4.0/src/CppUTestExt/CMakeLists.txt --- cpputest-3.8/src/CppUTestExt/CMakeLists.txt 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/CMakeLists.txt 2020-05-26 11:24:07.000000000 +0000 @@ -1,5 +1,6 @@ set(CppUTestExt_src CodeMemoryReportFormatter.cpp + GTest.cpp IEEE754ExceptionsPlugin.cpp MemoryReporterPlugin.cpp MockFailure.cpp @@ -29,6 +30,7 @@ ${CppUTestRootDirectory}/include/CppUTestExt/MockSupport_c.h ${CppUTestRootDirectory}/include/CppUTestExt/GMock.h ${CppUTestRootDirectory}/include/CppUTestExt/GTest.h + ${CppUTestRootDirectory}/include/CppUTestExt/GTestSupport.h ${CppUTestRootDirectory}/include/CppUTestExt/MemoryReporterPlugin.h ${CppUTestRootDirectory}/include/CppUTestExt/OrderedTest.h ${CppUTestRootDirectory}/include/CppUTestExt/GTestConvertor.h @@ -40,9 +42,19 @@ add_library(CppUTestExt STATIC ${CppUTestExt_src} ${CppUTestExt_headers}) target_link_libraries(CppUTestExt ${CPPUNIT_EXTERNAL_LIBRARIES}) -install(FILES ${CppUTestExt_headers} DESTINATION include/CppUTestExt) + +#[[Arrange for the include directory to be added to the include paths of any CMake target depending on CppUTestExt.]] +target_include_directories(CppUTestExt + PUBLIC + $ + $ +) + +set_target_properties(CppUTestExt PROPERTIES + PUBLIC_HEADER "${CppUTestExt_headers}") install(TARGETS CppUTestExt EXPORT CppUTestTargets - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/CppUTestExt" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/CppUTestExt") diff -Nru cpputest-3.8/src/CppUTestExt/CodeMemoryReportFormatter.cpp cpputest-4.0/src/CppUTestExt/CodeMemoryReportFormatter.cpp --- cpputest-3.8/src/CppUTestExt/CodeMemoryReportFormatter.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/CodeMemoryReportFormatter.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -44,7 +44,7 @@ }; CodeMemoryReportFormatter::CodeMemoryReportFormatter(TestMemoryAllocator* internalAllocator) - : codeReportingList_(NULL), internalAllocator_(internalAllocator) + : codeReportingList_(NULLPTR), internalAllocator_(internalAllocator) { } @@ -58,7 +58,7 @@ while (codeReportingList_) { CodeReportingAllocationNode* oldNode = codeReportingList_; codeReportingList_ = codeReportingList_->next_; - internalAllocator_->free_memory((char*) oldNode, __FILE__, __LINE__); + internalAllocator_->free_memory((char*) oldNode, 0, __FILE__, __LINE__); } } @@ -90,13 +90,13 @@ return fileNameOnly; } -SimpleString CodeMemoryReportFormatter::createVariableNameFromFileLineInfo(const char *file, int line) +SimpleString CodeMemoryReportFormatter::createVariableNameFromFileLineInfo(const char *file, size_t line) { SimpleString fileNameOnly = extractFileNameFromPath(file); fileNameOnly.replace(".", "_"); for (int i = 1; i < 100; i++) { - SimpleString variableName = StringFromFormat("%s_%d_%d", fileNameOnly.asCharString(), line, i); + SimpleString variableName = StringFromFormat("%s_%d_%d", fileNameOnly.asCharString(), (int) line, i); if (!variableExists(variableName)) return variableName; } @@ -127,19 +127,19 @@ return StringFromFormat("void* %s = malloc(%lu);", variableName.asCharString(), (unsigned long) size); } -SimpleString CodeMemoryReportFormatter::getDeallocationString(TestMemoryAllocator* allocator, const SimpleString& variableName, const char* file, int line) +SimpleString CodeMemoryReportFormatter::getDeallocationString(TestMemoryAllocator* allocator, const SimpleString& variableName, const char* file, size_t line) { if (isNewAllocator(allocator)) - return StringFromFormat("delete [] %s; /* using %s at %s:%d */", variableName.asCharString(), allocator->free_name(), file, line); + return StringFromFormat("delete [] %s; /* using %s at %s:%d */", variableName.asCharString(), allocator->free_name(), file, (int) line); else - return StringFromFormat("free(%s); /* at %s:%d */", variableName.asCharString(), file, line); + return StringFromFormat("free(%s); /* at %s:%d */", variableName.asCharString(), file, (int) line); } void CodeMemoryReportFormatter::report_test_start(TestResult* result, UtestShell& test) { clearReporting(); result->print(StringFromFormat("*/\nTEST(%s_memoryReport, %s)\n{ /* at %s:%d */\n", - test.getGroup().asCharString(), test.getName().asCharString(), test.getFile().asCharString(), test.getLineNumber()).asCharString()); + test.getGroup().asCharString(), test.getName().asCharString(), test.getFile().asCharString(), (int) test.getLineNumber()).asCharString()); } void CodeMemoryReportFormatter::report_test_end(TestResult* result, UtestShell&) @@ -153,19 +153,19 @@ test.getGroup().asCharString()).asCharString()); } -void CodeMemoryReportFormatter::report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, int line) +void CodeMemoryReportFormatter::report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, size_t line) { SimpleString variableName = createVariableNameFromFileLineInfo(file, line); result->print(StringFromFormat("\t%s\n", getAllocationString(allocator, variableName, size).asCharString()).asCharString()); addNodeToList(variableName.asCharString(), memory, codeReportingList_); } -void CodeMemoryReportFormatter::report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, int line) +void CodeMemoryReportFormatter::report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, size_t line) { SimpleString variableName; CodeReportingAllocationNode* node = findNode(memory); - if (memory == NULL) variableName = "NULL"; + if (memory == NULLPTR) variableName = "NULL"; else variableName = node->variableName_; result->print(StringFromFormat("\t%s\n", getDeallocationString(allocator, variableName, file, line).asCharString()).asCharString()); diff -Nru cpputest-3.8/src/CppUTestExt/GTest.cpp cpputest-4.0/src/CppUTestExt/GTest.cpp --- cpputest-3.8/src/CppUTestExt/GTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/GTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,9 @@ + +#include "CppUTest/TestHarness.h" +#include "CppUTestExt/GTestSupport.h" + +void CppuTestGTestIgnoreLeaksInTest() +{ + IGNORE_ALL_LEAKS_IN_TEST(); +} + diff -Nru cpputest-3.8/src/CppUTestExt/IEEE754ExceptionsPlugin.cpp cpputest-4.0/src/CppUTestExt/IEEE754ExceptionsPlugin.cpp --- cpputest-3.8/src/CppUTestExt/IEEE754ExceptionsPlugin.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/IEEE754ExceptionsPlugin.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -100,4 +100,54 @@ } } +#else + + +bool IEEE754ExceptionsPlugin::inexactDisabled_ = true; + +IEEE754ExceptionsPlugin::IEEE754ExceptionsPlugin(const SimpleString& name) + : TestPlugin(name) +{ +} + +void IEEE754ExceptionsPlugin::preTestAction(UtestShell&, TestResult&) +{ +} + +void IEEE754ExceptionsPlugin::postTestAction(UtestShell&, TestResult&) +{ +} + +void IEEE754ExceptionsPlugin::disableInexact() +{ +} + +void IEEE754ExceptionsPlugin::enableInexact() +{ +} + +bool IEEE754ExceptionsPlugin::checkIeee754OverflowExceptionFlag() +{ + return false; +} + +bool IEEE754ExceptionsPlugin::checkIeee754UnderflowExceptionFlag() +{ + return false; +} + +bool IEEE754ExceptionsPlugin::checkIeee754InexactExceptionFlag() +{ + return false; +} + +bool IEEE754ExceptionsPlugin::checkIeee754DivByZeroExceptionFlag() +{ + return false; +} + +void IEEE754ExceptionsPlugin::ieee754Check(UtestShell&, TestResult&, int, const char*) +{ +} + #endif diff -Nru cpputest-3.8/src/CppUTestExt/MemoryReportAllocator.cpp cpputest-4.0/src/CppUTestExt/MemoryReportAllocator.cpp --- cpputest-3.8/src/CppUTestExt/MemoryReportAllocator.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MemoryReportAllocator.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -29,7 +29,7 @@ #include "CppUTestExt/MemoryReportAllocator.h" #include "CppUTestExt/MemoryReportFormatter.h" -MemoryReportAllocator::MemoryReportAllocator() : result_(NULL), realAllocator_(NULL), formatter_(NULL) +MemoryReportAllocator::MemoryReportAllocator() : result_(NULLPTR), realAllocator_(NULLPTR), formatter_(NULLPTR) { } @@ -37,17 +37,17 @@ { } -const char* MemoryReportAllocator::name() +const char* MemoryReportAllocator::name() const { - return realAllocator_->name(); + return "MemoryReporterAllocator"; } -const char* MemoryReportAllocator::alloc_name() +const char* MemoryReportAllocator::alloc_name() const { return realAllocator_->alloc_name(); } -const char* MemoryReportAllocator::free_name() +const char* MemoryReportAllocator::free_name() const { return realAllocator_->free_name(); } @@ -62,6 +62,11 @@ return realAllocator_; } +TestMemoryAllocator* MemoryReportAllocator::actualAllocator() +{ + return realAllocator_->actualAllocator(); +} + void MemoryReportAllocator::setTestResult(TestResult* result) { result_ = result; @@ -72,7 +77,7 @@ formatter_ = formatter; } -char* MemoryReportAllocator::alloc_memory(size_t size, const char* file, int line) +char* MemoryReportAllocator::alloc_memory(size_t size, const char* file, size_t line) { char* memory = realAllocator_->alloc_memory(size, file, line); if (result_ && formatter_) @@ -80,9 +85,9 @@ return memory; } -void MemoryReportAllocator::free_memory(char* memory, const char* file, int line) +void MemoryReportAllocator::free_memory(char* memory, size_t size, const char* file, size_t line) { - realAllocator_->free_memory(memory, file, line); + realAllocator_->free_memory(memory, size, file, line); if (result_ && formatter_) formatter_->report_free_memory(result_, this, memory, file, line); } diff -Nru cpputest-3.8/src/CppUTestExt/MemoryReporterPlugin.cpp cpputest-4.0/src/CppUTestExt/MemoryReporterPlugin.cpp --- cpputest-3.8/src/CppUTestExt/MemoryReporterPlugin.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MemoryReporterPlugin.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -31,7 +31,7 @@ #include "CppUTestExt/CodeMemoryReportFormatter.h" MemoryReporterPlugin::MemoryReporterPlugin() - : TestPlugin("MemoryReporterPlugin"), formatter_(NULL) + : TestPlugin("MemoryReporterPlugin"), formatter_(NULLPTR) { } @@ -41,7 +41,7 @@ destroyMemoryFormatter(formatter_); } -bool MemoryReporterPlugin::parseArguments(int /* ac */, const char** av, int index) +bool MemoryReporterPlugin::parseArguments(int /* ac */, const char *const *av, int index) { SimpleString argument (av[index]); if (argument.contains("-pmemoryreport=")) { @@ -62,7 +62,7 @@ else if (type == "code") { return new CodeMemoryReportFormatter(defaultMallocAllocator()); } - return NULL; + return NULLPTR; } void MemoryReporterPlugin::destroyMemoryFormatter(MemoryReportFormatter* formatter) @@ -95,6 +95,20 @@ setCurrentMallocAllocator(mallocAllocator.getRealAllocator()); } +MemoryReportAllocator* MemoryReporterPlugin::getMallocAllocator() +{ + return &mallocAllocator; +} + +MemoryReportAllocator* MemoryReporterPlugin::getNewAllocator() +{ + return &newAllocator; +} + +MemoryReportAllocator* MemoryReporterPlugin::getNewArrayAllocator() +{ + return &newArrayAllocator; +} void MemoryReporterPlugin::initializeAllocator(MemoryReportAllocator* allocator, TestResult & result) { @@ -104,7 +118,7 @@ void MemoryReporterPlugin::preTestAction(UtestShell& test, TestResult& result) { - if (formatter_ == NULL) return; + if (formatter_ == NULLPTR) return; initializeAllocator(&mallocAllocator, result); initializeAllocator(&newAllocator, result); @@ -122,11 +136,11 @@ void MemoryReporterPlugin::postTestAction(UtestShell& test, TestResult& result) { - if (formatter_ == NULL) return; + if (formatter_ == NULLPTR) return; removeGlobalMemoryReportAllocators(); formatter_->report_test_end(&result, test); - if (test.getNext() == NULL || test.getNext()->getGroup() != currentTestGroup_) + if (test.getNext() == NULLPTR || test.getNext()->getGroup() != currentTestGroup_) formatter_->report_testgroup_end(&result, test); } diff -Nru cpputest-3.8/src/CppUTestExt/MemoryReportFormatter.cpp cpputest-4.0/src/CppUTestExt/MemoryReportFormatter.cpp --- cpputest-3.8/src/CppUTestExt/MemoryReportFormatter.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MemoryReportFormatter.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -47,14 +47,14 @@ result->print(StringFromFormat("ENDTEST(%s, %s)\n", test.getGroup().asCharString(), test.getName().asCharString()).asCharString()); } -void NormalMemoryReportFormatter::report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, int line) +void NormalMemoryReportFormatter::report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t size, char* memory, const char* file, size_t line) { - result->print(StringFromFormat("\tAllocation using %s of size: %lu pointer: %p at %s:%d\n", allocator->alloc_name(), (unsigned long) size, (void*) memory, file, line).asCharString()); + result->print(StringFromFormat("\tAllocation using %s of size: %lu pointer: %p at %s:%d\n", allocator->alloc_name(), (unsigned long) size, (void*) memory, file, (int) line).asCharString()); } -void NormalMemoryReportFormatter::report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, int line) +void NormalMemoryReportFormatter::report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* memory, const char* file, size_t line) { - result->print(StringFromFormat("\tDeallocation using %s of pointer: %p at %s:%d\n", allocator->free_name(), (void*) memory, file, line).asCharString()); + result->print(StringFromFormat("\tDeallocation using %s of pointer: %p at %s:%d\n", allocator->free_name(), (void*) memory, file, (int) line).asCharString()); } void NormalMemoryReportFormatter::report_testgroup_start(TestResult* result, UtestShell& test) diff -Nru cpputest-3.8/src/CppUTestExt/MockActualCall.cpp cpputest-4.0/src/CppUTestExt/MockActualCall.cpp --- cpputest-3.8/src/CppUTestExt/MockActualCall.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MockActualCall.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -49,10 +49,11 @@ return functionName_; } -MockCheckedActualCall::MockCheckedActualCall(int callOrder, MockFailureReporter* reporter, const MockExpectedCallsList& allExpectations) - : callOrder_(callOrder), reporter_(reporter), state_(CALL_SUCCEED), fulfilledExpectation_(NULL), allExpectations_(allExpectations), outputParameterExpectations_(NULL) +MockCheckedActualCall::MockCheckedActualCall(unsigned int callOrder, MockFailureReporter* reporter, const MockExpectedCallsList& allExpectations) + : callOrder_(callOrder), reporter_(reporter), state_(CALL_SUCCEED), expectationsChecked_(false), matchingExpectation_(NULLPTR), + allExpectations_(allExpectations), outputParameterExpectations_(NULLPTR) { - unfulfilledExpectations_.addUnfulfilledExpectations(allExpectations); + potentiallyMatchingExpectations_.addPotentiallyMatchingExpectations(allExpectations); } MockCheckedActualCall::~MockCheckedActualCall() @@ -78,7 +79,7 @@ } } -void MockCheckedActualCall::finalizeOutputParameters(MockCheckedExpectedCall* expectedCall) +void MockCheckedActualCall::copyOutputParameters(MockCheckedExpectedCall* expectedCall) { for (MockOutputParametersListNode* p = outputParameterExpectations_; p; p = p->next_) { @@ -86,7 +87,7 @@ MockNamedValueCopier* copier = outputParameter.getCopier(); if (copier) { - copier->copy(p->ptr_, outputParameter.getObjectPointer()); + copier->copy(p->ptr_, outputParameter.getConstObjectPointer()); } else if ((outputParameter.getType() == "const void*") && (p->type_ == "void*")) { @@ -103,15 +104,19 @@ } } -void MockCheckedActualCall::finalizeCallWhenFulfilled() +void MockCheckedActualCall::completeCallWhenMatchIsFound() { - if (unfulfilledExpectations_.hasFulfilledExpectationsWithoutIgnoredParameters()) { - finalizeOutputParameters(unfulfilledExpectations_.getOneFulfilledExpectationWithIgnoredParameters()); - } + // Expectations that don't ignore parameters have higher fulfillment preference than those that ignore parameters - if (unfulfilledExpectations_.hasFulfilledExpectations()) { - fulfilledExpectation_ = unfulfilledExpectations_.removeOneFulfilledExpectation(); + matchingExpectation_ = potentiallyMatchingExpectations_.removeFirstFinalizedMatchingExpectation(); + if (matchingExpectation_) { + copyOutputParameters(matchingExpectation_); callHasSucceeded(); + } else { + MockCheckedExpectedCall* matchingExpectationWithIgnoredParameters = potentiallyMatchingExpectations_.getFirstMatchingExpectation(); + if (matchingExpectationWithIgnoredParameters) { + copyOutputParameters(matchingExpectationWithIgnoredParameters); + } } } @@ -120,37 +125,34 @@ setState(CALL_SUCCEED); } -void MockCheckedActualCall::callIsInProgress() +void MockCheckedActualCall::discardCurrentlyMatchingExpectations() { - setState(CALL_IN_PROGRESS); - if (fulfilledExpectation_) + if (matchingExpectation_) { - fulfilledExpectation_->resetExpectation(); - fulfilledExpectation_ = NULL; + matchingExpectation_->resetActualCallMatchingState(); + matchingExpectation_ = NULLPTR; } - unfulfilledExpectations_.onlyKeepUnfulfilledExpectations(); + potentiallyMatchingExpectations_.onlyKeepUnmatchingExpectations(); } MockActualCall& MockCheckedActualCall::withName(const SimpleString& name) { setName(name); - callIsInProgress(); + setState(CALL_IN_PROGRESS); - unfulfilledExpectations_.onlyKeepExpectationsRelatedTo(name); - if (unfulfilledExpectations_.isEmpty()) { + potentiallyMatchingExpectations_.onlyKeepExpectationsRelatedTo(name); + if (potentiallyMatchingExpectations_.isEmpty()) { MockUnexpectedCallHappenedFailure failure(getTest(), name, allExpectations_); failTest(failure); return *this; } - unfulfilledExpectations_.callWasMade(callOrder_); - - finalizeCallWhenFulfilled(); + completeCallWhenMatchIsFound(); return *this; } -MockActualCall& MockCheckedActualCall::withCallOrder(int) +MockActualCall& MockCheckedActualCall::withCallOrder(unsigned int) { return *this; } @@ -162,18 +164,19 @@ return; } - callIsInProgress(); + setState(CALL_IN_PROGRESS); + discardCurrentlyMatchingExpectations(); - unfulfilledExpectations_.onlyKeepExpectationsWithInputParameter(actualParameter); + potentiallyMatchingExpectations_.onlyKeepExpectationsWithInputParameter(actualParameter); - if (unfulfilledExpectations_.isEmpty()) { + if (potentiallyMatchingExpectations_.isEmpty()) { MockUnexpectedInputParameterFailure failure(getTest(), getName(), actualParameter, allExpectations_); failTest(failure); return; } - unfulfilledExpectations_.parameterWasPassed(actualParameter.getName()); - finalizeCallWhenFulfilled(); + potentiallyMatchingExpectations_.parameterWasPassed(actualParameter.getName()); + completeCallWhenMatchIsFound(); } void MockCheckedActualCall::checkOutputParameter(const MockNamedValue& outputParameter) @@ -183,18 +186,19 @@ return; } - callIsInProgress(); + setState(CALL_IN_PROGRESS); + discardCurrentlyMatchingExpectations(); - unfulfilledExpectations_.onlyKeepExpectationsWithOutputParameter(outputParameter); + potentiallyMatchingExpectations_.onlyKeepExpectationsWithOutputParameter(outputParameter); - if (unfulfilledExpectations_.isEmpty()) { + if (potentiallyMatchingExpectations_.isEmpty()) { MockUnexpectedOutputParameterFailure failure(getTest(), getName(), outputParameter, allExpectations_); failTest(failure); return; } - unfulfilledExpectations_.outputParameterWasPassed(outputParameter.getName()); - finalizeCallWhenFulfilled(); + potentiallyMatchingExpectations_.outputParameterWasPassed(outputParameter.getName()); + completeCallWhenMatchIsFound(); } MockActualCall& MockCheckedActualCall::withBoolParameter(const SimpleString& name, bool value) @@ -237,6 +241,40 @@ return *this; } +#ifdef CPPUTEST_USE_LONG_LONG + +MockActualCall& MockCheckedActualCall::withUnsignedLongLongIntParameter(const SimpleString& name, cpputest_ulonglong value) +{ + MockNamedValue actualParameter(name); + actualParameter.setValue(value); + checkInputParameter(actualParameter); + return *this; +} + +MockActualCall& MockCheckedActualCall::withLongLongIntParameter(const SimpleString& name, cpputest_longlong value) +{ + MockNamedValue actualParameter(name); + actualParameter.setValue(value); + checkInputParameter(actualParameter); + return *this; +} + +#else + +MockActualCall& MockCheckedActualCall::withUnsignedLongLongIntParameter(const SimpleString&, cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); + return *this; +} + +MockActualCall& MockCheckedActualCall::withLongLongIntParameter(const SimpleString&, cpputest_longlong) +{ + FAIL("Long Long type is not supported"); + return *this; +} + +#endif + MockActualCall& MockCheckedActualCall::withDoubleParameter(const SimpleString& name, double value) { MockNamedValue actualParameter(name); @@ -288,9 +326,9 @@ MockActualCall& MockCheckedActualCall::withParameterOfType(const SimpleString& type, const SimpleString& name, const void* value) { MockNamedValue actualParameter(name); - actualParameter.setObjectPointer(type, value); + actualParameter.setConstObjectPointer(type, value); - if (actualParameter.getComparator() == NULL) { + if (actualParameter.getComparator() == NULLPTR) { MockNoWayToCompareCustomTypeFailure failure(getTest(), type); failTest(failure); return *this; @@ -315,7 +353,7 @@ addOutputParameter(name, type, output); MockNamedValue outputParameter(name); - outputParameter.setObjectPointer(type, output); + outputParameter.setConstObjectPointer(type, output); checkOutputParameter(outputParameter); return *this; @@ -333,23 +371,33 @@ void MockCheckedActualCall::checkExpectations() { - if (state_ != CALL_IN_PROGRESS) - { - unfulfilledExpectations_.resetExpectations(); + if(expectationsChecked_) { return; } - if (! unfulfilledExpectations_.hasUnfulfilledExpectations()) - FAIL("Actual call is in progress. Checking expectations. But no unfulfilled expectations. Cannot happen.") // LCOV_EXCL_LINE + expectationsChecked_ = true; - fulfilledExpectation_ = unfulfilledExpectations_.removeOneFulfilledExpectationWithIgnoredParameters(); - if (fulfilledExpectation_) { + if (state_ != CALL_IN_PROGRESS) { + if(state_ == CALL_SUCCEED) { + matchingExpectation_->callWasMade(callOrder_); + } + potentiallyMatchingExpectations_.resetActualCallMatchingState(); + return; + } + + if (potentiallyMatchingExpectations_.hasFinalizedMatchingExpectations()) + FAIL("Actual call is in progress, but there are finalized matching expectations when checking expectations. This cannot happen."); // LCOV_EXCL_LINE + + matchingExpectation_ = potentiallyMatchingExpectations_.removeFirstMatchingExpectation(); + if (matchingExpectation_) { + matchingExpectation_->finalizeActualCallMatch(); callHasSucceeded(); - unfulfilledExpectations_.resetExpectations(); + matchingExpectation_->callWasMade(callOrder_); + potentiallyMatchingExpectations_.resetActualCallMatchingState(); return; } - if (unfulfilledExpectations_.hasUnfulfilledExpectationsBecauseOfMissingParameters()) { + if (potentiallyMatchingExpectations_.hasUnmatchingExpectationsBecauseOfMissingParameters()) { MockExpectedParameterDidntHappenFailure failure(getTest(), getName(), allExpectations_); failTest(failure); } @@ -367,8 +415,8 @@ MockNamedValue MockCheckedActualCall::returnValue() { checkExpectations(); - if (fulfilledExpectation_) - return fulfilledExpectation_->returnValue(); + if (matchingExpectation_) + return matchingExpectation_->returnValue(); return MockNamedValue("no return value"); } @@ -424,6 +472,62 @@ return returnLongIntValue(); } +#ifdef CPPUTEST_USE_LONG_LONG + +cpputest_ulonglong MockCheckedActualCall::returnUnsignedLongLongIntValue() +{ + return returnValue().getUnsignedLongLongIntValue(); +} + +cpputest_ulonglong MockCheckedActualCall::returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong default_value) +{ + if (!hasReturnValue()) { + return default_value; + } + return returnUnsignedLongLongIntValue(); +} + +cpputest_longlong MockCheckedActualCall::returnLongLongIntValue() +{ + return returnValue().getLongLongIntValue(); +} + +cpputest_longlong MockCheckedActualCall::returnLongLongIntValueOrDefault(cpputest_longlong default_value) +{ + if (!hasReturnValue()) { + return default_value; + } + return returnLongLongIntValue(); +} + +#else + +cpputest_ulonglong MockCheckedActualCall::returnUnsignedLongLongIntValue() +{ + FAIL("Unsigned Long Long type is not supported"); + return cpputest_ulonglong(0); +} + +cpputest_ulonglong MockCheckedActualCall::returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong default_value) +{ + FAIL("Unsigned Long Long type is not supported"); + return default_value; +} + +cpputest_longlong MockCheckedActualCall::returnLongLongIntValue() +{ + FAIL("Long Long type is not supported"); + return cpputest_longlong(0); +} + +cpputest_longlong MockCheckedActualCall::returnLongLongIntValueOrDefault(cpputest_longlong default_value) +{ + FAIL("Long Long type is not supported"); + return default_value; +} + +#endif + double MockCheckedActualCall::returnDoubleValue() { return returnValue().getDoubleValue(); @@ -509,19 +613,27 @@ MockActualCall& MockCheckedActualCall::onObject(const void* objectPtr) { - callIsInProgress(); + if(hasFailed()) { + return *this; + } + + // Currently matching expectations are not discarded because the passed object + // is ignored if not specifically set in the expectation - unfulfilledExpectations_.onlyKeepExpectationsOnObject(objectPtr); + potentiallyMatchingExpectations_.onlyKeepExpectationsOnObject(objectPtr); - if (unfulfilledExpectations_.isEmpty()) { + if ((!matchingExpectation_) && potentiallyMatchingExpectations_.isEmpty()) { MockUnexpectedObjectFailure failure(getTest(), getName(), objectPtr, allExpectations_); failTest(failure); return *this; } - unfulfilledExpectations_.wasPassedToObject(); + potentiallyMatchingExpectations_.wasPassedToObject(); + + if (!matchingExpectation_) { + completeCallWhenMatchIsFound(); + } - finalizeCallWhenFulfilled(); return *this; } @@ -529,7 +641,7 @@ { MockOutputParametersListNode* newNode = new MockOutputParametersListNode(name, type, ptr); - if (outputParameterExpectations_ == NULL) + if (outputParameterExpectations_ == NULLPTR) outputParameterExpectations_ = newNode; else { MockOutputParametersListNode* lastNode = outputParameterExpectations_; @@ -541,7 +653,7 @@ void MockCheckedActualCall::cleanUpOutputParameterList() { MockOutputParametersListNode* current = outputParameterExpectations_; - MockOutputParametersListNode* toBeDeleted = NULL; + MockOutputParametersListNode* toBeDeleted = NULLPTR; while (current) { toBeDeleted = current; @@ -566,7 +678,7 @@ return *this; } -MockActualCall& MockActualCallTrace::withCallOrder(int callOrder) +MockActualCall& MockActualCallTrace::withCallOrder(unsigned int callOrder) { traceBuffer_ += " withCallOrder:"; traceBuffer_ += StringFrom(callOrder); @@ -590,31 +702,63 @@ MockActualCall& MockActualCallTrace::withUnsignedIntParameter(const SimpleString& name, unsigned int value) { addParameterName(name); - traceBuffer_ += StringFrom(value); + traceBuffer_ += StringFrom(value) + " " + BracketsFormattedHexStringFrom(value); return *this; } MockActualCall& MockActualCallTrace::withIntParameter(const SimpleString& name, int value) { addParameterName(name); - traceBuffer_ += StringFrom(value); + traceBuffer_ += StringFrom(value) + " " + BracketsFormattedHexStringFrom(value); return *this; } MockActualCall& MockActualCallTrace::withUnsignedLongIntParameter(const SimpleString& name, unsigned long int value) { addParameterName(name); - traceBuffer_ += StringFrom(value); + traceBuffer_ += StringFrom(value) + " " + BracketsFormattedHexStringFrom(value); return *this; } MockActualCall& MockActualCallTrace::withLongIntParameter(const SimpleString& name, long int value) { addParameterName(name); - traceBuffer_ += StringFrom(value); + traceBuffer_ += StringFrom(value) + " " + BracketsFormattedHexStringFrom(value); return *this; } +#ifdef CPPUTEST_USE_LONG_LONG + +MockActualCall& MockActualCallTrace::withUnsignedLongLongIntParameter(const SimpleString& name, cpputest_ulonglong value) +{ + addParameterName(name); + traceBuffer_ += StringFrom(value) + " " + BracketsFormattedHexStringFrom(value); + return *this; +} + +MockActualCall& MockActualCallTrace::withLongLongIntParameter(const SimpleString& name, cpputest_longlong value) +{ + addParameterName(name); + traceBuffer_ += StringFrom(value) + " " + BracketsFormattedHexStringFrom(value); + return *this; +} + +#else + +MockActualCall& MockActualCallTrace::withUnsignedLongLongIntParameter(const SimpleString&, cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); + return *this; +} + +MockActualCall& MockActualCallTrace::withLongLongIntParameter(const SimpleString&, cpputest_longlong) +{ + FAIL("Long Long type is not supported"); + return *this; +} + +#endif + MockActualCall& MockActualCallTrace::withDoubleParameter(const SimpleString& name, double value) { addParameterName(name); @@ -709,9 +853,59 @@ long int MockActualCallTrace::returnLongIntValueOrDefault(long int) { - return returnLongIntValue(); + return 0; } +#ifdef CPPUTEST_USE_LONG_LONG + +cpputest_longlong MockActualCallTrace::returnLongLongIntValue() +{ + return 0; +} + +cpputest_ulonglong MockActualCallTrace::returnUnsignedLongLongIntValue() +{ + return 0; +} + +cpputest_ulonglong MockActualCallTrace::returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong) +{ + return 0; +} + +cpputest_longlong MockActualCallTrace::returnLongLongIntValueOrDefault(cpputest_longlong) +{ + return 0; +} + +#else + +cpputest_longlong MockActualCallTrace::returnLongLongIntValue() +{ + FAIL("Long Long type is not supported"); + return cpputest_longlong(0); +} + +cpputest_ulonglong MockActualCallTrace::returnUnsignedLongLongIntValue() +{ + FAIL("Unsigned Long Long type is not supported"); + return cpputest_ulonglong(0); +} + +cpputest_ulonglong MockActualCallTrace::returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); + return cpputest_ulonglong(0); +} + +cpputest_longlong MockActualCallTrace::returnLongLongIntValueOrDefault(cpputest_longlong) +{ + FAIL("Long Long type is not supported"); + return cpputest_longlong(0); +} + +#endif + bool MockActualCallTrace::returnBoolValue() { return false; @@ -744,17 +938,17 @@ void * MockActualCallTrace::returnPointerValue() { - return NULL; + return NULLPTR; } const void * MockActualCallTrace::returnConstPointerValue() { - return NULL; + return NULLPTR; } void (*MockActualCallTrace::returnFunctionPointerValue())() { - return NULL; + return NULLPTR; } const void * MockActualCallTrace::returnConstPointerValueOrDefault(const void *) @@ -809,10 +1003,19 @@ return traceBuffer_.asCharString(); } +MockActualCallTrace* MockActualCallTrace::instance_ = NULLPTR; + MockActualCallTrace& MockActualCallTrace::instance() { - static MockActualCallTrace call; - return call; + if (instance_ == NULLPTR) + instance_ = new MockActualCallTrace; + return *instance_; +} + +void MockActualCallTrace::clearInstance() +{ + delete instance_; + instance_ = NULLPTR; } MockIgnoredActualCall& MockIgnoredActualCall::instance() diff -Nru cpputest-3.8/src/CppUTestExt/MockExpectedCall.cpp cpputest-4.0/src/CppUTestExt/MockExpectedCall.cpp --- cpputest-3.8/src/CppUTestExt/MockExpectedCall.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MockExpectedCall.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -52,7 +52,20 @@ } MockCheckedExpectedCall::MockCheckedExpectedCall() - : ignoreOtherParameters_(false), parametersWereIgnored_(false), callOrder_(0), expectedCallOrder_(NO_EXPECTED_CALL_ORDER), outOfOrder_(true), returnValue_(""), objectPtr_(NULL), wasPassedToObject_(true) + : ignoreOtherParameters_(false), isActualCallMatchFinalized_(false), + initialExpectedCallOrder_(NO_EXPECTED_CALL_ORDER), finalExpectedCallOrder_(NO_EXPECTED_CALL_ORDER), + outOfOrder_(false), returnValue_(""), objectPtr_(NULLPTR), isSpecificObjectExpected_(false), wasPassedToObject_(true), + actualCalls_(0), expectedCalls_(1) +{ + inputParameters_ = new MockNamedValueList(); + outputParameters_ = new MockNamedValueList(); +} + +MockCheckedExpectedCall::MockCheckedExpectedCall(unsigned int numCalls) + : ignoreOtherParameters_(false), isActualCallMatchFinalized_(false), + initialExpectedCallOrder_(NO_EXPECTED_CALL_ORDER), finalExpectedCallOrder_(NO_EXPECTED_CALL_ORDER), + outOfOrder_(false), returnValue_(""), objectPtr_(NULLPTR), isSpecificObjectExpected_(false), wasPassedToObject_(true), + actualCalls_(0), expectedCalls_(numCalls) { inputParameters_ = new MockNamedValueList(); outputParameters_ = new MockNamedValueList(); @@ -69,7 +82,6 @@ MockExpectedCall& MockCheckedExpectedCall::withName(const SimpleString& name) { setName(name); - callOrder_ = NOT_CALLED_YET; return *this; } @@ -113,6 +125,40 @@ return *this; } +#ifdef CPPUTEST_USE_LONG_LONG + +MockExpectedCall& MockCheckedExpectedCall::withLongLongIntParameter(const SimpleString& name, cpputest_longlong value) +{ + MockNamedValue* newParameter = new MockExpectedFunctionParameter(name); + inputParameters_->add(newParameter); + newParameter->setValue(value); + return *this; +} + +MockExpectedCall& MockCheckedExpectedCall::withUnsignedLongLongIntParameter(const SimpleString& name, cpputest_ulonglong value) +{ + MockNamedValue* newParameter = new MockExpectedFunctionParameter(name); + inputParameters_->add(newParameter); + newParameter->setValue(value); + return *this; +} + +#else + +MockExpectedCall& MockCheckedExpectedCall::withLongLongIntParameter(const SimpleString&, cpputest_longlong) +{ + FAIL("Long Long type is not supported"); + return *this; +} + +MockExpectedCall& MockCheckedExpectedCall::withUnsignedLongLongIntParameter(const SimpleString&, cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); + return *this; +} + +#endif + MockExpectedCall& MockCheckedExpectedCall::withDoubleParameter(const SimpleString& name, double value) { MockNamedValue* newParameter = new MockExpectedFunctionParameter(name); @@ -121,6 +167,14 @@ return *this; } +MockExpectedCall& MockCheckedExpectedCall::withDoubleParameter(const SimpleString& name, double value, double tolerance) +{ + MockNamedValue* newParameter = new MockExpectedFunctionParameter(name); + inputParameters_->add(newParameter); + newParameter->setValue(value, tolerance); + return *this; +} + MockExpectedCall& MockCheckedExpectedCall::withStringParameter(const SimpleString& name, const char* value) { MockNamedValue* newParameter = new MockExpectedFunctionParameter(name); @@ -165,7 +219,7 @@ { MockNamedValue* newParameter = new MockExpectedFunctionParameter(name); inputParameters_->add(newParameter); - newParameter->setObjectPointer(type, value); + newParameter->setConstObjectPointer(type, value); return *this; } @@ -182,10 +236,15 @@ { MockNamedValue* newParameter = new MockExpectedFunctionParameter(name); outputParameters_->add(newParameter); - newParameter->setObjectPointer(type, value); + newParameter->setConstObjectPointer(type, value); return *this; } +MockExpectedCall& MockCheckedExpectedCall::withUnmodifiedOutputParameter(const SimpleString& name) +{ + return withOutputParameterReturning(name, NULLPTR, 0); +} + SimpleString MockCheckedExpectedCall::getInputParameterType(const SimpleString& name) { MockNamedValue * p = inputParameters_->getValueByName(name); @@ -195,13 +254,13 @@ bool MockCheckedExpectedCall::hasInputParameterWithName(const SimpleString& name) { MockNamedValue * p = inputParameters_->getValueByName(name); - return p != NULL; + return p != NULLPTR; } bool MockCheckedExpectedCall::hasOutputParameterWithName(const SimpleString& name) { MockNamedValue * p = outputParameters_->getValueByName(name); - return p != NULL; + return p != NULLPTR; } MockNamedValue MockCheckedExpectedCall::getInputParameter(const SimpleString& name) @@ -216,25 +275,18 @@ return (p) ? *p : MockNamedValue(""); } -bool MockCheckedExpectedCall::areParametersFulfilled() +bool MockCheckedExpectedCall::areParametersMatchingActualCall() { MockNamedValueListNode* p; for (p = inputParameters_->begin(); p; p = p->next()) - if (! item(p)->isFulfilled()) + if (! item(p)->isMatchingActualCall()) return false; for (p = outputParameters_->begin(); p; p = p->next()) - if (! item(p)->isFulfilled()) + if (! item(p)->isMatchingActualCall()) return false; return true; } -bool MockCheckedExpectedCall::areIgnoredParametersFulfilled() -{ - if (ignoreOtherParameters_) - return parametersWereIgnored_; - return true; -} - MockExpectedCall& MockCheckedExpectedCall::ignoreOtherParameters() { ignoreOtherParameters_ = true; @@ -243,29 +295,39 @@ bool MockCheckedExpectedCall::isFulfilled() { - return isFulfilledWithoutIgnoredParameters() && areIgnoredParametersFulfilled(); + return (actualCalls_ == expectedCalls_); } -bool MockCheckedExpectedCall::isFulfilledWithoutIgnoredParameters() +bool MockCheckedExpectedCall::canMatchActualCalls() { - return callOrder_ != NOT_CALLED_YET && areParametersFulfilled() && wasPassedToObject_; + return (actualCalls_ < expectedCalls_); } +bool MockCheckedExpectedCall::isMatchingActualCallAndFinalized() +{ + return isMatchingActualCall() && (!ignoreOtherParameters_ || isActualCallMatchFinalized_); +} + +bool MockCheckedExpectedCall::isMatchingActualCall() +{ + return areParametersMatchingActualCall() && wasPassedToObject_; +} -void MockCheckedExpectedCall::callWasMade(int callOrder) +void MockCheckedExpectedCall::callWasMade(unsigned int callOrder) { - callOrder_ = callOrder; - if (expectedCallOrder_ == NO_EXPECTED_CALL_ORDER) - outOfOrder_ = false; - else if (callOrder_ == expectedCallOrder_) - outOfOrder_ = false; - else + actualCalls_++; + + if ( (initialExpectedCallOrder_ != NO_EXPECTED_CALL_ORDER) && + ((callOrder < initialExpectedCallOrder_) || (callOrder > finalExpectedCallOrder_)) ) { outOfOrder_ = true; + } + + resetActualCallMatchingState(); } -void MockCheckedExpectedCall::parametersWereIgnored() +void MockCheckedExpectedCall::finalizeActualCallMatch() { - parametersWereIgnored_ = true; + isActualCallMatchFinalized_ = true; } @@ -274,23 +336,24 @@ wasPassedToObject_ = true; } -void MockCheckedExpectedCall::resetExpectation() +void MockCheckedExpectedCall::resetActualCallMatchingState() { - callOrder_ = NOT_CALLED_YET; - wasPassedToObject_ = (objectPtr_ == NULL); + wasPassedToObject_ = !isSpecificObjectExpected_; + isActualCallMatchFinalized_ = false; + MockNamedValueListNode* p; for (p = inputParameters_->begin(); p; p = p->next()) - item(p)->setFulfilled(false); + item(p)->setMatchesActualCall(false); for (p = outputParameters_->begin(); p; p = p->next()) - item(p)->setFulfilled(false); + item(p)->setMatchesActualCall(false); } void MockCheckedExpectedCall::inputParameterWasPassed(const SimpleString& name) { for (MockNamedValueListNode* p = inputParameters_->begin(); p; p = p->next()) { if (p->getName() == name) - item(p)->setFulfilled(true); + item(p)->setMatchesActualCall(true); } } @@ -298,7 +361,7 @@ { for (MockNamedValueListNode* p = outputParameters_->begin(); p; p = p->next()) { if (p->getName() == name) - item(p)->setFulfilled(true); + item(p)->setMatchesActualCall(true); } } @@ -323,39 +386,46 @@ SimpleString MockCheckedExpectedCall::callToString() { SimpleString str; - if (objectPtr_) + if (isSpecificObjectExpected_) str = StringFromFormat("(object address: %p)::", objectPtr_); str += getName(); str += " -> "; - if (expectedCallOrder_ != NO_EXPECTED_CALL_ORDER) { - str += StringFromFormat("expected call order: <%d> -> ", expectedCallOrder_); + if (initialExpectedCallOrder_ != NO_EXPECTED_CALL_ORDER) { + if (initialExpectedCallOrder_ == finalExpectedCallOrder_) { + str += StringFromFormat("expected call order: <%u> -> ", initialExpectedCallOrder_); + } else { + str += StringFromFormat("expected calls order: <%u..%u> -> ", initialExpectedCallOrder_, finalExpectedCallOrder_); + } } - if (inputParameters_->begin() == NULL && outputParameters_->begin() == NULL) { + if (inputParameters_->begin() == NULLPTR && outputParameters_->begin() == NULLPTR) { str += (ignoreOtherParameters_) ? "all parameters ignored" : "no parameters"; - return str; - } + } else { + MockNamedValueListNode* p; - MockNamedValueListNode* p; + for (p = inputParameters_->begin(); p; p = p->next()) { + str += StringFromFormat("%s %s: <%s>", p->getType().asCharString(), p->getName().asCharString(), getInputParameterValueString(p->getName()).asCharString()); + if (p->next()) str += ", "; + } - for (p = inputParameters_->begin(); p; p = p->next()) { - str += StringFromFormat("%s %s: <%s>", p->getType().asCharString(), p->getName().asCharString(), getInputParameterValueString(p->getName()).asCharString()); - if (p->next()) str += ", "; - } + if (inputParameters_->begin() && outputParameters_->begin()) + { + str += ", "; + } - if (inputParameters_->begin() && outputParameters_->begin()) - { - str += ", "; - } + for (p = outputParameters_->begin(); p; p = p->next()) { + str += StringFromFormat("%s %s: ", p->getType().asCharString(), p->getName().asCharString()); + if (p->next()) str += ", "; + } - for (p = outputParameters_->begin(); p; p = p->next()) { - str += StringFromFormat("%s %s: ", p->getType().asCharString(), p->getName().asCharString()); - if (p->next()) str += ", "; + if (ignoreOtherParameters_) + str += ", other parameters are ignored"; } - if (ignoreOtherParameters_) - str += ", other parameters are ignored"; + str += StringFromFormat(" (expected %d call%s, called %d time%s)", + expectedCalls_, (expectedCalls_ == 1) ? "" : "s", actualCalls_, (actualCalls_ == 1) ? "" : "s" ); + return str; } @@ -365,13 +435,13 @@ MockNamedValueListNode* p; for (p = inputParameters_->begin(); p; p = p->next()) { - if (! item(p)->isFulfilled()) { + if (! item(p)->isMatchingActualCall()) { if (str != "") str += ", "; str += StringFromFormat("%s %s", p->getType().asCharString(), p->getName().asCharString()); } } for (p = outputParameters_->begin(); p; p = p->next()) { - if (! item(p)->isFulfilled()) { + if (! item(p)->isMatchingActualCall()) { if (str != "") str += ", "; str += StringFromFormat("%s %s", p->getType().asCharString(), p->getName().asCharString()); } @@ -386,7 +456,7 @@ bool MockCheckedExpectedCall::relatesToObject(const void* objectPtr) const { - return objectPtr_ == objectPtr; + return (!isSpecificObjectExpected_) || (objectPtr_ == objectPtr); } MockCheckedExpectedCall::MockExpectedFunctionParameter* MockCheckedExpectedCall::item(MockNamedValueListNode* node) @@ -395,18 +465,18 @@ } MockCheckedExpectedCall::MockExpectedFunctionParameter::MockExpectedFunctionParameter(const SimpleString& name) - : MockNamedValue(name), fulfilled_(false) + : MockNamedValue(name), matchesActualCall_(false) { } -void MockCheckedExpectedCall::MockExpectedFunctionParameter::setFulfilled(bool b) +void MockCheckedExpectedCall::MockExpectedFunctionParameter::setMatchesActualCall(bool b) { - fulfilled_ = b; + matchesActualCall_ = b; } -bool MockCheckedExpectedCall::MockExpectedFunctionParameter::isFulfilled() const +bool MockCheckedExpectedCall::MockExpectedFunctionParameter::isMatchingActualCall() const { - return fulfilled_; + return matchesActualCall_; } MockExpectedCall& MockCheckedExpectedCall::andReturnValue(bool value) @@ -444,294 +514,101 @@ return *this; } -MockExpectedCall& MockCheckedExpectedCall::andReturnValue(const char* value) -{ - returnValue_.setName("returnValue"); - returnValue_.setValue(value); - return *this; -} +#ifdef CPPUTEST_USE_LONG_LONG -MockExpectedCall& MockCheckedExpectedCall::andReturnValue(double value) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(cpputest_longlong value) { returnValue_.setName("returnValue"); returnValue_.setValue(value); return *this; } -MockExpectedCall& MockCheckedExpectedCall::andReturnValue(void* value) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(cpputest_ulonglong value) { returnValue_.setName("returnValue"); returnValue_.setValue(value); return *this; } -MockExpectedCall& MockCheckedExpectedCall::andReturnValue(const void* value) -{ - returnValue_.setName("returnValue"); - returnValue_.setValue(value); - return *this; -} +#else -MockExpectedCall& MockCheckedExpectedCall::andReturnValue(void (*value)()) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(cpputest_longlong) { - returnValue_.setName("returnValue"); - returnValue_.setValue(value); + FAIL("Long Long type is not supported"); return *this; } -MockExpectedCall& MockCheckedExpectedCall::onObject(void* objectPtr) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(cpputest_ulonglong) { - wasPassedToObject_ = false; - objectPtr_ = objectPtr; - return *this; -} - -MockNamedValue MockCheckedExpectedCall::returnValue() -{ - return returnValue_; -} - -int MockCheckedExpectedCall::getCallOrder() const -{ - return callOrder_; -} - -MockExpectedCall& MockCheckedExpectedCall::withCallOrder(int callOrder) -{ - expectedCallOrder_ = callOrder; + FAIL("Unsigned Long Long type is not supported"); return *this; } -bool MockCheckedExpectedCall::isOutOfOrder() const -{ - return outOfOrder_; -} - -struct MockExpectedCallCompositeNode -{ - MockExpectedCallCompositeNode(MockExpectedCall& functionCall, MockExpectedCallCompositeNode* next) : next_(next), call_(functionCall){} - - MockExpectedCallCompositeNode* next_; - MockExpectedCall& call_; -}; - -MockExpectedCallComposite::MockExpectedCallComposite() : head_(NULL) -{ -} - -MockExpectedCallComposite::~MockExpectedCallComposite() -{ +#endif -} - -void MockExpectedCallComposite::add(MockExpectedCall& call) -{ - head_ = new MockExpectedCallCompositeNode(call, head_); -} - -void MockExpectedCallComposite::clear() -{ - while (head_) { - MockExpectedCallCompositeNode* next = head_->next_; - delete head_; - head_ = next; - } -} - -MockExpectedCall& MockExpectedCallComposite::withName(const SimpleString& name) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withName(name); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withCallOrder(int) -{ - FAIL("withCallOrder not supported for CompositeCalls"); - return *this; // LCOV_EXCL_LINE -} - -MockExpectedCall& MockExpectedCallComposite::withBoolParameter(const SimpleString& name, bool value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withUnsignedIntParameter(const SimpleString& name, unsigned int value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withIntParameter(const SimpleString& name, int value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withLongIntParameter(const SimpleString& name, long int value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withUnsignedLongIntParameter(const SimpleString& name, unsigned long int value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withDoubleParameter(const SimpleString& name, double value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; - -} - -MockExpectedCall& MockExpectedCallComposite::withStringParameter(const SimpleString& name, const char* value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withPointerParameter(const SimpleString& name, void* value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withConstPointerParameter(const SimpleString& name, const void* value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withFunctionPointerParameter(const SimpleString& name, void (*value)()) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withMemoryBufferParameter(const SimpleString& name, const unsigned char* value, size_t size) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameter(name, value, size); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withParameterOfType(const SimpleString& typeName, const SimpleString& name, const void* value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withParameterOfType(typeName, name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withOutputParameterReturning(const SimpleString& name, const void* value, size_t size) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withOutputParameterReturning(name, value, size); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::withOutputParameterOfTypeReturning(const SimpleString& typeName, const SimpleString& name, const void* value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.withOutputParameterOfTypeReturning(typeName, name, value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::ignoreOtherParameters() -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.ignoreOtherParameters(); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::andReturnValue(bool value) -{ - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); - return *this; -} - -MockExpectedCall& MockExpectedCallComposite::andReturnValue(unsigned int value) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(const char* value) { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); + returnValue_.setName("returnValue"); + returnValue_.setValue(value); return *this; } -MockExpectedCall& MockExpectedCallComposite::andReturnValue(int value) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(double value) { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); + returnValue_.setName("returnValue"); + returnValue_.setValue(value); return *this; } -MockExpectedCall& MockExpectedCallComposite::andReturnValue(long int value) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(void* value) { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); + returnValue_.setName("returnValue"); + returnValue_.setValue(value); return *this; } -MockExpectedCall& MockExpectedCallComposite::andReturnValue(unsigned long int value) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(const void* value) { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); + returnValue_.setName("returnValue"); + returnValue_.setValue(value); return *this; } -MockExpectedCall& MockExpectedCallComposite::andReturnValue(double value) +MockExpectedCall& MockCheckedExpectedCall::andReturnValue(void (*value)()) { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); + returnValue_.setName("returnValue"); + returnValue_.setValue(value); return *this; } -MockExpectedCall& MockExpectedCallComposite::andReturnValue(const char* value) +MockExpectedCall& MockCheckedExpectedCall::onObject(void* objectPtr) { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); + isSpecificObjectExpected_ = true; + wasPassedToObject_ = false; + objectPtr_ = objectPtr; return *this; } -MockExpectedCall& MockExpectedCallComposite::andReturnValue(void* value) +MockNamedValue MockCheckedExpectedCall::returnValue() { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); - return *this; + return returnValue_; } -MockExpectedCall& MockExpectedCallComposite::andReturnValue(const void* value) +MockExpectedCall& MockCheckedExpectedCall::withCallOrder(unsigned int initialCallOrder, unsigned int finalCallOrder) { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); + initialExpectedCallOrder_ = initialCallOrder; + finalExpectedCallOrder_ = finalCallOrder; return *this; } -MockExpectedCall& MockExpectedCallComposite::andReturnValue(void (*value)()) +bool MockCheckedExpectedCall::isOutOfOrder() const { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.andReturnValue(value); - return *this; + return outOfOrder_; } -MockExpectedCall& MockExpectedCallComposite::onObject(void* object) +unsigned int MockCheckedExpectedCall::getActualCallsFulfilled() const { - for (MockExpectedCallCompositeNode* node = head_; node != NULL; node = node->next_) - node->call_.onObject(object); - return *this; + return actualCalls_; } MockExpectedCall& MockIgnoredExpectedCall::instance() diff -Nru cpputest-3.8/src/CppUTestExt/MockExpectedCallsList.cpp cpputest-4.0/src/CppUTestExt/MockExpectedCallsList.cpp --- cpputest-3.8/src/CppUTestExt/MockExpectedCallsList.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MockExpectedCallsList.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -29,7 +29,7 @@ #include "CppUTestExt/MockExpectedCallsList.h" #include "CppUTestExt/MockCheckedExpectedCall.h" -MockExpectedCallsList::MockExpectedCallsList() : head_(NULL) +MockExpectedCallsList::MockExpectedCallsList() : head_(NULLPTR) { } @@ -50,9 +50,9 @@ return false; } -int MockExpectedCallsList::size() const +unsigned int MockExpectedCallsList::size() const { - int count = 0; + unsigned int count = 0; for (MockExpectedCallsListNode* p = head_; p; p = p->next_) count++; return count; @@ -60,43 +60,46 @@ bool MockExpectedCallsList::isEmpty() const { - return size() == 0; + return head_ == NULLPTR; } - -int MockExpectedCallsList::amountOfExpectationsFor(const SimpleString& name) const +unsigned int MockExpectedCallsList::amountOfActualCallsFulfilledFor(const SimpleString& name) const { - int count = 0; - for (MockExpectedCallsListNode* p = head_; p; p = p->next_) - if (p->expectedCall_->relatesTo(name)) count++; + unsigned int count = 0; + for (MockExpectedCallsListNode* p = head_; p; p = p->next_) { + if (p->expectedCall_->relatesTo(name)) { + count += p->expectedCall_->getActualCallsFulfilled(); + } + } return count; - } -int MockExpectedCallsList::amountOfUnfulfilledExpectations() const +unsigned int MockExpectedCallsList::amountOfUnfulfilledExpectations() const { - int count = 0; + unsigned int count = 0; for (MockExpectedCallsListNode* p = head_; p; p = p->next_) if (! p->expectedCall_->isFulfilled()) count++; return count; } -bool MockExpectedCallsList::hasFulfilledExpectations() const +bool MockExpectedCallsList::hasFinalizedMatchingExpectations() const { - return (size() - amountOfUnfulfilledExpectations()) != 0; -} - -bool MockExpectedCallsList::hasFulfilledExpectationsWithoutIgnoredParameters() const -{ - for (MockExpectedCallsListNode* p = head_; p; p = p->next_) - if (p->expectedCall_->isFulfilledWithoutIgnoredParameters()) + for (MockExpectedCallsListNode* p = head_; p; p = p->next_) { + if (p->expectedCall_->isMatchingActualCallAndFinalized()) { return true; + } + } return false; } bool MockExpectedCallsList::hasUnfulfilledExpectations() const { - return amountOfUnfulfilledExpectations() != 0; + for (MockExpectedCallsListNode* p = head_; p; p = p->next_) { + if (!p->expectedCall_->isFulfilled()) { + return true; + } + } + return false; } bool MockExpectedCallsList::hasExpectationWithName(const SimpleString& name) const @@ -111,7 +114,7 @@ { MockExpectedCallsListNode* newCall = new MockExpectedCallsListNode(call); - if (head_ == NULL) + if (head_ == NULLPTR) head_ = newCall; else { MockExpectedCallsListNode* lastCall = head_; @@ -120,10 +123,10 @@ } } -void MockExpectedCallsList::addUnfulfilledExpectations(const MockExpectedCallsList& list) +void MockExpectedCallsList::addPotentiallyMatchingExpectations(const MockExpectedCallsList& list) { for (MockExpectedCallsListNode* p = list.head_; p; p = p->next_) - if (! p->expectedCall_->isFulfilled()) + if (p->expectedCall_->canMatchActualCalls()) addExpectedCall(p->expectedCall_); } @@ -144,7 +147,7 @@ { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) if (! p->expectedCall_->relatesTo(name)) - p->expectedCall_ = NULL; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); } @@ -153,17 +156,17 @@ { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) if (!p->expectedCall_->isOutOfOrder()) - p->expectedCall_ = NULL; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); } -void MockExpectedCallsList::onlyKeepUnfulfilledExpectations() +void MockExpectedCallsList::onlyKeepUnmatchingExpectations() { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) - if (p->expectedCall_->isFulfilled()) + if (p->expectedCall_->isMatchingActualCallAndFinalized()) { - p->expectedCall_->resetExpectation(); - p->expectedCall_ = NULL; + p->expectedCall_->resetActualCallMatchingState(); + p->expectedCall_ = NULLPTR; } pruneEmptyNodeFromList(); @@ -173,7 +176,7 @@ { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) if (! p->expectedCall_->hasInputParameterWithName(name)) - p->expectedCall_ = NULL; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); } @@ -181,7 +184,7 @@ { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) if (! p->expectedCall_->hasOutputParameterWithName(name)) - p->expectedCall_ = NULL; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); } @@ -189,7 +192,7 @@ { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) if (! p->expectedCall_->hasInputParameter(parameter)) - p->expectedCall_ = NULL; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); } @@ -197,7 +200,7 @@ { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) if (! p->expectedCall_->hasOutputParameter(parameter)) - p->expectedCall_ = NULL; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); } @@ -205,57 +208,56 @@ { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) if (! p->expectedCall_->relatesToObject(objectPtr)) - p->expectedCall_ = NULL; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); } -MockCheckedExpectedCall* MockExpectedCallsList::removeOneFulfilledExpectation() +MockCheckedExpectedCall* MockExpectedCallsList::removeFirstFinalizedMatchingExpectation() { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) { - if (p->expectedCall_->isFulfilled()) { - MockCheckedExpectedCall* fulfilledCall = p->expectedCall_; - p->expectedCall_ = NULL; + if (p->expectedCall_->isMatchingActualCallAndFinalized()) { + MockCheckedExpectedCall* matchingCall = p->expectedCall_; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); - return fulfilledCall; + return matchingCall; } } - return NULL; + return NULLPTR; } -MockCheckedExpectedCall* MockExpectedCallsList::getOneFulfilledExpectationWithIgnoredParameters() +MockCheckedExpectedCall* MockExpectedCallsList::getFirstMatchingExpectation() { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) { - if (p->expectedCall_->isFulfilledWithoutIgnoredParameters()) { + if (p->expectedCall_->isMatchingActualCall()) { return p->expectedCall_; } } - return NULL; + return NULLPTR; } -MockCheckedExpectedCall* MockExpectedCallsList::removeOneFulfilledExpectationWithIgnoredParameters() +MockCheckedExpectedCall* MockExpectedCallsList::removeFirstMatchingExpectation() { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) { - if (p->expectedCall_->isFulfilledWithoutIgnoredParameters()) { - MockCheckedExpectedCall* fulfilledCall = p->expectedCall_; - p->expectedCall_->parametersWereIgnored(); - p->expectedCall_ = NULL; + if (p->expectedCall_->isMatchingActualCall()) { + MockCheckedExpectedCall* matchingCall = p->expectedCall_; + p->expectedCall_ = NULLPTR; pruneEmptyNodeFromList(); - return fulfilledCall; + return matchingCall; } } - return NULL; + return NULLPTR; } void MockExpectedCallsList::pruneEmptyNodeFromList() { MockExpectedCallsListNode* current = head_; - MockExpectedCallsListNode* previous = NULL; - MockExpectedCallsListNode* toBeDeleted = NULL; + MockExpectedCallsListNode* previous = NULLPTR; + MockExpectedCallsListNode* toBeDeleted = NULLPTR; while (current) { - if (current->expectedCall_ == NULL) { + if (current->expectedCall_ == NULLPTR) { toBeDeleted = current; - if (previous == NULL) + if (previous == NULLPTR) head_ = current = current->next_; else current = previous->next_ = current->next_; @@ -278,16 +280,10 @@ } } -void MockExpectedCallsList::resetExpectations() -{ - for (MockExpectedCallsListNode* p = head_; p; p = p->next_) - p->expectedCall_->resetExpectation(); -} - -void MockExpectedCallsList::callWasMade(int callOrder) +void MockExpectedCallsList::resetActualCallMatchingState() { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) - p->expectedCall_->callWasMade(callOrder); + p->expectedCall_->resetActualCallMatchingState(); } void MockExpectedCallsList::wasPassedToObject() @@ -309,14 +305,6 @@ p->expectedCall_->outputParameterWasPassed(parameterName); } -MockExpectedCallsList::MockExpectedCallsListNode* MockExpectedCallsList::findNodeWithCallOrderOf(int callOrder) const -{ - for (MockExpectedCallsListNode* p = head_; p; p = p->next_) - if (p->expectedCall_->getCallOrder() == callOrder && p->expectedCall_->isFulfilled()) - return p; - return NULL; -} - static SimpleString stringOrNoneTextWhenEmpty(const SimpleString& inputString, const SimpleString& linePrefix) { SimpleString str = inputString; @@ -349,10 +337,9 @@ { SimpleString str; - MockExpectedCallsListNode* nextNodeInOrder; - for (int callOrder = 1; (nextNodeInOrder = findNodeWithCallOrderOf(callOrder)); callOrder++) - if (nextNodeInOrder) - str = appendStringOnANewLine(str, linePrefix, nextNodeInOrder->expectedCall_->callToString()); + for (MockExpectedCallsListNode* p = head_; p; p = p->next_) + if (p->expectedCall_->isFulfilled()) + str = appendStringOnANewLine(str, linePrefix, p->expectedCall_->callToString()); return stringOrNoneTextWhenEmpty(str, linePrefix); } @@ -361,16 +348,16 @@ { SimpleString str; for (MockExpectedCallsListNode* p = head_; p; p = p->next_) - if (! p->expectedCall_->isFulfilled()) + if (! p->expectedCall_->isMatchingActualCall()) str = appendStringOnANewLine(str, "", p->expectedCall_->missingParametersToString()); return stringOrNoneTextWhenEmpty(str, ""); } -bool MockExpectedCallsList::hasUnfulfilledExpectationsBecauseOfMissingParameters() const +bool MockExpectedCallsList::hasUnmatchingExpectationsBecauseOfMissingParameters() const { for (MockExpectedCallsListNode* p = head_; p; p = p->next_) - if (! p->expectedCall_->areParametersFulfilled()) + if (! p->expectedCall_->areParametersMatchingActualCall()) return true; return false; } diff -Nru cpputest-3.8/src/CppUTestExt/MockFailure.cpp cpputest-4.0/src/CppUTestExt/MockFailure.cpp --- cpputest-3.8/src/CppUTestExt/MockFailure.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MockFailure.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -38,7 +38,7 @@ { } - virtual void exitCurrentTest() const + virtual void exitCurrentTest() const _override { if (crashOnFailure_) UT_CRASH(); @@ -46,7 +46,7 @@ NormalTestTerminator::exitCurrentTest(); } // LCOV_EXCL_LINE - virtual ~MockFailureReporterTestTerminator() + virtual ~MockFailureReporterTestTerminator() _destructor_override { } private: @@ -71,9 +71,9 @@ void MockFailure::addExpectationsAndCallHistory(const MockExpectedCallsList& expectations) { - message_ += "\tEXPECTED calls that did NOT happen:\n"; + message_ += "\tEXPECTED calls that WERE NOT fulfilled:\n"; message_ += expectations.unfulfilledCallsToString("\t\t"); - message_ += "\n\tACTUAL calls that did happen (in call order):\n"; + message_ += "\n\tEXPECTED calls that WERE fulfilled:\n"; message_ += expectations.fulfilledCallsToString("\t\t"); } @@ -82,13 +82,13 @@ MockExpectedCallsList expectationsForFunction; expectationsForFunction.addExpectationsRelatedTo(name, expectations); - message_ += "\tEXPECTED calls that DID NOT happen related to function: "; + message_ += "\tEXPECTED calls that WERE NOT fulfilled related to function: "; message_ += name; message_ += "\n"; message_ += expectationsForFunction.unfulfilledCallsToString("\t\t"); - message_ += "\n\tACTUAL calls that DID happen related to function: "; + message_ += "\n\tEXPECTED calls that WERE fulfilled related to function: "; message_ += name; message_ += "\n"; @@ -97,14 +97,15 @@ MockExpectedCallsDidntHappenFailure::MockExpectedCallsDidntHappenFailure(UtestShell* test, const MockExpectedCallsList& expectations) : MockFailure(test) { - message_ = "Mock Failure: Expected call did not happen.\n"; + message_ = "Mock Failure: Expected call WAS NOT fulfilled.\n"; addExpectationsAndCallHistory(expectations); } MockUnexpectedCallHappenedFailure::MockUnexpectedCallHappenedFailure(UtestShell* test, const SimpleString& name, const MockExpectedCallsList& expectations) : MockFailure(test) { - if (expectations.amountOfExpectationsFor(name)) { - SimpleString ordinalNumber = StringFromOrdinalNumber((unsigned)(expectations.amountOfExpectationsFor(name) + 1)); + unsigned int amountOfActualCalls = expectations.amountOfActualCallsFulfilledFor(name); + if (amountOfActualCalls > 0) { + SimpleString ordinalNumber = StringFromOrdinalNumber(amountOfActualCalls + 1); message_ = StringFromFormat("Mock Failure: Unexpected additional (%s) call to function: ", ordinalNumber.asCharString()); } else { message_ = "Mock Failure: Unexpected call to function: "; diff -Nru cpputest-3.8/src/CppUTestExt/MockNamedValue.cpp cpputest-4.0/src/CppUTestExt/MockNamedValue.cpp --- cpputest-3.8/src/CppUTestExt/MockNamedValue.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MockNamedValue.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,14 +30,20 @@ #include "CppUTest/PlatformSpecificFunctions.h" -MockNamedValueComparatorsAndCopiersRepository* MockNamedValue::defaultRepository_ = NULL; +MockNamedValueComparatorsAndCopiersRepository* MockNamedValue::defaultRepository_ = NULLPTR; +const double MockNamedValue::defaultDoubleTolerance = 0.005; void MockNamedValue::setDefaultComparatorsAndCopiersRepository(MockNamedValueComparatorsAndCopiersRepository* repository) { defaultRepository_ = repository; } -MockNamedValue::MockNamedValue(const SimpleString& name) : name_(name), type_("int"), size_(0), comparator_(NULL), copier_(NULL) +MockNamedValueComparatorsAndCopiersRepository* MockNamedValue::getDefaultComparatorsAndCopiersRepository() +{ + return defaultRepository_; +} + +MockNamedValue::MockNamedValue(const SimpleString& name) : name_(name), type_("int"), size_(0), comparator_(NULLPTR), copier_(NULLPTR) { value_.intValue_ = 0; } @@ -76,10 +82,44 @@ value_.unsignedLongIntValue_ = value; } +#ifdef CPPUTEST_USE_LONG_LONG + +void MockNamedValue::setValue(cpputest_longlong value) +{ + type_ = "long long int"; + value_.longLongIntValue_ = value; +} + +void MockNamedValue::setValue(cpputest_ulonglong value) +{ + type_ = "unsigned long long int"; + value_.unsignedLongLongIntValue_ = value; +} + +#else + +void MockNamedValue::setValue(cpputest_longlong) +{ + FAIL("Long Long type is not supported"); +} + +void MockNamedValue::setValue(cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); +} + +#endif + void MockNamedValue::setValue(double value) { + setValue(value, defaultDoubleTolerance); +} + +void MockNamedValue::setValue(double value, double tolerance) +{ type_ = "double"; - value_.doubleValue_ = value; + value_.doubleValue_.value = value; + value_.doubleValue_.tolerance = tolerance; } void MockNamedValue::setValue(void* value) @@ -113,7 +153,18 @@ size_ = size; } -void MockNamedValue::setObjectPointer(const SimpleString& type, const void* objectPtr) +void MockNamedValue::setConstObjectPointer(const SimpleString& type, const void* objectPtr) +{ + type_ = type; + value_.constObjectPointerValue_ = objectPtr; + if (defaultRepository_) + { + comparator_ = defaultRepository_->getComparatorForType(type); + copier_ = defaultRepository_->getCopierForType(type); + } +} + +void MockNamedValue::setObjectPointer(const SimpleString& type, void* objectPtr) { type_ = type; value_.objectPointerValue_ = objectPtr; @@ -195,10 +246,70 @@ } } +#ifdef CPPUTEST_USE_LONG_LONG + +cpputest_longlong MockNamedValue::getLongLongIntValue() const +{ + if(type_ == "int") + return value_.intValue_; + else if(type_ == "unsigned int") + return (long long int)value_.unsignedIntValue_; + else if(type_ == "long int") + return value_.longIntValue_; + else if(type_ == "unsigned long int") + return (long long int)value_.unsignedLongIntValue_; + else + { + STRCMP_EQUAL("long long int", type_.asCharString()); + return value_.longLongIntValue_; + } +} + +cpputest_ulonglong MockNamedValue::getUnsignedLongLongIntValue() const +{ + if(type_ == "unsigned int") + return value_.unsignedIntValue_; + else if(type_ == "int" && value_.intValue_ >= 0) + return (unsigned long long int)value_.intValue_; + else if(type_ == "long int" && value_.longIntValue_ >= 0) + return (unsigned long long int)value_.longIntValue_; + else if(type_ == "unsigned long int") + return value_.unsignedLongIntValue_; + else if(type_ == "long long int" && value_.longLongIntValue_ >= 0) + return (unsigned long long int)value_.longLongIntValue_; + else + { + STRCMP_EQUAL("unsigned long long int", type_.asCharString()); + return value_.unsignedLongLongIntValue_; + } +} + +#else + +cpputest_longlong MockNamedValue::getLongLongIntValue() const +{ + FAIL("Long Long type is not supported"); + return cpputest_longlong(0); +} + +cpputest_ulonglong MockNamedValue::getUnsignedLongLongIntValue() const +{ + FAIL("Unsigned Long Long type is not supported"); + return cpputest_ulonglong(0); +} + +#endif + double MockNamedValue::getDoubleValue() const { STRCMP_EQUAL("double", type_.asCharString()); - return value_.doubleValue_; + return value_.doubleValue_.value; +} + +double MockNamedValue::getDoubleTolerance() const +{ + STRCMP_EQUAL("double", type_.asCharString()); + return value_.doubleValue_.tolerance; } const char* MockNamedValue::getStringValue() const @@ -231,7 +342,12 @@ return value_.memoryBufferValue_; } -const void* MockNamedValue::getObjectPointer() const +const void* MockNamedValue::getConstObjectPointer() const +{ + return value_.constObjectPointerValue_; +} + +void* MockNamedValue::getObjectPointer() const { return value_.objectPointerValue_; } @@ -258,25 +374,63 @@ else if((type_ == "int") && (p.type_ == "long int")) return value_.intValue_ == p.value_.longIntValue_; else if((type_ == "unsigned int") && (p.type_ == "int")) - return (long)value_.unsignedIntValue_ == (long)p.value_.intValue_; + return (p.value_.intValue_ >= 0) && (value_.unsignedIntValue_ == (unsigned int)p.value_.intValue_); else if((type_ == "int") && (p.type_ == "unsigned int")) - return (long)value_.intValue_ == (long)p.value_.unsignedIntValue_; + return (value_.intValue_ >= 0) && ((unsigned int)value_.intValue_ == p.value_.unsignedIntValue_); else if((type_ == "unsigned long int") && (p.type_ == "int")) - return value_.unsignedLongIntValue_ == (unsigned long)p.value_.intValue_; + return (p.value_.intValue_ >= 0) && (value_.unsignedLongIntValue_ == (unsigned long)p.value_.intValue_); else if((type_ == "int") && (p.type_ == "unsigned long int")) - return (unsigned long)value_.intValue_ == p.value_.unsignedLongIntValue_; + return (value_.intValue_ >= 0) && ((unsigned long)value_.intValue_ == p.value_.unsignedLongIntValue_); else if((type_ == "unsigned int") && (p.type_ == "long int")) - return (long int)value_.unsignedIntValue_ == p.value_.longIntValue_; + return (p.value_.longIntValue_ >= 0) && (value_.unsignedIntValue_ == (unsigned long)p.value_.longIntValue_); else if((type_ == "long int") && (p.type_ == "unsigned int")) - return value_.longIntValue_ == (long int)p.value_.unsignedIntValue_; + return (value_.longIntValue_ >= 0) && ((unsigned long)value_.longIntValue_ == p.value_.unsignedIntValue_); else if((type_ == "unsigned int") && (p.type_ == "unsigned long int")) return value_.unsignedIntValue_ == p.value_.unsignedLongIntValue_; else if((type_ == "unsigned long int") && (p.type_ == "unsigned int")) return value_.unsignedLongIntValue_ == p.value_.unsignedIntValue_; else if((type_ == "long int") && (p.type_ == "unsigned long int")) - return (value_.longIntValue_ >= 0) && (value_.longIntValue_ == (long) p.value_.unsignedLongIntValue_); + return (value_.longIntValue_ >= 0) && ((unsigned long)value_.longIntValue_ == p.value_.unsignedLongIntValue_); else if((type_ == "unsigned long int") && (p.type_ == "long int")) - return (p.value_.longIntValue_ >= 0) && ((long)value_.unsignedLongIntValue_ == p.value_.longIntValue_); + return (p.value_.longIntValue_ >= 0) && (value_.unsignedLongIntValue_ == (unsigned long) p.value_.longIntValue_); +#ifdef CPPUTEST_USE_LONG_LONG + else if ((type_ == "long long int") && (p.type_ == "int")) + return value_.longLongIntValue_ == p.value_.intValue_; + else if ((type_ == "int") && (p.type_ == "long long int")) + return value_.intValue_ == p.value_.longLongIntValue_; + else if ((type_ == "long long int") && (p.type_ == "long int")) + return value_.longLongIntValue_ == p.value_.longIntValue_; + else if ((type_ == "long int") && (p.type_ == "long long int")) + return value_.longIntValue_ == p.value_.longLongIntValue_; + else if ((type_ == "long long int") && (p.type_ == "unsigned int")) + return (value_.longLongIntValue_ >= 0) && ((unsigned long long)value_.longLongIntValue_ == p.value_.unsignedIntValue_); + else if ((type_ == "unsigned int") && (p.type_ == "long long int")) + return (p.value_.longLongIntValue_ >= 0) && (value_.unsignedIntValue_ == (unsigned long long)p.value_.longLongIntValue_); + else if ((type_ == "long long int") && (p.type_ == "unsigned long int")) + return (value_.longLongIntValue_ >= 0) && ((unsigned long long)value_.longLongIntValue_ == p.value_.unsignedLongIntValue_); + else if ((type_ == "unsigned long int") && (p.type_ == "long long int")) + return (p.value_.longLongIntValue_ >= 0) && (value_.unsignedLongIntValue_ == (unsigned long long)p.value_.longLongIntValue_); + else if ((type_ == "long long int") && (p.type_ == "unsigned long long int")) + return (value_.longLongIntValue_ >= 0) && ((unsigned long long)value_.longLongIntValue_ == p.value_.unsignedLongLongIntValue_); + else if ((type_ == "unsigned long long int") && (p.type_ == "long long int")) + return (p.value_.longLongIntValue_ >= 0) && (value_.unsignedLongLongIntValue_ == (unsigned long long)p.value_.longLongIntValue_); + else if ((type_ == "unsigned long long int") && (p.type_ == "int")) + return (p.value_.intValue_ >= 0) && (value_.unsignedLongLongIntValue_ == (unsigned long long)p.value_.intValue_); + else if ((type_ == "int") && (p.type_ == "unsigned long long int")) + return (value_.intValue_ >= 0) && ((unsigned long long)value_.intValue_ == p.value_.unsignedLongLongIntValue_); + else if ((type_ == "unsigned long long int") && (p.type_ == "unsigned int")) + return value_.unsignedLongLongIntValue_ == p.value_.unsignedIntValue_; + else if ((type_ == "unsigned int") && (p.type_ == "unsigned long long int")) + return value_.unsignedIntValue_ == p.value_.unsignedLongLongIntValue_; + else if ((type_ == "unsigned long long int") && (p.type_ == "long int")) + return (p.value_.longIntValue_ >= 0) && (value_.unsignedLongLongIntValue_ == (unsigned long long)p.value_.longIntValue_); + else if ((type_ == "long int") && (p.type_ == "unsigned long long int")) + return (value_.longIntValue_ >= 0) && ((unsigned long long)value_.longIntValue_ == p.value_.unsignedLongLongIntValue_); + else if ((type_ == "unsigned long long int") && (p.type_ == "unsigned long int")) + return value_.unsignedLongLongIntValue_ == p.value_.unsignedLongIntValue_; + else if ((type_ == "unsigned long int") && (p.type_ == "unsigned long long int")) + return value_.unsignedLongIntValue_ == p.value_.unsignedLongLongIntValue_; +#endif if (type_ != p.type_) return false; @@ -290,6 +444,12 @@ return value_.longIntValue_ == p.value_.longIntValue_; else if (type_ == "unsigned long int") return value_.unsignedLongIntValue_ == p.value_.unsignedLongIntValue_; +#ifdef CPPUTEST_USE_LONG_LONG + else if (type_ == "long long int") + return value_.longLongIntValue_ == p.value_.longLongIntValue_; + else if (type_ == "unsigned long long int") + return value_.unsignedLongLongIntValue_ == p.value_.unsignedLongLongIntValue_; +#endif else if (type_ == "const char*") return SimpleString(value_.stringValue_) == SimpleString(p.value_.stringValue_); else if (type_ == "void*") @@ -299,7 +459,7 @@ else if (type_ == "void (*)()") return value_.functionPointerValue_ == p.value_.functionPointerValue_; else if (type_ == "double") - return (doubles_equal(value_.doubleValue_, p.value_.doubleValue_, 0.005)); + return (doubles_equal(value_.doubleValue_.value, p.value_.doubleValue_.value, value_.doubleValue_.tolerance)); else if (type_ == "const unsigned char*") { if (size_ != p.size_) { @@ -309,7 +469,7 @@ } if (comparator_) - return comparator_->isEqual(value_.objectPointerValue_, p.value_.objectPointerValue_); + return comparator_->isEqual(value_.constObjectPointerValue_, p.value_.constObjectPointerValue_); return false; } @@ -329,13 +489,19 @@ if (type_ == "bool") return StringFrom(value_.boolValue_); else if (type_ == "int") - return StringFrom(value_.intValue_); + return StringFrom(value_.intValue_) + " " + BracketsFormattedHexStringFrom(value_.intValue_); else if (type_ == "unsigned int") - return StringFrom(value_.unsignedIntValue_); + return StringFrom(value_.unsignedIntValue_) + " " + BracketsFormattedHexStringFrom(value_.unsignedIntValue_); else if (type_ == "long int") - return StringFrom(value_.longIntValue_); + return StringFrom(value_.longIntValue_) + " " + BracketsFormattedHexStringFrom(value_.longIntValue_); else if (type_ == "unsigned long int") - return StringFrom(value_.unsignedLongIntValue_); + return StringFrom(value_.unsignedLongIntValue_) + " " + BracketsFormattedHexStringFrom(value_.unsignedLongIntValue_); +#ifdef CPPUTEST_USE_LONG_LONG + else if (type_ == "long long int") + return StringFrom(value_.longLongIntValue_) + " " + BracketsFormattedHexStringFrom(value_.longLongIntValue_); + else if (type_ == "unsigned long long int") + return StringFrom(value_.unsignedLongLongIntValue_) + " " + BracketsFormattedHexStringFrom(value_.unsignedLongLongIntValue_); +#endif else if (type_ == "const char*") return value_.stringValue_; else if (type_ == "void*") @@ -345,12 +511,12 @@ else if (type_ == "const void*") return StringFrom(value_.constPointerValue_); else if (type_ == "double") - return StringFrom(value_.doubleValue_); + return StringFrom(value_.doubleValue_.value); else if (type_ == "const unsigned char*") return StringFromBinaryWithSizeOrNull(value_.memoryBufferValue_, size_); if (comparator_) - return comparator_->valueToString(value_.objectPointerValue_); + return comparator_->valueToString(value_.constObjectPointerValue_); return StringFromFormat("No comparator found for type: \"%s\"", type_.asCharString()); @@ -377,7 +543,7 @@ } MockNamedValueListNode::MockNamedValueListNode(MockNamedValue* newValue) - : data_(newValue), next_(NULL) + : data_(newValue), next_(NULLPTR) { } @@ -391,7 +557,7 @@ return data_->getType(); } -MockNamedValueList::MockNamedValueList() : head_(NULL) +MockNamedValueList::MockNamedValueList() : head_(NULLPTR) { } @@ -408,7 +574,7 @@ void MockNamedValueList::add(MockNamedValue* newValue) { MockNamedValueListNode* newNode = new MockNamedValueListNode(newValue); - if (head_ == NULL) + if (head_ == NULLPTR) head_ = newNode; else { MockNamedValueListNode* lastNode = head_; @@ -422,7 +588,7 @@ for (MockNamedValueListNode * p = head_; p; p = p->next()) if (p->getName() == name) return p->item(); - return NULL; + return NULLPTR; } MockNamedValueListNode* MockNamedValueList::begin() @@ -433,16 +599,18 @@ struct MockNamedValueComparatorsAndCopiersRepositoryNode { MockNamedValueComparatorsAndCopiersRepositoryNode(const SimpleString& name, MockNamedValueComparator* comparator, MockNamedValueComparatorsAndCopiersRepositoryNode* next) - : name_(name), comparator_(comparator), copier_(NULL), next_(next) {} + : name_(name), comparator_(comparator), copier_(NULLPTR), next_(next) {} MockNamedValueComparatorsAndCopiersRepositoryNode(const SimpleString& name, MockNamedValueCopier* copier, MockNamedValueComparatorsAndCopiersRepositoryNode* next) - : name_(name), comparator_(NULL), copier_(copier), next_(next) {} + : name_(name), comparator_(NULLPTR), copier_(copier), next_(next) {} + MockNamedValueComparatorsAndCopiersRepositoryNode(const SimpleString& name, MockNamedValueComparator* comparator, MockNamedValueCopier* copier, MockNamedValueComparatorsAndCopiersRepositoryNode* next) + : name_(name), comparator_(comparator), copier_(copier), next_(next) {} SimpleString name_; MockNamedValueComparator* comparator_; MockNamedValueCopier* copier_; MockNamedValueComparatorsAndCopiersRepositoryNode* next_; }; -MockNamedValueComparatorsAndCopiersRepository::MockNamedValueComparatorsAndCopiersRepository() : head_(NULL) +MockNamedValueComparatorsAndCopiersRepository::MockNamedValueComparatorsAndCopiersRepository() : head_(NULLPTR) { } @@ -475,18 +643,18 @@ { for (MockNamedValueComparatorsAndCopiersRepositoryNode* p = head_; p; p = p->next_) if (p->name_ == name && p->comparator_) return p->comparator_; - return NULL; + return NULLPTR; } MockNamedValueCopier* MockNamedValueComparatorsAndCopiersRepository::getCopierForType(const SimpleString& name) { for (MockNamedValueComparatorsAndCopiersRepositoryNode* p = head_; p; p = p->next_) if (p->name_ == name && p->copier_) return p->copier_; - return NULL; + return NULLPTR; } void MockNamedValueComparatorsAndCopiersRepository::installComparatorsAndCopiers(const MockNamedValueComparatorsAndCopiersRepository& repository) { for (MockNamedValueComparatorsAndCopiersRepositoryNode* p = repository.head_; p; p = p->next_) - head_ = new MockNamedValueComparatorsAndCopiersRepositoryNode(p->name_, p->comparator_, head_); + head_ = new MockNamedValueComparatorsAndCopiersRepositoryNode(p->name_, p->comparator_, p->copier_, head_); } diff -Nru cpputest-3.8/src/CppUTestExt/MockSupport_c.cpp cpputest-4.0/src/CppUTestExt/MockSupport_c.cpp --- cpputest-3.8/src/CppUTestExt/MockSupport_c.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MockSupport_c.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -49,7 +49,7 @@ TestTerminatorWithoutExceptions::exitCurrentTest(); } // LCOV_EXCL_LINE // LCOV_EXCL_START - virtual ~MockFailureReporterTestTerminatorForInCOnlyCode() + virtual ~MockFailureReporterTestTerminatorForInCOnlyCode() _destructor_override { } // LCOV_EXCL_STOP @@ -69,9 +69,9 @@ }; -static MockSupport* currentMockSupport = NULL; -static MockExpectedCall* expectedCall = NULL; -static MockActualCall* actualCall = NULL; +static MockSupport* currentMockSupport = NULLPTR; +static MockExpectedCall* expectedCall = NULLPTR; +static MockActualCall* actualCall = NULLPTR; static MockFailureReporterForInCOnlyCode failureReporterForC; class MockCFunctionComparatorNode : public MockNamedValueComparator @@ -79,7 +79,7 @@ public: MockCFunctionComparatorNode(MockCFunctionComparatorNode* next, MockTypeEqualFunction_c equal, MockTypeValueToStringFunction_c toString) : next_(next), equal_(equal), toString_(toString) {} - virtual ~MockCFunctionComparatorNode() {} + virtual ~MockCFunctionComparatorNode() _destructor_override {} virtual bool isEqual(const void* object1, const void* object2) _override { @@ -95,14 +95,14 @@ MockTypeValueToStringFunction_c toString_; }; -static MockCFunctionComparatorNode* comparatorList_ = NULL; +static MockCFunctionComparatorNode* comparatorList_ = NULLPTR; class MockCFunctionCopierNode : public MockNamedValueCopier { public: MockCFunctionCopierNode(MockCFunctionCopierNode* next, MockTypeCopyFunction_c copier) : next_(next), copier_(copier) {} - virtual ~MockCFunctionCopierNode() {} + virtual ~MockCFunctionCopierNode() _destructor_override {} virtual void copy(void* dst, const void* src) _override { @@ -113,14 +113,14 @@ MockTypeCopyFunction_c copier_; }; -static MockCFunctionCopierNode* copierList_ = NULL; +static MockCFunctionCopierNode* copierList_ = NULLPTR; extern "C" { void strictOrder_c(); MockExpectedCall_c* expectOneCall_c(const char* name); void expectNoCall_c(const char* name); -MockExpectedCall_c* expectNCalls_c(const int number, const char* name); +MockExpectedCall_c* expectNCalls_c(const unsigned int number, const char* name); MockActualCall_c* actualCall_c(const char* name); void disable_c(); void enable_c(); @@ -134,6 +134,7 @@ void setConstPointerData_c(const char* name, const void* value); void setFunctionPointerData_c(const char* name, void (*value)()); void setDataObject_c(const char* name, const char* type, void* value); +void setDataConstObject_c(const char* name, const char* type, const void* value); MockValue_c getData_c(const char* name); int hasReturnValue_c(); @@ -147,7 +148,10 @@ MockExpectedCall_c* withUnsignedIntParameters_c(const char* name, unsigned int value); MockExpectedCall_c* withLongIntParameters_c(const char* name, long int value); MockExpectedCall_c* withUnsignedLongIntParameters_c(const char* name, unsigned long int value); +MockExpectedCall_c* withLongLongIntParameters_c(const char* name, cpputest_longlong value); +MockExpectedCall_c* withUnsignedLongLongIntParameters_c(const char* name, cpputest_ulonglong value); MockExpectedCall_c* withDoubleParameters_c(const char* name, double value); +MockExpectedCall_c* withDoubleParametersAndTolerance_c(const char* name, double value, double tolerance); MockExpectedCall_c* withStringParameters_c(const char* name, const char* value); MockExpectedCall_c* withPointerParameters_c(const char* name, void* value); MockExpectedCall_c* withConstPointerParameters_c(const char* name, const void* value); @@ -156,12 +160,15 @@ MockExpectedCall_c* withParameterOfType_c(const char* type, const char* name, const void* value); MockExpectedCall_c* withOutputParameterReturning_c(const char* name, const void* value, size_t size); MockExpectedCall_c* withOutputParameterOfTypeReturning_c(const char* type, const char* name, const void* value); +MockExpectedCall_c* withUnmodifiedOutputParameter_c(const char* name); MockExpectedCall_c* ignoreOtherParameters_c(); MockExpectedCall_c* andReturnBoolValue_c(int value); MockExpectedCall_c* andReturnIntValue_c(int value); MockExpectedCall_c* andReturnUnsignedIntValue_c(unsigned int value); MockExpectedCall_c* andReturnLongIntValue_c(long int value); MockExpectedCall_c* andReturnUnsignedLongIntValue_c(unsigned long int value); +MockExpectedCall_c* andReturnLongLongIntValue_c(cpputest_longlong value); +MockExpectedCall_c* andReturnUnsignedLongLongIntValue_c(cpputest_ulonglong value); MockExpectedCall_c* andReturnDoubleValue_c(double value); MockExpectedCall_c* andReturnStringValue_c(const char* value); MockExpectedCall_c* andReturnPointerValue_c(void* value); @@ -173,6 +180,8 @@ MockActualCall_c* withActualUnsignedIntParameters_c(const char* name, unsigned int value); MockActualCall_c* withActualLongIntParameters_c(const char* name, long int value); MockActualCall_c* withActualUnsignedLongIntParameters_c(const char* name, unsigned long int value); +MockActualCall_c* withActualLongLongIntParameters_c(const char* name, cpputest_longlong value); +MockActualCall_c* withActualUnsignedLongLongIntParameters_c(const char* name, cpputest_ulonglong value); MockActualCall_c* withActualDoubleParameters_c(const char* name, double value); MockActualCall_c* withActualStringParameters_c(const char* name, const char* value); MockActualCall_c* withActualPointerParameters_c(const char* name, void* value); @@ -193,6 +202,10 @@ long int returnLongIntValueOrDefault_c(long int defaultValue); unsigned long int unsignedLongIntReturnValue_c(); unsigned long int returnUnsignedLongIntValueOrDefault_c(unsigned long int defaultValue); +cpputest_longlong longLongIntReturnValue_c(); +cpputest_longlong returnLongLongIntValueOrDefault_c(cpputest_longlong defaultValue); +cpputest_ulonglong unsignedLongLongIntReturnValue_c(); +cpputest_ulonglong returnUnsignedLongLongIntValueOrDefault_c(cpputest_ulonglong defaultValue); const char* stringReturnValue_c(); const char* returnStringValueOrDefault_c(const char * defaultValue); double doubleReturnValue_c(); @@ -237,7 +250,10 @@ withUnsignedIntParameters_c, withLongIntParameters_c, withUnsignedLongIntParameters_c, + withLongLongIntParameters_c, + withUnsignedLongLongIntParameters_c, withDoubleParameters_c, + withDoubleParametersAndTolerance_c, withStringParameters_c, withPointerParameters_c, withConstPointerParameters_c, @@ -246,12 +262,15 @@ withParameterOfType_c, withOutputParameterReturning_c, withOutputParameterOfTypeReturning_c, + withUnmodifiedOutputParameter_c, ignoreOtherParameters_c, andReturnBoolValue_c, andReturnUnsignedIntValue_c, andReturnIntValue_c, andReturnLongIntValue_c, andReturnUnsignedLongIntValue_c, + andReturnLongLongIntValue_c, + andReturnUnsignedLongLongIntValue_c, andReturnDoubleValue_c, andReturnStringValue_c, andReturnPointerValue_c, @@ -265,6 +284,8 @@ withActualUnsignedIntParameters_c, withActualLongIntParameters_c, withActualUnsignedLongIntParameters_c, + withActualLongLongIntParameters_c, + withActualUnsignedLongLongIntParameters_c, withActualDoubleParameters_c, withActualStringParameters_c, withActualPointerParameters_c, @@ -286,6 +307,10 @@ returnLongIntValueOrDefault_c, unsignedLongIntReturnValue_c, returnUnsignedLongIntValueOrDefault_c, + longLongIntReturnValue_c, + returnLongLongIntValueOrDefault_c, + unsignedLongLongIntReturnValue_c, + returnUnsignedLongLongIntValueOrDefault_c, stringReturnValue_c, returnStringValueOrDefault_c, doubleReturnValue_c, @@ -316,6 +341,10 @@ returnLongIntValueOrDefault_c, unsignedLongIntReturnValue_c, returnUnsignedLongIntValueOrDefault_c, + longLongIntReturnValue_c, + returnLongLongIntValueOrDefault_c, + unsignedLongLongIntReturnValue_c, + returnUnsignedLongLongIntValueOrDefault_c, stringReturnValue_c, returnStringValueOrDefault_c, doubleReturnValue_c, @@ -335,6 +364,7 @@ setConstPointerData_c, setFunctionPointerData_c, setDataObject_c, + setDataConstObject_c, getData_c, disable_c, enable_c, @@ -378,12 +408,48 @@ return &gExpectedCall; } +#ifdef CPPUTEST_USE_LONG_LONG + +MockExpectedCall_c* withLongLongIntParameters_c(const char* name, cpputest_longlong value) +{ + expectedCall = &expectedCall->withParameter(name, value); + return &gExpectedCall; +} + +MockExpectedCall_c* withUnsignedLongLongIntParameters_c(const char* name, cpputest_ulonglong value) +{ + expectedCall = &expectedCall->withParameter(name, value); + return &gExpectedCall; +} + +#else + +MockExpectedCall_c* withLongLongIntParameters_c(const char*, cpputest_longlong) +{ + FAIL("Long Long type is not supported"); + return &gExpectedCall; +} + +MockExpectedCall_c* withUnsignedLongLongIntParameters_c(const char*, cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); + return &gExpectedCall; +} + +#endif + MockExpectedCall_c* withDoubleParameters_c(const char* name, double value) { expectedCall = &expectedCall->withParameter(name, value); return &gExpectedCall; } +MockExpectedCall_c* withDoubleParametersAndTolerance_c(const char* name, double value, double tolerance) +{ + expectedCall = &expectedCall->withParameter(name, value, tolerance); + return &gExpectedCall; +} + MockExpectedCall_c* withStringParameters_c(const char* name, const char* value) { expectedCall = &expectedCall->withParameter(name, value); @@ -432,6 +498,12 @@ return &gExpectedCall; } +MockExpectedCall_c* withUnmodifiedOutputParameter_c(const char* name) +{ + expectedCall = &expectedCall->withUnmodifiedOutputParameter(name); + return &gExpectedCall; +} + MockExpectedCall_c* ignoreOtherParameters_c() { expectedCall = &expectedCall->ignoreOtherParameters(); @@ -468,6 +540,36 @@ return &gExpectedCall; } +#ifdef CPPUTEST_USE_LONG_LONG + +MockExpectedCall_c* andReturnLongLongIntValue_c(cpputest_longlong value) +{ + expectedCall = &expectedCall->andReturnValue(value); + return &gExpectedCall; +} + +MockExpectedCall_c* andReturnUnsignedLongLongIntValue_c(cpputest_ulonglong value) +{ + expectedCall = &expectedCall->andReturnValue(value); + return &gExpectedCall; +} + +#else + +MockExpectedCall_c* andReturnLongLongIntValue_c(cpputest_longlong) +{ + FAIL("Long Long type is not supported"); + return &gExpectedCall; +} + +MockExpectedCall_c* andReturnUnsignedLongLongIntValue_c(cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); + return &gExpectedCall; +} + +#endif + MockExpectedCall_c* andReturnDoubleValue_c(double value) { expectedCall = &expectedCall->andReturnValue(value); @@ -521,6 +623,16 @@ returnValue.type = MOCKVALUETYPE_UNSIGNED_LONG_INTEGER; returnValue.value.unsignedLongIntValue = namedValue.getUnsignedLongIntValue(); } +#ifdef CPPUTEST_USE_LONG_LONG + else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "long long int") == 0) { + returnValue.type = MOCKVALUETYPE_LONG_LONG_INTEGER; + returnValue.value.longLongIntValue = namedValue.getLongLongIntValue(); + } + else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "unsigned long long int") == 0) { + returnValue.type = MOCKVALUETYPE_UNSIGNED_LONG_LONG_INTEGER; + returnValue.value.unsignedLongLongIntValue = namedValue.getUnsignedLongLongIntValue(); + } +#endif else if (SimpleString::StrCmp(namedValue.getType().asCharString(), "double") == 0) { returnValue.type = MOCKVALUETYPE_DOUBLE; returnValue.value.doubleValue = namedValue.getDoubleValue(); @@ -568,7 +680,7 @@ currentMockSupport->expectNoCall(name); } -MockExpectedCall_c* expectNCalls_c(const int number, const char* name) +MockExpectedCall_c* expectNCalls_c(const unsigned int number, const char* name) { expectedCall = ¤tMockSupport->expectNCalls(number, name); return &gExpectedCall; @@ -610,6 +722,36 @@ return &gActualCall; } +#ifdef CPPUTEST_USE_LONG_LONG + +MockActualCall_c* withActualLongLongIntParameters_c(const char* name, cpputest_longlong value) +{ + actualCall = &actualCall->withParameter(name, value); + return &gActualCall; +} + +MockActualCall_c* withActualUnsignedLongLongIntParameters_c(const char* name, cpputest_ulonglong value) +{ + actualCall = &actualCall->withParameter(name, value); + return &gActualCall; +} + +#else + +MockActualCall_c* withActualLongLongIntParameters_c(const char*, cpputest_longlong) +{ + FAIL("Long Long type is not supported"); + return &gActualCall; +} + +MockActualCall_c* withActualUnsignedLongLongIntParameters_c(const char*, cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); + return &gActualCall; +} + +#endif + MockActualCall_c* withActualDoubleParameters_c(const char* name, double value) { actualCall = &actualCall->withParameter(name, value); @@ -734,6 +876,62 @@ return unsignedLongIntReturnValue_c(); } +#ifdef CPPUTEST_USE_LONG_LONG + +cpputest_longlong longLongIntReturnValue_c() +{ + return actualCall->returnLongLongIntValue(); +} + +cpputest_longlong returnLongLongIntValueOrDefault_c(cpputest_longlong defaultValue) +{ + if (!hasReturnValue_c()) { + return defaultValue; + } + return longLongIntReturnValue_c(); +} + +cpputest_ulonglong unsignedLongLongIntReturnValue_c() +{ + return actualCall->returnUnsignedLongLongIntValue(); +} + +cpputest_ulonglong returnUnsignedLongLongIntValueOrDefault_c(cpputest_ulonglong defaultValue) +{ + if (!hasReturnValue_c()) { + return defaultValue; + } + return unsignedLongLongIntReturnValue_c(); +} + +#else + +cpputest_longlong longLongIntReturnValue_c() +{ + FAIL("Long Long type is not supported"); + return cpputest_longlong(0); +} + +cpputest_longlong returnLongLongIntValueOrDefault_c(cpputest_longlong) +{ + FAIL("Long Long type is not supported"); + return cpputest_longlong(0); +} + +cpputest_ulonglong unsignedLongLongIntReturnValue_c() +{ + FAIL("Unsigned Long Long type is not supported"); + return cpputest_ulonglong(0); +} + +cpputest_ulonglong returnUnsignedLongLongIntValueOrDefault_c(cpputest_ulonglong) +{ + FAIL("Unsigned Long Long type is not supported"); + return cpputest_ulonglong(0); +} + +#endif + const char* stringReturnValue_c() { return actualCall->returnStringValue(); @@ -859,6 +1057,11 @@ currentMockSupport->setDataObject(name, type, value); } +void setDataConstObject_c(const char* name, const char* type, const void* value) +{ + currentMockSupport->setDataConstObject(name, type, value); +} + MockValue_c getData_c(const char* name) { return getMockValueCFromNamedValue(currentMockSupport->getData(name)); diff -Nru cpputest-3.8/src/CppUTestExt/MockSupport.cpp cpputest-4.0/src/CppUTestExt/MockSupport.cpp --- cpputest-3.8/src/CppUTestExt/MockSupport.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MockSupport.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -44,9 +44,9 @@ } MockSupport::MockSupport(const SimpleString& mockName) - : callOrder_(0), expectedCallOrder_(0), strictOrdering_(false), standardReporter_(&defaultReporter_), ignoreOtherCalls_(false), enabled_(true), lastActualFunctionCall_(NULL), mockName_(mockName), tracing_(false) + : actualCallOrder_(0), expectedCallOrder_(0), strictOrdering_(false), standardReporter_(&defaultReporter_), ignoreOtherCalls_(false), enabled_(true), lastActualFunctionCall_(NULLPTR), mockName_(mockName), tracing_(false) { - setActiveReporter(NULL); + setActiveReporter(NULLPTR); } MockSupport::~MockSupport() @@ -60,7 +60,7 @@ void MockSupport::setMockFailureStandardReporter(MockFailureReporter* reporter) { - standardReporter_ = (reporter != NULL) ? reporter : &defaultReporter_; + standardReporter_ = (reporter != NULLPTR) ? reporter : &defaultReporter_; if (lastActualFunctionCall_) lastActualFunctionCall_->setMockFailureReporter(standardReporter_); @@ -113,17 +113,15 @@ void MockSupport::clear() { delete lastActualFunctionCall_; - lastActualFunctionCall_ = NULL; + lastActualFunctionCall_ = NULLPTR; tracing_ = false; - MockActualCallTrace::instance().clear(); + MockActualCallTrace::clearInstance(); expectations_.deleteAllExpectationsAndClearList(); - unExpectations_.deleteAllExpectationsAndClearList(); - compositeCalls_.clear(); ignoreOtherCalls_ = false; enabled_ = true; - callOrder_ = 0; + actualCallOrder_ = 0; expectedCallOrder_ = 0; strictOrdering_ = false; @@ -150,74 +148,61 @@ MockExpectedCall& MockSupport::expectOneCall(const SimpleString& functionName) { - if (!enabled_) return MockIgnoredExpectedCall::instance(); - - countCheck(); - - MockCheckedExpectedCall* call = new MockCheckedExpectedCall; - call->withName(appendScopeToName(functionName)); - if (strictOrdering_) - call->withCallOrder(++expectedCallOrder_); - expectations_.addExpectedCall(call); - return *call; + return expectNCalls(1, functionName); } void MockSupport::expectNoCall(const SimpleString& functionName) { - if (!enabled_) return; - - countCheck(); - - MockCheckedExpectedCall* call = new MockCheckedExpectedCall; - call->withName(appendScopeToName(functionName)); - unExpectations_.addExpectedCall(call); + expectNCalls(0, functionName); } -MockExpectedCall& MockSupport::expectNCalls(int amount, const SimpleString& functionName) +MockExpectedCall& MockSupport::expectNCalls(unsigned int amount, const SimpleString& functionName) { - compositeCalls_.clear(); + if (!enabled_) return MockIgnoredExpectedCall::instance(); - for (int i = 0; i < amount; i++) - compositeCalls_.add(expectOneCall(functionName)); - return compositeCalls_; -} + countCheck(); -MockCheckedActualCall* MockSupport::createActualFunctionCall() -{ - lastActualFunctionCall_ = new MockCheckedActualCall(++callOrder_, activeReporter_, expectations_); - return lastActualFunctionCall_; + MockCheckedExpectedCall* call = new MockCheckedExpectedCall(amount); + call->withName(appendScopeToName(functionName)); + if (strictOrdering_) { + call->withCallOrder(expectedCallOrder_ + 1, expectedCallOrder_ + amount); + expectedCallOrder_ += amount; + } + expectations_.addExpectedCall(call); + return *call; } -bool MockSupport::hasntExpectationWithName(const SimpleString& functionName) +MockCheckedActualCall* MockSupport::createActualCall() { - return !expectations_.hasExpectationWithName(functionName) && ignoreOtherCalls_; + lastActualFunctionCall_ = new MockCheckedActualCall(++actualCallOrder_, activeReporter_, expectations_); + return lastActualFunctionCall_; } -bool MockSupport::hasntUnexpectationWithName(const SimpleString& functionName) +bool MockSupport::callIsIgnored(const SimpleString& functionName) { - return !unExpectations_.hasExpectationWithName(functionName); + return ignoreOtherCalls_ && !expectations_.hasExpectationWithName(functionName); } MockActualCall& MockSupport::actualCall(const SimpleString& functionName) { - const SimpleString scopeFuntionName = appendScopeToName(functionName); + const SimpleString scopeFunctionName = appendScopeToName(functionName); if (lastActualFunctionCall_) { lastActualFunctionCall_->checkExpectations(); delete lastActualFunctionCall_; - lastActualFunctionCall_ = NULL; + lastActualFunctionCall_ = NULLPTR; } if (!enabled_) return MockIgnoredActualCall::instance(); - if (tracing_) return MockActualCallTrace::instance().withName(scopeFuntionName); + if (tracing_) return MockActualCallTrace::instance().withName(scopeFunctionName); - if (hasntUnexpectationWithName(scopeFuntionName) && hasntExpectationWithName(scopeFuntionName)) { + if (callIsIgnored(scopeFunctionName)) { return MockIgnoredActualCall::instance(); } - MockCheckedActualCall* call = createActualFunctionCall(); - call->withName(scopeFuntionName); + MockCheckedActualCall* call = createActualCall(); + call->withName(scopeFunctionName); return *call; } @@ -268,19 +253,19 @@ return callsLeft != 0; } -bool MockSupport::wasLastCallFulfilled() +bool MockSupport::wasLastActualCallFulfilled() { if (lastActualFunctionCall_ && !lastActualFunctionCall_->isFulfilled()) return false; for (MockNamedValueListNode* p = data_.begin(); p; p = p->next()) - if (getMockSupport(p) && !getMockSupport(p)->wasLastCallFulfilled()) + if (getMockSupport(p) && !getMockSupport(p)->wasLastActualCallFulfilled()) return false; return true; } -void MockSupport::failTestWithUnexpectedCalls() +void MockSupport::failTestWithExpectedCallsNotFulfilled() { MockExpectedCallsList expectationsList; expectationsList.addExpectations(expectations_); @@ -290,7 +275,6 @@ expectationsList.addExpectations(getMockSupport(p)->expectations_); MockExpectedCallsDidntHappenFailure failure(activeReporter_->getTestToFail(), expectationsList); - clear(); failTest(failure); } @@ -304,12 +288,12 @@ expectationsList.addExpectations(getMockSupport(p)->expectations_); MockCallOrderFailure failure(activeReporter_->getTestToFail(), expectationsList); - clear(); failTest(failure); } void MockSupport::failTest(MockFailure& failure) { + clear(); activeReporter_->failTest(failure); } @@ -318,7 +302,7 @@ UtestShell::getCurrent()->countCheck(); } -void MockSupport::checkExpectationsOfLastCall() +void MockSupport::checkExpectationsOfLastActualCall() { if(lastActualFunctionCall_) lastActualFunctionCall_->checkExpectations(); @@ -344,10 +328,10 @@ void MockSupport::checkExpectations() { - checkExpectationsOfLastCall(); + checkExpectationsOfLastActualCall(); - if (wasLastCallFulfilled() && expectedCallsLeft()) - failTestWithUnexpectedCalls(); + if (wasLastActualCallFulfilled() && expectedCallsLeft()) + failTestWithExpectedCallsNotFulfilled(); if (hasCallsOutOfOrder()) failTestWithOutOfOrderCalls(); @@ -356,13 +340,13 @@ bool MockSupport::hasData(const SimpleString& name) { - return data_.getValueByName(name) != NULL; + return data_.getValueByName(name) != NULLPTR; } MockNamedValue* MockSupport::retrieveDataFromStore(const SimpleString& name) { MockNamedValue* newData = data_.getValueByName(name); - if (newData == NULL) { + if (newData == NULLPTR) { newData = new MockNamedValue(name); data_.add(newData); } @@ -423,10 +407,16 @@ newData->setObjectPointer(type, value); } +void MockSupport::setDataConstObject(const SimpleString& name, const SimpleString& type, const void* value) +{ + MockNamedValue* newData = retrieveDataFromStore(name); + newData->setConstObjectPointer(type, value); +} + MockNamedValue MockSupport::getData(const SimpleString& name) { MockNamedValue* value = data_.getValueByName(name); - if (value == NULL) + if (value == NULLPTR) return MockNamedValue(""); return *value; } @@ -465,8 +455,8 @@ MockSupport* MockSupport::getMockSupport(MockNamedValueListNode* node) { if (node->getType() == "MockSupport" && node->getName().contains(MOCK_SUPPORT_SCOPE_PREFIX)) - return (MockSupport*) node->item()->getObjectPointer(); - return NULL; + return (MockSupport*) node->item()->getObjectPointer(); + return NULLPTR; } MockNamedValue MockSupport::returnValue() @@ -556,6 +546,62 @@ return returnValue().getUnsignedLongIntValue(); } +#ifdef CPPUTEST_USE_LONG_LONG + +cpputest_longlong MockSupport::longLongIntReturnValue() +{ + return returnValue().getLongLongIntValue(); +} + +cpputest_ulonglong MockSupport::unsignedLongLongIntReturnValue() +{ + return returnValue().getUnsignedLongLongIntValue(); +} + +cpputest_longlong MockSupport::returnLongLongIntValueOrDefault(cpputest_longlong defaultValue) +{ + if (hasReturnValue()) { + return longLongIntReturnValue(); + } + return defaultValue; +} + +cpputest_ulonglong MockSupport::returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong defaultValue) +{ + if (hasReturnValue()) { + return unsignedLongLongIntReturnValue(); + } + return defaultValue; +} + +#else + +cpputest_longlong MockSupport::longLongIntReturnValue() +{ + FAIL("Long Long type is not supported"); + return cpputest_longlong(0); +} + +cpputest_ulonglong MockSupport::unsignedLongLongIntReturnValue() +{ + FAIL("Unsigned Long Long type is not supported"); + return cpputest_ulonglong(0); +} + +cpputest_longlong MockSupport::returnLongLongIntValueOrDefault(cpputest_longlong defaultValue) +{ + FAIL("Long Long type is not supported"); + return defaultValue; +} + +cpputest_ulonglong MockSupport::returnUnsignedLongLongIntValueOrDefault(cpputest_ulonglong defaultValue) +{ + FAIL("Unsigned Long Long type is not supported"); + return defaultValue; +} + +#endif + const char* MockSupport::stringReturnValue() { return returnValue().getStringValue(); diff -Nru cpputest-3.8/src/CppUTestExt/MockSupportPlugin.cpp cpputest-4.0/src/CppUTestExt/MockSupportPlugin.cpp --- cpputest-3.8/src/CppUTestExt/MockSupportPlugin.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/MockSupportPlugin.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -57,6 +57,11 @@ MockSupportPlugin::~MockSupportPlugin() { + clear(); +} + +void MockSupportPlugin::clear() +{ repository_.clear(); } @@ -72,7 +77,7 @@ if (!test.hasFailed()) mock().checkExpectations(); mock().clear(); - mock().setMockFailureStandardReporter(NULL); + mock().setMockFailureStandardReporter(NULLPTR); mock().removeAllComparatorsAndCopiers(); } diff -Nru cpputest-3.8/src/CppUTestExt/OrderedTest.cpp cpputest-4.0/src/CppUTestExt/OrderedTest.cpp --- cpputest-3.8/src/CppUTestExt/OrderedTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/CppUTestExt/OrderedTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -29,10 +29,10 @@ #include "CppUTest/TestRegistry.h" #include "CppUTestExt/OrderedTest.h" -OrderedTestShell* OrderedTestShell::_orderedTestsHead = 0; +OrderedTestShell* OrderedTestShell::_orderedTestsHead = NULLPTR; OrderedTestShell::OrderedTestShell() : - _nextOrderedTest(0), _level(0) + _nextOrderedTest(NULLPTR), _level(0) { } @@ -62,7 +62,7 @@ bool OrderedTestShell::firstOrderedTest() { - return (getOrderedTestHead() == 0); + return (getOrderedTestHead() == NULLPTR); } OrderedTestShell* OrderedTestShell::addOrderedTest(OrderedTestShell* test) @@ -77,7 +77,7 @@ TestRegistry *reg = TestRegistry::getCurrentRegistry(); UtestShell* head = getOrderedTestHead(); - if (NULL == reg->getFirstTest() || head == reg->getFirstTest()) { + if (NULLPTR == reg->getFirstTest() || head == reg->getFirstTest()) { reg->addTest(test); } else { @@ -96,7 +96,7 @@ OrderedTestInstaller::OrderedTestInstaller(OrderedTestShell& test, const char* groupName, const char* testName, const char* fileName, - int lineNumber, int level) + size_t lineNumber, int level) { test.setTestName(testName); test.setGroupName(groupName); diff -Nru cpputest-3.8/src/Platforms/armcc/UtestPlatform.cpp cpputest-4.0/src/Platforms/armcc/UtestPlatform.cpp --- cpputest-3.8/src/Platforms/armcc/UtestPlatform.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/Platforms/armcc/UtestPlatform.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -39,6 +39,8 @@ #undef calloc #undef realloc #undef free +#undef strdup +#undef strndup #define far // eliminate "meaningless type qualifier" warning diff -Nru cpputest-3.8/src/Platforms/C2000/UtestPlatform.cpp cpputest-4.0/src/Platforms/C2000/UtestPlatform.cpp --- cpputest-3.8/src/Platforms/C2000/UtestPlatform.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/Platforms/C2000/UtestPlatform.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -34,6 +34,8 @@ #undef free #undef calloc #undef realloc +#undef strdup +#undef strndup #define far // eliminate "meaningless type qualifier" warning #include diff -Nru cpputest-3.8/src/Platforms/Dos/UtestPlatform.cpp cpputest-4.0/src/Platforms/Dos/UtestPlatform.cpp --- cpputest-3.8/src/Platforms/Dos/UtestPlatform.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/Platforms/Dos/UtestPlatform.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -34,6 +34,8 @@ #undef free #undef calloc #undef realloc +#undef strdup +#undef strndup #define far // eliminate "meaningless type qualifier" warning #include @@ -184,6 +186,16 @@ void* (*PlatformSpecificMemCpy)(void* s1, const void* s2, size_t size) = DosMemCpy; void* (*PlatformSpecificMemset)(void* mem, int c, size_t size) = DosMemset; +static void DosSrand(unsigned int seed) +{ + srand(seed); +} + +static int DosRand() +{ + return rand(); +} + static double DosFabs(double d) { return fabs(d); @@ -199,6 +211,8 @@ return isinf(d); } +void (*PlatformSpecificSrand)(unsigned int) = DosSrand; +int (*PlatformSpecificRand)(void) = DosRand; double (*PlatformSpecificFabs)(double) = DosFabs; int (*PlatformSpecificIsNan)(double d) = DosIsNan; int (*PlatformSpecificIsInf)(double d) = DosIsInf; diff -Nru cpputest-3.8/src/Platforms/Gcc/UtestPlatform.cpp cpputest-4.0/src/Platforms/Gcc/UtestPlatform.cpp --- cpputest-3.8/src/Platforms/Gcc/UtestPlatform.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/Platforms/Gcc/UtestPlatform.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -31,8 +31,18 @@ #undef free #undef calloc #undef realloc +#undef strdup +#undef strndup +#ifdef CPPUTEST_HAVE_GETTIMEOFDAY #include +#endif +#ifdef CPPUTEST_HAVE_FORK +#include +#include +#include +#endif + #include #include #include @@ -40,13 +50,11 @@ #include #include #include -#include #include -#ifndef __MINGW32__ -#include -#include -#endif + +#ifdef CPPUTEST_HAVE_PTHREAD_MUTEX_LOCK #include +#endif #include "CppUTest/PlatformSpecificFunctions.h" @@ -72,44 +80,59 @@ #else +static void SetTestFailureByStatusCode(UtestShell* shell, TestResult* result, int status) +{ + if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { + result->addFailure(TestFailure(shell, "Failed in separate process")); + } else if (WIFSIGNALED(status)) { + SimpleString message("Failed in separate process - killed by signal "); + message += StringFrom(WTERMSIG(status)); + result->addFailure(TestFailure(shell, message)); + } else if (WIFSTOPPED(status)) { + result->addFailure(TestFailure(shell, "Stopped in separate process - continuing")); + } +} + static void GccPlatformSpecificRunTestInASeperateProcess(UtestShell* shell, TestPlugin* plugin, TestResult* result) { - pid_t cpid, w; - int status; + const pid_t syscallError = -1; + pid_t cpid; + pid_t w; + int status = 0; cpid = PlatformSpecificFork(); - if (cpid == -1) { + if (cpid == syscallError) { result->addFailure(TestFailure(shell, "Call to fork() failed")); return; } if (cpid == 0) { /* Code executed by child */ - shell->runOneTestInCurrentProcess(plugin, *result); // LCOV_EXCL_LINE - _exit(result->getFailureCount()); // LCOV_EXCL_LINE + const size_t initialFailureCount = result->getFailureCount(); // LCOV_EXCL_LINE + shell->runOneTestInCurrentProcess(plugin, *result); // LCOV_EXCL_LINE + _exit(initialFailureCount < result->getFailureCount()); // LCOV_EXCL_LINE } else { /* Code executed by parent */ + size_t amountOfRetries = 0; do { w = PlatformSpecificWaitPid(cpid, &status, WUNTRACED); - if (w == -1) { - if(EINTR ==errno) continue; /* OS X debugger */ - result->addFailure(TestFailure(shell, "Call to waitpid() failed")); - return; - } - - if (WIFEXITED(status) && WEXITSTATUS(status) > result->getFailureCount()) { - result->addFailure(TestFailure(shell, "Failed in separate process")); - } else if (WIFSIGNALED(status)) { - SimpleString signal(StringFrom(WTERMSIG(status))); - { - SimpleString message("Failed in separate process - killed by signal "); - message += signal; - result->addFailure(TestFailure(shell, message)); + if (w == syscallError) { + // OS X debugger causes EINTR + if (EINTR == errno) { + if (amountOfRetries > 30) { + result->addFailure(TestFailure(shell, "Call to waitpid() failed with EINTR. Tried 30 times and giving up! Sometimes happens in debugger")); + return; + } + amountOfRetries++; + } + else { + result->addFailure(TestFailure(shell, "Call to waitpid() failed")); + return; } - } else if (WIFSTOPPED(status)) { - result->addFailure(TestFailure(shell, "Stopped in separate process - continuing")); - kill(w, SIGCONT); + } else { + SetTestFailureByStatusCode(shell, result, status); + if (WIFSTOPPED(status)) kill(w, SIGCONT); } - } while (!WIFEXITED(status) && !WIFSIGNALED(status)); + } while ((w == syscallError) || (!WIFEXITED(status) && !WIFSIGNALED(status))); } } @@ -149,11 +172,11 @@ } /* - * MacOSX clang 3.0 doesn't seem to recognize longjmp and thus complains about __no_return_. + * MacOSX clang 3.0 doesn't seem to recognize longjmp and thus complains about _no_return_. * The later clang compilers complain when it isn't there. So only way is to check the clang compiler here :( */ #if !((__clang_major__ == 3) && (__clang_minor__ == 0)) -__no_return__ +_no_return_ #endif static void PlatformSpecificLongJmpImplementation() { @@ -174,17 +197,27 @@ static long TimeInMillisImplementation() { +#ifdef CPPUTEST_HAVE_GETTIMEOFDAY struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return (tv.tv_sec * 1000) + (long)((double)tv.tv_usec * 0.001); +#else + return 0; +#endif } static const char* TimeStringImplementation() { - time_t tm = time(NULL); + time_t theTime = time(NULLPTR); static char dateTime[80]; - struct tm *tmp = localtime(&tm); +#ifdef _WIN32 + static struct tm lastlocaltime; + localtime_s(&lastlocaltime, &theTime); + struct tm *tmp = &lastlocaltime; +#else + struct tm *tmp = localtime(&theTime); +#endif strftime(dateTime, 80, "%Y-%m-%dT%H:%M:%S", tmp); return dateTime; } @@ -197,11 +230,20 @@ #pragma clang diagnostic ignored "-Wformat-nonliteral" #endif +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wused-but-marked-unused" +#endif int (*PlatformSpecificVSNprintf)(char *str, size_t size, const char* format, va_list va_args_list) = vsnprintf; static PlatformSpecificFile PlatformSpecificFOpenImplementation(const char* filename, const char* flag) { +#ifdef _WIN32 + FILE* file; + fopen_s(&file, filename, flag); + return file; +#else return fopen(filename, flag); +#endif } static void PlatformSpecificFPutsImplementation(const char* str, PlatformSpecificFile file) @@ -250,35 +292,59 @@ } double (*PlatformSpecificFabs)(double) = fabs; +void (*PlatformSpecificSrand)(unsigned int) = srand; +int (*PlatformSpecificRand)(void) = rand; int (*PlatformSpecificIsNan)(double) = IsNanImplementation; int (*PlatformSpecificIsInf)(double) = IsInfImplementation; int (*PlatformSpecificAtExit)(void(*func)(void)) = atexit; /// this was undefined before static PlatformSpecificMutex PThreadMutexCreate(void) { +#ifdef CPPUTEST_HAVE_PTHREAD_MUTEX_LOCK pthread_mutex_t *mutex = new pthread_mutex_t; - pthread_mutex_init(mutex, NULL); - + pthread_mutex_init(mutex, NULLPTR); return (PlatformSpecificMutex)mutex; +#else + return NULLPTR; +#endif + } +#ifdef CPPUTEST_HAVE_PTHREAD_MUTEX_LOCK static void PThreadMutexLock(PlatformSpecificMutex mtx) { pthread_mutex_lock((pthread_mutex_t *)mtx); } +#else +static void PThreadMutexLock(PlatformSpecificMutex) +{ +} +#endif +#ifdef CPPUTEST_HAVE_PTHREAD_MUTEX_LOCK static void PThreadMutexUnlock(PlatformSpecificMutex mtx) { pthread_mutex_unlock((pthread_mutex_t *)mtx); } +#else +static void PThreadMutexUnlock(PlatformSpecificMutex) +{ +} +#endif +#ifdef CPPUTEST_HAVE_PTHREAD_MUTEX_LOCK static void PThreadMutexDestroy(PlatformSpecificMutex mtx) { pthread_mutex_t *mutex = (pthread_mutex_t *)mtx; pthread_mutex_destroy(mutex); delete mutex; } +#else +static void PThreadMutexDestroy(PlatformSpecificMutex) +{ +} +#endif PlatformSpecificMutex (*PlatformSpecificMutexCreate)(void) = PThreadMutexCreate; void (*PlatformSpecificMutexLock)(PlatformSpecificMutex) = PThreadMutexLock; diff -Nru cpputest-3.8/src/Platforms/GccNoStdC/UtestPlatform.cpp cpputest-4.0/src/Platforms/GccNoStdC/UtestPlatform.cpp --- cpputest-3.8/src/Platforms/GccNoStdC/UtestPlatform.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/Platforms/GccNoStdC/UtestPlatform.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,49 +30,53 @@ #undef free #undef calloc #undef realloc +#undef strdup +#undef strndup #include "CppUTest/PlatformSpecificFunctions.h" -void (*PlatformSpecificRunTestInASeperateProcess)(UtestShell*, TestPlugin*, TestResult*) = NULL; -int (*PlatformSpecificFork)() = NULL; -int (*PlatformSpecificWaitPid)(int, int*, int) = NULL; +void (*PlatformSpecificRunTestInASeperateProcess)(UtestShell*, TestPlugin*, TestResult*) = NULLPTR; +int (*PlatformSpecificFork)() = NULLPTR; +int (*PlatformSpecificWaitPid)(int, int*, int) = NULLPTR; TestOutput::WorkingEnvironment PlatformSpecificGetWorkingEnvironment() { return TestOutput::eclipse; } -void (*PlatformSpecificLongJmp)() = NULL; -int (*PlatformSpecificSetJmp)(void (*)(void*), void*) = NULL; -void (*PlatformSpecificRestoreJumpBuffer)() = NULL; +void (*PlatformSpecificLongJmp)() = NULLPTR; +int (*PlatformSpecificSetJmp)(void (*)(void*), void*) = NULLPTR; +void (*PlatformSpecificRestoreJumpBuffer)() = NULLPTR; -long (*GetPlatformSpecificTimeInMillis)() = NULL; -const char* (*GetPlatformSpecificTimeString)() = NULL; +long (*GetPlatformSpecificTimeInMillis)() = NULLPTR; +const char* (*GetPlatformSpecificTimeString)() = NULLPTR; /* IO operations */ -PlatformSpecificFile (*PlatformSpecificFOpen)(const char* filename, const char* flag) = NULL; -void (*PlatformSpecificFPuts)(const char* str, PlatformSpecificFile file) = NULL; -void (*PlatformSpecificFClose)(PlatformSpecificFile file) = NULL; +PlatformSpecificFile (*PlatformSpecificFOpen)(const char* filename, const char* flag) = NULLPTR; +void (*PlatformSpecificFPuts)(const char* str, PlatformSpecificFile file) = NULLPTR; +void (*PlatformSpecificFClose)(PlatformSpecificFile file) = NULLPTR; -int (*PlatformSpecificPutchar)(int c) = NULL; -void (*PlatformSpecificFlush)(void) = NULL; +int (*PlatformSpecificPutchar)(int c) = NULLPTR; +void (*PlatformSpecificFlush)(void) = NULLPTR; -int (*PlatformSpecificVSNprintf)(char *str, size_t size, const char* format, va_list va_args_list) = NULL; +int (*PlatformSpecificVSNprintf)(char *str, size_t size, const char* format, va_list va_args_list) = NULLPTR; /* Dynamic Memory operations */ -void* (*PlatformSpecificMalloc)(size_t) = NULL; -void* (*PlatformSpecificRealloc)(void*, size_t) = NULL; -void (*PlatformSpecificFree)(void*) = NULL; -void* (*PlatformSpecificMemCpy)(void*, const void*, size_t) = NULL; -void* (*PlatformSpecificMemset)(void*, int, size_t) = NULL; - -double (*PlatformSpecificFabs)(double) = NULL; -int (*PlatformSpecificIsNan)(double) = NULL; -int (*PlatformSpecificIsInf)(double) = NULL; -int (*PlatformSpecificAtExit)(void(*func)(void)) = NULL; - -PlatformSpecificMutex (*PlatformSpecificMutexCreate)(void) = NULL; -void (*PlatformSpecificMutexLock)(PlatformSpecificMutex mtx) = NULL; -void (*PlatformSpecificMutexUnlock)(PlatformSpecificMutex mtx) = NULL; -void (*PlatformSpecificMutexDestroy)(PlatformSpecificMutex mtx) = NULL; +void* (*PlatformSpecificMalloc)(size_t) = NULLPTR; +void* (*PlatformSpecificRealloc)(void*, size_t) = NULLPTR; +void (*PlatformSpecificFree)(void*) = NULLPTR; +void* (*PlatformSpecificMemCpy)(void*, const void*, size_t) = NULLPTR; +void* (*PlatformSpecificMemset)(void*, int, size_t) = NULLPTR; + +double (*PlatformSpecificFabs)(double) = NULLPTR; +int (*PlatformSpecificIsNan)(double) = NULLPTR; +int (*PlatformSpecificIsInf)(double) = NULLPTR; +int (*PlatformSpecificAtExit)(void(*func)(void)) = NULLPTR; + +PlatformSpecificMutex (*PlatformSpecificMutexCreate)(void) = NULLPTR; +void (*PlatformSpecificMutexLock)(PlatformSpecificMutex mtx) = NULLPTR; +void (*PlatformSpecificMutexUnlock)(PlatformSpecificMutex mtx) = NULLPTR; +void (*PlatformSpecificMutexDestroy)(PlatformSpecificMutex mtx) = NULLPTR; +void (*PlatformSpecificSrand)(unsigned int) = NULLPTR; +int (*PlatformSpecificRand)(void) = NULLPTR; diff -Nru cpputest-3.8/src/Platforms/Iar/UtestPlatform.cpp cpputest-4.0/src/Platforms/Iar/UtestPlatform.cpp --- cpputest-3.8/src/Platforms/Iar/UtestPlatform.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/Platforms/Iar/UtestPlatform.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -39,6 +39,8 @@ #undef calloc #undef realloc #undef free +#undef strdup +#undef strndup #include "CppUTest/PlatformSpecificFunctions.h" static jmp_buf test_exit_jmp_buf[10]; @@ -113,7 +115,10 @@ static const char* TimeStringImplementation() { time_t tm = time(NULL); - return ctime(&tm); + char* pTimeStr = ctime(&tm); + char* newlineChar = strchr(pTimeStr, '\n'); // Find the terminating newline character. + if(newlineChar != NULL) *newlineChar = '\0'; //If newline is found replace it with the string terminator. + return (pTimeStr); } long (*GetPlatformSpecificTimeInMillis)() = TimeInMillisImplementation; @@ -123,15 +128,18 @@ static PlatformSpecificFile PlatformSpecificFOpenImplementation(const char* filename, const char* flag) { + static int fileNo = 0; (void)filename; (void)flag; - return 0; + fileNo++; + return (void*)fileNo; } static void PlatformSpecificFPutsImplementation(const char* str, PlatformSpecificFile file) { (void)str; (void)file; + printf("FILE%d:%s",(int)file, str); } static void PlatformSpecificFCloseImplementation(PlatformSpecificFile file) diff -Nru cpputest-3.8/src/Platforms/Keil/UtestPlatform.cpp cpputest-4.0/src/Platforms/Keil/UtestPlatform.cpp --- cpputest-3.8/src/Platforms/Keil/UtestPlatform.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/Platforms/Keil/UtestPlatform.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -31,6 +31,8 @@ #undef free #undef calloc #undef realloc +#undef strdup +#undef strndup #define far // eliminate "meaningless type qualifier" warning #include diff -Nru cpputest-3.8/src/Platforms/VisualCpp/UtestPlatform.cpp cpputest-4.0/src/Platforms/VisualCpp/UtestPlatform.cpp --- cpputest-3.8/src/Platforms/VisualCpp/UtestPlatform.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/src/Platforms/VisualCpp/UtestPlatform.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -4,6 +4,8 @@ #undef free #undef calloc #undef realloc +#undef strdup +#undef strndup #include #include @@ -75,7 +77,26 @@ static long VisualCppTimeInMillis() { - return timeGetTime(); + static LARGE_INTEGER s_frequency; + static const BOOL s_use_qpc = QueryPerformanceFrequency(&s_frequency); + if (s_use_qpc) + { + LARGE_INTEGER now; + QueryPerformanceCounter(&now); + return (long)((now.QuadPart * 1000) / s_frequency.QuadPart); + } + else + { + #ifdef TIMERR_NOERROR + return timeGetTime(); + #else + #if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_VISTA) || (_WIN32_WINNT < _WIN32_WINNT_VISTA) + return GetTickCount(); + #else + return (long)GetTickCount64(); + #endif + #endif + } } long (*GetPlatformSpecificTimeInMillis)() = VisualCppTimeInMillis; @@ -164,6 +185,8 @@ free(memory); } +void (*PlatformSpecificSrand)(unsigned int) = srand; +int (*PlatformSpecificRand)(void) = rand; void* (*PlatformSpecificMalloc)(size_t size) = VisualCppMalloc; void* (*PlatformSpecificRealloc)(void* memory, size_t size) = VisualCppReAlloc; void (*PlatformSpecificFree)(void* memory) = VisualCppFree; diff -Nru cpputest-3.8/test-driver cpputest-4.0/test-driver --- cpputest-3.8/test-driver 2016-05-02 05:35:47.000000000 +0000 +++ cpputest-4.0/test-driver 2020-05-26 11:27:12.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2013-07-13.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2020 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -140,9 +140,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru cpputest-3.8/tests/AllocationInCFile.c cpputest-4.0/tests/AllocationInCFile.c --- cpputest-3.8/tests/AllocationInCFile.c 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllocationInCFile.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#include "AllocationInCFile.h" -#include "CppUTest/MemoryLeakDetectorMallocMacros.h" -#include "CppUTest/StandardCLibrary.h" - -/* This file is for simulating overloads of malloc */ - -char* mallocAllocation() -{ - return (char*) malloc(10UL); -} - -void freeAllocation(void* memory) -{ - free(memory); -} - -#undef free - -void freeAllocationWithoutMacro(void* memory) -{ - free(memory); -} - diff -Nru cpputest-3.8/tests/AllocationInCFile.h cpputest-4.0/tests/AllocationInCFile.h --- cpputest-3.8/tests/AllocationInCFile.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllocationInCFile.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#ifndef ALLOCATIONINCFILE_H -#define ALLOCATIONINCFILE_H - -#ifdef __cplusplus -extern "C" { -#endif - -extern char* mallocAllocation(void); -extern void freeAllocation(void* memory); -extern void freeAllocationWithoutMacro(void* memory); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru cpputest-3.8/tests/AllocationInCppFile.cpp cpputest-4.0/tests/AllocationInCppFile.cpp --- cpputest-3.8/tests/AllocationInCppFile.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllocationInCppFile.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* This file is for emulating allocations in a C++ file. - * It is used simulating the use of the memory leak detector on production code in C++ - */ -#undef new -#include "CppUTest/MemoryLeakDetectorNewMacros.h" -#include "AllocationInCppFile.h" - -char* newAllocation() -{ - return new char; -} - -char* newArrayAllocation() -{ - return new char[100]; -} - -#undef new - -char* newAllocationWithoutMacro() -{ - return new char; -} - -char* newArrayAllocationWithoutMacro() -{ - return new char[100]; -} - -#if CPPUTEST_USE_STD_CPP_LIB - -ClassThatThrowsAnExceptionInTheConstructor::ClassThatThrowsAnExceptionInTheConstructor() -{ - throw 1; -} - -#endif diff -Nru cpputest-3.8/tests/AllocationInCppFile.h cpputest-4.0/tests/AllocationInCppFile.h --- cpputest-3.8/tests/AllocationInCppFile.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllocationInCppFile.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -#ifndef ALLOCATIONINCPPFILE_H -#define ALLOCATIONINCPPFILE_H - -char* newAllocation(); -char* newArrayAllocation(); - -char* newAllocationWithoutMacro(); -char* newArrayAllocationWithoutMacro(); - -#if CPPUTEST_USE_STD_CPP_LIB - -class ClassThatThrowsAnExceptionInTheConstructor -{ -public: - ClassThatThrowsAnExceptionInTheConstructor() __no_return__; -}; - -#endif - -#endif diff -Nru cpputest-3.8/tests/AllocLetTestFree.c cpputest-4.0/tests/AllocLetTestFree.c --- cpputest-3.8/tests/AllocLetTestFree.c 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllocLetTestFree.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ - -#include "CppUTest/StandardCLibrary.h" - -#if CPPUTEST_USE_STD_C_LIB - -#include "AllocLetTestFree.h" - -typedef struct AllocLetTestFreeStruct -{ - int placeHolderForHiddenStructElements; -} AllocLetTestFreeStruct; - -AllocLetTestFree AllocLetTestFree_Create(void) -{ - size_t count = 1; - AllocLetTestFree self = (AllocLetTestFree)calloc(count, sizeof(AllocLetTestFreeStruct)); - return self; -} - -void AllocLetTestFree_Destroy(AllocLetTestFree self) -{ - AllocLetTestFree no_use = self; - self = NULL; - self = no_use; - -} -#endif diff -Nru cpputest-3.8/tests/AllocLetTestFree.h cpputest-4.0/tests/AllocLetTestFree.h --- cpputest-3.8/tests/AllocLetTestFree.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllocLetTestFree.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ - -#ifndef D_AllocLetTestFree_H -#define D_AllocLetTestFree_H - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct AllocLetTestFreeStruct * AllocLetTestFree; - -AllocLetTestFree AllocLetTestFree_Create(void); -void AllocLetTestFree_Destroy(AllocLetTestFree); - -#ifdef __cplusplus -} -#endif - -#endif /* D_FakeAllocLetTestFree_H */ diff -Nru cpputest-3.8/tests/AllocLetTestFreeTest.cpp cpputest-4.0/tests/AllocLetTestFreeTest.cpp --- cpputest-3.8/tests/AllocLetTestFreeTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllocLetTestFreeTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ - -#include "CppUTest/StandardCLibrary.h" - -extern "C" -{ -#include "AllocLetTestFree.h" -} - -#include "CppUTest/TestHarness.h" - -#if CPPUTEST_USE_STD_C_LIB -/* - * This test makes sure that memory leak malloc macros are forced into .cpp and .c files - */ -TEST_GROUP(AllocLetTestFree) -{ - AllocLetTestFree allocLetTestFree; - - void setup() - { - allocLetTestFree = AllocLetTestFree_Create(); - } - - void teardown() - { - AllocLetTestFree_Destroy(allocLetTestFree); - } -}; - -TEST(AllocLetTestFree, Create) -{ - free(allocLetTestFree); -} - -#endif diff -Nru cpputest-3.8/tests/AllTests.cpp cpputest-4.0/tests/AllTests.cpp --- cpputest-3.8/tests/AllTests.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllTests.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/CommandLineTestRunner.h" - -int main(int ac, const char** av) -{ - /* These checks are here to make sure assertions outside test runs don't crash */ - CHECK(true); - LONGS_EQUAL(1, 1); - - return CommandLineTestRunner::RunAllTests(ac, const_cast(av)); /* cover alternate method */ -} - diff -Nru cpputest-3.8/tests/AllTests.dep cpputest-4.0/tests/AllTests.dep --- cpputest-3.8/tests/AllTests.dep 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllTests.dep 1970-01-01 00:00:00.000000000 +0000 @@ -1,740 +0,0 @@ -# Microsoft Developer Studio Generated Dependency File, included by AllTests.mak - -.\AllocationInCFile.c : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorMallocMacros.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - ".\AllocationInCFile.h"\ - - -.\AllocationInCppFile.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - ".\AllocationInCppFile.h"\ - - -.\CppUTestExt\AllTests.cpp : \ - "..\include\CppUTest\CommandLineArguments.h"\ - "..\include\CppUTest\CommandLineTestRunner.h"\ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\MemoryReportAllocator.h"\ - "..\include\CppUTestExt\MemoryReporterPlugin.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\CppUTestExt\MockSupportPlugin.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CheatSheetTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CppUTestExt\CodeMemoryReportFormatterTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\CodeMemoryReportFormatter.h"\ - "..\include\CppUTestExt\MemoryReportAllocator.h"\ - "..\include\CppUTestExt\MemoryReportFormatter.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CommandLineArgumentsTest.cpp : \ - "..\include\CppUTest\CommandLineArguments.h"\ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CommandLineTestRunnerTest.cpp : \ - "..\include\CppUTest\CommandLineArguments.h"\ - "..\include\CppUTest\CommandLineTestRunner.h"\ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CppUTestExt\GTest2ConvertorTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\JUnitOutputTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\JunitTestOutput.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\MemoryLeakDetectorTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetector.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\MemoryLeakOperatorOverloadsTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetector.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestHarness_c.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - ".\AllocationInCFile.h"\ - ".\AllocationInCppFile.h"\ - - -.\MemoryLeakWarningTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetector.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleMutex.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestHarness_c.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CppUTestExt\MemoryReportAllocatorTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\MemoryReportAllocator.h"\ - "..\include\CppUTestExt\MemoryReportFormatter.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CppUTestExt\MemoryReporterPluginTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\MemoryReportAllocator.h"\ - "..\include\CppUTestExt\MemoryReporterPlugin.h"\ - "..\include\CppUTestExt\MemoryReportFormatter.h"\ - "..\include\cpputestext\mockactualcall.h"\ - "..\include\CppUTestExt\MockCheckedActualCall.h"\ - "..\include\CppUTestExt\MockCheckedExpectedCall.h"\ - "..\include\cpputestext\mockexpectedcall.h"\ - "..\include\CppUTestExt\MockExpectedCallsList.h"\ - "..\include\CppUTestExt\MockFailure.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\CppUTestExt\MockSupport.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CppUTestExt\MemoryReportFormatterTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\MemoryReportAllocator.h"\ - "..\include\CppUTestExt\MemoryReportFormatter.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CppUTestExt\MockActualCallTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\cpputestext\mockactualcall.h"\ - "..\include\CppUTestExt\MockCheckedActualCall.h"\ - "..\include\CppUTestExt\MockCheckedExpectedCall.h"\ - "..\include\cpputestext\mockexpectedcall.h"\ - "..\include\CppUTestExt\MockExpectedCallsList.h"\ - "..\include\CppUTestExt\MockFailure.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - ".\CppUTestExt\MockFailureTest.h"\ - - -.\CppUTestExt\MockCheatSheetTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\cpputestext\mockactualcall.h"\ - "..\include\CppUTestExt\MockCheckedActualCall.h"\ - "..\include\CppUTestExt\MockCheckedExpectedCall.h"\ - "..\include\cpputestext\mockexpectedcall.h"\ - "..\include\CppUTestExt\MockExpectedCallsList.h"\ - "..\include\CppUTestExt\MockFailure.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\CppUTestExt\MockSupport.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\CppUTestExt\MockExpectedCallTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\MockCheckedExpectedCall.h"\ - "..\include\cpputestext\mockexpectedcall.h"\ - "..\include\CppUTestExt\MockFailure.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - ".\CppUTestExt\MockFailureTest.h"\ - - -.\CppUTestExt\MockExpectedFunctionsListTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\MockCheckedExpectedCall.h"\ - "..\include\cpputestext\mockexpectedcall.h"\ - "..\include\CppUTestExt\MockExpectedCallsList.h"\ - "..\include\CppUTestExt\MockFailure.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - ".\CppUTestExt\MockFailureTest.h"\ - - -.\CppUTestExt\MockFailureTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\MockCheckedExpectedCall.h"\ - "..\include\cpputestext\mockexpectedcall.h"\ - "..\include\CppUTestExt\MockExpectedCallsList.h"\ - "..\include\CppUTestExt\MockFailure.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - ".\CppUTestExt\MockFailureTest.h"\ - - -.\CppUTestExt\MockPluginTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\cpputestext\mockactualcall.h"\ - "..\include\CppUTestExt\MockCheckedActualCall.h"\ - "..\include\CppUTestExt\MockCheckedExpectedCall.h"\ - "..\include\cpputestext\mockexpectedcall.h"\ - "..\include\CppUTestExt\MockExpectedCallsList.h"\ - "..\include\CppUTestExt\MockFailure.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\CppUTestExt\MockSupport.h"\ - "..\include\CppUTestExt\MockSupportPlugin.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - ".\CppUTestExt\MockFailureTest.h"\ - - -.\CppUTestExt\MockSupport_cTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestHarness_c.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\MockSupport_c.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - ".\CppUTestExt\MockSupport_cTestCFile.h"\ - - -.\CppUTestExt\MockSupport_cTestCFile.c : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTestExt\MockSupport_c.h"\ - ".\CppUTestExt\MockSupport_cTestCFile.h"\ - - -.\CppUTestExt\MockSupportTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\cpputestext\mockactualcall.h"\ - "..\include\CppUTestExt\MockCheckedActualCall.h"\ - "..\include\CppUTestExt\MockCheckedExpectedCall.h"\ - "..\include\cpputestext\mockexpectedcall.h"\ - "..\include\CppUTestExt\MockExpectedCallsList.h"\ - "..\include\CppUTestExt\MockFailure.h"\ - "..\include\CppUTestExt\MockNamedValue.h"\ - "..\include\CppUTestExt\MockSupport.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - ".\CppUTestExt\MockFailureTest.h"\ - - -.\CppUTestExt\OrderedTestTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\CppUTestExt\OrderedTest.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\PluginTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\PreprocessorTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\SetPluginTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\SimpleStringTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\TestFailureTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\TestFilterTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\TestHarness_cTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestHarness_c.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\TestHarness_cTestCFile.c : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestHarness_c.h"\ - - -.\TestInstallerTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\TestMemoryAllocatorTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestMemoryAllocator.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\TestOutputTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\TestRegistryTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\TestResultTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - - -.\UtestTest.cpp : \ - "..\include\CppUTest\CppUTestConfig.h"\ - "..\include\CppUTest\MemoryLeakDetectorNewMacros.h"\ - "..\include\CppUTest\MemoryLeakWarningPlugin.h"\ - "..\include\CppUTest\PlatformSpecificFunctions.h"\ - "..\include\CppUTest\PlatformSpecificFunctions_c.h"\ - "..\include\CppUTest\SimpleString.h"\ - "..\include\CppUTest\StandardCLibrary.h"\ - "..\include\CppUTest\TestFailure.h"\ - "..\include\CppUTest\TestFilter.h"\ - "..\include\CppUTest\TestHarness.h"\ - "..\include\CppUTest\TestOutput.h"\ - "..\include\CppUTest\TestPlugin.h"\ - "..\include\CppUTest\TestRegistry.h"\ - "..\include\CppUTest\TestResult.h"\ - "..\include\CppUTest\TestTestingFixture.h"\ - "..\include\CppUTest\Utest.h"\ - "..\include\CppUTest\UtestMacros.h"\ - "..\include\platforms\visualcpp\stdint.h"\ - diff -Nru cpputest-3.8/tests/AllTests.dsp cpputest-4.0/tests/AllTests.dsp --- cpputest-3.8/tests/AllTests.dsp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllTests.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,381 +0,0 @@ -# Microsoft Developer Studio Project File - Name="AllTests" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=AllTests - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "AllTests.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "AllTests.mak" CFG="AllTests - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "AllTests - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "AllTests - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "AllTests - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /Ob0 /I "..\include" /I "..\include\Platforms\VisualCpp" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /D "CPPUTEST_USE_LONG_LONG" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /incremental:yes /machine:I386 -# Begin Special Build Tool -TargetPath=.\Release\AllTests.exe -SOURCE="$(InputPath)" -PostBuild_Cmds=$(TargetPath) -# End Special Build Tool - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\include" /I "..\include\Platforms\VisualCpp" /FI"CppUTest/MemoryLeakDetectorMallocMacros.h" /FI"CppUTest/MemoryLeakDetectorNewMacros.h" /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /D "CPPUTEST_USE_LONG_LONG" /FR /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\lib\CppUTestd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /incremental:no -# Begin Special Build Tool -TargetPath=.\Debug\AllTests.exe -SOURCE="$(InputPath)" -PostBuild_Cmds=$(TargetPath) -v -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "AllTests - Win32 Release" -# Name "AllTests - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\AllocationInCFile.c -# End Source File -# Begin Source File - -SOURCE=.\AllocationInCppFile.cpp -# End Source File -# Begin Source File - -SOURCE=.\AllocLetTestFree.c -# End Source File -# Begin Source File - -SOURCE=.\AllocLetTestFreeTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\AllTests.cpp -# End Source File -# Begin Source File - -SOURCE=.\CheatSheetTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\CodeMemoryReporterTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CommandLineArgumentsTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CommandLineTestRunnerTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\ExpectedFunctionsListTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\GMockTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\GTest1Test.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\GTest2ConvertorTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\JUnitOutputTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\MemoryLeakDetectorTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\MemoryLeakWarningTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\MemoryOperatorOverloadTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MemoryReportAllocatorTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MemoryReporterPluginTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MemoryReportFormatterTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockActualCallTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockCheatSheetTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockExpectedCallTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockFailureReporterForTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockFailureReporterForTest.h -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockFailureTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockNamedValueTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockPluginTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockSupport_cTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockSupport_cTestCFile.c -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockSupport_cTestCFile.h -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\MockSupportTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\CppUTestExt\OrderedTestTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\PluginTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\PreprocessorTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\SetPluginTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\SimpleMutexTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\SimpleStringTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestFailureNaNTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestFailureTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestFilterTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestHarness_cTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestHarness_cTestCFile.c -# End Source File -# Begin Source File - -SOURCE=.\TestInstallerTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestMemoryAllocatorTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestOutputTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestRegistryTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestResultTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\TestUtestMacro.cpp -# End Source File -# Begin Source File - -SOURCE=.\UtestPlatformTest.cpp -# End Source File -# Begin Source File - -SOURCE=.\UtestTest.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\AllocationInCFile.h -# End Source File -# Begin Source File - -SOURCE=.\AllocationInCppFile.h -# End Source File -# Begin Source File - -SOURCE=.\AllTests.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\CommandLineArguments.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\CppUTestConfig.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\MemoryLeakDetector.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\MemoryLeakDetectorMallocMacros.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\MemoryLeakDetectorNewMacros.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\PlatformSpecificFunctions.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\PlatformSpecificFunctions_c.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\SimpleMutex.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\StandardCLibrary.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\TestFailure.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\TestFilter.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\TestMemoryAllocator.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\TestTestingFixture.h -# End Source File -# Begin Source File - -SOURCE=..\include\CppUTest\UtestMacros.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff -Nru cpputest-3.8/tests/AllTests.h cpputest-4.0/tests/AllTests.h --- cpputest-3.8/tests/AllTests.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllTests.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -//Include this in the test main to execute these tests -IMPORT_TEST_GROUP( Utest); -IMPORT_TEST_GROUP( Failure); -IMPORT_TEST_GROUP( TestOutput); -IMPORT_TEST_GROUP( SimpleString); -IMPORT_TEST_GROUP( TestInstaller); -IMPORT_TEST_GROUP( NullTest); -IMPORT_TEST_GROUP( MemoryLeakWarningTest); -IMPORT_TEST_GROUP( TestHarness_c); -IMPORT_TEST_GROUP( CommandLineTestRunner); -IMPORT_TEST_GROUP( JUnitOutputTest); -IMPORT_TEST_GROUP( MemoryLeakDetectorTest); - -/* In allTest.cpp */ -IMPORT_TEST_GROUP(CheatSheet); - diff -Nru cpputest-3.8/tests/AllTests.mak cpputest-4.0/tests/AllTests.mak --- cpputest-3.8/tests/AllTests.mak 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/AllTests.mak 1970-01-01 00:00:00.000000000 +0000 @@ -1,1166 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on AllTests.dsp -!IF "$(CFG)" == "" -CFG=AllTests - Win32 Debug -!MESSAGE No configuration specified. Defaulting to AllTests - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "AllTests - Win32 Release" && "$(CFG)" != "AllTests - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "AllTests.mak" CFG="AllTests - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "AllTests - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "AllTests - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "AllTests - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\Release -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\AllTests.exe" - -!ELSE - -ALL : "CppUTest - Win32 Release" "$(OUTDIR)\AllTests.exe" - -!ENDIF - -!IF "$(RECURSE)" == "1" -CLEAN :"CppUTest - Win32 ReleaseCLEAN" -!ELSE -CLEAN : -!ENDIF - -@erase "$(INTDIR)\AllocationInCFile.obj" - -@erase "$(INTDIR)\AllocationInCppFile.obj" - -@erase "$(INTDIR)\AllTests.obj" - -@erase "$(INTDIR)\CheatSheetTest.obj" - -@erase "$(INTDIR)\CodeMemoryReportFormatterTest.obj" - -@erase "$(INTDIR)\CommandLineArgumentsTest.obj" - -@erase "$(INTDIR)\CommandLineTestRunnerTest.obj" - -@erase "$(INTDIR)\GMockTest.obj" - -@erase "$(INTDIR)\GTest1Test.obj" - -@erase "$(INTDIR)\GTest2ConvertorTest.obj" - -@erase "$(INTDIR)\JUnitOutputTest.obj" - -@erase "$(INTDIR)\MemoryLeakDetectorTest.obj" - -@erase "$(INTDIR)\MemoryLeakOperatorOverloadsTest.obj" - -@erase "$(INTDIR)\MemoryLeakWarningTest.obj" - -@erase "$(INTDIR)\MemoryReportAllocatorTest.obj" - -@erase "$(INTDIR)\MemoryReporterPluginTest.obj" - -@erase "$(INTDIR)\MemoryReportFormatterTest.obj" - -@erase "$(INTDIR)\MockActualCallTest.obj" - -@erase "$(INTDIR)\MockCheatSheetTest.obj" - -@erase "$(INTDIR)\MockExpectedCallTest.obj" - -@erase "$(INTDIR)\MockExpectedFunctionsListTest.obj" - -@erase "$(INTDIR)\MockFailureTest.obj" - -@erase "$(INTDIR)\MockPluginTest.obj" - -@erase "$(INTDIR)\MockSupport_cTest.obj" - -@erase "$(INTDIR)\MockSupport_cTestCFile.obj" - -@erase "$(INTDIR)\MockSupportTest.obj" - -@erase "$(INTDIR)\OrderedTestTest.obj" - -@erase "$(INTDIR)\PluginTest.obj" - -@erase "$(INTDIR)\PreprocessorTest.obj" - -@erase "$(INTDIR)\SetPluginTest.obj" - -@erase "$(INTDIR)\SimpleStringTest.obj" - -@erase "$(INTDIR)\TestFailureTest.obj" - -@erase "$(INTDIR)\TestFilterTest.obj" - -@erase "$(INTDIR)\TestHarness_cTest.obj" - -@erase "$(INTDIR)\TestHarness_cTestCFile.obj" - -@erase "$(INTDIR)\TestInstallerTest.obj" - -@erase "$(INTDIR)\TestMemoryAllocatorTest.obj" - -@erase "$(INTDIR)\TestOutputTest.obj" - -@erase "$(INTDIR)\TestRegistryTest.obj" - -@erase "$(INTDIR)\TestResultTest.obj" - -@erase "$(INTDIR)\UtestTest.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(OUTDIR)\AllTests.exe" - -@erase "$(OUTDIR)\AllTests.ilk" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\include" /I "..\include\Platforms\VisualCpp" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /D "CPPUTEST_USE_LONG_LONG" /Fp"$(INTDIR)\AllTests.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\AllTests.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\AllTests.pdb" /machine:I386 /out:"$(OUTDIR)\AllTests.exe" -LINK32_OBJS= \ - "$(INTDIR)\AllocationInCFile.obj" \ - "$(INTDIR)\AllocationInCppFile.obj" \ - "$(INTDIR)\AllTests.obj" \ - "$(INTDIR)\CheatSheetTest.obj" \ - "$(INTDIR)\CodeMemoryReportFormatterTest.obj" \ - "$(INTDIR)\CommandLineArgumentsTest.obj" \ - "$(INTDIR)\CommandLineTestRunnerTest.obj" \ - "$(INTDIR)\GMockTest.obj" \ - "$(INTDIR)\GTest1Test.obj" \ - "$(INTDIR)\GTest2ConvertorTest.obj" \ - "$(INTDIR)\JUnitOutputTest.obj" \ - "$(INTDIR)\MemoryLeakDetectorTest.obj" \ - "$(INTDIR)\MemoryLeakOperatorOverloadsTest.obj" \ - "$(INTDIR)\MemoryLeakWarningTest.obj" \ - "$(INTDIR)\MemoryReportAllocatorTest.obj" \ - "$(INTDIR)\MemoryReporterPluginTest.obj" \ - "$(INTDIR)\MemoryReportFormatterTest.obj" \ - "$(INTDIR)\MockActualCallTest.obj" \ - "$(INTDIR)\MockCheatSheetTest.obj" \ - "$(INTDIR)\MockExpectedCallTest.obj" \ - "$(INTDIR)\MockExpectedFunctionsListTest.obj" \ - "$(INTDIR)\MockFailureTest.obj" \ - "$(INTDIR)\MockPluginTest.obj" \ - "$(INTDIR)\MockSupport_cTest.obj" \ - "$(INTDIR)\MockSupport_cTestCFile.obj" \ - "$(INTDIR)\MockSupportTest.obj" \ - "$(INTDIR)\OrderedTestTest.obj" \ - "$(INTDIR)\PluginTest.obj" \ - "$(INTDIR)\PreprocessorTest.obj" \ - "$(INTDIR)\SetPluginTest.obj" \ - "$(INTDIR)\SimpleStringTest.obj" \ - "$(INTDIR)\TestFailureTest.obj" \ - "$(INTDIR)\TestFilterTest.obj" \ - "$(INTDIR)\TestHarness_cTest.obj" \ - "$(INTDIR)\TestHarness_cTestCFile.obj" \ - "$(INTDIR)\TestInstallerTest.obj" \ - "$(INTDIR)\TestMemoryAllocatorTest.obj" \ - "$(INTDIR)\TestOutputTest.obj" \ - "$(INTDIR)\TestRegistryTest.obj" \ - "$(INTDIR)\TestResultTest.obj" \ - "$(INTDIR)\UtestTest.obj" \ - "..\Release\CppUTest.lib" - -"$(OUTDIR)\AllTests.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -TargetPath=.\Release\AllTests.exe -SOURCE="$(InputPath)" -DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep - -ALL : $(DS_POSTBUILD_DEP) - -# Begin Custom Macros -OutDir=.\Release -# End Custom Macros - -$(DS_POSTBUILD_DEP) : "CppUTest - Win32 Release" "$(OUTDIR)\AllTests.exe" - .\Release\AllTests.exe - echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\Debug -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\AllTests.exe" "$(OUTDIR)\AllTests.bsc" - -!ELSE - -ALL : "CppUTest - Win32 Debug" "$(OUTDIR)\AllTests.exe" "$(OUTDIR)\AllTests.bsc" - -!ENDIF - -!IF "$(RECURSE)" == "1" -CLEAN :"CppUTest - Win32 DebugCLEAN" -!ELSE -CLEAN : -!ENDIF - -@erase "$(INTDIR)\AllocationInCFile.obj" - -@erase "$(INTDIR)\AllocationInCFile.sbr" - -@erase "$(INTDIR)\AllocationInCppFile.obj" - -@erase "$(INTDIR)\AllocationInCppFile.sbr" - -@erase "$(INTDIR)\AllTests.obj" - -@erase "$(INTDIR)\AllTests.sbr" - -@erase "$(INTDIR)\CheatSheetTest.obj" - -@erase "$(INTDIR)\CheatSheetTest.sbr" - -@erase "$(INTDIR)\CodeMemoryReportFormatterTest.obj" - -@erase "$(INTDIR)\CodeMemoryReportFormatterTest.sbr" - -@erase "$(INTDIR)\CommandLineArgumentsTest.obj" - -@erase "$(INTDIR)\CommandLineArgumentsTest.sbr" - -@erase "$(INTDIR)\CommandLineTestRunnerTest.obj" - -@erase "$(INTDIR)\CommandLineTestRunnerTest.sbr" - -@erase "$(INTDIR)\GMockTest.obj" - -@erase "$(INTDIR)\GMockTest.sbr" - -@erase "$(INTDIR)\GTest1Test.obj" - -@erase "$(INTDIR)\GTest1Test.sbr" - -@erase "$(INTDIR)\GTest2ConvertorTest.obj" - -@erase "$(INTDIR)\GTest2ConvertorTest.sbr" - -@erase "$(INTDIR)\JUnitOutputTest.obj" - -@erase "$(INTDIR)\JUnitOutputTest.sbr" - -@erase "$(INTDIR)\MemoryLeakDetectorTest.obj" - -@erase "$(INTDIR)\MemoryLeakDetectorTest.sbr" - -@erase "$(INTDIR)\MemoryLeakOperatorOverloadsTest.obj" - -@erase "$(INTDIR)\MemoryLeakOperatorOverloadsTest.sbr" - -@erase "$(INTDIR)\MemoryLeakWarningTest.obj" - -@erase "$(INTDIR)\MemoryLeakWarningTest.sbr" - -@erase "$(INTDIR)\MemoryReportAllocatorTest.obj" - -@erase "$(INTDIR)\MemoryReportAllocatorTest.sbr" - -@erase "$(INTDIR)\MemoryReporterPluginTest.obj" - -@erase "$(INTDIR)\MemoryReporterPluginTest.sbr" - -@erase "$(INTDIR)\MemoryReportFormatterTest.obj" - -@erase "$(INTDIR)\MemoryReportFormatterTest.sbr" - -@erase "$(INTDIR)\MockActualCallTest.obj" - -@erase "$(INTDIR)\MockActualCallTest.sbr" - -@erase "$(INTDIR)\MockCheatSheetTest.obj" - -@erase "$(INTDIR)\MockCheatSheetTest.sbr" - -@erase "$(INTDIR)\MockExpectedCallTest.obj" - -@erase "$(INTDIR)\MockExpectedCallTest.sbr" - -@erase "$(INTDIR)\MockExpectedFunctionsListTest.obj" - -@erase "$(INTDIR)\MockExpectedFunctionsListTest.sbr" - -@erase "$(INTDIR)\MockFailureTest.obj" - -@erase "$(INTDIR)\MockFailureTest.sbr" - -@erase "$(INTDIR)\MockPluginTest.obj" - -@erase "$(INTDIR)\MockPluginTest.sbr" - -@erase "$(INTDIR)\MockSupport_cTest.obj" - -@erase "$(INTDIR)\MockSupport_cTest.sbr" - -@erase "$(INTDIR)\MockSupport_cTestCFile.obj" - -@erase "$(INTDIR)\MockSupport_cTestCFile.sbr" - -@erase "$(INTDIR)\MockSupportTest.obj" - -@erase "$(INTDIR)\MockSupportTest.sbr" - -@erase "$(INTDIR)\OrderedTestTest.obj" - -@erase "$(INTDIR)\OrderedTestTest.sbr" - -@erase "$(INTDIR)\PluginTest.obj" - -@erase "$(INTDIR)\PluginTest.sbr" - -@erase "$(INTDIR)\PreprocessorTest.obj" - -@erase "$(INTDIR)\PreprocessorTest.sbr" - -@erase "$(INTDIR)\SetPluginTest.obj" - -@erase "$(INTDIR)\SetPluginTest.sbr" - -@erase "$(INTDIR)\SimpleStringTest.obj" - -@erase "$(INTDIR)\SimpleStringTest.sbr" - -@erase "$(INTDIR)\TestFailureTest.obj" - -@erase "$(INTDIR)\TestFailureTest.sbr" - -@erase "$(INTDIR)\TestFilterTest.obj" - -@erase "$(INTDIR)\TestFilterTest.sbr" - -@erase "$(INTDIR)\TestHarness_cTest.obj" - -@erase "$(INTDIR)\TestHarness_cTest.sbr" - -@erase "$(INTDIR)\TestHarness_cTestCFile.obj" - -@erase "$(INTDIR)\TestHarness_cTestCFile.sbr" - -@erase "$(INTDIR)\TestInstallerTest.obj" - -@erase "$(INTDIR)\TestInstallerTest.sbr" - -@erase "$(INTDIR)\TestMemoryAllocatorTest.obj" - -@erase "$(INTDIR)\TestMemoryAllocatorTest.sbr" - -@erase "$(INTDIR)\TestOutputTest.obj" - -@erase "$(INTDIR)\TestOutputTest.sbr" - -@erase "$(INTDIR)\TestRegistryTest.obj" - -@erase "$(INTDIR)\TestRegistryTest.sbr" - -@erase "$(INTDIR)\TestResultTest.obj" - -@erase "$(INTDIR)\TestResultTest.sbr" - -@erase "$(INTDIR)\UtestTest.obj" - -@erase "$(INTDIR)\UtestTest.sbr" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(OUTDIR)\AllTests.bsc" - -@erase "$(OUTDIR)\AllTests.exe" - -@erase "$(OUTDIR)\AllTests.ilk" - -@erase "$(OUTDIR)\AllTests.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /GX /ZI /Od /I "..\include" /I "..\include\Platforms\VisualCpp" /FI"CppUTest/MemoryLeakDetectorMallocMacros.h" /FI"CppUTest/MemoryLeakDetectorNewMacros.h" /D "_CONSOLE" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "CPPUTEST_MEM_LEAK_DETECTION_DISABLED" /D "CPPUTEST_USE_LONG_LONG" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\AllTests.bsc" -BSC32_SBRS= \ - "$(INTDIR)\AllocationInCFile.sbr" \ - "$(INTDIR)\AllocationInCppFile.sbr" \ - "$(INTDIR)\AllTests.sbr" \ - "$(INTDIR)\CheatSheetTest.sbr" \ - "$(INTDIR)\CodeMemoryReportFormatterTest.sbr" \ - "$(INTDIR)\CommandLineArgumentsTest.sbr" \ - "$(INTDIR)\CommandLineTestRunnerTest.sbr" \ - "$(INTDIR)\GMockTest.sbr" \ - "$(INTDIR)\GTest1Test.sbr" \ - "$(INTDIR)\GTest2ConvertorTest.sbr" \ - "$(INTDIR)\JUnitOutputTest.sbr" \ - "$(INTDIR)\MemoryLeakDetectorTest.sbr" \ - "$(INTDIR)\MemoryLeakOperatorOverloadsTest.sbr" \ - "$(INTDIR)\MemoryLeakWarningTest.sbr" \ - "$(INTDIR)\MemoryReportAllocatorTest.sbr" \ - "$(INTDIR)\MemoryReporterPluginTest.sbr" \ - "$(INTDIR)\MemoryReportFormatterTest.sbr" \ - "$(INTDIR)\MockActualCallTest.sbr" \ - "$(INTDIR)\MockCheatSheetTest.sbr" \ - "$(INTDIR)\MockExpectedCallTest.sbr" \ - "$(INTDIR)\MockExpectedFunctionsListTest.sbr" \ - "$(INTDIR)\MockFailureTest.sbr" \ - "$(INTDIR)\MockPluginTest.sbr" \ - "$(INTDIR)\MockSupport_cTest.sbr" \ - "$(INTDIR)\MockSupport_cTestCFile.sbr" \ - "$(INTDIR)\MockSupportTest.sbr" \ - "$(INTDIR)\OrderedTestTest.sbr" \ - "$(INTDIR)\PluginTest.sbr" \ - "$(INTDIR)\PreprocessorTest.sbr" \ - "$(INTDIR)\SetPluginTest.sbr" \ - "$(INTDIR)\SimpleStringTest.sbr" \ - "$(INTDIR)\TestFailureTest.sbr" \ - "$(INTDIR)\TestFilterTest.sbr" \ - "$(INTDIR)\TestHarness_cTest.sbr" \ - "$(INTDIR)\TestHarness_cTestCFile.sbr" \ - "$(INTDIR)\TestInstallerTest.sbr" \ - "$(INTDIR)\TestMemoryAllocatorTest.sbr" \ - "$(INTDIR)\TestOutputTest.sbr" \ - "$(INTDIR)\TestRegistryTest.sbr" \ - "$(INTDIR)\TestResultTest.sbr" \ - "$(INTDIR)\UtestTest.sbr" - -"$(OUTDIR)\AllTests.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LINK32=link.exe -LINK32_FLAGS=..\lib\CppUTest.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\AllTests.pdb" /debug /machine:I386 /out:"$(OUTDIR)\AllTests.exe" /pdbtype:sept -LINK32_OBJS= \ - "$(INTDIR)\AllocationInCFile.obj" \ - "$(INTDIR)\AllocationInCppFile.obj" \ - "$(INTDIR)\AllTests.obj" \ - "$(INTDIR)\CheatSheetTest.obj" \ - "$(INTDIR)\CodeMemoryReportFormatterTest.obj" \ - "$(INTDIR)\CommandLineArgumentsTest.obj" \ - "$(INTDIR)\CommandLineTestRunnerTest.obj" \ - "$(INTDIR)\GMockTest.obj" \ - "$(INTDIR)\GTest1Test.obj" \ - "$(INTDIR)\GTest2ConvertorTest.obj" \ - "$(INTDIR)\JUnitOutputTest.obj" \ - "$(INTDIR)\MemoryLeakDetectorTest.obj" \ - "$(INTDIR)\MemoryLeakOperatorOverloadsTest.obj" \ - "$(INTDIR)\MemoryLeakWarningTest.obj" \ - "$(INTDIR)\MemoryReportAllocatorTest.obj" \ - "$(INTDIR)\MemoryReporterPluginTest.obj" \ - "$(INTDIR)\MemoryReportFormatterTest.obj" \ - "$(INTDIR)\MockActualCallTest.obj" \ - "$(INTDIR)\MockCheatSheetTest.obj" \ - "$(INTDIR)\MockExpectedCallTest.obj" \ - "$(INTDIR)\MockExpectedFunctionsListTest.obj" \ - "$(INTDIR)\MockFailureTest.obj" \ - "$(INTDIR)\MockPluginTest.obj" \ - "$(INTDIR)\MockSupport_cTest.obj" \ - "$(INTDIR)\MockSupport_cTestCFile.obj" \ - "$(INTDIR)\MockSupportTest.obj" \ - "$(INTDIR)\OrderedTestTest.obj" \ - "$(INTDIR)\PluginTest.obj" \ - "$(INTDIR)\PreprocessorTest.obj" \ - "$(INTDIR)\SetPluginTest.obj" \ - "$(INTDIR)\SimpleStringTest.obj" \ - "$(INTDIR)\TestFailureTest.obj" \ - "$(INTDIR)\TestFilterTest.obj" \ - "$(INTDIR)\TestHarness_cTest.obj" \ - "$(INTDIR)\TestHarness_cTestCFile.obj" \ - "$(INTDIR)\TestInstallerTest.obj" \ - "$(INTDIR)\TestMemoryAllocatorTest.obj" \ - "$(INTDIR)\TestOutputTest.obj" \ - "$(INTDIR)\TestRegistryTest.obj" \ - "$(INTDIR)\TestResultTest.obj" \ - "$(INTDIR)\UtestTest.obj" \ - "..\lib\CppUTest.lib" - -"$(OUTDIR)\AllTests.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -TargetPath=.\Debug\AllTests.exe -SOURCE="$(InputPath)" -DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep - -ALL : $(DS_POSTBUILD_DEP) - -# Begin Custom Macros -OutDir=.\Debug -# End Custom Macros - -$(DS_POSTBUILD_DEP) : "CppUTest - Win32 Debug" "$(OUTDIR)\AllTests.exe" "$(OUTDIR)\AllTests.bsc" - .\Debug\AllTests.exe -v - echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" - -!ENDIF - -.c{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(NO_EXTERNAL_DEPS)" != "1" -!IF EXISTS("AllTests.dep") -!INCLUDE "AllTests.dep" -!ELSE -!MESSAGE Warning: cannot find "AllTests.dep" -!ENDIF -!ENDIF - - -!IF "$(CFG)" == "AllTests - Win32 Release" || "$(CFG)" == "AllTests - Win32 Debug" -SOURCE=.\AllocationInCFile.c - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\AllocationInCFile.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\AllocationInCFile.obj" "$(INTDIR)\AllocationInCFile.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\AllocationInCppFile.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\AllocationInCppFile.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\AllocationInCppFile.obj" "$(INTDIR)\AllocationInCppFile.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\CppUTestExt\AllTests.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\AllTests.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\AllTests.obj" "$(INTDIR)\AllTests.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CheatSheetTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\CheatSheetTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\CheatSheetTest.obj" "$(INTDIR)\CheatSheetTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\CppUTestExt\CodeMemoryReportFormatterTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\CodeMemoryReportFormatterTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\CodeMemoryReportFormatterTest.obj" "$(INTDIR)\CodeMemoryReportFormatterTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CommandLineArgumentsTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\CommandLineArgumentsTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\CommandLineArgumentsTest.obj" "$(INTDIR)\CommandLineArgumentsTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\CommandLineTestRunnerTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\CommandLineTestRunnerTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\CommandLineTestRunnerTest.obj" "$(INTDIR)\CommandLineTestRunnerTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\CppUTestExt\GMockTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\GMockTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\GMockTest.obj" "$(INTDIR)\GMockTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\GTest1Test.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\GTest1Test.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\GTest1Test.obj" "$(INTDIR)\GTest1Test.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\GTest2ConvertorTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\GTest2ConvertorTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\GTest2ConvertorTest.obj" "$(INTDIR)\GTest2ConvertorTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\JUnitOutputTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\JUnitOutputTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\JUnitOutputTest.obj" "$(INTDIR)\JUnitOutputTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\MemoryLeakDetectorTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MemoryLeakDetectorTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MemoryLeakDetectorTest.obj" "$(INTDIR)\MemoryLeakDetectorTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\MemoryLeakOperatorOverloadsTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MemoryLeakOperatorOverloadsTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MemoryLeakOperatorOverloadsTest.obj" "$(INTDIR)\MemoryLeakOperatorOverloadsTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\MemoryLeakWarningTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MemoryLeakWarningTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MemoryLeakWarningTest.obj" "$(INTDIR)\MemoryLeakWarningTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\CppUTestExt\MemoryReportAllocatorTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MemoryReportAllocatorTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MemoryReportAllocatorTest.obj" "$(INTDIR)\MemoryReportAllocatorTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MemoryReporterPluginTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MemoryReporterPluginTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MemoryReporterPluginTest.obj" "$(INTDIR)\MemoryReporterPluginTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MemoryReportFormatterTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MemoryReportFormatterTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MemoryReportFormatterTest.obj" "$(INTDIR)\MemoryReportFormatterTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockActualCallTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockActualCallTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockActualCallTest.obj" "$(INTDIR)\MockActualCallTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockCheatSheetTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockCheatSheetTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockCheatSheetTest.obj" "$(INTDIR)\MockCheatSheetTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockExpectedCallTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockExpectedCallTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockExpectedCallTest.obj" "$(INTDIR)\MockExpectedCallTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockExpectedFunctionsListTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockExpectedFunctionsListTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockExpectedFunctionsListTest.obj" "$(INTDIR)\MockExpectedFunctionsListTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockFailureTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockFailureTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockFailureTest.obj" "$(INTDIR)\MockFailureTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockPluginTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockPluginTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockPluginTest.obj" "$(INTDIR)\MockPluginTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockSupport_cTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockSupport_cTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockSupport_cTest.obj" "$(INTDIR)\MockSupport_cTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockSupport_cTestCFile.c - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockSupport_cTestCFile.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockSupport_cTestCFile.obj" "$(INTDIR)\MockSupport_cTestCFile.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\MockSupportTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\MockSupportTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\MockSupportTest.obj" "$(INTDIR)\MockSupportTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\CppUTestExt\OrderedTestTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\OrderedTestTest.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\OrderedTestTest.obj" "$(INTDIR)\OrderedTestTest.sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\PluginTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\PluginTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\PluginTest.obj" "$(INTDIR)\PluginTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\PreprocessorTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\PreprocessorTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\PreprocessorTest.obj" "$(INTDIR)\PreprocessorTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\SetPluginTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\SetPluginTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\SetPluginTest.obj" "$(INTDIR)\SetPluginTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\SimpleStringTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\SimpleStringTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\SimpleStringTest.obj" "$(INTDIR)\SimpleStringTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestFailureTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestFailureTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestFailureTest.obj" "$(INTDIR)\TestFailureTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestFilterTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestFilterTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestFilterTest.obj" "$(INTDIR)\TestFilterTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestHarness_cTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestHarness_cTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestHarness_cTest.obj" "$(INTDIR)\TestHarness_cTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestHarness_cTestCFile.c - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestHarness_cTestCFile.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestHarness_cTestCFile.obj" "$(INTDIR)\TestHarness_cTestCFile.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestInstallerTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestInstallerTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestInstallerTest.obj" "$(INTDIR)\TestInstallerTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestMemoryAllocatorTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestMemoryAllocatorTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestMemoryAllocatorTest.obj" "$(INTDIR)\TestMemoryAllocatorTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestOutputTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestOutputTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestOutputTest.obj" "$(INTDIR)\TestOutputTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestRegistryTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestRegistryTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestRegistryTest.obj" "$(INTDIR)\TestRegistryTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\TestResultTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\TestResultTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\TestResultTest.obj" "$(INTDIR)\TestResultTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -SOURCE=.\UtestTest.cpp - -!IF "$(CFG)" == "AllTests - Win32 Release" - - -"$(INTDIR)\UtestTest.obj" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - - -"$(INTDIR)\UtestTest.obj" "$(INTDIR)\UtestTest.sbr" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - -!IF "$(CFG)" == "AllTests - Win32 Release" - -"CppUTest - Win32 Release" : - cd "\DEV\05_CPPUTEST\CPPUTEST" - $(MAKE) /$(MAKEFLAGS) /F .\CppUTest.mak CFG="CppUTest - Win32 Release" - cd ".\tests" - -"CppUTest - Win32 ReleaseCLEAN" : - cd "\DEV\05_CPPUTEST\CPPUTEST" - $(MAKE) /$(MAKEFLAGS) /F .\CppUTest.mak CFG="CppUTest - Win32 Release" RECURSE=1 CLEAN - cd ".\tests" - -!ELSEIF "$(CFG)" == "AllTests - Win32 Debug" - -"CppUTest - Win32 Debug" : - cd "\DEV\05_CPPUTEST\CPPUTEST" - $(MAKE) /$(MAKEFLAGS) /F .\CppUTest.mak CFG="CppUTest - Win32 Debug" - cd ".\tests" - -"CppUTest - Win32 DebugCLEAN" : - cd "\DEV\05_CPPUTEST\CPPUTEST" - $(MAKE) /$(MAKEFLAGS) /F .\CppUTest.mak CFG="CppUTest - Win32 Debug" RECURSE=1 CLEAN - cd ".\tests" - -!ENDIF - - -!ENDIF - diff -Nru cpputest-3.8/tests/AllTests.vcproj cpputest-4.0/tests/AllTests.vcproj --- cpputest-3.8/tests/AllTests.vcproj 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/tests/AllTests.vcproj 2020-05-26 11:24:07.000000000 +0000 @@ -194,7 +194,7 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > + + + + + + + + + + + + + + + + + + + + + + + + + + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {913088F6-37C0-4195-80E9-548C7C5303CB} @@ -19,11 +27,21 @@ false MultiByte + + Application + false + MultiByte + Application false MultiByte + + Application + false + MultiByte + @@ -31,19 +49,33 @@ + + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\cpputest_build\ + ..\cpputest_build\ ..\cpputest_build\Release\$(ProjectName)\ + ..\cpputest_build\Release\$(ProjectName)\ false + false ..\cpputest_build\ + ..\cpputest_build\ ..\cpputest_build\Debug\$(ProjectName)\ + ..\cpputest_build\Debug\$(ProjectName)\ true + true @@ -62,6 +94,7 @@ true ..\include;..\include\CppUTestExt\CppUTestGTest;..\include\CppUTestExt\CppUTestGMock;..\include\Platforms\VisualCpp;%(AdditionalIncludeDirectories) OldStyle + true NDEBUG;%(PreprocessorDefinitions) @@ -83,6 +116,44 @@ "$(TargetPath)" + + + .\Release/AllTests.tlb + + + + + MaxSpeed + OnlyExplicitInline + WIN32;NDEBUG;_CONSOLE;CPPUTEST_USE_LONG_LONG;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + Level3 + true + ..\include;..\include\CppUTestExt\CppUTestGTest;..\include\CppUTestExt\CppUTestGMock;..\include\Platforms\VisualCpp;%(AdditionalIncludeDirectories) + OldStyle + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Console + false + + + + + true + .\Release/AllTests.bsc + + + "$(TargetPath)" + + .\Debug/AllTests.tlb @@ -122,6 +193,44 @@ "$(TargetPath)" + + + .\Debug/AllTests.tlb + + + + + Disabled + ..\include;..\include\CppUTestExt\CppUTestGTest;..\include\CppUTestExt\CppUTestGMock;..\include\Platforms\VisualCpp;%(AdditionalIncludeDirectories) + _CONSOLE;WIN32;_DEBUG;CPPUTEST_USE_LONG_LONG;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + true + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + true + true + Console + false + + + + + true + + + "$(TargetPath)" + + {f468f539-27bd-468e-be64-dde641400b51} @@ -133,13 +242,14 @@ - - - - - - - + + + + + + + + @@ -168,42 +278,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + + - \ No newline at end of file + diff -Nru cpputest-3.8/tests/CheatSheetTest.cpp cpputest-4.0/tests/CheatSheetTest.cpp --- cpputest-3.8/tests/CheatSheetTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CheatSheetTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - -static void (*real_one) (); -static void stub(){} - -/* in CheatSheetTest.cpp */ -#include "CppUTest/TestHarness.h" - -/* Declare TestGroup with name CheatSheet */ -TEST_GROUP(CheatSheet) -{ -/* declare a setup method for the test group. Optional. */ - void setup () - { -/* Set method real_one to stub. Automatically restore in teardown */ - UT_PTR_SET(real_one, stub); - } - -/* Declare a teardown method for the test group. Optional */ - void teardown() - { - } -}; /* Do not forget semicolumn */ - -/* Declare one test within the test group */ -TEST(CheatSheet, TestName) -{ - /* Check two longs are equal */ - LONGS_EQUAL(1, 1); - - /* Check a condition */ - CHECK(true == true); - - /* Check a string */ - STRCMP_EQUAL("HelloWorld", "HelloWorld"); -} - diff -Nru cpputest-3.8/tests/CMakeLists.txt cpputest-4.0/tests/CMakeLists.txt --- cpputest-3.8/tests/CMakeLists.txt 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/tests/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -enable_testing() - -set(CppUTestTests_src - AllTests.cpp - SetPluginTest.cpp - CheatSheetTest.cpp - SimpleStringTest.cpp - CommandLineArgumentsTest.cpp - TestFailureTest.cpp - TestFailureNaNTest.cpp - CommandLineTestRunnerTest.cpp - TestFilterTest.cpp - TestHarness_cTest.cpp - JUnitOutputTest.cpp - TestHarness_cTestCFile.c - MemoryLeakDetectorTest.cpp - TestInstallerTest.cpp - AllocLetTestFree.c - MemoryOperatorOverloadTest.cpp - TestMemoryAllocatorTest.cpp - MemoryLeakWarningTest.cpp - TestOutputTest.cpp - AllocLetTestFreeTest.cpp - TestRegistryTest.cpp - AllocationInCFile.c - PluginTest.cpp - TestResultTest.cpp - PreprocessorTest.cpp - TestUTestMacro.cpp - TestUTestStringMacro.cpp - AllocationInCppFile.cpp - UtestTest.cpp - SimpleMutexTest.cpp - UtestPlatformTest.cpp - TeamCityOutputTest.cpp -) - -if (MSVC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4723") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4723") -endif (MSVC) - -if (MINGW) - find_package (Threads REQUIRED) - set(THREAD_LIB "pthread") -endif (MINGW) - -if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "OpenBSD") - set (THREADS_HAVE_PTHREAD_ARG 1) - find_package (Threads REQUIRED) - set (THREAD_LIB "pthread") -endif () - -add_executable(CppUTestTests ${CppUTestTests_src}) -cpputest_normalize_test_output_location(CppUTestTests) -target_link_libraries(CppUTestTests CppUTest ${THREAD_LIB}) - -add_subdirectory(CppUTestExt) -cpputest_buildtime_discover_tests(CppUTestTests) diff -Nru cpputest-3.8/tests/CommandLineArgumentsTest.cpp cpputest-4.0/tests/CommandLineArgumentsTest.cpp --- cpputest-3.8/tests/CommandLineArgumentsTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CommandLineArgumentsTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,436 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/CommandLineArguments.h" -#include "CppUTest/TestRegistry.h" - -class OptionsPlugin: public TestPlugin -{ -public: - OptionsPlugin(const SimpleString& name) : - TestPlugin(name) - { - } - ~OptionsPlugin() - { - } - bool parseArguments(int /*ac*/, const char** /*av*/, int /*index*/) - { - return true; - } -}; - -TEST_GROUP(CommandLineArguments) -{ - CommandLineArguments* args; - OptionsPlugin* plugin; - - void setup() - { - plugin = new OptionsPlugin("options"); - args = NULL; - } - void teardown() - { - delete args; - delete plugin; - } - - bool newArgumentParser(int argc, const char** argv) - { - args = new CommandLineArguments(argc, argv); - return args->parse(plugin); - } -}; - -TEST(CommandLineArguments, Create) -{ -} - -TEST(CommandLineArguments, verboseSetMultipleParameters) -{ - const char* argv[] = { "tests.exe", "-v" }; - CHECK(newArgumentParser(2, argv)); - CHECK(args->isVerbose()); -} - -TEST(CommandLineArguments, setColor) -{ - const char* argv[] = { "tests.exe", "-c" }; - CHECK(newArgumentParser(2, argv)); - CHECK(args->isColor()); -} - -TEST(CommandLineArguments, repeatSet) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-r3" }; - CHECK(newArgumentParser(argc, argv)); - LONGS_EQUAL(3, args->getRepeatCount()); -} - -TEST(CommandLineArguments, repeatSetDifferentParameter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-r", "4" }; - CHECK(newArgumentParser(argc, argv)); - LONGS_EQUAL(4, args->getRepeatCount()); -} - -TEST(CommandLineArguments, repeatSetDefaultsToTwo) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-r" }; - CHECK(newArgumentParser(argc, argv)); - LONGS_EQUAL(2, args->getRepeatCount()); -} - -TEST(CommandLineArguments, runningTestsInSeperateProcesses) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-p" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->runTestsInSeperateProcess()); -} - -TEST(CommandLineArguments, setGroupFilter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-g", "group" }; - CHECK(newArgumentParser(argc, argv)); - CHECK_EQUAL(TestFilter("group"), *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setGroupFilterSameParameter) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-ggroup" }; - CHECK(newArgumentParser(argc, argv)); - CHECK_EQUAL(TestFilter("group"), *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setStrictGroupFilter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-sg", "group" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter groupFilter("group"); - groupFilter.strictMatching(); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setStrictGroupFilterSameParameter) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-sggroup" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter groupFilter("group"); - groupFilter.strictMatching(); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setExcludeGroupFilter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-xg", "group" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter groupFilter("group"); - groupFilter.invertMatching(); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setExcludeGroupFilterSameParameter) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-xggroup" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter groupFilter("group"); - groupFilter.invertMatching(); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setExcludeStrictGroupFilter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-xsg", "group" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter groupFilter("group"); - groupFilter.invertMatching(); - groupFilter.strictMatching(); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setExcludeStrictGroupFilterSameParameter) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-xsggroup" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter groupFilter("group"); - groupFilter.invertMatching(); - groupFilter.strictMatching(); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setNameFilter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-n", "name" }; - CHECK(newArgumentParser(argc, argv)); - CHECK_EQUAL(TestFilter("name"), *args->getNameFilters()); -} - -TEST(CommandLineArguments, setNameFilterSameParameter) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-nname" }; - CHECK(newArgumentParser(argc, argv)); - CHECK_EQUAL(TestFilter("name"), *args->getNameFilters()); -} - -TEST(CommandLineArguments, setStrictNameFilter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-sn", "name" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter nameFilter("name"); - nameFilter.strictMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()); -} - -TEST(CommandLineArguments, setStrictNameFilterSameParameter) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-snname" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter nameFilter("name"); - nameFilter.strictMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()); -} - -TEST(CommandLineArguments, setExcludeNameFilter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-xn", "name" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter nameFilter("name"); - nameFilter.invertMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()); -} - -TEST(CommandLineArguments, setExcludeNameFilterSameParameter) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-xnname" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter nameFilter("name"); - nameFilter.invertMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()); -} - -TEST(CommandLineArguments, setExcludeStrictNameFilter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-xsn", "name" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter nameFilter("name"); - nameFilter.invertMatching(); - nameFilter.strictMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()); -} - -TEST(CommandLineArguments, setExcludeStrictNameFilterSameParameter) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-xsnname" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter nameFilter("name"); - nameFilter.invertMatching(); - nameFilter.strictMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()); -} - -TEST(CommandLineArguments, setTestToRunUsingVerboseOutput) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "TEST(testgroup, testname) - stuff" }; - CHECK(newArgumentParser(argc, argv)); - - TestFilter nameFilter("testname"); - TestFilter groupFilter("testgroup"); - nameFilter.strictMatching(); - groupFilter.strictMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setTestToRunUsingVerboseOutputOfIgnoreTest) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "IGNORE_TEST(testgroup, testname) - stuff" }; - CHECK(newArgumentParser(argc, argv)); - - TestFilter nameFilter("testname"); - TestFilter groupFilter("testgroup"); - nameFilter.strictMatching(); - groupFilter.strictMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()); -} - -TEST(CommandLineArguments, setNormalOutput) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-onormal" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->isEclipseOutput()); -} - -TEST(CommandLineArguments, setEclipseOutput) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-oeclipse" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->isEclipseOutput()); -} - -TEST(CommandLineArguments, setNormalOutputDifferentParameter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-o", "normal" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->isEclipseOutput()); -} - -TEST(CommandLineArguments, setJUnitOutputDifferentParameter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-o", "junit" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->isJUnitOutput()); -} - -TEST(CommandLineArguments, setTeamCityOutputDifferentParameter) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-o", "teamcity" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->isTeamCityOutput()); -} - -TEST(CommandLineArguments, setOutputToGarbage) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-o", "garbage" }; - CHECK(!newArgumentParser(argc, argv)); -} - -TEST(CommandLineArguments, setPrintGroups) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-lg" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->isListingTestGroupNames()); -} - -TEST(CommandLineArguments, setPrintGroupsAndNames) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-ln" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->isListingTestGroupAndCaseNames()); -} - -TEST(CommandLineArguments, weirdParamatersPrintsUsageAndReturnsFalse) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-SomethingWeird" }; - CHECK(!newArgumentParser(argc, argv)); - STRCMP_EQUAL("usage [-v] [-c] [-p] [-lg] [-ln] [-ri] [-r#] [-g|sg|xg|xsg groupName]... [-n|sn|xn|xsn testName]... [\"TEST(groupName, testName)\"]... [-o{normal, junit, teamcity}] [-k packageName]\n", - args->usage()); -} - -TEST(CommandLineArguments, pluginKnowsOption) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-pPluginOption" }; - TestRegistry::getCurrentRegistry()->installPlugin(plugin); - CHECK(newArgumentParser(argc, argv)); - TestRegistry::getCurrentRegistry()->removePluginByName("options"); -} - - -TEST(CommandLineArguments, checkDefaultArguments) -{ - int argc = 1; - const char* argv[] = { "tests.exe" }; - CHECK(newArgumentParser(argc, argv)); - CHECK(!args->isVerbose()); - LONGS_EQUAL(1, args->getRepeatCount()); - CHECK(NULL == args->getGroupFilters()); - CHECK(NULL == args->getNameFilters()); - CHECK(args->isEclipseOutput()); - CHECK(SimpleString("") == args->getPackageName()); -} - -TEST(CommandLineArguments, setPackageName) -{ - int argc = 3; - const char* argv[] = { "tests.exe", "-k", "package" }; - CHECK(newArgumentParser(argc, argv)); - CHECK_EQUAL(SimpleString("package"), args->getPackageName()); -} - -TEST(CommandLineArguments, lotsOfGroupsAndTests) -{ - int argc = 10; - const char* argv[] = { "tests.exe", "-sggroup1", "-xntest1", "-sggroup2", "-sntest2", "-sntest3", "-sggroup3", "-sntest4", "-sggroup4", "-sntest5" }; - CHECK(newArgumentParser(argc, argv)); - TestFilter nameFilter("test1"); - nameFilter.invertMatching(); - TestFilter groupFilter("group1"); - groupFilter.strictMatching(); - CHECK_EQUAL(nameFilter, *args->getNameFilters()->getNext()->getNext()->getNext()->getNext()); - CHECK_EQUAL(groupFilter, *args->getGroupFilters()->getNext()->getNext()->getNext()); -} - -TEST(CommandLineArguments, lastParameterFieldMissing) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-k"}; - CHECK(newArgumentParser(argc, argv)); - CHECK_EQUAL(SimpleString(""), args->getPackageName()); -} - -TEST(CommandLineArguments, setOptRun) -{ - int argc = 2; - const char* argv[] = { "tests.exe", "-ri"}; - CHECK(newArgumentParser(argc, argv)); - CHECK(args->isRunIgnored()); -} - diff -Nru cpputest-3.8/tests/CommandLineTestRunnerTest.cpp cpputest-4.0/tests/CommandLineTestRunnerTest.cpp --- cpputest-3.8/tests/CommandLineTestRunnerTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CommandLineTestRunnerTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,326 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/CommandLineTestRunner.h" -#include "CppUTest/TestRegistry.h" -#include "CppUTest/TestTestingFixture.h" -#include "CppUTest/TestPlugin.h" -#include "CppUTest/JUnitTestOutput.h" -#include "CppUTest/PlatformSpecificFunctions.h" -#include "CppUTestExt/MockSupport.h" - - -class DummyPluginWhichCountsThePlugins : public TestPlugin -{ -public: - - bool returnValue; - int amountOfPlugins; - - DummyPluginWhichCountsThePlugins(const SimpleString& name, TestRegistry* registry) : - TestPlugin(name), returnValue(true), amountOfPlugins(0), registry_(registry) - { - } - - virtual bool parseArguments(int, const char**, int) - { - /* Remove ourselves from the count */ - amountOfPlugins = registry_->countPlugins() - 1; - return returnValue; - } -private: - TestRegistry* registry_; -}; - -class CommandLineTestRunnerWithStringBufferOutput : public CommandLineTestRunner -{ -public: - StringBufferTestOutput* fakeJUnitOutputWhichIsReallyABuffer_; - StringBufferTestOutput* fakeConsoleOutputWhichIsReallyABuffer; - StringBufferTestOutput* fakeTCOutputWhichIsReallyABuffer; - - CommandLineTestRunnerWithStringBufferOutput(int argc, const char** argv, TestRegistry* registry) - : CommandLineTestRunner(argc, argv, registry), fakeJUnitOutputWhichIsReallyABuffer_(NULL), - fakeConsoleOutputWhichIsReallyABuffer(NULL), fakeTCOutputWhichIsReallyABuffer(NULL) - {} - - TestOutput* createConsoleOutput() - { - fakeConsoleOutputWhichIsReallyABuffer = new StringBufferTestOutput; - return fakeConsoleOutputWhichIsReallyABuffer; - } - - TestOutput* createJUnitOutput(const SimpleString&) - { - fakeJUnitOutputWhichIsReallyABuffer_ = new StringBufferTestOutput; - return fakeJUnitOutputWhichIsReallyABuffer_; - } - - TestOutput* createTeamCityOutput() - { - fakeTCOutputWhichIsReallyABuffer = new StringBufferTestOutput; - return fakeTCOutputWhichIsReallyABuffer; - } -}; - -TEST_GROUP(CommandLineTestRunner) -{ - TestRegistry registry; - UtestShell *oneTest_; - DummyPluginWhichCountsThePlugins* pluginCountingPlugin; - - void setup() - { - oneTest_ = new UtestShell("group", "test", "file", 1); - registry.addTest(oneTest_); - pluginCountingPlugin = new DummyPluginWhichCountsThePlugins("PluginCountingPlugin", ®istry); - } - void teardown() - { - delete pluginCountingPlugin; - delete oneTest_; - } -}; - -TEST(CommandLineTestRunner, OnePluginGetsInstalledDuringTheRunningTheTests) -{ - const char* argv[] = { "tests.exe", "-psomething"}; - - registry.installPlugin(pluginCountingPlugin); - - CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); - commandLineTestRunner.runAllTestsMain(); - registry.removePluginByName("PluginCountingPlugin"); - - LONGS_EQUAL(0, registry.countPlugins()); - LONGS_EQUAL(1, pluginCountingPlugin->amountOfPlugins); -} - -TEST(CommandLineTestRunner, NoPluginsAreInstalledAtTheEndOfARunWhenTheArgumentsAreInvalid) -{ - const char* argv[] = { "tests.exe", "-fdskjnfkds"}; - - CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); - commandLineTestRunner.runAllTestsMain(); - - LONGS_EQUAL(0, registry.countPlugins()); - -} - -TEST(CommandLineTestRunner, TeamcityOutputEnabled) -{ - const char* argv[] = {"tests.exe", "-oteamcity"}; - CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); - commandLineTestRunner.runAllTestsMain(); - CHECK(commandLineTestRunner.fakeTCOutputWhichIsReallyABuffer); -} - -TEST(CommandLineTestRunner, JunitOutputEnabled) -{ - const char* argv[] = { "tests.exe", "-ojunit"}; - - CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); - commandLineTestRunner.runAllTestsMain(); - CHECK(commandLineTestRunner.fakeJUnitOutputWhichIsReallyABuffer_); -} - -TEST(CommandLineTestRunner, JunitOutputAndVerboseEnabled) -{ - const char* argv[] = { "tests.exe", "-ojunit", "-v"}; - - CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(3, argv, ®istry); - commandLineTestRunner.runAllTestsMain(); - STRCMP_CONTAINS("TEST(group, test)", commandLineTestRunner.fakeJUnitOutputWhichIsReallyABuffer_->getOutput().asCharString()); - STRCMP_CONTAINS("TEST(group, test)", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); -} - -TEST(CommandLineTestRunner, listTestGroupNamesShouldWorkProperly) -{ - const char* argv[] = { "tests.exe", "-lg" }; - - CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); - commandLineTestRunner.runAllTestsMain(); - - STRCMP_CONTAINS("group", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); -} - -TEST(CommandLineTestRunner, listTestGroupAndCaseNamesShouldWorkProperly) -{ - const char* argv[] = { "tests.exe", "-ln" }; - - CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); - commandLineTestRunner.runAllTestsMain(); - - STRCMP_CONTAINS("group.test", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); -} - -extern "C" { - typedef PlatformSpecificFile (*FOpenFunc)(const char*, const char*); - typedef void (*FPutsFunc)(const char*, PlatformSpecificFile); - typedef void (*FCloseFunc)(PlatformSpecificFile); - typedef int (*PutcharFunc)(int); -} - -struct FakeOutput -{ - FakeOutput() : SaveFOpen(PlatformSpecificFOpen), SaveFPuts(PlatformSpecificFPuts), - SaveFClose(PlatformSpecificFClose), SavePutchar(PlatformSpecificPutchar) - { - PlatformSpecificFOpen = (FOpenFunc)fopen_fake; - PlatformSpecificFPuts = (FPutsFunc)fputs_fake; - PlatformSpecificFClose = (FCloseFunc)fclose_fake; - PlatformSpecificPutchar = (PutcharFunc)putchar_fake; - } - ~FakeOutput() - { - PlatformSpecificPutchar = SavePutchar; - PlatformSpecificFOpen = SaveFOpen; - PlatformSpecificFPuts = SaveFPuts; - PlatformSpecificFClose = SaveFClose; - } - static PlatformSpecificFile fopen_fake(const char*, const char*) - { - return (PlatformSpecificFile)0; - } - static void fputs_fake(const char* str, PlatformSpecificFile) - { - file += str; - } - static void fclose_fake(PlatformSpecificFile) - { - } - static int putchar_fake(int c) - { - console += StringFrom((char)c); - return c; - } - static SimpleString file; - static SimpleString console; -private: - FOpenFunc SaveFOpen; - FPutsFunc SaveFPuts; - FCloseFunc SaveFClose; - PutcharFunc SavePutchar; -}; - -SimpleString FakeOutput::console = ""; -SimpleString FakeOutput::file = ""; - -TEST(CommandLineTestRunner, realJunitOutputShouldBeCreatedAndWorkProperly) -{ - const char* argv[] = { "tests.exe", "-ojunit", "-v", "-kpackage", }; - - FakeOutput* fakeOutput = new FakeOutput; /* UT_PTR_SET() is not reentrant */ - - CommandLineTestRunner commandLineTestRunner(4, argv, ®istry); - commandLineTestRunner.runAllTestsMain(); - - delete fakeOutput; /* Original output must be restored before further output occurs */ - - STRCMP_CONTAINS(" nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/CommandLineTestRunner.h" +#include "CppUTest/TestMemoryAllocator.h" +#include "CppUTest/SimpleStringInternalCache.h" + +#define SHOW_MEMORY_REPORT 0 + +int main(int ac, char **av) +{ + int returnValue = 0; + GlobalSimpleStringCache stringCache; + + { + /* These checks are here to make sure assertions outside test runs don't crash */ + CHECK(true); + LONGS_EQUAL(1, 1); + +#if SHOW_MEMORY_REPORT + GlobalMemoryAccountant accountant; + accountant.start(); +#endif + + CommandLineTestRunner::RunAllTests(ac, av); /* cover alternate method */ + +#if SHOW_MEMORY_REPORT + accountant.stop(); + printf("%s", accountant.report().asCharString()); +#endif + } + + return returnValue; +} + diff -Nru cpputest-3.8/tests/CppUTest/AllTests.h cpputest-4.0/tests/CppUTest/AllTests.h --- cpputest-3.8/tests/CppUTest/AllTests.h 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/AllTests.h 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +//Include this in the test main to execute these tests +IMPORT_TEST_GROUP( Utest); +IMPORT_TEST_GROUP( Failure); +IMPORT_TEST_GROUP( TestOutput); +IMPORT_TEST_GROUP( SimpleString); +IMPORT_TEST_GROUP( TestInstaller); +IMPORT_TEST_GROUP( NullTest); +IMPORT_TEST_GROUP( MemoryLeakWarningTest); +IMPORT_TEST_GROUP( TestHarness_c); +IMPORT_TEST_GROUP( CommandLineTestRunner); +IMPORT_TEST_GROUP( JUnitOutputTest); +IMPORT_TEST_GROUP( MemoryLeakDetectorTest); + +/* In allTest.cpp */ +IMPORT_TEST_GROUP(CheatSheet); + diff -Nru cpputest-3.8/tests/CppUTest/CheatSheetTest.cpp cpputest-4.0/tests/CppUTest/CheatSheetTest.cpp --- cpputest-3.8/tests/CppUTest/CheatSheetTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/CheatSheetTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,36 @@ + +static void (*real_one) (); +static void stub(){} + +/* in CheatSheetTest.cpp */ +#include "CppUTest/TestHarness.h" + +/* Declare TestGroup with name CheatSheet */ +TEST_GROUP(CheatSheet) +{ +/* declare a setup method for the test group. Optional. */ + void setup () + { +/* Set method real_one to stub. Automatically restore in teardown */ + UT_PTR_SET(real_one, stub); + } + +/* Declare a teardown method for the test group. Optional */ + void teardown() + { + } +}; /* Do not forget semicolumn */ + +/* Declare one test within the test group */ +TEST(CheatSheet, TestName) +{ + /* Check two longs are equal */ + LONGS_EQUAL(1, 1); + + /* Check a condition */ + CHECK(true == true); + + /* Check a string */ + STRCMP_EQUAL("HelloWorld", "HelloWorld"); +} + diff -Nru cpputest-3.8/tests/CppUTest/CMakeLists.txt cpputest-4.0/tests/CppUTest/CMakeLists.txt --- cpputest-3.8/tests/CppUTest/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/CMakeLists.txt 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,61 @@ +set(CppUTestTests_src + AllTests.cpp + SetPluginTest.cpp + CheatSheetTest.cpp + SimpleStringTest.cpp + SimpleStringCacheTest.cpp + CompatabilityTests.cpp + CommandLineArgumentsTest.cpp + TestFailureTest.cpp + TestFailureNaNTest.cpp + CommandLineTestRunnerTest.cpp + TestFilterTest.cpp + TestHarness_cTest.cpp + JUnitOutputTest.cpp + TestHarness_cTestCFile.c + DummyMemoryLeakDetector.cpp + MemoryLeakDetectorTest.cpp + TestInstallerTest.cpp + AllocLetTestFree.c + MemoryOperatorOverloadTest.cpp + TestMemoryAllocatorTest.cpp + MemoryLeakWarningTest.cpp + TestOutputTest.cpp + AllocLetTestFreeTest.cpp + TestRegistryTest.cpp + AllocationInCFile.c + PluginTest.cpp + TestResultTest.cpp + PreprocessorTest.cpp + TestUTestMacro.cpp + TestUTestStringMacro.cpp + AllocationInCppFile.cpp + UtestTest.cpp + SimpleMutexTest.cpp + UtestPlatformTest.cpp + TeamCityOutputTest.cpp +) + +if (MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4723") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4723") +endif (MSVC) + +if (MINGW) + find_package (Threads REQUIRED) + set(THREAD_LIB "pthread") +endif (MINGW) + +if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "OpenBSD") + set (THREADS_HAVE_PTHREAD_ARG 1) + find_package (Threads REQUIRED) + set (THREAD_LIB "pthread") +endif () + +add_executable(CppUTestTests ${CppUTestTests_src}) +cpputest_normalize_test_output_location(CppUTestTests) +target_link_libraries(CppUTestTests CppUTest ${THREAD_LIB}) + +if (TESTS_BUILD_DISCOVER) + cpputest_buildtime_discover_tests(CppUTestTests) +endif() diff -Nru cpputest-3.8/tests/CppUTest/CommandLineArgumentsTest.cpp cpputest-4.0/tests/CppUTest/CommandLineArgumentsTest.cpp --- cpputest-3.8/tests/CppUTest/CommandLineArgumentsTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/CommandLineArgumentsTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,541 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/CommandLineArguments.h" +#include "CppUTest/TestRegistry.h" + +class OptionsPlugin: public TestPlugin +{ +public: + OptionsPlugin(const SimpleString& name) : + TestPlugin(name) + { + } + ~OptionsPlugin() _destructor_override + { + } + bool parseArguments(int /*ac*/, const char *const * /*av*/, int /*index*/) _override + { + return true; + } +}; + +TEST_GROUP(CommandLineArguments) +{ + CommandLineArguments* args; + OptionsPlugin* plugin; + + void setup() + { + plugin = new OptionsPlugin("options"); + args = NULLPTR; + } + void teardown() + { + delete args; + delete plugin; + } + + bool newArgumentParser(int argc, const char *const *argv) + { + args = new CommandLineArguments(argc, argv); + return args->parse(plugin); + } +}; + +TEST(CommandLineArguments, Create) +{ +} + +TEST(CommandLineArguments, verboseSetMultipleParameters) +{ + const char* argv[] = { "tests.exe", "-v" }; + CHECK(newArgumentParser(2, argv)); + CHECK(args->isVerbose()); +} + +TEST(CommandLineArguments, veryVerbose) +{ + const char* argv[] = { "tests.exe", "-vv" }; + CHECK(newArgumentParser(2, argv)); + CHECK(args->isVeryVerbose()); +} + +TEST(CommandLineArguments, setColor) +{ + const char* argv[] = { "tests.exe", "-c" }; + CHECK(newArgumentParser(2, argv)); + CHECK(args->isColor()); +} + +TEST(CommandLineArguments, repeatSet) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-r3" }; + CHECK(newArgumentParser(argc, argv)); + LONGS_EQUAL(3, args->getRepeatCount()); +} + +TEST(CommandLineArguments, repeatSetDifferentParameter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-r", "4" }; + CHECK(newArgumentParser(argc, argv)); + LONGS_EQUAL(4, args->getRepeatCount()); +} + +TEST(CommandLineArguments, repeatSetDefaultsToTwoAndShuffleDisabled) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-r" }; + CHECK(newArgumentParser(argc, argv)); + LONGS_EQUAL(2, args->getRepeatCount()); +} + +TEST(CommandLineArguments, reverseEnabled) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-b" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_TRUE(args->isReversing()); +} + +TEST(CommandLineArguments, shuffleDisabledByDefault) +{ + int argc = 1; + const char* argv[] = { "tests.exe" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_FALSE(args->isShuffling()); +} + +TEST(CommandLineArguments, shuffleEnabled) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-s" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_TRUE(args->isShuffling()); +} + +TEST(CommandLineArguments, shuffleWithSeedZeroIsOk) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-s0" }; + CHECK_FALSE(newArgumentParser(argc, argv)); + CHECK_EQUAL(0, args->getShuffleSeed()); +} + +TEST(CommandLineArguments, shuffleEnabledSpecificSeedCase1) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-s999"}; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(999, args->getShuffleSeed()); +} + +TEST(CommandLineArguments, shuffleEnabledSpecificSeedCase2) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-s 888"}; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(888, args->getShuffleSeed()); +} + +TEST(CommandLineArguments, shuffleEnabledSpecificSeedCase3) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-s", "777"}; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(777, args->getShuffleSeed()); +} + +TEST(CommandLineArguments, shuffleBeforeDoesNotDisturbOtherSwitch) +{ + int argc = 4; + const char* argv[] = { "tests.exe", "-s", "-sg", "group" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter groupFilter("group"); + groupFilter.strictMatching(); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); + CHECK_TRUE(args->isShuffling()); +} + +TEST(CommandLineArguments, runningTestsInSeperateProcesses) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-p" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->runTestsInSeperateProcess()); +} + +TEST(CommandLineArguments, setGroupFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-g", "group" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(TestFilter("group"), *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setCompleteGroupDotNameFilterInvalidArgument) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-t", "groupname" }; + CHECK_FALSE(newArgumentParser(argc, argv)); +} +TEST(CommandLineArguments, setCompleteGroupDotNameFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-t", "group.name" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(TestFilter("group"), *args->getGroupFilters()); + CHECK_EQUAL(TestFilter("name"), *args->getNameFilters()); +} + + +TEST(CommandLineArguments, setGroupFilterSameParameter) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-ggroup" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(TestFilter("group"), *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setStrictGroupFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-sg", "group" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter groupFilter("group"); + groupFilter.strictMatching(); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setStrictGroupFilterSameParameter) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-sggroup" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter groupFilter("group"); + groupFilter.strictMatching(); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setExcludeGroupFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-xg", "group" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter groupFilter("group"); + groupFilter.invertMatching(); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setExcludeGroupFilterSameParameter) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-xggroup" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter groupFilter("group"); + groupFilter.invertMatching(); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setExcludeStrictGroupFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-xsg", "group" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter groupFilter("group"); + groupFilter.invertMatching(); + groupFilter.strictMatching(); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setExcludeStrictGroupFilterSameParameter) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-xsggroup" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter groupFilter("group"); + groupFilter.invertMatching(); + groupFilter.strictMatching(); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setNameFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-n", "name" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(TestFilter("name"), *args->getNameFilters()); +} + +TEST(CommandLineArguments, setNameFilterSameParameter) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-nname" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(TestFilter("name"), *args->getNameFilters()); +} + +TEST(CommandLineArguments, setStrictNameFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-sn", "name" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter nameFilter("name"); + nameFilter.strictMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()); +} + +TEST(CommandLineArguments, setStrictNameFilterSameParameter) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-snname" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter nameFilter("name"); + nameFilter.strictMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()); +} + +TEST(CommandLineArguments, setExcludeNameFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-xn", "name" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter nameFilter("name"); + nameFilter.invertMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()); +} + +TEST(CommandLineArguments, setExcludeNameFilterSameParameter) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-xnname" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter nameFilter("name"); + nameFilter.invertMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()); +} + +TEST(CommandLineArguments, setExcludeStrictNameFilter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-xsn", "name" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter nameFilter("name"); + nameFilter.invertMatching(); + nameFilter.strictMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()); +} + +TEST(CommandLineArguments, setExcludeStrictNameFilterSameParameter) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-xsnname" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter nameFilter("name"); + nameFilter.invertMatching(); + nameFilter.strictMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()); +} + +TEST(CommandLineArguments, setTestToRunUsingVerboseOutput) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "TEST(testgroup, testname) - stuff" }; + CHECK(newArgumentParser(argc, argv)); + + TestFilter nameFilter("testname"); + TestFilter groupFilter("testgroup"); + nameFilter.strictMatching(); + groupFilter.strictMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setTestToRunUsingVerboseOutputOfIgnoreTest) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "IGNORE_TEST(testgroup, testname) - stuff" }; + CHECK(newArgumentParser(argc, argv)); + + TestFilter nameFilter("testname"); + TestFilter groupFilter("testgroup"); + nameFilter.strictMatching(); + groupFilter.strictMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()); +} + +TEST(CommandLineArguments, setNormalOutput) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-onormal" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->isEclipseOutput()); +} + +TEST(CommandLineArguments, setEclipseOutput) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-oeclipse" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->isEclipseOutput()); +} + +TEST(CommandLineArguments, setNormalOutputDifferentParameter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-o", "normal" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->isEclipseOutput()); +} + +TEST(CommandLineArguments, setJUnitOutputDifferentParameter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-o", "junit" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->isJUnitOutput()); +} + +TEST(CommandLineArguments, setTeamCityOutputDifferentParameter) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-o", "teamcity" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->isTeamCityOutput()); +} + +TEST(CommandLineArguments, setOutputToGarbage) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-o", "garbage" }; + CHECK(!newArgumentParser(argc, argv)); +} + +TEST(CommandLineArguments, setPrintGroups) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-lg" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->isListingTestGroupNames()); +} + +TEST(CommandLineArguments, setPrintGroupsAndNames) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-ln" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->isListingTestGroupAndCaseNames()); +} + +TEST(CommandLineArguments, weirdParamatersReturnsFalse) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-SomethingWeird" }; + CHECK(!newArgumentParser(argc, argv)); +} + +TEST(CommandLineArguments, printUsage) +{ + STRCMP_EQUAL("use -h for more extensive help\nusage [-h] [-v] [-vv] [-c] [-p] [-lg] [-ln] [-ri] [-r#]\n" + " [-g|sg|xg|xsg groupName]... [-n|sn|xn|xsn testName]... [-t groupName.testName]...\n" + " [-b] [-s [randomizerSeed>0]] [\"TEST(groupName, testName)\"]... [-o{normal, junit, teamcity}] [-k packageName]\n", + args->usage()); +} + +TEST(CommandLineArguments, helpPrintsTheHelp) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-h" }; + CHECK(!newArgumentParser(argc, argv)); + CHECK(args->needHelp()); +} + + +TEST(CommandLineArguments, pluginKnowsOption) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-pPluginOption" }; + TestRegistry::getCurrentRegistry()->installPlugin(plugin); + CHECK(newArgumentParser(argc, argv)); + TestRegistry::getCurrentRegistry()->removePluginByName("options"); +} + + +TEST(CommandLineArguments, checkDefaultArguments) +{ + int argc = 1; + const char* argv[] = { "tests.exe" }; + CHECK(newArgumentParser(argc, argv)); + CHECK(!args->isVerbose()); + LONGS_EQUAL(1, args->getRepeatCount()); + CHECK(NULLPTR == args->getGroupFilters()); + CHECK(NULLPTR == args->getNameFilters()); + CHECK(args->isEclipseOutput()); + CHECK(SimpleString("") == args->getPackageName()); +} + +TEST(CommandLineArguments, setPackageName) +{ + int argc = 3; + const char* argv[] = { "tests.exe", "-k", "package" }; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(SimpleString("package"), args->getPackageName()); +} + +TEST(CommandLineArguments, lotsOfGroupsAndTests) +{ + int argc = 10; + const char* argv[] = { "tests.exe", "-sggroup1", "-xntest1", "-sggroup2", "-sntest2", "-sntest3", "-sggroup3", "-sntest4", "-sggroup4", "-sntest5" }; + CHECK(newArgumentParser(argc, argv)); + TestFilter nameFilter("test1"); + nameFilter.invertMatching(); + TestFilter groupFilter("group1"); + groupFilter.strictMatching(); + CHECK_EQUAL(nameFilter, *args->getNameFilters()->getNext()->getNext()->getNext()->getNext()); + CHECK_EQUAL(groupFilter, *args->getGroupFilters()->getNext()->getNext()->getNext()); +} + +TEST(CommandLineArguments, lastParameterFieldMissing) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-k"}; + CHECK(newArgumentParser(argc, argv)); + CHECK_EQUAL(SimpleString(""), args->getPackageName()); +} + +TEST(CommandLineArguments, setOptRun) +{ + int argc = 2; + const char* argv[] = { "tests.exe", "-ri"}; + CHECK(newArgumentParser(argc, argv)); + CHECK(args->isRunIgnored()); +} + diff -Nru cpputest-3.8/tests/CppUTest/CommandLineTestRunnerTest.cpp cpputest-4.0/tests/CppUTest/CommandLineTestRunnerTest.cpp --- cpputest-3.8/tests/CppUTest/CommandLineTestRunnerTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/CommandLineTestRunnerTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,456 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/CommandLineTestRunner.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTest/TestTestingFixture.h" +#include "CppUTest/TestPlugin.h" +#include "CppUTest/JUnitTestOutput.h" +#include "CppUTest/PlatformSpecificFunctions.h" +#include "CppUTestExt/MockSupport.h" + + +class DummyPluginWhichCountsThePlugins : public TestPlugin +{ +public: + + bool returnValue; + int amountOfPlugins; + + DummyPluginWhichCountsThePlugins(const SimpleString& name, TestRegistry* registry) : + TestPlugin(name), returnValue(true), amountOfPlugins(0), registry_(registry) + { + } + + virtual bool parseArguments(int, const char *const *, int) + { + /* Remove ourselves from the count */ + amountOfPlugins = registry_->countPlugins() - 1; + return returnValue; + } +private: + TestRegistry* registry_; +}; + +class CommandLineTestRunnerWithStringBufferOutput : public CommandLineTestRunner +{ +public: + StringBufferTestOutput* fakeJUnitOutputWhichIsReallyABuffer_; + StringBufferTestOutput* fakeConsoleOutputWhichIsReallyABuffer; + StringBufferTestOutput* fakeTCOutputWhichIsReallyABuffer; + + CommandLineTestRunnerWithStringBufferOutput(int argc, const char *const *argv, TestRegistry* registry) + : CommandLineTestRunner(argc, argv, registry), fakeJUnitOutputWhichIsReallyABuffer_(NULLPTR), + fakeConsoleOutputWhichIsReallyABuffer(NULLPTR), fakeTCOutputWhichIsReallyABuffer(NULLPTR) + {} + + TestOutput* createConsoleOutput() + { + fakeConsoleOutputWhichIsReallyABuffer = new StringBufferTestOutput; + return fakeConsoleOutputWhichIsReallyABuffer; + } + + TestOutput* createJUnitOutput(const SimpleString&) + { + fakeJUnitOutputWhichIsReallyABuffer_ = new StringBufferTestOutput; + return fakeJUnitOutputWhichIsReallyABuffer_; + } + + TestOutput* createTeamCityOutput() + { + fakeTCOutputWhichIsReallyABuffer = new StringBufferTestOutput; + return fakeTCOutputWhichIsReallyABuffer; + } +}; + +TEST_GROUP(CommandLineTestRunner) +{ + TestRegistry registry; + UtestShell *test1; + UtestShell *test2; + DummyPluginWhichCountsThePlugins* pluginCountingPlugin; + + void setup() + { + test1 = new UtestShell("group1", "test1", "file1", 1); + test2 = new UtestShell("group2", "test2", "file2", 2); + registry.addTest(test1); + pluginCountingPlugin = new DummyPluginWhichCountsThePlugins("PluginCountingPlugin", ®istry); + } + void teardown() + { + delete pluginCountingPlugin; + delete test2; + delete test1; + } + + SimpleString runAndGetOutput(const int argc, const char* argv[]) + { + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(argc, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + return commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput(); + } +}; + +TEST(CommandLineTestRunner, OnePluginGetsInstalledDuringTheRunningTheTests) +{ + const char* argv[] = { "tests.exe", "-psomething"}; + + registry.installPlugin(pluginCountingPlugin); + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + registry.removePluginByName("PluginCountingPlugin"); + + LONGS_EQUAL(0, registry.countPlugins()); + LONGS_EQUAL(1, pluginCountingPlugin->amountOfPlugins); +} + +TEST(CommandLineTestRunner, NoPluginsAreInstalledAtTheEndOfARunWhenTheArgumentsAreInvalid) +{ + const char* argv[] = { "tests.exe", "-fdskjnfkds"}; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + + LONGS_EQUAL(0, registry.countPlugins()); + +} + +TEST(CommandLineTestRunner, ReturnsOneWhenTheArgumentsAreInvalid) +{ + const char* argv[] = { "tests.exe", "-some-invalid=parameter" }; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + int returned = commandLineTestRunner.runAllTestsMain(); + + LONGS_EQUAL(1, returned); +} + +TEST(CommandLineTestRunner, ReturnsOnePrintsHelpOnHelp) +{ + const char* argv[] = { "tests.exe", "-h" }; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + int returned = commandLineTestRunner.runAllTestsMain(); + + LONGS_EQUAL(1, returned); + STRCMP_CONTAINS("Thanks for using CppUTest.", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); +} + + +TEST(CommandLineTestRunner, ReturnsZeroWhenNoErrors) +{ + const char* argv[] = { "tests.exe" }; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(1, argv, ®istry); + int returned = commandLineTestRunner.runAllTestsMain(); + + LONGS_EQUAL(0, returned); +} + +TEST(CommandLineTestRunner, ReturnsOneWhenNoTestsMatchProvidedFilter) +{ + const char* argv[] = { "tests.exe", "-g", "NoSuchGroup"}; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(3, argv, ®istry); + int returned = commandLineTestRunner.runAllTestsMain(); + + LONGS_EQUAL(1, returned); +} + +TEST(CommandLineTestRunner, TeamcityOutputEnabled) +{ + const char* argv[] = {"tests.exe", "-oteamcity"}; + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + CHECK(commandLineTestRunner.fakeTCOutputWhichIsReallyABuffer != NULLPTR); +} + +TEST(CommandLineTestRunner, JunitOutputEnabled) +{ + const char* argv[] = { "tests.exe", "-ojunit"}; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + CHECK(commandLineTestRunner.fakeJUnitOutputWhichIsReallyABuffer_ != NULLPTR); +} + +TEST(CommandLineTestRunner, JunitOutputAndVerboseEnabled) +{ + const char* argv[] = { "tests.exe", "-ojunit", "-v"}; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(3, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + STRCMP_CONTAINS("TEST(group1, test1)", commandLineTestRunner.fakeJUnitOutputWhichIsReallyABuffer_->getOutput().asCharString()); + STRCMP_CONTAINS("TEST(group1, test1)", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); +} + +TEST(CommandLineTestRunner, veryVerboseSetOnOutput) +{ + const char* argv[] = { "tests.exe", "-vv"}; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + STRCMP_CONTAINS("TEST(group1, test1)", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); + STRCMP_CONTAINS("destroyTest", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); +} + +TEST(CommandLineTestRunner, defaultTestsAreRunInOrderTheyAreInRepository) +{ + const char* argv[] = { "tests.exe", "-v"}; + + registry.addTest(test2); + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + + SimpleStringCollection stringCollection; + commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().split("\n", stringCollection); + STRCMP_CONTAINS("test2", stringCollection[0].asCharString()); + STRCMP_CONTAINS("test1", stringCollection[1].asCharString()); +} + +TEST(CommandLineTestRunner, testsCanBeRunInReverseOrder) +{ + const char* argv[] = { "tests.exe", "-v", "-b"}; + + registry.addTest(test2); + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(3, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + + SimpleStringCollection stringCollection; + commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().split("\n", stringCollection); + STRCMP_CONTAINS("test1", stringCollection[0].asCharString()); + STRCMP_CONTAINS("test2", stringCollection[1].asCharString()); +} + +TEST(CommandLineTestRunner, listTestGroupNamesShouldWorkProperly) +{ + const char* argv[] = { "tests.exe", "-lg" }; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + + STRCMP_CONTAINS("group", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); +} + +TEST(CommandLineTestRunner, listTestGroupAndCaseNamesShouldWorkProperly) +{ + const char* argv[] = { "tests.exe", "-ln" }; + + CommandLineTestRunnerWithStringBufferOutput commandLineTestRunner(2, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + + STRCMP_CONTAINS("group1.test1", commandLineTestRunner.fakeConsoleOutputWhichIsReallyABuffer->getOutput().asCharString()); +} + +TEST(CommandLineTestRunner, randomShuffleSeedIsPrintedAndRandFuncIsExercised) +{ + // more than 1 item in test list ensures that shuffle algorithm calls rand_() + UtestShell *anotherTest = new UtestShell("group", "test2", "file", 1); + registry.addTest(anotherTest); + + const char* argv[] = { "tests.exe", "-s"}; + SimpleString text = runAndGetOutput(2, argv); + STRCMP_CONTAINS("shuffling enabled with seed:", text.asCharString()); + + delete anotherTest; +} + +TEST(CommandLineTestRunner, specificShuffleSeedIsPrintedVerbose) +{ + const char* argv[] = { "tests.exe", "-s2", "-v"}; + SimpleString text = runAndGetOutput(3, argv); + STRCMP_CONTAINS("shuffling enabled with seed: 2", text.asCharString()); +} + +extern "C" { + typedef PlatformSpecificFile (*FOpenFunc)(const char*, const char*); + typedef void (*FPutsFunc)(const char*, PlatformSpecificFile); + typedef void (*FCloseFunc)(PlatformSpecificFile); + typedef int (*PutcharFunc)(int); +} + +struct FakeOutput +{ + FakeOutput() : SaveFOpen(PlatformSpecificFOpen), SaveFPuts(PlatformSpecificFPuts), + SaveFClose(PlatformSpecificFClose), SavePutchar(PlatformSpecificPutchar) + { + installFakes(); + currentFake = this; + } + + ~FakeOutput() + { + currentFake = NULLPTR; + restoreOriginals(); + } + + void installFakes() + { + PlatformSpecificFOpen = (FOpenFunc)fopen_fake; + PlatformSpecificFPuts = (FPutsFunc)fputs_fake; + PlatformSpecificFClose = (FCloseFunc)fclose_fake; + PlatformSpecificPutchar = (PutcharFunc)putchar_fake; + } + + void restoreOriginals() + { + PlatformSpecificPutchar = SavePutchar; + PlatformSpecificFOpen = SaveFOpen; + PlatformSpecificFPuts = SaveFPuts; + PlatformSpecificFClose = SaveFClose; + } + + static PlatformSpecificFile fopen_fake(const char*, const char*) + { + return (PlatformSpecificFile) NULLPTR; + } + + static void fputs_fake(const char* str, PlatformSpecificFile) + { + currentFake->file += str; + } + + static void fclose_fake(PlatformSpecificFile) + { + } + + static int putchar_fake(int c) + { + currentFake->console += StringFrom((char)c); + return c; + } + + SimpleString file; + SimpleString console; + + static FakeOutput* currentFake; +private: + FOpenFunc SaveFOpen; + FPutsFunc SaveFPuts; + FCloseFunc SaveFClose; + PutcharFunc SavePutchar; +}; + +FakeOutput* FakeOutput::currentFake = NULLPTR; + +TEST(CommandLineTestRunner, realJunitOutputShouldBeCreatedAndWorkProperly) +{ + const char* argv[] = { "tests.exe", "-ojunit", "-v", "-kpackage", }; + + FakeOutput fakeOutput; /* UT_PTR_SET() is not reentrant */ + + CommandLineTestRunner commandLineTestRunner(4, argv, ®istry); + commandLineTestRunner.runAllTestsMain(); + + fakeOutput.restoreOriginals(); + + STRCMP_CONTAINS(" + +TEST_GROUP(StandardCppLibrary) +{ +}; + +#if defined(__cplusplus) && __cplusplus >= 201402L + +TEST(StandardCppLibrary, UniquePtrConversationToBool) +{ + auto const aNull = std::unique_ptr(nullptr); + CHECK_FALSE(aNull); + + auto const notNull = std::make_unique(1); + CHECK_TRUE(notNull); +} + +#endif + +#endif + diff -Nru cpputest-3.8/tests/CppUTest/DummyMemoryLeakDetector.cpp cpputest-4.0/tests/CppUTest/DummyMemoryLeakDetector.cpp --- cpputest-3.8/tests/CppUTest/DummyMemoryLeakDetector.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/DummyMemoryLeakDetector.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/MemoryLeakDetector.h" +#include "DummyMemoryLeakDetector.h" + +DummyMemoryLeakDetector::DummyMemoryLeakDetector(MemoryLeakFailure* reporter) : MemoryLeakDetector(reporter) +{ + memoryLeakDetectorWasDeleted = false; +} + +DummyMemoryLeakDetector::~DummyMemoryLeakDetector() +{ + memoryLeakDetectorWasDeleted = true; +} + +bool DummyMemoryLeakDetector::wasDeleted() +{ + return memoryLeakDetectorWasDeleted; +} + +bool DummyMemoryLeakDetector::memoryLeakDetectorWasDeleted = false; + +DummyMemoryLeakFailure::DummyMemoryLeakFailure() + : MemoryLeakFailure() +{ + memoryLeakFailureWasDelete = false; +} + +DummyMemoryLeakFailure::~DummyMemoryLeakFailure() +{ + memoryLeakFailureWasDelete = true; +} + +bool DummyMemoryLeakFailure::wasDeleted() +{ + return memoryLeakFailureWasDelete; +} + +void DummyMemoryLeakFailure::fail(char*) +{ +} + +bool DummyMemoryLeakFailure::memoryLeakFailureWasDelete = false; + + + diff -Nru cpputest-3.8/tests/CppUTest/DummyMemoryLeakDetector.h cpputest-4.0/tests/CppUTest/DummyMemoryLeakDetector.h --- cpputest-3.8/tests/CppUTest/DummyMemoryLeakDetector.h 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/DummyMemoryLeakDetector.h 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +class DummyMemoryLeakDetector : public MemoryLeakDetector +{ +public: + DummyMemoryLeakDetector(MemoryLeakFailure* reporter); + virtual ~DummyMemoryLeakDetector() _destructor_override; + static bool wasDeleted(); + +private: + static bool memoryLeakDetectorWasDeleted; +}; + +class DummyMemoryLeakFailure : public MemoryLeakFailure +{ +public: + DummyMemoryLeakFailure(); + + virtual ~DummyMemoryLeakFailure() _destructor_override; + static bool wasDeleted(); + virtual void fail(char*) _override; + +private: + static bool memoryLeakFailureWasDelete; +}; + diff -Nru cpputest-3.8/tests/CppUTest/JUnitOutputTest.cpp cpputest-4.0/tests/CppUTest/JUnitOutputTest.cpp --- cpputest-3.8/tests/CppUTest/JUnitOutputTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/JUnitOutputTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,759 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/JUnitTestOutput.h" +#include "CppUTest/TestResult.h" +#include "CppUTest/PlatformSpecificFunctions.h" +#include "CppUTest/SimpleString.h" + +class FileForJUnitOutputTests +{ + SimpleString name_; + bool isOpen_; + SimpleString buffer_; + FileForJUnitOutputTests* next_; + + SimpleStringCollection linesOfFile_; + +public: + + FileForJUnitOutputTests(const SimpleString& filename, FileForJUnitOutputTests* next) : + name_(filename), isOpen_(true), next_(next) {} + + FileForJUnitOutputTests* nextFile() + { + return next_; + } + + SimpleString name() + { + return name_; + } + + void write(const SimpleString& buffer) + { + buffer_ += buffer; + } + + void close() + { + isOpen_ = false; + } + + const char* line(size_t lineNumber) + { + buffer_.split("\n", linesOfFile_); + return linesOfFile_[lineNumber-1].asCharString(); + + } + + const char* lineFromTheBack(size_t lineNumberFromTheBack) + { + return line(amountOfLines() - (lineNumberFromTheBack - 1)); + } + + size_t amountOfLines() + { + buffer_.split("\n", linesOfFile_); + return linesOfFile_.size(); + } + + SimpleString content() + { + return buffer_; + } +}; + +class FileSystemForJUnitTestOutputTests +{ + FileForJUnitOutputTests* firstFile_; + +public: + FileSystemForJUnitTestOutputTests() : firstFile_(NULLPTR) {} + ~FileSystemForJUnitTestOutputTests() { clear(); } + + void clear(void) + { + while (firstFile_) { + FileForJUnitOutputTests* fileToBeDeleted = firstFile_; + firstFile_ = firstFile_->nextFile(); + delete fileToBeDeleted; + } + } + + FileForJUnitOutputTests* openFile(const SimpleString& filename) + { + firstFile_ = new FileForJUnitOutputTests(filename, firstFile_); + return firstFile_; + } + + int amountOfFiles() { + int totalAmountOfFiles = 0; + for (FileForJUnitOutputTests* current = firstFile_; current != NULLPTR; current = current->nextFile()) + totalAmountOfFiles++; + return totalAmountOfFiles; + } + + bool fileExists(const char* filename) + { + FileForJUnitOutputTests *searchedFile = file(filename); + return (searchedFile != NULLPTR); + } + + FileForJUnitOutputTests* file(const char* filename) + { + for (FileForJUnitOutputTests* current = firstFile_; current != NULLPTR; current = current->nextFile()) + if (current->name() == filename) + return current; + return NULLPTR; + } +}; + +extern "C" { + static long millisTime = 0; + static const char* theTime = ""; + + static long MockGetPlatformSpecificTimeInMillis() + { + return millisTime; + } + + static const char* MockGetPlatformSpecificTimeString() + { + return theTime; + } +} + +class JUnitTestOutputTestRunner +{ + TestResult result_; + + const char* currentGroupName_; + UtestShell* currentTest_; + bool firstTestInGroup_; + int timeTheTestTakes_; + unsigned int numberOfChecksInTest_; + TestFailure* testFailure_; + +public: + + explicit JUnitTestOutputTestRunner(const TestResult& result) : + result_(result), currentGroupName_(NULLPTR), currentTest_(NULLPTR), firstTestInGroup_(true), timeTheTestTakes_(0), numberOfChecksInTest_(0), testFailure_(NULLPTR) + { + millisTime = 0; + theTime = "1978-10-03T00:00:00"; + + UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); + UT_PTR_SET(GetPlatformSpecificTimeString, MockGetPlatformSpecificTimeString); + } + + JUnitTestOutputTestRunner& start() + { + result_.testsStarted(); + return *this; + } + + JUnitTestOutputTestRunner& end() + { + endOfPreviousTestGroup(); + delete currentTest_; + result_.testsEnded(); + return *this; + } + + JUnitTestOutputTestRunner& endGroupAndClearTest() + { + endOfPreviousTestGroup(); + delete currentTest_; + currentTest_ = NULLPTR; + return *this; + } + + void endOfPreviousTestGroup() + { + runPreviousTest(); + if (currentTest_) { + result_.currentGroupEnded(currentTest_); + firstTestInGroup_ = true; + } + + currentGroupName_ = NULLPTR; + } + + JUnitTestOutputTestRunner& withGroup(const char* groupName) + { + runPreviousTest(); + endOfPreviousTestGroup(); + + currentGroupName_ = groupName; + return *this; + } + + JUnitTestOutputTestRunner& withTest(const char* testName) + { + runPreviousTest(); + delete currentTest_; + + currentTest_ = new UtestShell(currentGroupName_, testName, "file", 1); + return *this; + } + + JUnitTestOutputTestRunner& withIgnoredTest(const char* testName) + { + runPreviousTest(); + delete currentTest_; + + currentTest_ = new IgnoredUtestShell(currentGroupName_, testName, "file", 1); + return *this; + } + + JUnitTestOutputTestRunner& inFile(const char* fileName) + { + if(currentTest_) { + currentTest_->setFileName(fileName); + } + return *this; + } + + JUnitTestOutputTestRunner& onLine(size_t lineNumber) + { + if(currentTest_) { + currentTest_->setLineNumber(lineNumber); + } + return *this; + } + + void runPreviousTest() + { + if (currentTest_ == NULLPTR) return; + + if (firstTestInGroup_) { + result_.currentGroupStarted(currentTest_); + firstTestInGroup_ = false; + } + result_.currentTestStarted(currentTest_); + + millisTime += timeTheTestTakes_; + for(unsigned int i = 0; i < numberOfChecksInTest_; i++) { + result_.countCheck(); + } + numberOfChecksInTest_ = 0; + + if (testFailure_) { + result_.addFailure(*testFailure_); + delete testFailure_; + testFailure_ = NULLPTR; + } + + result_.currentTestEnded(currentTest_); + } + + JUnitTestOutputTestRunner& thatHasChecks(unsigned int numOfChecks) + { + numberOfChecksInTest_ = numOfChecks; + return *this; + } + + JUnitTestOutputTestRunner& thatTakes(int timeElapsed) + { + timeTheTestTakes_ = timeElapsed; + return *this; + } + + JUnitTestOutputTestRunner& seconds() + { + return *this; + } + + JUnitTestOutputTestRunner& thatFails(const char* message, const char* file, size_t line) + { + testFailure_ = new TestFailure( currentTest_, file, line, message); + return *this; + } + + JUnitTestOutputTestRunner& atTime(const char* newTime) + { + theTime = newTime; + return *this; + } + + JUnitTestOutputTestRunner& thatPrints(const char* output) + { + runPreviousTest(); + result_.print(output); + return *this; + } +}; + +extern "C" { + static FileSystemForJUnitTestOutputTests fileSystem; + + static PlatformSpecificFile mockFOpen(const char* filename, const char*) + { + return fileSystem.openFile(filename); + } + + static void mockFPuts(const char* str, PlatformSpecificFile file) + { + ((FileForJUnitOutputTests*)file)->write(str); + } + + static void mockFClose(PlatformSpecificFile file) + { + ((FileForJUnitOutputTests*)file)->close(); + } +} + +TEST_GROUP(JUnitOutputTest) +{ + JUnitTestOutput *junitOutput; + TestResult *result; + JUnitTestOutputTestRunner *testCaseRunner; + FileForJUnitOutputTests* outputFile; + + void setup() + { + UT_PTR_SET(PlatformSpecificFOpen, mockFOpen); + UT_PTR_SET(PlatformSpecificFPuts, mockFPuts); + UT_PTR_SET(PlatformSpecificFClose, mockFClose); + junitOutput = new JUnitTestOutput(); + result = new TestResult(*junitOutput); + testCaseRunner = new JUnitTestOutputTestRunner(*result); + } + + void teardown() + { + delete testCaseRunner; + delete result; + delete junitOutput; + fileSystem.clear(); + } +}; + +TEST(JUnitOutputTest, withOneTestGroupAndOneTestOnlyWriteToOneFile) +{ + testCaseRunner->start() + .withGroup("groupname").withTest("testname") + .end(); + + LONGS_EQUAL(1, fileSystem.amountOfFiles()); + CHECK(fileSystem.fileExists("cpputest_groupname.xml")); +} + +TEST(JUnitOutputTest, withReservedCharactersInPackageOrTestGroupUsesUnderscoresForFileName) +{ + junitOutput->setPackageName("p/a\\c?k%a*g:e|n\"ae."); + testCaseRunner->start() + .withGroup("g/r\\o?u%p*n:a|m\"eere").withTest("testname") + .end(); + + CHECK(fileSystem.fileExists("cpputest_p_a_c_k_a_g_e_n_a_m_e._g_r_o_u_p_n_a_m_e_h_ere.xml")); +} + +TEST(JUnitOutputTest, withOneTestGroupAndOneTestOutputsValidXMLFiles) +{ + testCaseRunner->start() + .withGroup("groupname").withTest("testname") + .end(); + + outputFile = fileSystem.file("cpputest_groupname.xml"); + STRCMP_EQUAL("\n", outputFile->line(1)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndOneTestOutputsTestSuiteStartAndEndBlocks) +{ + testCaseRunner->start() + .withGroup("groupname").withTest("testname") + .end(); + + outputFile = fileSystem.file("cpputest_groupname.xml"); + STRCMP_EQUAL("\n", outputFile->line(2)); + STRCMP_EQUAL("\n", outputFile->lineFromTheBack(1)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndOneTestFileShouldContainAnEmptyPropertiesBlock) +{ + testCaseRunner->start() + .withGroup("groupname").withTest("testname") + .end(); + + outputFile = fileSystem.file("cpputest_groupname.xml"); + STRCMP_EQUAL("\n", outputFile->line(3)); + STRCMP_EQUAL("\n", outputFile->line(4)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndOneTestFileShouldContainAnEmptyStdoutBlock) +{ + testCaseRunner->start() + .withGroup("groupname").withTest("testname") + .end(); + + outputFile = fileSystem.file("cpputest_groupname.xml"); + STRCMP_EQUAL("\n", outputFile->lineFromTheBack(3)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndOneTestFileShouldContainAnEmptyStderrBlock) +{ + testCaseRunner->start() + .withGroup("groupname").withTest("testname") + .end(); + + outputFile = fileSystem.file("cpputest_groupname.xml"); + STRCMP_EQUAL("\n", outputFile->lineFromTheBack(2)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndOneTestFileShouldContainsATestCaseBlock) +{ + testCaseRunner->start() + .withGroup("groupname").withTest("testname") + .end(); + + outputFile = fileSystem.file("cpputest_groupname.xml"); + + STRCMP_EQUAL("\n", outputFile->line(5)); + STRCMP_EQUAL("\n", outputFile->line(6)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndTwoTestCasesCreateCorrectTestgroupBlockAndCorrectTestCaseBlock) +{ + testCaseRunner->start() + .withGroup("twoTestsGroup").withTest("firstTestName").withTest("secondTestName") + .end(); + + outputFile = fileSystem.file("cpputest_twoTestsGroup.xml"); + + STRCMP_EQUAL("\n", outputFile->line(2)); + STRCMP_EQUAL("\n", outputFile->line(5)); + STRCMP_EQUAL("\n", outputFile->line(6)); + STRCMP_EQUAL("\n", outputFile->line(7)); + STRCMP_EQUAL("\n", outputFile->line(8)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndTimeHasElapsedAndTimestampChanged) +{ + testCaseRunner->start().atTime("2013-07-04T22:28:00") + .withGroup("timeGroup").withTest("Dummy").thatTakes(10).seconds() + .end(); + + outputFile = fileSystem.file("cpputest_timeGroup.xml"); + + STRCMP_EQUAL("\n", outputFile->line(2)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndMultipleTestCasesWithElapsedTime) +{ + testCaseRunner->start() + .withGroup("twoTestsGroup") + .withTest("firstTestName").thatTakes(10).seconds() + .withTest("secondTestName").thatTakes(50).seconds() + .end(); + + outputFile = fileSystem.file("cpputest_twoTestsGroup.xml"); + STRCMP_EQUAL("\n", outputFile->line(2)); + STRCMP_EQUAL("\n", outputFile->line(5)); + STRCMP_EQUAL("\n", outputFile->line(6)); + STRCMP_EQUAL("\n", outputFile->line(7)); + STRCMP_EQUAL("\n", outputFile->line(8)); +} + +TEST(JUnitOutputTest, withOneTestGroupAndOneFailingTest) +{ + testCaseRunner->start() + .withGroup("testGroupWithFailingTest") + .withTest("FailingTestName").thatFails("Test failed", "thisfile", 10) + .end(); + + outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); + STRCMP_EQUAL("\n", outputFile->line(2)); + STRCMP_EQUAL("\n", outputFile->line(5)); + STRCMP_EQUAL("\n", outputFile->line(6)); + STRCMP_EQUAL("\n", outputFile->line(7)); + STRCMP_EQUAL("\n", outputFile->line(8)); +} + +TEST(JUnitOutputTest, withTwoTestGroupAndOneFailingTest) +{ + testCaseRunner->start() + .withGroup("testGroupWithFailingTest") + .withTest("FirstTest") + .withTest("FailingTestName").thatFails("Test failed", "thisfile", 10) + .end(); + + outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); + + STRCMP_EQUAL("\n", outputFile->line(2)); + STRCMP_EQUAL("\n", outputFile->line(7)); + STRCMP_EQUAL("\n", outputFile->line(8)); +} + +TEST(JUnitOutputTest, testFailureWithLessThanAndGreaterThanInsideIt) +{ + testCaseRunner->start() + .withGroup("testGroupWithFailingTest") + .withTest("FailingTestName").thatFails("Test ", "thisfile", 10) + .end(); + + outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); + + STRCMP_EQUAL("\n", outputFile->line(6)); +} + +TEST(JUnitOutputTest, testFailureWithQuotesInIt) +{ + testCaseRunner->start() + .withGroup("testGroupWithFailingTest") + .withTest("FailingTestName").thatFails("Test \"failed\"", "thisfile", 10) + .end(); + + outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); + + STRCMP_EQUAL("\n", outputFile->line(6)); +} + +TEST(JUnitOutputTest, testFailureWithNewlineInIt) +{ + testCaseRunner->start() + .withGroup("testGroupWithFailingTest") + .withTest("FailingTestName").thatFails("Test \nfailed", "thisfile", 10) + .end(); + + outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); + + STRCMP_EQUAL("\n", outputFile->line(6)); +} + +TEST(JUnitOutputTest, testFailureWithDifferentFileAndLine) +{ + testCaseRunner->start() + .withGroup("testGroupWithFailingTest") + .withTest("FailingTestName").thatFails("Test failed", "importantFile", 999) + .end(); + + outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); + + STRCMP_EQUAL("\n", outputFile->line(6)); +} + +TEST(JUnitOutputTest, testFailureWithAmpersandsAndLessThan) +{ + testCaseRunner->start() + .withGroup("testGroupWithFailingTest") + .withTest("FailingTestName").thatFails("&object1 < &object2", "importantFile", 999) + .end(); + + outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); + + STRCMP_EQUAL("\n", outputFile->line(6)); +} + +TEST(JUnitOutputTest, testFailureWithAmpersands) +{ + testCaseRunner->start() + .withGroup("testGroupWithFailingTest") + .withTest("FailingTestName").thatFails("&object1 != &object2", "importantFile", 999) + .end(); + + outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); + + STRCMP_EQUAL("\n", outputFile->line(6)); +} + +TEST(JUnitOutputTest, aCoupleOfTestFailures) +{ + testCaseRunner->start() + .withGroup("testGroup") + .withTest("passingOne") + .withTest("FailingTest").thatFails("Failure", "file", 99) + .withTest("passingTwo") + .withTest("passingThree") + .withTest("AnotherFailingTest").thatFails("otherFailure", "anotherFile", 10) + .end(); + + outputFile = fileSystem.file("cpputest_testGroup.xml"); + + STRCMP_EQUAL("\n", outputFile->line(8)); + STRCMP_EQUAL("\n", outputFile->line(16)); +} + +TEST(JUnitOutputTest, testFailuresInSeparateGroups) +{ + testCaseRunner->start() + .withGroup("testGroup") + .withTest("passingOne") + .withTest("FailingTest").thatFails("Failure", "file", 99) + .withGroup("AnotherGroup") + .withTest("AnotherFailingTest").thatFails("otherFailure", "anotherFile", 10) + .end(); + + outputFile = fileSystem.file("cpputest_testGroup.xml"); + + STRCMP_EQUAL("\n", outputFile->line(8)); + + outputFile = fileSystem.file("cpputest_AnotherGroup.xml"); + STRCMP_EQUAL("\n", outputFile->line(8)); +} + +TEST(JUnitOutputTest, twoTestGroupsWriteToTwoDifferentFiles) +{ + testCaseRunner->start() + .withGroup("firstTestGroup") + .withTest("testName") + .withGroup("secondTestGroup") + .withTest("testName") + .end(); + + CHECK(fileSystem.file("cpputest_firstTestGroup.xml") != NULLPTR); + CHECK(fileSystem.file("cpputest_secondTestGroup.xml") != NULLPTR); + +} + +TEST(JUnitOutputTest, testGroupWithWeirdName) +{ + STRCMP_EQUAL("cpputest_group_weird_name.xml", junitOutput->createFileName("group/weird/name").asCharString()); +} + +TEST(JUnitOutputTest, TestCaseBlockWithAPackageName) +{ + junitOutput->setPackageName("packagename"); + testCaseRunner->start() + .withGroup("groupname").withTest("testname") + .end(); + + outputFile = fileSystem.file("cpputest_packagename_groupname.xml"); + + STRCMP_EQUAL("\n", outputFile->line(5)); + STRCMP_EQUAL("\n", outputFile->line(6)); +} + +TEST(JUnitOutputTest, TestCaseBlockForIgnoredTest) +{ + junitOutput->setPackageName("packagename"); + testCaseRunner->start() + .withGroup("groupname").withIgnoredTest("testname") + .end(); + + outputFile = fileSystem.file("cpputest_packagename_groupname.xml"); + + STRCMP_EQUAL("\n", outputFile->line(5)); + STRCMP_EQUAL("\n", outputFile->line(6)); + STRCMP_EQUAL("\n", outputFile->line(7)); +} + +TEST(JUnitOutputTest, TestCaseWithTestLocation) +{ + junitOutput->setPackageName("packagename"); + testCaseRunner->start() + .withGroup("groupname") + .withTest("testname").inFile("MySource.c").onLine(159) + .end(); + + outputFile = fileSystem.file("cpputest_packagename_groupname.xml"); + + STRCMP_EQUAL("\n", outputFile->line(5)); +} + +TEST(JUnitOutputTest, MultipleTestCaseWithTestLocations) +{ + testCaseRunner->start() + .withGroup("twoTestsGroup") + .withTest("firstTestName").inFile("MyFirstSource.c").onLine(846) + .withTest("secondTestName").inFile("MySecondSource.c").onLine(513) + .end(); + + outputFile = fileSystem.file("cpputest_twoTestsGroup.xml"); + + STRCMP_EQUAL("\n", outputFile->line(5)); + STRCMP_EQUAL("\n", outputFile->line(7)); +} + +TEST(JUnitOutputTest, TestCaseBlockWithAssertions) +{ + junitOutput->setPackageName("packagename"); + testCaseRunner->start() + .withGroup("groupname") + .withTest("testname") + .thatHasChecks(24) + .end(); + + outputFile = fileSystem.file("cpputest_packagename_groupname.xml"); + + STRCMP_EQUAL("\n", outputFile->line(5)); +} + +TEST(JUnitOutputTest, MultipleTestCaseBlocksWithAssertions) +{ + testCaseRunner->start() + .withGroup("twoTestsGroup") + .withTest("firstTestName").thatHasChecks(456) + .withTest("secondTestName").thatHasChecks(567) + .end(); + + outputFile = fileSystem.file("cpputest_twoTestsGroup.xml"); + + STRCMP_EQUAL("\n", outputFile->line(5)); + STRCMP_EQUAL("\n", outputFile->line(7)); +} + +TEST(JUnitOutputTest, MultipleTestCasesInDifferentGroupsWithAssertions) +{ + testCaseRunner->start() + .withGroup("groupOne") + .withTest("testA").thatHasChecks(456) + .endGroupAndClearTest() + .withGroup("groupTwo") + .withTest("testB").thatHasChecks(678) + .end(); + + outputFile = fileSystem.file("cpputest_groupOne.xml"); + STRCMP_EQUAL("\n", outputFile->line(5)); + + outputFile = fileSystem.file("cpputest_groupTwo.xml"); + STRCMP_EQUAL("\n", outputFile->line(5)); +} + +TEST(JUnitOutputTest, UTPRINTOutputInJUnitOutput) +{ + testCaseRunner->start() + .withGroup("groupname") + .withTest("testname").thatPrints("someoutput") + .end(); + + outputFile = fileSystem.file("cpputest_groupname.xml"); + STRCMP_EQUAL("someoutput\n", outputFile->lineFromTheBack(3)); +} + +TEST(JUnitOutputTest, UTPRINTOutputInJUnitOutputWithSpecials) +{ + testCaseRunner->start() + .withGroup("groupname") + .withTest("testname").thatPrints("The in \"Spain\"\nGoes \\mainly\\ down the Dr&in\n") + .end(); + + outputFile = fileSystem.file("cpputest_groupname.xml"); + STRCMP_EQUAL("The <rain> in "Spain"{newline}Goes \\mainly\\ down the Dr&in{newline}\n", outputFile->lineFromTheBack(3)); +} diff -Nru cpputest-3.8/tests/CppUTest/MemoryLeakDetectorTest.cpp cpputest-4.0/tests/CppUTest/MemoryLeakDetectorTest.cpp --- cpputest-3.8/tests/CppUTest/MemoryLeakDetectorTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/MemoryLeakDetectorTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,692 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/MemoryLeakDetector.h" +#include "CppUTest/TestMemoryAllocator.h" +#include "CppUTest/PlatformSpecificFunctions.h" + +class MemoryLeakFailureForTest: public MemoryLeakFailure +{ +public: + virtual ~MemoryLeakFailureForTest() _destructor_override + { + } + + virtual void fail(char* fail_string) _override + { + *message = fail_string; + } + + SimpleString *message; +}; + +class NewAllocatorForMemoryLeakDetectionTest: public TestMemoryAllocator +{ +public: + NewAllocatorForMemoryLeakDetectionTest() : + TestMemoryAllocator("Standard New Allocator", "new", "delete"), + alloc_called(0), free_called(0) + { + } + + int alloc_called; + int free_called; + char* alloc_memory(size_t size, const char*, size_t) + { + alloc_called++; + return TestMemoryAllocator::alloc_memory(size, "file", 1); + } + void free_memory(char* memory, size_t size, const char* file, size_t line) + { + free_called++; + TestMemoryAllocator::free_memory(memory, size, file, line); + } +}; + +class AllocatorForMemoryLeakDetectionTest: public TestMemoryAllocator +{ +public: + AllocatorForMemoryLeakDetectionTest() : + alloc_called(0), free_called(0), allocMemoryLeakNodeCalled(0), freeMemoryLeakNodeCalled(0) + { + } + + int alloc_called; + int free_called; + int allocMemoryLeakNodeCalled; + int freeMemoryLeakNodeCalled; + + char* alloc_memory(size_t size, const char* file, size_t line) + { + alloc_called++; + return TestMemoryAllocator::alloc_memory(size, file, line); + } + void free_memory(char* memory, size_t size, const char* file, size_t line) + { + free_called++; + TestMemoryAllocator::free_memory(memory, size, file, line); + } + + char* allocMemoryLeakNode(size_t size) + { + allocMemoryLeakNodeCalled++; + return TestMemoryAllocator::alloc_memory(size, __FILE__, __LINE__); + } + + void freeMemoryLeakNode(char* memory) + { + freeMemoryLeakNodeCalled++; + TestMemoryAllocator::free_memory(memory, 0, __FILE__, __LINE__); + } +}; + +TEST_GROUP(MemoryLeakDetectorTest) +{ + MemoryLeakDetector* detector; + MemoryLeakFailureForTest *reporter; + AllocatorForMemoryLeakDetectionTest* testAllocator; + + void setup() + { + reporter = new MemoryLeakFailureForTest; + detector = new MemoryLeakDetector(reporter); + testAllocator = new AllocatorForMemoryLeakDetectionTest; + detector->enable(); + detector->startChecking(); + reporter->message = new SimpleString(); + } + void teardown() + { + delete reporter->message; + delete detector; + delete reporter; + delete testAllocator; + } +}; + +TEST(MemoryLeakDetectorTest, OneLeak) +{ + char* mem = detector->allocMemory(testAllocator, 3); + detector->stopChecking(); + SimpleString output = detector->report(mem_leak_period_checking); + STRCMP_CONTAINS("Memory leak(s) found", output.asCharString()); + STRCMP_CONTAINS("size: 3", output.asCharString()); + STRCMP_CONTAINS("alloc", output.asCharString()); + STRCMP_CONTAINS(StringFromFormat("%p", (void*) mem).asCharString(), output.asCharString()); + STRCMP_CONTAINS("Total number of leaks", output.asCharString()); + PlatformSpecificFree(mem); + LONGS_EQUAL(1, testAllocator->alloc_called); + LONGS_EQUAL(0, testAllocator->free_called); +} + +TEST(MemoryLeakDetectorTest, sequenceNumbersOfMemoryLeaks) +{ + char* mem = detector->allocMemory(defaultNewAllocator(), 1); + char* mem2 = detector->allocMemory(defaultNewAllocator(), 2); + char* mem3 = detector->allocMemory(defaultNewAllocator(), 3); + SimpleString output = detector->report(mem_leak_period_checking); + + STRCMP_CONTAINS("Alloc num (1)", output.asCharString()); + STRCMP_CONTAINS("Alloc num (2)", output.asCharString()); + STRCMP_CONTAINS("Alloc num (3)", output.asCharString()); + + PlatformSpecificFree(mem); + PlatformSpecificFree(mem2); + PlatformSpecificFree(mem3); +} + +TEST(MemoryLeakDetectorTest, memoryDumpOutput) +{ + char* mem = detector->allocMemory(defaultNewAllocator(), 6); + SimpleString::StrNCpy(mem, "test1", 6); + SimpleString output = detector->report(mem_leak_period_checking); + + STRCMP_CONTAINS("Alloc num (1)", output.asCharString()); + STRCMP_CONTAINS("Leak size: 6 Allocated at", output.asCharString()); + STRCMP_CONTAINS("Content:", output.asCharString()); + STRCMP_CONTAINS("0000: 74 65 73 74 31 00 |test1.|", output.asCharString()); + + PlatformSpecificFree(mem); +} + +TEST(MemoryLeakDetectorTest, OneHundredLeaks) +{ + const int amount_alloc = 100; + char *mem[amount_alloc]; + for (int i = 0; i < amount_alloc; i++) + mem[i] = detector->allocMemory(defaultMallocAllocator(), 3); + detector->stopChecking(); + + SimpleString output = detector->report(mem_leak_period_checking); + + STRCMP_CONTAINS("Memory leak(s) found", output.asCharString()); + STRCMP_CONTAINS("Total number of leaks", output.asCharString()); + STRCMP_CONTAINS("Memory leak reports about malloc and free", output.asCharString()); + + //don't reuse i for vc6 compatibility + for (int j = 0; j < amount_alloc; j++) + PlatformSpecificFree(mem[j]); +} + +TEST(MemoryLeakDetectorTest, OneLeakOutsideCheckingPeriod) +{ + detector->stopChecking(); + char* mem = detector->allocMemory(defaultNewAllocator(), 4); + SimpleString output = detector->report(mem_leak_period_all); + CHECK(output.contains("Memory leak(s) found")); + CHECK(output.contains("size: 4")); + CHECK(output.contains("new")); + CHECK(output.contains("Total number of leaks")); + PlatformSpecificFree(mem); +} + +TEST(MemoryLeakDetectorTest, NoLeaksWhatsoever) +{ + detector->stopChecking(); + STRCMP_CONTAINS("No memory leaks", detector->report(mem_leak_period_checking)); + STRCMP_CONTAINS("No memory leaks", detector->report(mem_leak_period_all)); +} + +TEST(MemoryLeakDetectorTest, TwoLeaksUsingOperatorNew) +{ + char* mem = detector->allocMemory(defaultNewAllocator(), 4); + char* mem2 = detector->allocMemory(defaultNewAllocator(), 8); + detector->stopChecking(); + SimpleString output = detector->report(mem_leak_period_checking); + LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_checking)); + CHECK(output.contains("size: 8")); + CHECK(output.contains("size: 4")); + PlatformSpecificFree(mem); + PlatformSpecificFree(mem2); +} + +TEST(MemoryLeakDetectorTest, OneAllocButNoLeak) +{ + char* mem = detector->allocMemory(testAllocator, 4); + detector->deallocMemory(testAllocator, mem); + detector->stopChecking(); + STRCMP_CONTAINS("No memory leaks", detector->report(mem_leak_period_checking)); + LONGS_EQUAL(1, testAllocator->alloc_called); + LONGS_EQUAL(1, testAllocator->free_called); +} + +TEST(MemoryLeakDetectorTest, TwoAllocOneFreeOneLeak) +{ + char* mem = detector->allocMemory(testAllocator, 4); + char* mem2 = detector->allocMemory(testAllocator, 12); + detector->deallocMemory(testAllocator, mem); + detector->stopChecking(); + SimpleString output = detector->report(mem_leak_period_checking); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); + CHECK(output.contains("Leak size: 12")); + CHECK(!output.contains("Leak size: 4")); + PlatformSpecificFree(mem2); + LONGS_EQUAL(2, testAllocator->alloc_called); + LONGS_EQUAL(1, testAllocator->free_called); +} + +TEST(MemoryLeakDetectorTest, TwoAllocOneFreeOneLeakReverseOrder) +{ + char* mem = detector->allocMemory(defaultNewAllocator(), 4); + char* mem2 = detector->allocMemory(defaultNewAllocator(), 12); + detector->deallocMemory(defaultNewAllocator(), mem2); + detector->stopChecking(); + SimpleString output = detector->report(mem_leak_period_checking); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); + CHECK(!output.contains("size: 12")); + CHECK(output.contains("size: 4")); + PlatformSpecificFree(mem); +} + +TEST(MemoryLeakDetectorTest, DeleteNonAlocatedMemory) +{ + char a; + char* pa = &a; + detector->deallocMemory(defaultMallocAllocator(), pa, "FREE.c", 100); + detector->stopChecking(); + CHECK(reporter->message->contains("Deallocating non-allocated memory")); + CHECK(reporter->message->contains(" allocated at file: line: 0 size: 0 type: unknown")); + CHECK(reporter->message->contains(" deallocated at file: FREE.c line: 100 type: free")); +} + +TEST(MemoryLeakDetectorTest, IgnoreMemoryAllocatedOutsideCheckingPeriod) +{ + detector->stopChecking(); + char* mem = detector->allocMemory(defaultNewAllocator(), 4); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); + detector->deallocMemory(defaultNewAllocator(), mem); +} + +TEST(MemoryLeakDetectorTest, IgnoreMemoryAllocatedOutsideCheckingPeriodComplicatedCase) +{ + char* mem = detector->allocMemory(defaultNewAllocator(), 4); + detector->stopChecking(); + + char* mem2 = detector->allocMemory(defaultNewAllocator(), 8); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); + detector->clearAllAccounting(mem_leak_period_checking); + PlatformSpecificFree(mem); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); + + detector->startChecking(); + char* mem3 = detector->allocMemory(defaultNewAllocator(), 4); + detector->stopChecking(); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); + LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_all)); + + detector->clearAllAccounting(mem_leak_period_checking); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); + + detector->clearAllAccounting(mem_leak_period_all); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); + PlatformSpecificFree(mem2); + PlatformSpecificFree(mem3); +} + +TEST(MemoryLeakDetectorTest, OneLeakUsingOperatorNewWithFileLine) +{ + char* mem = detector->allocMemory(defaultNewAllocator(), 4, "file.cpp", 1234); + detector->stopChecking(); + SimpleString output = detector->report(mem_leak_period_checking); + CHECK(output.contains("file.cpp")); + CHECK(output.contains("1234")); + PlatformSpecificFree(mem); +} + +TEST(MemoryLeakDetectorTest, OneAllocAndFreeUsingArrayNew) +{ + char* mem = detector->allocMemory(defaultNewArrayAllocator(), 10, "file.cpp", 1234); + char* mem2 = detector->allocMemory(defaultNewArrayAllocator(), 12); + LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_all)); + SimpleString output = detector->report(mem_leak_period_checking); + CHECK(output.contains("new []")); + detector->deallocMemory(defaultNewArrayAllocator(), mem); + detector->deallocMemory(defaultNewArrayAllocator(), mem2); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); + detector->stopChecking(); +} + +TEST(MemoryLeakDetectorTest, OneAllocAndFree) +{ + char* mem = detector->allocMemory(defaultMallocAllocator(), 10, "file.cpp", 1234); + char* mem2 = detector->allocMemory(defaultMallocAllocator(), 12); + LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_checking)); + SimpleString output = detector->report(mem_leak_period_checking); + CHECK(output.contains("malloc")); + detector->deallocMemory(defaultMallocAllocator(), mem); + detector->deallocMemory(defaultMallocAllocator(), mem2, "file.c", 5678); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); + detector->stopChecking(); +} + +TEST(MemoryLeakDetectorTest, OneRealloc) +{ + char* mem1 = detector->allocMemory(testAllocator, 10, "file.cpp", 1234, true); + + char* mem2 = detector->reallocMemory(testAllocator, mem1, 1000, "other.cpp", 5678, true); + + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); + SimpleString output = detector->report(mem_leak_period_checking); + CHECK(output.contains("other.cpp")); + + detector->deallocMemory(testAllocator, mem2, true); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); + detector->stopChecking(); + LONGS_EQUAL(1, testAllocator->alloc_called); + LONGS_EQUAL(1, testAllocator->free_called); + LONGS_EQUAL(2, testAllocator->allocMemoryLeakNodeCalled); + LONGS_EQUAL(2, testAllocator->freeMemoryLeakNodeCalled); +} + +TEST(MemoryLeakDetectorTest, ReallocNonAllocatedMemory) +{ + char mem1; + char* mem2 = detector->reallocMemory(testAllocator, &mem1, 5, "other.cpp", 13, true); + detector->deallocMemory(testAllocator, mem2, true); + detector->stopChecking(); + CHECK(reporter->message->contains("Deallocating non-allocated memory\n")); + CHECK(reporter->message->contains(" deallocated at file: other.cpp line: 13")); +} + +TEST(MemoryLeakDetectorTest, AllocOneTypeFreeAnotherType) +{ + char* mem = detector->allocMemory(defaultNewArrayAllocator(), 100, "ALLOC.c", 10); + detector->deallocMemory(defaultMallocAllocator(), mem, "FREE.c", 100); + detector->stopChecking(); + CHECK(reporter->message->contains("Allocation/deallocation type mismatch")); + CHECK(reporter->message->contains(" allocated at file: ALLOC.c line: 10 size: 100 type: new []")); + CHECK(reporter->message->contains(" deallocated at file: FREE.c line: 100 type: free")); +} + +TEST(MemoryLeakDetectorTest, AllocOneTypeFreeAnotherTypeWithCheckingDisabled) +{ + detector->disableAllocationTypeChecking(); + char* mem = detector->allocMemory(defaultNewArrayAllocator(), 100, "ALLOC.c", 10); + detector->deallocMemory(defaultNewAllocator(), mem, "FREE.c", 100); + detector->stopChecking(); + STRCMP_EQUAL("", reporter->message->asCharString()); + detector->enableAllocationTypeChecking(); +} + +TEST(MemoryLeakDetectorTest, mallocLeakGivesAdditionalWarning) +{ + char* mem = detector->allocMemory(defaultMallocAllocator(), 100, "ALLOC.c", 10); + detector->stopChecking(); + SimpleString output = detector->report(mem_leak_period_checking); + STRCMP_CONTAINS("Memory leak reports about malloc and free can be caused by allocating using the cpputest version of malloc", output.asCharString()); + PlatformSpecificFree(mem); +} + +TEST(MemoryLeakDetectorTest, newLeakDoesNotGiveAdditionalWarning) +{ + char* mem = detector->allocMemory(defaultNewAllocator(), 100, "ALLOC.c", 10); + detector->stopChecking(); + SimpleString output = detector->report(mem_leak_period_checking); + CHECK(! output.contains("Memory leak reports about malloc and free")); + PlatformSpecificFree(mem); +} + +TEST(MemoryLeakDetectorTest, MarkCheckingPeriodLeaksAsNonCheckingPeriod) +{ + char* mem = detector->allocMemory(defaultNewArrayAllocator(), 100); + char* mem2 = detector->allocMemory(defaultNewArrayAllocator(), 100); + detector->stopChecking(); + LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_checking)); + LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_all)); + detector->markCheckingPeriodLeaksAsNonCheckingPeriod(); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); + LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_all)); + PlatformSpecificFree(mem); + PlatformSpecificFree(mem2); +} + +TEST(MemoryLeakDetectorTest, memoryCorruption) +{ + char* mem = detector->allocMemory(defaultMallocAllocator(), 10, "ALLOC.c", 10); + mem[10] = 'O'; + mem[11] = 'H'; + detector->deallocMemory(defaultMallocAllocator(), mem, "FREE.c", 100); + detector->stopChecking(); + CHECK(reporter->message->contains("Memory corruption")); + CHECK(reporter->message->contains(" allocated at file: ALLOC.c line: 10 size: 10 type: malloc")); + CHECK(reporter->message->contains(" deallocated at file: FREE.c line: 100 type: free")); +} + +TEST(MemoryLeakDetectorTest, safelyDeleteNULL) +{ + detector->deallocMemory(defaultNewAllocator(), NULLPTR); + STRCMP_EQUAL("", reporter->message->asCharString()); +} + +TEST(MemoryLeakDetectorTest, periodDisabled) +{ + detector->disable(); + char* mem = detector->allocMemory(defaultMallocAllocator(), 2); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_disabled)); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_enabled)); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); + detector->deallocMemory(defaultMallocAllocator(), mem); +} + +TEST(MemoryLeakDetectorTest, periodEnabled) +{ + detector->enable(); + char* mem = detector->allocMemory(defaultMallocAllocator(), 2); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_disabled)); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_enabled)); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); + detector->deallocMemory(defaultMallocAllocator(), mem); +} + +TEST(MemoryLeakDetectorTest, periodChecking) +{ + char* mem = detector->allocMemory(defaultMallocAllocator(), 2); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_disabled)); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_enabled)); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); + detector->deallocMemory(defaultMallocAllocator(), mem); +} + +TEST(MemoryLeakDetectorTest, defaultAllocationStageIsZero) +{ + LONGS_EQUAL(0, detector->getCurrentAllocationStage()); +} + +TEST(MemoryLeakDetectorTest, canFreeNoAllocations) +{ + detector->deallocAllMemoryInCurrentAllocationStage(); + LONGS_EQUAL(0, detector->getCurrentAllocationStage()); +} + +TEST(MemoryLeakDetectorTest, increaseAllocationStage) +{ + detector->increaseAllocationStage(); + LONGS_EQUAL(1, detector->getCurrentAllocationStage()); +} + +TEST(MemoryLeakDetectorTest, decreaseAllocationStage) +{ + detector->increaseAllocationStage(); + detector->decreaseAllocationStage(); + LONGS_EQUAL(0, detector->getCurrentAllocationStage()); +} + +TEST(MemoryLeakDetectorTest, freeAllMemoryInCurrentAllocationStage) +{ + detector->increaseAllocationStage(); + detector->allocMemory(defaultMallocAllocator(), 2); + detector->allocMemory(defaultMallocAllocator(), 2); + detector->deallocAllMemoryInCurrentAllocationStage(); + LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); +} + +TEST(MemoryLeakDetectorTest, freeOnlyTheMemoryInTheAllocationStage) +{ + char* mem = detector->allocMemory(defaultMallocAllocator(), 2); + detector->increaseAllocationStage(); + detector->allocMemory(defaultMallocAllocator(), 2); + detector->deallocAllMemoryInCurrentAllocationStage(); + LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); + detector->deallocMemory(defaultMallocAllocator(), mem); +} + +TEST(MemoryLeakDetectorTest, allocateWithANullAllocatorCausesNoProblems) +{ + char* mem = detector->allocMemory(NullUnknownAllocator::defaultAllocator(), 2); + detector->deallocMemory(NullUnknownAllocator::defaultAllocator(), mem); +} + +TEST(MemoryLeakDetectorTest, invalidateMemory) +{ + unsigned char* mem = (unsigned char*)detector->allocMemory(defaultMallocAllocator(), 2); + + detector->invalidateMemory((char*)mem); + CHECK(mem[0] == 0xCD); + CHECK(mem[1] == 0xCD); + detector->deallocMemory(defaultMallocAllocator(), mem); +} + +TEST(MemoryLeakDetectorTest, invalidateMemoryNULLShouldWork) +{ + detector->invalidateMemory(NULLPTR); +} + +TEST_GROUP(MemoryLeakDetectorListTest) +{ +}; + +TEST(MemoryLeakDetectorListTest, clearAllAccountingIsWorkingProperly) +{ + MemoryLeakDetectorList listForTesting; + MemoryLeakDetectorNode node1, node2, node3; + node3.period_ = mem_leak_period_disabled; + listForTesting.addNewNode(&node1); + listForTesting.addNewNode(&node2); + listForTesting.addNewNode(&node3); + + listForTesting.clearAllAccounting(mem_leak_period_enabled); + + POINTERS_EQUAL(NULLPTR, listForTesting.getFirstLeak(mem_leak_period_enabled)); + CHECK(&node3 == listForTesting.getFirstLeak(mem_leak_period_disabled)); +} + +TEST_GROUP(SimpleStringBuffer) +{ +}; + +TEST(SimpleStringBuffer, initialStringIsEmpty) +{ + SimpleStringBuffer buffer; + STRCMP_EQUAL("", buffer.toString()); +} + +TEST(SimpleStringBuffer, simpleTest) +{ + SimpleStringBuffer buffer; + buffer.add("Hello"); + buffer.add(" World"); + STRCMP_EQUAL("Hello World", buffer.toString()); +} + +TEST(SimpleStringBuffer, writePastLimit) +{ + SimpleStringBuffer buffer; + for (int i = 0; i < SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN * 2; i++) + buffer.add("h"); + SimpleString str("h", SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN-1); + STRCMP_EQUAL(str.asCharString(), buffer.toString()); +} + +TEST(SimpleStringBuffer, setWriteLimit) +{ + SimpleStringBuffer buffer; + buffer.setWriteLimit(10); + for (int i = 0; i < SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN ; i++) + buffer.add("h"); + SimpleString str("h", 10); + STRCMP_EQUAL(str.asCharString(), buffer.toString()); +} + +TEST(SimpleStringBuffer, setWriteLimitTooHighIsIgnored) +{ + SimpleStringBuffer buffer; + buffer.setWriteLimit(SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN+10); + for (int i = 0; i < SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN+10; i++) + buffer.add("h"); + SimpleString str("h", SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN-1); + STRCMP_EQUAL(str.asCharString(), buffer.toString()); +} + +TEST(SimpleStringBuffer, resetWriteLimit) +{ + SimpleStringBuffer buffer; + buffer.setWriteLimit(10); + for (int i = 0; i < SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN ; i++) + buffer.add("h"); + buffer.resetWriteLimit(); + buffer.add("%s", SimpleString("h", 10).asCharString()); + + SimpleString str("h", 20); + STRCMP_EQUAL(str.asCharString(), buffer.toString()); +} + +TEST(SimpleStringBuffer, addMemoryDumpOneLinePlusOnePartial) +{ + SimpleStringBuffer buffer; + buffer.addMemoryDump("deadbeefdeadbeefhopsxx", 22); + STRCMP_EQUAL(" 0000: 64 65 61 64 62 65 65 66 64 65 61 64 62 65 65 66 |deadbeefdeadbeef|\n" + " 0010: 68 6f 70 73 78 78 |hopsxx|\n", + buffer.toString()); +} + +TEST(SimpleStringBuffer, addMemoryDumpNonPrintable) +{ + SimpleStringBuffer buffer; + // Ensure we test edge cases - NUL, 0x1F, 0x7F, 0xFF + buffer.addMemoryDump("\x15\x7f\xff\x00\x1ftdd", 8); + STRCMP_EQUAL(" 0000: 15 7f ff 00 1f 74 64 64 |.....tdd|\n", + buffer.toString()); +} + +TEST(SimpleStringBuffer, addMemoryDumpOneLine) +{ + SimpleStringBuffer buffer; + buffer.addMemoryDump("deadbeefdeadbeef", 16); + STRCMP_EQUAL(" 0000: 64 65 61 64 62 65 65 66 64 65 61 64 62 65 65 66 |deadbeefdeadbeef|\n", + buffer.toString()); +} + +TEST(SimpleStringBuffer, addMemoryDumpOneHalfLine) +{ + SimpleStringBuffer buffer; + buffer.addMemoryDump("deadbeef", 8); + STRCMP_EQUAL(" 0000: 64 65 61 64 62 65 65 66 |deadbeef|\n", + buffer.toString()); +} + +TEST(SimpleStringBuffer, addMemoryDumpOneByte) +{ + SimpleStringBuffer buffer; + buffer.addMemoryDump("Z", 1); + STRCMP_EQUAL(" 0000: 5a |Z|\n", + buffer.toString()); +} + +TEST(SimpleStringBuffer, addMemoryDumpZeroBytes) +{ + SimpleStringBuffer buffer; + buffer.addMemoryDump("", 0); + STRCMP_EQUAL("", buffer.toString()); +} + +TEST_GROUP(ReallocBugReported) +{ + MemoryLeakFailureForTest reporter; +}; + +TEST(ReallocBugReported, CanSafelyDoAReallocWithANewAllocator) +{ + MemoryLeakDetector detector(&reporter); + char* mem = detector.allocMemory(defaultNewAllocator(), 5, "file", 1); + mem = detector.reallocMemory(defaultNewAllocator(), mem, 19, "file", 1); + detector.deallocMemory(defaultNewAllocator(), mem); +} + +TEST(ReallocBugReported, CanSafelyDoAReallocWithAMallocAllocator) +{ + MemoryLeakDetector detector(&reporter); + char* mem = detector.allocMemory(defaultMallocAllocator(), 5, "file", 1, true); + mem = detector.reallocMemory(defaultMallocAllocator(), mem, 19, "file", 1, true); + detector.deallocMemory(defaultMallocAllocator(), mem, true); +} diff -Nru cpputest-3.8/tests/CppUTest/MemoryLeakWarningTest.cpp cpputest-4.0/tests/CppUTest/MemoryLeakWarningTest.cpp --- cpputest-3.8/tests/CppUTest/MemoryLeakWarningTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/MemoryLeakWarningTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,520 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/MemoryLeakWarningPlugin.h" +#include "CppUTest/MemoryLeakDetector.h" +#include "CppUTest/TestMemoryAllocator.h" +#include "CppUTest/TestTestingFixture.h" +#include "CppUTest/TestHarness_c.h" +#include "CppUTest/SimpleMutex.h" +#include "DummyMemoryLeakDetector.h" + +TEST_GROUP(MemoryLeakWarningLocalDetectorTest) +{ + DummyMemoryLeakFailure dummy; +}; + +TEST(MemoryLeakWarningLocalDetectorTest, localDetectorReturnsNewGlobalWhenNoneWasSet) +{ + MemoryLeakWarningPlugin memoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", NULLPTR); + CHECK(NULLPTR != memoryLeakWarningPlugin.getMemoryLeakDetector()); +} + +TEST(MemoryLeakWarningLocalDetectorTest, localDetectorIsTheOneSpecifiedInConstructor) +{ + MemoryLeakDetector localDetector(&dummy); + MemoryLeakWarningPlugin memoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", &localDetector); + POINTERS_EQUAL(&localDetector, memoryLeakWarningPlugin.getMemoryLeakDetector()); +} + +TEST(MemoryLeakWarningLocalDetectorTest, localDetectorIsGlobalDetector) +{ + MemoryLeakDetector* globalDetector = MemoryLeakWarningPlugin::getGlobalDetector(); + MemoryLeakWarningPlugin memoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", NULLPTR); + MemoryLeakDetector* localDetector = memoryLeakWarningPlugin.getMemoryLeakDetector(); + POINTERS_EQUAL(globalDetector, localDetector); +} + +static char* leak1; +static long* leak2; + +static MemoryLeakDetector* detector; +static MemoryLeakWarningPlugin* memPlugin; +static TestMemoryAllocator* allocator; + +TEST_GROUP(MemoryLeakWarningTest) +{ + DummyMemoryLeakFailure dummy; + TestTestingFixture* fixture; + + void setup() + { + fixture = new TestTestingFixture(); + detector = new MemoryLeakDetector(&dummy); + allocator = new TestMemoryAllocator; + memPlugin = new MemoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", detector); + fixture->installPlugin(memPlugin); + memPlugin->enable(); + + leak1 = NULLPTR; + leak2 = NULLPTR; + } + + void teardown() + { + detector->deallocMemory(allocator, leak1); + detector->deallocMemory(allocator, leak2); + + delete fixture; + delete memPlugin; + delete detector; + delete allocator; + } +}; + +static void _testTwoLeaks() +{ + leak1 = detector->allocMemory(allocator, 10); + leak2 = (long*) (void*) detector->allocMemory(allocator, 4); +} + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +TEST(MemoryLeakWarningTest, TwoLeaks) +{ + fixture->setTestFunction(_testTwoLeaks); + fixture->runAllTests(); + + LONGS_EQUAL(1, fixture->getFailureCount()); +} + +#else + +TEST(MemoryLeakWarningTest, TwoLeaks) +{ + fixture->setTestFunction(_testTwoLeaks); + fixture->runAllTests(); + + LONGS_EQUAL(0, fixture->getFailureCount()); +} + +#endif + + +static void _testLeakWarningWithPluginDisabled() +{ + memPlugin->expectLeaksInTest(1); + leak1 = (char*) cpputest_malloc_location_with_leak_detection(10, __FILE__, __LINE__); +} + +TEST(MemoryLeakWarningTest, LeakWarningWithPluginDisabled) +{ + fixture->setTestFunction(_testLeakWarningWithPluginDisabled); + + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); + + fixture->runAllTests(); + + LONGS_EQUAL(0, fixture->getFailureCount()); + fixture->assertPrintContains("Warning: Expected 1 leak(s), but leak detection was disabled"); + + cpputest_free_location_with_leak_detection(leak1, __FILE__, __LINE__); + leak1 = NULLPTR; + + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); +} + +static void _testIgnore2() +{ + memPlugin->expectLeaksInTest(2); + leak1 = detector->allocMemory(allocator, 10); + leak2 = (long*) (void*) detector->allocMemory(allocator, 4); +} + +TEST(MemoryLeakWarningTest, Ignore2) +{ + fixture->setTestFunction(_testIgnore2); + fixture->runAllTests(); + LONGS_EQUAL(0, fixture->getFailureCount()); +} + +static void _failAndLeakMemory() +{ + leak1 = detector->allocMemory(allocator, 10); + FAIL(""); +} + +TEST(MemoryLeakWarningTest, FailingTestDoesNotReportMemoryLeaks) +{ + fixture->setTestFunction(_failAndLeakMemory); + fixture->runAllTests(); + LONGS_EQUAL(1, fixture->getFailureCount()); +} + +static bool cpputestHasCrashed; + +TEST_GROUP(MemoryLeakWarningGlobalDetectorTest) +{ + MemoryLeakDetector* detector; + MemoryLeakFailure* failureReporter; + + DummyMemoryLeakDetector * dummyDetector; + MemoryLeakFailure* dummyReporter; + + GlobalMemoryAllocatorStash memoryAllocatorStash; + + static void crashMethod() + { + cpputestHasCrashed = true; + } + + void setup() + { + memoryAllocatorStash.save(); + detector = MemoryLeakWarningPlugin::getGlobalDetector(); + failureReporter = MemoryLeakWarningPlugin::getGlobalFailureReporter(); + + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); + + dummyReporter = new DummyMemoryLeakFailure; + dummyDetector = new DummyMemoryLeakDetector(dummyReporter); + + UtestShell::setCrashMethod(crashMethod); + cpputestHasCrashed = false; +} + + void teardown() + { + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); + + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); + + if (!DummyMemoryLeakDetector::wasDeleted()) delete dummyDetector; + if (!DummyMemoryLeakFailure::wasDeleted()) delete dummyReporter; + MemoryLeakWarningPlugin::setGlobalDetector(detector, failureReporter); + + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); + + UtestShell::resetCrashMethod(); + + memoryAllocatorStash.restore(); + } +}; + +TEST(MemoryLeakWarningGlobalDetectorTest, turnOffNewOverloadsCausesNoAdditionalLeaks) +{ + size_t storedAmountOfLeaks = detector->totalMemoryLeaks(mem_leak_period_all); + + char* arrayMemory = new char[100]; + char* nonArrayMemory = new char; + char* mallocMemory = (char*) cpputest_malloc_location_with_leak_detection(10, "file", 10); + char* reallocMemory = (char*) cpputest_realloc_location_with_leak_detection(NULLPTR, 10, "file", 10); + + LONGS_EQUAL(storedAmountOfLeaks, detector->totalMemoryLeaks(mem_leak_period_all)); + + cpputest_free_location_with_leak_detection(mallocMemory, "file", 10); + cpputest_free_location_with_leak_detection(reallocMemory, "file", 10); + delete [] arrayMemory; + delete nonArrayMemory; +} + +TEST(MemoryLeakWarningGlobalDetectorTest, destroyGlobalDetector) +{ + MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); + + MemoryLeakWarningPlugin::destroyGlobalDetector(); + + CHECK(DummyMemoryLeakDetector::wasDeleted()); + CHECK(DummyMemoryLeakFailure::wasDeleted()); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, MemoryWarningPluginCanBeSetToDestroyTheGlobalDetector) +{ + MemoryLeakWarningPlugin* plugin = new MemoryLeakWarningPlugin("dummy"); + plugin->destroyGlobalDetectorAndTurnOffMemoryLeakDetectionInDestructor(true); + MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); + + delete plugin; + + CHECK(DummyMemoryLeakDetector::wasDeleted()); +} + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +TEST(MemoryLeakWarningGlobalDetectorTest, crashOnLeakWithOperatorNew) +{ + MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); + + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); + + crash_on_allocation_number(1); + char* memory = new char[100]; + CHECK(cpputestHasCrashed); + delete [] memory; + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, crashOnLeakWithOperatorNewArray) +{ + MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); + + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); + + crash_on_allocation_number(1); + char* memory = new char; + CHECK(cpputestHasCrashed); + delete memory; + + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, crashOnLeakWithOperatorMalloc) +{ + MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); + + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); + + crash_on_allocation_number(1); + char* memory = (char*) cpputest_malloc(10); + CHECK(cpputestHasCrashed); + cpputest_free(memory); + + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, gettingTheGlobalDetectorDoesNotRestoreTheMemoryLeakOverloadsWhenTheyWereAlreadyOff) +{ + MemoryLeakWarningPlugin::setGlobalDetector(NULLPTR, NULLPTR); + MemoryLeakDetector* temporaryDetector = MemoryLeakWarningPlugin::getGlobalDetector(); + MemoryLeakFailure* temporaryReporter = MemoryLeakWarningPlugin::getGlobalFailureReporter(); + + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); + + bool areNewDeleteOverloaded = MemoryLeakWarningPlugin::areNewDeleteOverloaded(); + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); + + CHECK(!areNewDeleteOverloaded); + + delete temporaryReporter; + delete temporaryDetector; + MemoryLeakWarningPlugin::setGlobalDetector(NULLPTR, NULLPTR); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, checkIfTheMemoryLeakOverloadsAreOn) +{ + MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads(); + CHECK(MemoryLeakWarningPlugin::areNewDeleteOverloaded()); + + MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, checkIfTheMemoryLeakOverloadsAreOff) +{ + MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); + bool areNewDeleteOverloaded = MemoryLeakWarningPlugin::areNewDeleteOverloaded(); + + MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads(); + CHECK(!areNewDeleteOverloaded); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, checkIfTheMemoryLeakOverloadsAreOnWithRestore) +{ + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); + CHECK(MemoryLeakWarningPlugin::areNewDeleteOverloaded()); + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, checkIfTheMemoryLeakOverloadsAreOffWithSaveDisable) +{ + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); + CHECK(!MemoryLeakWarningPlugin::areNewDeleteOverloaded()); + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); +} + +TEST(MemoryLeakWarningGlobalDetectorTest, threadSafeMemoryLeakDetectorOverloadsAreAlsoOverloaded) +{ + MemoryLeakWarningPlugin::restoreNewDeleteOverloads(); + MemoryLeakWarningPlugin::turnOnThreadSafeNewDeleteOverloads(); + CHECK(MemoryLeakWarningPlugin::areNewDeleteOverloaded()); + MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads(); + MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads(); +} + +#endif + +#if CPPUTEST_USE_STD_CPP_LIB + +TEST(MemoryLeakWarningGlobalDetectorTest, turnOffNewOverloadsNoThrowCausesNoAdditionalLeaks) +{ +#undef new + size_t storedAmountOfLeaks = detector->totalMemoryLeaks(mem_leak_period_all); + + char* nonMemoryNoThrow = new (std::nothrow) char; + char* nonArrayMemoryNoThrow = new (std::nothrow) char[10]; + char* nonArrayMemoryThrow = new char[10]; + + LONGS_EQUAL(storedAmountOfLeaks, detector->totalMemoryLeaks(mem_leak_period_all)); + + ::operator delete(nonMemoryNoThrow, std::nothrow); + ::operator delete[](nonArrayMemoryNoThrow, std::nothrow); + ::operator delete[](nonArrayMemoryThrow, std::nothrow); +#ifdef CPPUTEST_USE_NEW_MACROS + #include "CppUTest/MemoryLeakDetectorNewMacros.h" +#endif +} + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +static int mutexLockCount = 0; +static int mutexUnlockCount = 0; + +static void StubMutexLock(PlatformSpecificMutex) +{ + mutexLockCount++; +} + +static void StubMutexUnlock(PlatformSpecificMutex) +{ + mutexUnlockCount++; +} + +TEST_GROUP(MemoryLeakWarningThreadSafe) +{ + void setup() + { + UT_PTR_SET(PlatformSpecificMutexLock, StubMutexLock); + UT_PTR_SET(PlatformSpecificMutexUnlock, StubMutexUnlock); + + mutexLockCount = 0; + mutexUnlockCount = 0; + } + + void teardown() + { + } +}; + +TEST(MemoryLeakWarningThreadSafe, turnOnThreadSafeMallocFreeReallocOverloadsDebug) +{ + size_t storedAmountOfLeaks = MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all); + + MemoryLeakWarningPlugin::turnOnThreadSafeNewDeleteOverloads(); + + int *n = (int*) cpputest_malloc(sizeof(int)); + + LONGS_EQUAL(storedAmountOfLeaks + 1, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); + CHECK_EQUAL(1, mutexLockCount); + CHECK_EQUAL(1, mutexUnlockCount); + + n = (int*) cpputest_realloc(n, sizeof(int)*3); + + LONGS_EQUAL(storedAmountOfLeaks + 1, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); + CHECK_EQUAL(2, mutexLockCount); + CHECK_EQUAL(2, mutexUnlockCount); + + cpputest_free(n); + + LONGS_EQUAL(storedAmountOfLeaks, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); + CHECK_EQUAL(3, mutexLockCount); + CHECK_EQUAL(3, mutexUnlockCount); + + MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads(); +} + +TEST(MemoryLeakWarningThreadSafe, turnOnThreadSafeNewDeleteOverloadsDebug) +{ + size_t storedAmountOfLeaks = MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all); + + MemoryLeakWarningPlugin::turnOnThreadSafeNewDeleteOverloads(); + + int *n = new int; + char *str = new char[20]; + + LONGS_EQUAL(storedAmountOfLeaks + 2, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); + CHECK_EQUAL(2, mutexLockCount); + CHECK_EQUAL(2, mutexUnlockCount); + + delete [] str; + delete n; + + LONGS_EQUAL(storedAmountOfLeaks, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); + CHECK_EQUAL(4, mutexLockCount); + CHECK_EQUAL(4, mutexUnlockCount); + + MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads(); +} + +#ifdef __clang__ + +IGNORE_TEST(MemoryLeakWarningThreadSafe, turnOnThreadSafeNewDeleteOverloads) +{ + /* Clang misbehaves with -O2 - it will not overload operator new or + * operator new[] no matter what. Therefore, this test is must be ignored. + */ +} + +#else + +TEST(MemoryLeakWarningThreadSafe, turnOnThreadSafeNewDeleteOverloads) +{ +#undef new + + size_t storedAmountOfLeaks = MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all); + MemoryLeakWarningPlugin::turnOnThreadSafeNewDeleteOverloads(); + + int *n = new int; + int *n_nothrow = new (std::nothrow) int; + char *str = new char[20]; + char *str_nothrow = new (std::nothrow) char[20]; + + LONGS_EQUAL(storedAmountOfLeaks + 4, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); + CHECK_EQUAL(4, mutexLockCount); + CHECK_EQUAL(4, mutexUnlockCount); + + delete [] str_nothrow; + delete [] str; + delete n; + delete n_nothrow; + + LONGS_EQUAL(storedAmountOfLeaks, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); + CHECK_EQUAL(8, mutexLockCount); + CHECK_EQUAL(8, mutexUnlockCount); + + MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads(); +#ifdef CPPUTEST_USE_NEW_MACROS + #include "CppUTest/MemoryLeakDetectorNewMacros.h" +#endif +} + +#endif + +#endif + +#endif diff -Nru cpputest-3.8/tests/CppUTest/MemoryOperatorOverloadTest.cpp cpputest-4.0/tests/CppUTest/MemoryOperatorOverloadTest.cpp --- cpputest-3.8/tests/CppUTest/MemoryOperatorOverloadTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/MemoryOperatorOverloadTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,445 @@ +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestMemoryAllocator.h" +#include "CppUTest/MemoryLeakDetector.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTest/PlatformSpecificFunctions.h" +#include "CppUTest/TestTestingFixture.h" +#include "AllocationInCppFile.h" + +#include "CppUTest/TestHarness_c.h" +#include "AllocationInCFile.h" + +TEST_GROUP(BasicBehavior) +{ +}; + +TEST(BasicBehavior, CanDeleteNullPointers) +{ + delete (char*) NULLPTR; + delete [] (char*) NULLPTR; +} + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +CPPUTEST_DO_NOT_SANITIZE_ADDRESS +static void deleteArrayInvalidatesMemory() +{ + unsigned char* memory = new unsigned char[10]; + PlatformSpecificMemset(memory, 0xAB, 10); + delete [] memory; + CHECK(memory[5] != 0xCB); +} + +TEST(BasicBehavior, deleteArrayInvalidatesMemory) +{ + deleteArrayInvalidatesMemory(); +} + +CPPUTEST_DO_NOT_SANITIZE_ADDRESS +static void deleteInvalidatesMemory() +{ + unsigned char* memory = new unsigned char; + *memory = 0xAD; + delete memory; + CHECK(*memory != 0xAD); +} + +TEST(BasicBehavior, deleteInvalidatesMemory) +{ + deleteInvalidatesMemory(); +} + +#if __cplusplus >= 201402L +TEST(BasicBehavior, DeleteWithSizeParameterWorks) +{ + char* charMemory = new char; + char* charArrayMemory = new char[10]; + ::operator delete(charMemory, sizeof(char)); + ::operator delete[](charArrayMemory, sizeof(char)* 10); +} +#endif + +static void deleteUnallocatedMemory() +{ + delete (char*) 0x1234678; + FAIL("Should never come here"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(BasicBehavior, deleteWillNotThrowAnExceptionWhenDeletingUnallocatedMemoryButCanStillCauseTestFailures) +{ + /* + * Test failure might cause an exception. But according to C++ standard, you aren't allowed + * to throw exceptions in the delete function. If you do that, it will call std::terminate. + * Therefore, the delete will need to fail without exceptions. + */ + MemoryLeakFailure* defaultReporter = MemoryLeakWarningPlugin::getGlobalFailureReporter(); + TestTestingFixture fixture; + fixture.setTestFunction(deleteUnallocatedMemory); + fixture.runAllTests(); + LONGS_EQUAL(1, fixture.getFailureCount()); + POINTERS_EQUAL(defaultReporter, MemoryLeakWarningPlugin::getGlobalFailureReporter()); +} + +#endif + +#ifdef CPPUTEST_USE_MALLOC_MACROS + +/* This include is added because *sometimes* the cstdlib does an #undef. This should have been prevented */ +#if CPPUTEST_USE_STD_CPP_LIB +#include +#endif + +TEST(BasicBehavior, bothMallocAndFreeAreOverloaded) +{ + void* memory = cpputest_malloc_location(sizeof(char), "file", 10); + free(memory); + + memory = malloc(sizeof(unsigned char)); + cpputest_free_location(memory, "file", 10); +} + +#endif + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +CPPUTEST_DO_NOT_SANITIZE_ADDRESS +static void freeInvalidatesMemory() +{ + unsigned char* memory = (unsigned char*) cpputest_malloc(sizeof(unsigned char)); + *memory = 0xAD; + cpputest_free(memory); + CHECK(*memory != 0xAD); +} + +TEST(BasicBehavior, freeInvalidatesMemory) +{ + freeInvalidatesMemory(); +} +#endif + +TEST_GROUP(MemoryLeakOverridesToBeUsedInProductionCode) +{ + MemoryLeakDetector* memLeakDetector; + void setup() + { + memLeakDetector = MemoryLeakWarningPlugin::getGlobalDetector(); + } + +}; + +#ifdef CPPUTEST_USE_MALLOC_MACROS + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, MallocOverrideIsUsed) +{ + size_t memLeaks = memLeakDetector->totalMemoryLeaks(mem_leak_period_checking); + void* memory = malloc(10); + LONGS_EQUAL(memLeaks+1, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); + free (memory); +} + +#ifdef CPPUTEST_USE_STRDUP_MACROS + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, StrdupOverrideIsUsed) +{ + size_t memLeaks = memLeakDetector->totalMemoryLeaks(mem_leak_period_checking); + char* memory = strdup("0123456789"); + LONGS_EQUAL(memLeaks+1, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); + free (memory); +} + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, StrndupOverrideIsUsed) +{ + size_t memLeaks = memLeakDetector->totalMemoryLeaks(mem_leak_period_checking); + char* memory = strndup("0123456789", 10); + LONGS_EQUAL(memLeaks+1, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); + free (memory); +} +#endif + +#endif + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, UseNativeMallocByTemporarlySwitchingOffMalloc) +{ + size_t memLeaks = memLeakDetector->totalMemoryLeaks(mem_leak_period_checking); +#ifdef CPPUTEST_USE_MALLOC_MACROS + #undef malloc + #undef free +#endif + +#if CPPUTEST_USE_STD_C_LIB + void* memory = malloc(10); + LONGS_EQUAL(memLeaks, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); + free (memory); +#else + void* memory = PlatformSpecificMalloc(10); + LONGS_EQUAL(memLeaks, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); + PlatformSpecificFree (memory); +#endif + +#ifdef CPPUTEST_USE_MALLOC_MACROS +#include "CppUTest/MemoryLeakDetectorMallocMacros.h" +#endif +} + +/* TEST... allowing for a new overload in a class */ +class NewDummyClass +{ +public: + static bool overloaded_new_called; + +#ifdef CPPUTEST_USE_NEW_MACROS + #undef new +#endif + void* operator new (size_t size) +#ifdef CPPUTEST_USE_NEW_MACROS + #include "CppUTest/MemoryLeakDetectorNewMacros.h" +#endif + { + overloaded_new_called = true; + return malloc(size); + } + void dummyFunction() + { + char* memory = new char; + delete memory; + } +}; +bool NewDummyClass::overloaded_new_called = false; + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, NoSideEffectsFromTurningOffNewMacros) +{ + /* + * Interesting effect of wrapping the operator new around the macro is + * that the actual new that is called is a different one than expected. + * + * The overloaded operator new doesn't actually ever get called. + * + * This might come as a surprise, so it is important to realize! + */ + NewDummyClass dummy; + dummy.dummyFunction(); + // CHECK(dummy.overloaded_new_called); +} + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, UseNativeNewByTemporarlySwitchingOffNew) +{ +#ifdef CPPUTEST_USE_NEW_MACROS + #undef new + #undef delete +#endif + char* memory = new char[10]; + delete [] memory; +#ifdef CPPUTEST_USE_NEW_MACROS + #include "CppUTest/MemoryLeakDetectorNewMacros.h" +#endif +} + + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, OperatorNewMacroOverloadViaIncludeFileWorks) +{ + char* leak = newAllocation(); + STRCMP_NOCASE_CONTAINS("AllocationInCppFile.cpp", memLeakDetector->report(mem_leak_period_checking)); + delete leak; +} + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, OperatorNewArrayMacroOverloadViaIncludeFileWorks) +{ + char* leak = newArrayAllocation(); + STRCMP_NOCASE_CONTAINS("AllocationInCppFile.cpp", memLeakDetector->report(mem_leak_period_checking)); + delete[] leak; +} + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, MallocOverrideWorks) +{ + char* leak = mallocAllocation(); + STRCMP_NOCASE_CONTAINS("AllocationInCFile.c", memLeakDetector->report(mem_leak_period_checking)); + freeAllocation(leak); +} + +#ifdef CPPUTEST_USE_STRDUP_MACROS +TEST(MemoryLeakOverridesToBeUsedInProductionCode, StrdupOverrideWorks) +{ + char* leak = strdupAllocation(); + STRCMP_NOCASE_CONTAINS("AllocationInCFile.c", memLeakDetector->report(mem_leak_period_checking)); + freeAllocation(leak); +} + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, StrndupOverrideWorks) +{ + char* leak = strndupAllocation(); + STRCMP_NOCASE_CONTAINS("AllocationInCFile.c", memLeakDetector->report(mem_leak_period_checking)); + freeAllocation(leak); +} +#endif + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, MallocWithButFreeWithoutLeakDetectionDoesntCrash) +{ + char* leak = mallocAllocation(); + freeAllocationWithoutMacro(leak); + LONGS_EQUAL(2, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); + memLeakDetector->removeMemoryLeakInformationWithoutCheckingOrDeallocatingTheMemoryButDeallocatingTheAccountInformation(getCurrentMallocAllocator(), leak, true); +} + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, OperatorNewOverloadingWithoutMacroWorks) +{ + char* leak = newAllocationWithoutMacro(); + STRCMP_CONTAINS("unknown", memLeakDetector->report(mem_leak_period_checking)); + delete leak; +} + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, OperatorNewArrayOverloadingWithoutMacroWorks) +{ + char* leak = newArrayAllocationWithoutMacro(); + STRCMP_CONTAINS("unknown", memLeakDetector->report(mem_leak_period_checking)); + delete[] leak; +} + +#else + +TEST(MemoryLeakOverridesToBeUsedInProductionCode, MemoryOverridesAreDisabled) +{ + char* leak = newAllocation(); + STRCMP_EQUAL("No memory leaks were detected.", memLeakDetector->report(mem_leak_period_checking)); + delete leak; +} + +#endif + +TEST_GROUP(OutOfMemoryTestsForOperatorNew) +{ + TestMemoryAllocator* no_memory_allocator; + GlobalMemoryAllocatorStash memoryAllocatorStash; + void setup() + { + memoryAllocatorStash.save(); + no_memory_allocator = new NullUnknownAllocator; + setCurrentNewAllocator(no_memory_allocator); + setCurrentNewArrayAllocator(no_memory_allocator); + } + + void teardown() + { + memoryAllocatorStash.restore(); + delete no_memory_allocator; + } +}; + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +#if CPPUTEST_USE_STD_CPP_LIB + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorThrowsAnExceptionWhenUsingStdCppNew) +{ + CHECK_THROWS(std::bad_alloc, new char); +} + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorThrowsAnExceptionWhenUsingStdCppNew) +{ + CHECK_THROWS(std::bad_alloc, new char[10]); +} + +TEST_GROUP(TestForExceptionsInConstructor) +{ +}; + +TEST(TestForExceptionsInConstructor,ConstructorThrowsAnException) +{ + CHECK_THROWS(int, new ClassThatThrowsAnExceptionInTheConstructor); +} + +TEST(TestForExceptionsInConstructor,ConstructorThrowsAnExceptionAllocatedAsArray) +{ + CHECK_THROWS(int, new ClassThatThrowsAnExceptionInTheConstructor[10]); +} + +#else + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorReturnsNull) +{ + POINTERS_EQUAL(NULLPTR, new char); +} + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorReturnsNull) +{ + POINTERS_EQUAL(NULLPTR, new char[10]); +} + +#endif + +#undef new + +#if CPPUTEST_USE_STD_CPP_LIB + + +/* + * CLang 4.2 and memory allocation. + * + * Clang 4.2 has done some optimizations to their memory management that actually causes slightly different behavior than what the C++ Standard defines. + * Usually this is not a problem... but in this case, it is a problem. + * + * More information about the optimization can be found at: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3433.html + * We've done a bug-report to clang to fix some of this non-standard behavior, which is open at: http://llvm.org/bugs/show_bug.cgi?id=15541 + * + * I very much hope that nobody would actually ever hit this bug/optimization as it is hard to figure out what is going on. + * + * The original test simply did "new char". Because the memory wasn't assigned to anything and is local in context, the optimization *doesn't* call + * the operator new overload. Because it doesn't call the operator new (optimizing away a call to operator new), therefore the method wouldn't throw an exception + * and therefore this test failed. + * + * The first attempt to fix this is to create a local variable and assigned the memory to that. Also this doesn't work as it still detects the allocation is + * local and optimizes away the memory call. + * + * Now, we assign the memory on some static global which fools the optimizer to believe that it isn't local and it stops optimizing the operator new call. + * + * We (Bas Vodde and Terry Yin) suspect that in a real product, you wouldn't be able to detect the optimization and it's breaking of Standard C++. Therefore, + * for now, we keep this hack in the test to fool the optimizer and hope nobody will ever notice this 'optimizer behavior' in a real product. + * + * Update 2020: The gcc compiler implemented the same optimization, but it seems to be slightly smarter and discovered that we assign to a static variable. + * Thus it still optimized away the call to operator new. Did another bug report, but it is unlikely to get fixed. You can find it at: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94671 + * + * Changed the variable to be external so it would definitively be a mistake to optimize the call. + * + */ + +extern char* some_memory; +char* some_memory; + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorThrowsAnExceptionWhenUsingStdCppNewWithoutOverride) +{ + CHECK_THROWS(std::bad_alloc, some_memory = new char); +} + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorThrowsAnExceptionWhenUsingStdCppNewWithoutOverride) +{ + CHECK_THROWS(std::bad_alloc, some_memory = new char[10]); +} + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorReturnsNullWithoutOverride) +{ + POINTERS_EQUAL(NULLPTR, new (std::nothrow) char); +} + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorReturnsNullWithoutOverride) +{ + POINTERS_EQUAL(NULLPTR, new (std::nothrow) char[10]); +} + +#else + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorReturnsNullWithoutOverride) +{ + POINTERS_EQUAL(NULLPTR, new char); +} + +TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorReturnsNullWithoutOverride) +{ + POINTERS_EQUAL(NULLPTR, new char[10]); +} + +#endif + +#endif diff -Nru cpputest-3.8/tests/CppUTest/PluginTest.cpp cpputest-4.0/tests/CppUTest/PluginTest.cpp --- cpputest-3.8/tests/CppUTest/PluginTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/PluginTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestTestingFixture.h" + +#define GENERIC_PLUGIN "GenericPlugin" +#define GENERIC_PLUGIN2 "GenericPlugin2" +#define GENERIC_PLUGIN3 "GenericPlugin3" + +static int sequenceNumber; + +class DummyPlugin: public TestPlugin +{ +public: + DummyPlugin(const SimpleString& name) : + TestPlugin(name), preAction(0), preActionSequence(0), postAction(0), postActionSequence(0) + { + } + + virtual void preTestAction(UtestShell&, TestResult&) + { + preAction++; + preActionSequence = sequenceNumber++; + } + + virtual void postTestAction(UtestShell&, TestResult&) + { + postAction++; + postActionSequence = sequenceNumber++; + } + + int preAction; + int preActionSequence; + int postAction; + int postActionSequence; +}; + +class DummyPluginWhichAcceptsParameters: public DummyPlugin +{ +public: + DummyPluginWhichAcceptsParameters(const SimpleString& name) : + DummyPlugin(name) + { + } + + virtual bool parseArguments(int ac, const char *const *av, int index) + { + SimpleString argument (av[index]); + if (argument == "-paccept") + return true; + return TestPlugin::parseArguments(ac, av, index); + } + +}; + +TEST_GROUP(PluginTest) +{ + DummyPlugin* firstPlugin; + DummyPluginWhichAcceptsParameters* secondPlugin; + DummyPlugin* thirdPlugin; + TestTestingFixture *genFixture; + TestRegistry* registry; + + void setup() + { + firstPlugin = new DummyPlugin(GENERIC_PLUGIN); + secondPlugin = new DummyPluginWhichAcceptsParameters(GENERIC_PLUGIN2); + thirdPlugin = new DummyPlugin(GENERIC_PLUGIN3); + genFixture = new TestTestingFixture; + registry = genFixture->getRegistry(); + registry->installPlugin(firstPlugin); + sequenceNumber = 1; + } + + void teardown() + { + delete firstPlugin; + delete secondPlugin; + delete thirdPlugin; + delete genFixture; + } +}; + +#define GENERIC_PLUGIN "GenericPlugin" + +TEST(PluginTest, PluginHasName) +{ + STRCMP_EQUAL(GENERIC_PLUGIN, firstPlugin->getName().asCharString()); +} + +TEST(PluginTest, InstallPlugin) +{ + CHECK_EQUAL(firstPlugin, registry->getFirstPlugin()); + CHECK_EQUAL(firstPlugin, registry->getPluginByName(GENERIC_PLUGIN)); + LONGS_EQUAL(1, registry->countPlugins()); +} + +TEST(PluginTest, InstallMultiplePlugins) +{ + registry->installPlugin(thirdPlugin); + CHECK_EQUAL(firstPlugin, registry->getPluginByName(GENERIC_PLUGIN)); + CHECK_EQUAL(thirdPlugin, registry->getPluginByName(GENERIC_PLUGIN3)); + POINTERS_EQUAL(NULLPTR, registry->getPluginByName("I do not exist")); +} + +TEST(PluginTest, ActionsAllRun) +{ + genFixture->runAllTests(); + genFixture->runAllTests(); + CHECK_EQUAL(2, firstPlugin->preAction); + CHECK_EQUAL(2, firstPlugin->postAction); +} + +TEST(PluginTest, Sequence) +{ + registry->installPlugin(thirdPlugin); + genFixture->runAllTests(); + CHECK_EQUAL(1, thirdPlugin->preActionSequence); + CHECK_EQUAL(2, firstPlugin->preActionSequence); + CHECK_EQUAL(3, firstPlugin->postActionSequence); + CHECK_EQUAL(4, thirdPlugin->postActionSequence); + LONGS_EQUAL(2, registry->countPlugins()); +} + +TEST(PluginTest, RemovePluginByName) +{ + registry->installPlugin(secondPlugin); + registry->installPlugin(thirdPlugin); + LONGS_EQUAL(3, registry->countPlugins()); + registry->removePluginByName(GENERIC_PLUGIN2); + LONGS_EQUAL(2, registry->countPlugins()); +} + +struct DefaultPlugin : public TestPlugin +{ + DefaultPlugin() : TestPlugin("default") {} +}; + +TEST(PluginTest, DefaultPostTestActionDoesntDoAnything) +{ + DefaultPlugin defaultPlugin; + registry->installPlugin(&defaultPlugin); + genFixture->runAllTests(); +} + +TEST(PluginTest, DisablesPluginsDontRun) +{ + registry->installPlugin(thirdPlugin); + thirdPlugin->disable(); + genFixture->runAllTests(); + CHECK(!thirdPlugin->isEnabled()); + thirdPlugin->enable(); + genFixture->runAllTests(); + CHECK_EQUAL(2, firstPlugin->preAction); + CHECK_EQUAL(1, thirdPlugin->preAction); + CHECK(thirdPlugin->isEnabled()); +} + +TEST(PluginTest, ParseArgumentsForUnknownArgumentsFails) +{ + registry->installPlugin(secondPlugin); + const char *cmd_line[] = {"nonsense", "andmorenonsense"}; + CHECK(registry->getFirstPlugin()->parseAllArguments(2, const_cast(cmd_line), 0) == false); /* cover non-const wrapper, too */ +} + +TEST(PluginTest, ParseArgumentsContinuesAndSucceedsWhenAPluginCanParse) +{ + registry->installPlugin(secondPlugin); + const char *cmd_line[] = {"-paccept", "andmorenonsense"}; + CHECK(registry->getFirstPlugin()->parseAllArguments(2, const_cast(cmd_line), 0)); /* cover non-const wrapper, too */ +} diff -Nru cpputest-3.8/tests/CppUTest/PreprocessorTest.cpp cpputest-4.0/tests/CppUTest/PreprocessorTest.cpp --- cpputest-3.8/tests/CppUTest/PreprocessorTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/PreprocessorTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" + +TEST_GROUP(PreprocessorTest) +{ +}; + diff -Nru cpputest-3.8/tests/CppUTest/SetPluginTest.cpp cpputest-4.0/tests/CppUTest/SetPluginTest.cpp --- cpputest-3.8/tests/CppUTest/SetPluginTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/SetPluginTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,171 @@ +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestPlugin.h" + +static void orig_func1() +{ +} + +static void stub_func1() +{ +} + +static void orig_func2() +{ +} + +static void stub_func2() +{ +} + +static void (*fp1)(); +static void (*fp2)(); + +TEST_GROUP(SetPointerPluginTest) +{ + SetPointerPlugin* plugin_; + TestRegistry* myRegistry_; + StringBufferTestOutput* output_; + TestResult* result_; + + void setup() + { + myRegistry_ = new TestRegistry(); + plugin_ = new SetPointerPlugin("TestSetPlugin"); + myRegistry_->setCurrentRegistry(myRegistry_); + myRegistry_->installPlugin(plugin_); + output_ = new StringBufferTestOutput(); + result_ = new TestResult(*output_); + } + + void teardown() + { + myRegistry_->setCurrentRegistry(NULLPTR); + delete myRegistry_; + delete plugin_; + delete output_; + delete result_; + } +}; + +class FunctionPointerUtest : public Utest +{ +public: + void setup() _override + { + UT_PTR_SET(fp1, stub_func1); + UT_PTR_SET(fp2, stub_func2); + UT_PTR_SET(fp2, stub_func2); + } + void testBody() _override + { + CHECK(fp1 == stub_func1); + CHECK(fp2 == stub_func2); + } +}; + +class FunctionPointerUtestShell: public UtestShell +{ +public: + virtual Utest* createTest() + { + return new FunctionPointerUtest(); + } +}; + +TEST(SetPointerPluginTest, installTwoFunctionPointer) +{ + FunctionPointerUtestShell *tst = new FunctionPointerUtestShell(); + + fp1 = orig_func1; + fp2 = orig_func2; + myRegistry_->addTest(tst); + myRegistry_->runAllTests(*result_); + CHECK(fp1 == orig_func1); + CHECK(fp2 == orig_func2); + LONGS_EQUAL(0, result_->getFailureCount()); + LONGS_EQUAL(2, result_->getCheckCount()); + delete tst; +} + +class MaxFunctionPointerUtest : public Utest +{ +public: + int numOfFpSets; + MaxFunctionPointerUtest(int num) : + numOfFpSets(num) + { + } + + void setup() + { + for (int i = 0; i < numOfFpSets; ++i) + { + UT_PTR_SET(fp1, stub_func1); + } + } +}; + +class MaxFunctionPointerUtestShell: public UtestShell +{ +public: + int numOfFpSets; + MaxFunctionPointerUtestShell(int num) : + numOfFpSets(num) + { + } + + virtual Utest* createTest() + { + return new MaxFunctionPointerUtest(numOfFpSets); + } +}; + +TEST(SetPointerPluginTest, installTooMuchFunctionPointer) +{ + MaxFunctionPointerUtestShell *tst = new MaxFunctionPointerUtestShell(SetPointerPlugin::MAX_SET + 1); + myRegistry_->addTest(tst); + + myRegistry_->runAllTests(*result_); + + LONGS_EQUAL(1, result_->getFailureCount()); + delete tst; +} + +static double orig_double = 3.0; +static double* orig_double_ptr = &orig_double; +static double stub_double = 4.0; + +class SetDoublePointerUtest : public Utest +{ +public: + void setup() + { + UT_PTR_SET(orig_double_ptr, &stub_double); + } + void testBody() + { + CHECK(orig_double_ptr == &stub_double); + } +}; + +class SetDoublePointerUtestShell: public UtestShell +{ +public: + Utest * createTest() + { + return new SetDoublePointerUtest(); + } +}; + +TEST(SetPointerPluginTest, doublePointer) +{ + SetDoublePointerUtestShell *doubletst = new SetDoublePointerUtestShell(); + myRegistry_->addTest(doubletst); + myRegistry_->runAllTests(*result_); + + CHECK(orig_double_ptr == &orig_double); + LONGS_EQUAL(1, result_->getCheckCount()); + delete doubletst; +} diff -Nru cpputest-3.8/tests/CppUTest/SimpleMutexTest.cpp cpputest-4.0/tests/CppUTest/SimpleMutexTest.cpp --- cpputest-3.8/tests/CppUTest/SimpleMutexTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/SimpleMutexTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2014, Michael Feathers, James Grenning, Bas Vodde and Chen YewMing + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/SimpleMutex.h" +#include "CppUTest/PlatformSpecificFunctions.h" + +static int mutexCreateCount = 0; +static int mutexLockCount = 0; +static int mutexUnlockCount = 0; +static int mutexDestroyCount = 0; + +static PlatformSpecificMutex StubMutexCreate(void) +{ + mutexCreateCount++; + return NULLPTR; +} + +static void StubMutexLock(PlatformSpecificMutex) +{ + mutexLockCount++; +} + +static void StubMutexUnlock(PlatformSpecificMutex) +{ + mutexUnlockCount++; +} + +static void StubMutexDestroy(PlatformSpecificMutex) +{ + mutexDestroyCount++; +} + + + +TEST_GROUP(SimpleMutexTest) +{ + void setup() + { + UT_PTR_SET(PlatformSpecificMutexCreate, StubMutexCreate); + UT_PTR_SET(PlatformSpecificMutexLock, StubMutexLock); + UT_PTR_SET(PlatformSpecificMutexUnlock, StubMutexUnlock); + UT_PTR_SET(PlatformSpecificMutexDestroy, StubMutexDestroy); + + mutexCreateCount = 0; + mutexDestroyCount = 0; + mutexLockCount = 0; + mutexUnlockCount = 0; + } + + void teardown() + { + } +}; + +TEST(SimpleMutexTest, CreateAndDestroy) +{ + { + SimpleMutex mtx; + } + + CHECK_EQUAL(1, mutexCreateCount); + CHECK_EQUAL(1, mutexDestroyCount); + CHECK_EQUAL(0, mutexLockCount); + CHECK_EQUAL(0, mutexUnlockCount); +} + +TEST(SimpleMutexTest, LockUnlockTest) +{ + { + SimpleMutex mtx; + mtx.Lock(); + mtx.Unlock(); + } + + CHECK_EQUAL(1, mutexCreateCount); + CHECK_EQUAL(1, mutexLockCount); + CHECK_EQUAL(1, mutexUnlockCount); + CHECK_EQUAL(1, mutexDestroyCount); +} diff -Nru cpputest-3.8/tests/CppUTest/SimpleStringCacheTest.cpp cpputest-4.0/tests/CppUTest/SimpleStringCacheTest.cpp --- cpputest-3.8/tests/CppUTest/SimpleStringCacheTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/SimpleStringCacheTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,390 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/SimpleStringInternalCache.h" +#include "CppUTest/TestTestingFixture.h" + +class TestFunctionWithCache : public ExecFunction +{ +public: + void (*testFunction)(SimpleStringInternalCache*, size_t); + SimpleStringInternalCache* parameter; + size_t allocationSize; + + void exec() _override + { + testFunction(parameter, allocationSize); + } +}; + +TEST_GROUP(SimpleStringInternalCache) +{ + SimpleStringInternalCache cache; + MemoryAccountant accountant; + MemoryLeakAllocator* defaultAllocator; + AccountingTestMemoryAllocator* allocator; + + TestFunctionWithCache testFunction; + TestTestingFixture fixture; + + void setup() + { + fixture.setTestFunction(&testFunction); + testFunction.parameter = &cache; + + defaultAllocator = new MemoryLeakAllocator(defaultMallocAllocator()); + allocator = new AccountingTestMemoryAllocator(accountant, defaultAllocator); + cache.setAllocator(defaultAllocator); + } + + void teardown() + { + cache.clearAllIncludingCurrentlyUsedMemory(); + accountant.clear(); + delete allocator; + delete defaultAllocator; + } + + void createCacheForSize(size_t size, size_t amount) + { + for (size_t i = 0; i < amount; i++) { + char* memory = cache.alloc(size); + cache.dealloc(memory, size); + } + } +}; + +TEST(SimpleStringInternalCache, cacheHitWithOneEntry) +{ + createCacheForSize(10, 1); + cache.setAllocator(allocator); + + char* mem = cache.alloc(10); + mem[0] = 'B'; + mem[3] = 'A'; + mem[9] = 'S'; + + cache.setAllocator(allocator->originalAllocator()); + + LONGS_EQUAL(0, accountant.totalAllocationsOfSize(10)); + CHECK(!cache.hasFreeBlocksOfSize(10)); + + cache.setAllocator(allocator); +} + +TEST(SimpleStringInternalCache, cacheHitWithTwoEntries) +{ + createCacheForSize(10, 2); + cache.setAllocator(allocator); + + cache.alloc(10); + cache.alloc(10); + + cache.setAllocator(allocator->originalAllocator()); + + LONGS_EQUAL(0, accountant.totalAllocationsOfSize(10)); + CHECK(!cache.hasFreeBlocksOfSize(10)); + + cache.setAllocator(allocator); +} + +TEST(SimpleStringInternalCache, allocatingMoreThanCacheAvailable) +{ + createCacheForSize(10, 1); + cache.setAllocator(allocator); + + cache.alloc(10); + cache.alloc(10); + + cache.setAllocator(allocator->originalAllocator()); + + LONGS_EQUAL(1, accountant.totalAllocationsOfSize(32)); + CHECK(!cache.hasFreeBlocksOfSize(10)); + + cache.setAllocator(allocator); +} + + +TEST(SimpleStringInternalCache, allocationWillReuseTheAllocatedBlocks) +{ + cache.setAllocator(allocator); + + char* mem = cache.alloc(10); + cache.dealloc(mem, 10); + mem = cache.alloc(10); + cache.dealloc(mem, 10); + + LONGS_EQUAL(1, accountant.totalAllocationsOfSize(32)); +} + + +TEST(SimpleStringInternalCache, multipleDifferentSizeAllocationsAndDeallocations) +{ + cache.setAllocator(allocator); + + char* mem10 = cache.alloc(10); + char* mem11 = cache.alloc(11); + + char* mem100 = cache.alloc(100); + cache.dealloc(mem100, 100); + + char* mem101 = cache.alloc(101); + char* mem102 = cache.alloc(102); + char* mem103 = cache.alloc(103); + cache.dealloc(mem101, 102); + cache.dealloc(mem102, 103); + cache.dealloc(mem103, 104); + + cache.alloc(105); + cache.alloc(106); + cache.alloc(107); + + cache.dealloc(mem10, 10); + cache.dealloc(mem11, 11); + + LONGS_EQUAL(2, accountant.totalAllocationsOfSize(32)); + LONGS_EQUAL(3, accountant.totalAllocationsOfSize(128)); +} + +TEST(SimpleStringInternalCache, deallocOfCachedMemoryWillNotDealloc) +{ + cache.setAllocator(allocator); + + char* mem = cache.alloc(10); + cache.dealloc(mem, 10); + + LONGS_EQUAL(0, accountant.totalDeallocationsOfSize(32)); +} + +TEST(SimpleStringInternalCache, clearCacheWillRemoveAllCachedMemoryButNotAllUsedMemory) +{ + cache.setAllocator(allocator); + + char* mem = cache.alloc(10); + cache.dealloc(mem, 10); + + mem = cache.alloc(60); + + cache.clearCache(); + + LONGS_EQUAL(1, accountant.totalDeallocationsOfSize(32)); + LONGS_EQUAL(0, accountant.totalDeallocationsOfSize(64)); +} + +TEST(SimpleStringInternalCache, clearAllIncludingCurrentlyUsedMemory) +{ + cache.setAllocator(allocator); + + cache.alloc(60); + + cache.clearAllIncludingCurrentlyUsedMemory(); + + LONGS_EQUAL(1, accountant.totalDeallocationsOfSize(64)); +} + + + +TEST(SimpleStringInternalCache, allocatingLargerStringThanCached) +{ + cache.setAllocator(allocator); + + char* mem = cache.alloc(1234); + cache.dealloc(mem, 1234); + + LONGS_EQUAL(1, accountant.totalAllocationsOfSize(1234)); + LONGS_EQUAL(1, accountant.totalDeallocationsOfSize(1234)); +} + +TEST(SimpleStringInternalCache, allocatingMultipleLargerStringThanCached) +{ + cache.setAllocator(allocator); + + char* mem = cache.alloc(1234); + char* mem2 = cache.alloc(1234); + char* mem3 = cache.alloc(1234); + + cache.dealloc(mem2, 1234); + cache.dealloc(mem, 1234); + cache.dealloc(mem3, 1234); + + LONGS_EQUAL(3, accountant.totalAllocationsOfSize(1234)); + LONGS_EQUAL(3, accountant.totalDeallocationsOfSize(1234)); +} + + +TEST(SimpleStringInternalCache, clearAllIncludingCurrentlyUsedMemoryAlsoReleasesLargeNonCachesMemory) +{ + cache.setAllocator(allocator); + + cache.alloc(1234); + cache.alloc(1234); + cache.alloc(1234); + + cache.clearAllIncludingCurrentlyUsedMemory(); + + LONGS_EQUAL(3, accountant.totalAllocationsOfSize(1234)); + LONGS_EQUAL(3, accountant.totalDeallocationsOfSize(1234)); +} + +static void _deallocatingStringMemoryThatWasntAllocatedWithCache(SimpleStringInternalCache* cache, size_t allocationSize) +{ + char* mem = defaultMallocAllocator()->alloc_memory(allocationSize, __FILE__, __LINE__); + mem[0] = 'B'; + mem[1] = 'a'; + mem[2] = 's'; + mem[3] = '\0'; + cache->dealloc(mem, allocationSize); + defaultMallocAllocator()->free_memory(mem, allocationSize, __FILE__, __LINE__); +} + +TEST(SimpleStringInternalCache, deallocatingMemoryThatWasntAllocatedWhileCacheWasInPlaceProducesWarning) +{ + testFunction.testFunction = _deallocatingStringMemoryThatWasntAllocatedWithCache; + testFunction.allocationSize = 123; + + cache.setAllocator(allocator); + fixture.runAllTests(); + + fixture.assertPrintContains("\nWARNING: Attempting to deallocate a String buffer that was allocated while not caching. Ignoring it!\n" + "This is likely due statics and will cause problems.\n" + "Only warning once to avoid recursive warnings.\n" + "String we are deallocating: \"Bas\"\n"); + +} + +static void _deallocatingStringMemoryTwiceThatWasntAllocatedWithCache(SimpleStringInternalCache* cache, size_t allocationSize) +{ + char* mem = defaultMallocAllocator()->alloc_memory(allocationSize, __FILE__, __LINE__); + mem[0] = '\0'; + cache->dealloc(mem, allocationSize); + cache->dealloc(mem, allocationSize); + defaultMallocAllocator()->free_memory(mem, allocationSize, __FILE__, __LINE__); +} + +TEST(SimpleStringInternalCache, deallocatingMemoryThatWasntAllocatedWhileCacheWasInPlaceProducesWarningButOnlyOnce) +{ + testFunction.testFunction = _deallocatingStringMemoryTwiceThatWasntAllocatedWithCache; + testFunction.allocationSize = 123; + + cache.setAllocator(allocator); + fixture.runAllTests(); + + LONGS_EQUAL(1, fixture.getOutput().count("WARNING")); +} + +TEST(SimpleStringInternalCache, deallocatingLargeMemoryThatWasntAllocatedWhileCacheWasInPlaceProducesWarning) +{ + testFunction.testFunction = _deallocatingStringMemoryThatWasntAllocatedWithCache; + testFunction.allocationSize = 12345; + + cache.setAllocator(allocator); + fixture.runAllTests(); + + fixture.assertPrintContains("\nWARNING: Attempting to deallocate a String buffer that was allocated while not caching. Ignoring it!\n" + "This is likely due statics and will cause problems.\n" + "Only warning once to avoid recursive warnings.\n" + "String we are deallocating: \"Bas\"\n"); + +} + +TEST(SimpleStringInternalCache, deallocatingLargeMemoryThatWasntAllocatedWhileCacheWasInPlaceProducesWarningButOnlyOnce) +{ + testFunction.testFunction = _deallocatingStringMemoryTwiceThatWasntAllocatedWithCache; + testFunction.allocationSize = 12345; + + cache.setAllocator(allocator); + fixture.runAllTests(); + + LONGS_EQUAL(1, fixture.getOutput().count("WARNING")); +} + +TEST_GROUP(SimpleStringCacheAllocator) +{ + SimpleStringCacheAllocator* allocator; + SimpleStringInternalCache cache; + MemoryAccountant accountant; + AccountingTestMemoryAllocator* accountingAllocator; + + void setup() + { + accountingAllocator = new AccountingTestMemoryAllocator(accountant, defaultMallocAllocator()); + allocator = new SimpleStringCacheAllocator(cache, accountingAllocator); + } + + void teardown() + { + cache.clearCache(); + delete allocator; + delete accountingAllocator; + } +}; + +TEST(SimpleStringCacheAllocator, allocationIsCached) +{ + char* mem = allocator->alloc_memory(10, __FILE__, __LINE__); + allocator->free_memory(mem, 10, __FILE__, __LINE__); + + size_t totalAllocations = accountant.totalAllocations(); + size_t totalDeallocations = accountant.totalDeallocations(); + + mem = allocator->alloc_memory(10, __FILE__, __LINE__); + allocator->free_memory(mem, 10, __FILE__, __LINE__); + + LONGS_EQUAL(totalAllocations, accountant.totalAllocations()); + LONGS_EQUAL(totalDeallocations, accountant.totalDeallocations()); +} + +TEST(SimpleStringCacheAllocator, originalAllocator) +{ + POINTERS_EQUAL(defaultMallocAllocator(), allocator->actualAllocator()); + STRCMP_EQUAL(defaultMallocAllocator()->alloc_name(), allocator->alloc_name()); + STRCMP_EQUAL(defaultMallocAllocator()->free_name(), allocator->free_name()); +} + +TEST(SimpleStringCacheAllocator, name) +{ + STRCMP_EQUAL("SimpleStringCacheAllocator", allocator->name()); +} + + + +TEST_GROUP(GlobalSimpleStringCache) +{ +}; + +TEST(GlobalSimpleStringCache, installsAndRemovedCache) +{ + TestMemoryAllocator* originalStringAllocator = SimpleString::getStringAllocator(); + { + GlobalSimpleStringCache cache; + STRCMP_EQUAL("SimpleStringCacheAllocator", SimpleString::getStringAllocator()->name()); + POINTERS_EQUAL(cache.getAllocator(), SimpleString::getStringAllocator()); + } + POINTERS_EQUAL(originalStringAllocator, SimpleString::getStringAllocator()); +} + diff -Nru cpputest-3.8/tests/CppUTest/SimpleStringTest.cpp cpputest-4.0/tests/CppUTest/SimpleStringTest.cpp --- cpputest-3.8/tests/CppUTest/SimpleStringTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/SimpleStringTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,1265 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/SimpleString.h" +#include "CppUTest/PlatformSpecificFunctions.h" +#include "CppUTest/TestMemoryAllocator.h" +#include "CppUTest/MemoryLeakDetector.h" +#include "CppUTest/TestTestingFixture.h" + +class JustUseNewStringAllocator : public TestMemoryAllocator +{ +public: + virtual ~JustUseNewStringAllocator() _destructor_override {} + + char* alloc_memory(size_t size, const char* file, size_t line) _override + { + return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewArrayAllocator(), size, file, line); + } + void free_memory(char* str, size_t, const char* file, size_t line) _override + { + MemoryLeakWarningPlugin::getGlobalDetector()->deallocMemory(getCurrentNewArrayAllocator(), str, file, line); + } +}; + +class GlobalSimpleStringMemoryAccountantExecFunction + : public ExecFunction +{ +public: + void (*testFunction_)(GlobalSimpleStringMemoryAccountant*); + GlobalSimpleStringMemoryAccountant* parameter_; + + virtual void exec() _override + { + testFunction_(parameter_); + } +}; + +TEST_GROUP(GlobalSimpleStringMemoryAccountant) +{ + GlobalSimpleStringAllocatorStash stash; + GlobalSimpleStringMemoryAccountantExecFunction testFunction; + TestTestingFixture fixture; + GlobalSimpleStringMemoryAccountant accountant; + + void setup() + { + stash.save(); + testFunction.parameter_ = &accountant; + fixture.setTestFunction(&testFunction); + } + + void teardown() + { + stash.restore(); + } +}; + +TEST(GlobalSimpleStringMemoryAccountant, start) +{ + accountant.start(); + POINTERS_EQUAL(accountant.getAllocator(), SimpleString::getStringAllocator()); +} + +TEST(GlobalSimpleStringMemoryAccountant, startTwiceDoesNothing) +{ + accountant.start(); + TestMemoryAllocator* memoryAccountantAllocator = SimpleString::getStringAllocator(); + accountant.start(); + + POINTERS_EQUAL(memoryAccountantAllocator, SimpleString::getStringAllocator()); + + accountant.stop(); +} + +TEST(GlobalSimpleStringMemoryAccountant, stop) +{ + TestMemoryAllocator* originalAllocator = SimpleString::getStringAllocator(); + accountant.start(); + accountant.stop(); + POINTERS_EQUAL(originalAllocator, SimpleString::getStringAllocator()); +} + +static void _stopAccountant(GlobalSimpleStringMemoryAccountant* accountant) +{ + accountant->stop(); +} + +TEST(GlobalSimpleStringMemoryAccountant, stopWithoutStartWillFail) +{ + testFunction.testFunction_ = _stopAccountant; + fixture.runAllTests(); + fixture.assertPrintContains("Global SimpleString allocator stopped without starting"); +} + +static void _changeAllocatorBetweenStartAndStop(GlobalSimpleStringMemoryAccountant* accountant) +{ + TestMemoryAllocator* originalAllocator = SimpleString::getStringAllocator(); + accountant->start(); + SimpleString::setStringAllocator(originalAllocator); + accountant->stop(); +} + +TEST(GlobalSimpleStringMemoryAccountant, stopFailsWhenAllocatorWasChangedInBetween) +{ + testFunction.testFunction_ = _changeAllocatorBetweenStartAndStop; + fixture.runAllTests(); + fixture.assertPrintContains("GlobalStrimpleStringMemoryAccountant: allocator has changed between start and stop!"); +} + +TEST(GlobalSimpleStringMemoryAccountant, report) +{ + SimpleString str; + accountant.start(); + str += "More"; + accountant.stop(); + STRCMP_CONTAINS(" 1 0 1", accountant.report().asCharString()); +} + +TEST(GlobalSimpleStringMemoryAccountant, reportUseCaches) +{ + size_t caches[] = {32}; + accountant.useCacheSizes(caches, 1); + SimpleString str; + accountant.start(); + str += "More"; + accountant.stop(); + STRCMP_CONTAINS("32 1 1 1", accountant.report().asCharString()); +} + + +TEST_GROUP(SimpleString) +{ + JustUseNewStringAllocator justNewForSimpleStringTestAllocator; + GlobalSimpleStringAllocatorStash stash; + void setup() + { + stash.save(); + SimpleString::setStringAllocator(&justNewForSimpleStringTestAllocator); + } + void teardown() + { + stash.restore(); + } +}; + +TEST(SimpleString, defaultAllocatorIsNewArrayAllocator) +{ + SimpleString::setStringAllocator(NULLPTR); + POINTERS_EQUAL(defaultNewArrayAllocator(), SimpleString::getStringAllocator()); +} + +class MyOwnStringAllocator : public TestMemoryAllocator +{ +public: + MyOwnStringAllocator() : memoryWasAllocated(false) {} + virtual ~MyOwnStringAllocator() _destructor_override {} + + bool memoryWasAllocated; + char* alloc_memory(size_t size, const char* file, size_t line) _override + { + memoryWasAllocated = true; + return TestMemoryAllocator::alloc_memory(size, file, line); + } +}; + +TEST(SimpleString, allocatorForSimpleStringCanBeReplaced) +{ + MyOwnStringAllocator myOwnAllocator; + SimpleString::setStringAllocator(&myOwnAllocator); + SimpleString simpleString; + CHECK(myOwnAllocator.memoryWasAllocated); + SimpleString::setStringAllocator(NULLPTR); +} + +TEST(SimpleString, CreateSequence) +{ + SimpleString expected("hellohello"); + SimpleString actual("hello", 2); + + CHECK_EQUAL(expected, actual); +} + +TEST(SimpleString, CreateSequenceOfZero) +{ + SimpleString expected(""); + SimpleString actual("hello", 0); + + CHECK_EQUAL(expected, actual); +} + +TEST(SimpleString, Copy) +{ + SimpleString s1("hello"); + SimpleString s2(s1); + + CHECK_EQUAL(s1, s2); +} + +TEST(SimpleString, Assignment) +{ + SimpleString s1("hello"); + SimpleString s2("goodbye"); + + s2 = s1; + + CHECK_EQUAL(s1, s2); +} + +TEST(SimpleString, Equality) +{ + SimpleString s1("hello"); + SimpleString s2("hello"); + + CHECK(s1 == s2); +} + +TEST(SimpleString, InEquality) +{ + SimpleString s1("hello"); + SimpleString s2("goodbye"); + + CHECK(s1 != s2); +} + +TEST(SimpleString, CompareNoCaseWithoutCase) +{ + SimpleString s1("hello"); + SimpleString s2("hello"); + + CHECK(s1.equalsNoCase(s2)); +} + +TEST(SimpleString, CompareNoCaseWithCase) +{ + SimpleString s1("hello"); + SimpleString s2("HELLO"); + + CHECK(s1.equalsNoCase(s2)); +} + +TEST(SimpleString, CompareNoCaseWithCaseNotEqual) +{ + SimpleString s1("hello"); + SimpleString s2("WORLD"); + + CHECK(!s1.equalsNoCase(s2)); +} + + +TEST(SimpleString, asCharString) +{ + SimpleString s1("hello"); + + STRCMP_EQUAL("hello", s1.asCharString()); +} + +TEST(SimpleString, Size) +{ + SimpleString s1("hello!"); + + LONGS_EQUAL(6, s1.size()); +} + +TEST(SimpleString, lowerCase) +{ + SimpleString s1("AbCdEfG1234"); + SimpleString s2(s1.lowerCase()); + STRCMP_EQUAL("abcdefg1234", s2.asCharString()); + STRCMP_EQUAL("AbCdEfG1234", s1.asCharString()); +} + +TEST(SimpleString, Addition) +{ + SimpleString s1("hello!"); + SimpleString s2("goodbye!"); + SimpleString s3("hello!goodbye!"); + SimpleString s4; + s4 = s1 + s2; + + CHECK_EQUAL(s3, s4); +} + +TEST(SimpleString, Concatenation) +{ + SimpleString s1("hello!"); + SimpleString s2("goodbye!"); + SimpleString s3("hello!goodbye!"); + SimpleString s4; + s4 += s1; + s4 += s2; + + CHECK_EQUAL(s3, s4); + + SimpleString s5("hello!goodbye!hello!goodbye!"); + s4 += s4; + + CHECK_EQUAL(s5, s4); +} + +TEST(SimpleString, Contains) +{ + SimpleString s("hello!"); + SimpleString empty(""); + SimpleString beginning("hello"); + SimpleString end("lo!"); + SimpleString mid("l"); + SimpleString notPartOfString("xxxx"); + + CHECK(s.contains(empty)); + CHECK(s.contains(beginning)); + CHECK(s.contains(end)); + CHECK(s.contains(mid)); + CHECK(!s.contains(notPartOfString)); + + CHECK(empty.contains(empty)); + CHECK(!empty.contains(s)); +} + +TEST(SimpleString, startsWith) +{ + SimpleString hi("Hi you!"); + SimpleString part("Hi"); + SimpleString diff("Hrrm Hi you! ffdsfd"); + CHECK(hi.startsWith(part)); + CHECK(!part.startsWith(hi)); + CHECK(!diff.startsWith(hi)); +} + +TEST(SimpleString, split) +{ + SimpleString hi("hello\nworld\nhow\ndo\nyou\ndo\n\n"); + + SimpleStringCollection collection; + hi.split("\n", collection); + + LONGS_EQUAL(7, collection.size()); + STRCMP_EQUAL("hello\n", collection[0].asCharString()); + STRCMP_EQUAL("world\n", collection[1].asCharString()); + STRCMP_EQUAL("how\n", collection[2].asCharString()); + STRCMP_EQUAL("do\n", collection[3].asCharString()); + STRCMP_EQUAL("you\n", collection[4].asCharString()); + STRCMP_EQUAL("do\n", collection[5].asCharString()); + STRCMP_EQUAL("\n", collection[6].asCharString()); +} + +TEST(SimpleString, splitNoTokenOnTheEnd) +{ + SimpleString string("Bah Yah oops"); + SimpleStringCollection collection; + + string.split(" ", collection); + LONGS_EQUAL(3, collection.size()); + STRCMP_EQUAL("Bah ", collection[0].asCharString()); + STRCMP_EQUAL("Yah ", collection[1].asCharString()); + STRCMP_EQUAL("oops", collection[2].asCharString()); +} + +TEST(SimpleString, count) +{ + SimpleString str("ha ha ha ha"); + LONGS_EQUAL(4, str.count("ha")); +} + +TEST(SimpleString, countTogether) +{ + SimpleString str("hahahaha"); + LONGS_EQUAL(4, str.count("ha")); +} + +TEST(SimpleString, countEmptyString) +{ + SimpleString str("hahahaha"); + LONGS_EQUAL(8, str.count("")); +} + +TEST(SimpleString, countEmptyStringInEmptyString) +{ + SimpleString str; + LONGS_EQUAL(0, str.count("")); +} + +TEST(SimpleString, endsWith) +{ + SimpleString str("Hello World"); + CHECK(str.endsWith("World")); + CHECK(!str.endsWith("Worl")); + CHECK(!str.endsWith("Hello")); + SimpleString str2("ah"); + CHECK(str2.endsWith("ah")); + CHECK(!str2.endsWith("baah")); + SimpleString str3(""); + CHECK(!str3.endsWith("baah")); + + SimpleString str4("ha ha ha ha"); + CHECK(str4.endsWith("ha")); +} + +TEST(SimpleString, replaceCharWithChar) +{ + SimpleString str("abcabcabca"); + str.replace('a', 'b'); + STRCMP_EQUAL("bbcbbcbbcb", str.asCharString()); +} + +TEST(SimpleString, replaceEmptyStringWithEmptyString) +{ + SimpleString str; + str.replace("", ""); + STRCMP_EQUAL("", str.asCharString()); +} + +TEST(SimpleString, replaceWholeString) +{ + SimpleString str("boo"); + str.replace("boo", ""); + STRCMP_EQUAL("", str.asCharString()); +} + +TEST(SimpleString, replaceStringWithString) +{ + SimpleString str("boo baa boo baa boo"); + str.replace("boo", "boohoo"); + STRCMP_EQUAL("boohoo baa boohoo baa boohoo", str.asCharString()); +} + +TEST(SimpleString, subStringFromEmptyString) +{ + SimpleString str(""); + STRCMP_EQUAL("", str.subString(0, 1).asCharString()); +} + +TEST(SimpleString, subStringFromSmallString) +{ + SimpleString str("H"); + STRCMP_EQUAL("H", str.subString(0, 1).asCharString()); +} + +TEST(SimpleString, subStringFromPos0) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("Hello", str.subString(0, 5).asCharString()); +} + +TEST(SimpleString, subStringFromPos1) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("ello ", str.subString(1, 5).asCharString()); +} + +TEST(SimpleString, subStringFromPos5WithAmountLargerThanString) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("World", str.subString(6, 10).asCharString()); +} + +TEST(SimpleString, subStringFromPos6ToEndOfString) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("World", str.subString(6).asCharString()); +} + +TEST(SimpleString, subStringBeginPosOutOfBounds) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("", str.subString(13, 5).asCharString()); +} + +TEST(SimpleString, subStringFromTillNormal) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("Hello", str.subStringFromTill('H', ' ').asCharString()); +} + +TEST(SimpleString, subStringFromTillOutOfBounds) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("World", str.subStringFromTill('W', '!').asCharString()); +} + +TEST(SimpleString, subStringFromTillStartDoesntExist) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("", str.subStringFromTill('!', ' ').asCharString()); +} + +TEST(SimpleString, subStringFromTillWhenTheEndAppearsBeforeTheStart) +{ + SimpleString str("Hello World"); + STRCMP_EQUAL("World", str.subStringFromTill('W', 'H').asCharString()); +} + +TEST(SimpleString, findNormal) +{ + SimpleString str("Hello World"); + LONGS_EQUAL(0, str.find('H')); + LONGS_EQUAL(1, str.find('e')); + LONGS_EQUAL(SimpleString::npos, str.find('!')); +} + +TEST(SimpleString, at) +{ + SimpleString str("Hello World"); + BYTES_EQUAL('H', str.at(0)); +} + +TEST(SimpleString, copyInBufferNormal) +{ + SimpleString str("Hello World"); + size_t bufferSize = str.size()+1; + char* buffer = (char*) PlatformSpecificMalloc(bufferSize); + str.copyToBuffer(buffer, bufferSize); + STRCMP_EQUAL(str.asCharString(), buffer); + PlatformSpecificFree(buffer); +} + +TEST(SimpleString, copyInBufferWithEmptyBuffer) +{ + SimpleString str("Hello World"); + char* buffer= NULLPTR; + str.copyToBuffer(buffer, 0); + POINTERS_EQUAL(NULLPTR, buffer); +} + +TEST(SimpleString, copyInBufferWithBiggerBufferThanNeeded) +{ + SimpleString str("Hello"); + size_t bufferSize = 20; + char* buffer= (char*) PlatformSpecificMalloc(bufferSize); + str.copyToBuffer(buffer, bufferSize); + STRCMP_EQUAL(str.asCharString(), buffer); + PlatformSpecificFree(buffer); +} + +TEST(SimpleString, copyInBufferWithSmallerBufferThanNeeded) +{ + SimpleString str("Hello"); + size_t bufferSize = str.size(); + char* buffer= (char*) PlatformSpecificMalloc(bufferSize); + str.copyToBuffer(buffer, bufferSize); + STRNCMP_EQUAL(str.asCharString(), buffer, (bufferSize-1)); + LONGS_EQUAL(0, buffer[bufferSize-1]); + PlatformSpecificFree(buffer); +} + +TEST(SimpleString, ContainsNull) +{ + SimpleString s(NULLPTR); + STRCMP_EQUAL("", s.asCharString()); +} + +TEST(SimpleString, NULLReportsNullString) +{ + STRCMP_EQUAL("(null)", StringFromOrNull((char*) NULLPTR).asCharString()); +} + +TEST(SimpleString, Booleans) +{ + SimpleString s1(StringFrom(true)); + SimpleString s2(StringFrom(false)); + CHECK(s1 == "true"); + CHECK(s2 == "false"); +} + +TEST(SimpleString, Pointers) +{ + SimpleString s(StringFrom((void *)0x1234)); + STRCMP_EQUAL("0x1234", s.asCharString()); +} + +TEST(SimpleString, FunctionPointers) +{ + SimpleString s(StringFrom((void (*)())0x1234)); + STRCMP_EQUAL("0x1234", s.asCharString()); +} + +TEST(SimpleString, Characters) +{ + SimpleString s(StringFrom('a')); + STRCMP_EQUAL("a", s.asCharString()); +} + +TEST(SimpleString, NegativeSignedBytes) +{ + STRCMP_EQUAL("-15", StringFrom((signed char)-15).asCharString()); +} + +TEST(SimpleString, PositiveSignedBytes) +{ + STRCMP_EQUAL("4", StringFrom(4).asCharString()); +} + +TEST(SimpleString, LongInts) +{ + SimpleString s(StringFrom((long)1)); + CHECK(s == "1"); +} + +TEST(SimpleString, UnsignedLongInts) +{ + SimpleString s(StringFrom((unsigned long)1)); + SimpleString s2(StringFrom((unsigned long)1)); + CHECK(s == s2); +} + +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(SimpleString, LongLongInts) +{ + SimpleString s(StringFrom((long long)1)); + CHECK(s == "1"); +} + +TEST(SimpleString, UnsignedLongLongInts) +{ + SimpleString s(StringFrom((unsigned long long)1)); + SimpleString s2(StringFrom((unsigned long long)1)); + CHECK(s == s2); +} + +#endif /* CPPUTEST_USE_LONG_LONG */ + +TEST(SimpleString, Doubles) +{ + SimpleString s(StringFrom(1.2)); + STRCMP_EQUAL("1.2", s.asCharString()); +} + +extern "C" { + static int alwaysTrue(double) { return true; } +} + +TEST(SimpleString, NaN) +{ + UT_PTR_SET(PlatformSpecificIsNan, alwaysTrue); + SimpleString s(StringFrom(0.0)); + STRCMP_EQUAL("Nan - Not a number", s.asCharString()); +} + +TEST(SimpleString, Inf) +{ + UT_PTR_SET(PlatformSpecificIsInf, alwaysTrue); + SimpleString s(StringFrom(0.0)); + STRCMP_EQUAL("Inf - Infinity", s.asCharString()); +} + +TEST(SimpleString, SmallDoubles) +{ + SimpleString s(StringFrom(1.2e-10)); + STRCMP_CONTAINS("1.2e", s.asCharString()); +} + +TEST(SimpleString, Sizes) +{ + size_t size = 10; + STRCMP_EQUAL("10", StringFrom((int) size).asCharString()); +} + +#if __cplusplus > 199711L && !defined __arm__ && CPPUTEST_USE_STD_CPP_LIB + +TEST(SimpleString, nullptr_type) +{ + SimpleString s(StringFrom(nullptr)); + STRCMP_EQUAL("(null)", s.asCharString()); +} + +#endif + +TEST(SimpleString, HexStrings) +{ + STRCMP_EQUAL("f3", HexStringFrom((signed char)-13).asCharString()); + + SimpleString h1 = HexStringFrom(0xffffL); + STRCMP_EQUAL("ffff", h1.asCharString()); + +#ifdef CPPUTEST_USE_LONG_LONG + SimpleString h15 = HexStringFrom(0xffffLL); + STRCMP_EQUAL("ffff", h15.asCharString()); +#endif + + SimpleString h2 = HexStringFrom((void *)0xfffeL); + STRCMP_EQUAL("fffe", h2.asCharString()); + + SimpleString h3 = HexStringFrom((void (*)())0xfffdL); + STRCMP_EQUAL("fffd", h3.asCharString()); +} + +TEST(SimpleString, StringFromFormat) +{ + SimpleString h1 = StringFromFormat("%s %s! %d", "Hello", "World", 2009); + STRCMP_EQUAL("Hello World! 2009", h1.asCharString()); +} + +TEST(SimpleString, StringFromFormatpointer) +{ + //this is not a great test. but %p is odd on mingw and even more odd on Solaris. + SimpleString h1 = StringFromFormat("%p", (void*) 1); + if (h1.size() == 3) + STRCMP_EQUAL("0x1", h1.asCharString()); + else if (h1.size() == 8) + STRCMP_EQUAL("00000001", h1.asCharString()); + else if (h1.size() == 9) + STRCMP_EQUAL("0000:0001", h1.asCharString()); + else if (h1.size() == 16) + STRCMP_EQUAL("0000000000000001", h1.asCharString()); + else if (h1.size() == 1) + STRCMP_EQUAL("1", h1.asCharString()); + else + FAIL("Off %p behavior"); +} + +TEST(SimpleString, StringFromFormatLarge) +{ + const char* s = "ThisIsAPrettyLargeStringAndIfWeAddThisManyTimesToABufferItWillbeFull"; + SimpleString h1 = StringFromFormat("%s%s%s%s%s%s%s%s%s%s", s, s, s, s, s, s, s, s, s, s); + LONGS_EQUAL(10, h1.count(s)); +} + +TEST(SimpleString, StringFromConstSimpleString) +{ + STRCMP_EQUAL("bla", StringFrom(SimpleString("bla")).asCharString()); +} + +static int WrappedUpVSNPrintf(char* buf, size_t n, const char* format, ...) +{ + va_list arguments; + va_start(arguments, format); + + int result = PlatformSpecificVSNprintf(buf, n, format, arguments); + va_end(arguments); + return result; +} + +TEST(SimpleString, PlatformSpecificSprintf_fits) +{ + char buf[10]; + + int count = WrappedUpVSNPrintf(buf, sizeof(buf), "%s", "12345"); + STRCMP_EQUAL("12345", buf); + LONGS_EQUAL(5, count); +} + +TEST(SimpleString, PlatformSpecificSprintf_doesNotFit) +{ + char buf[10]; + + int count = WrappedUpVSNPrintf(buf, sizeof(buf), "%s", "12345678901"); + STRCMP_EQUAL("123456789", buf); + LONGS_EQUAL(11, count); +} + +TEST(SimpleString, PadStringsToSameLengthString1Larger) +{ + SimpleString str1("1"); + SimpleString str2("222"); + + SimpleString::padStringsToSameLength(str1, str2, '4'); + STRCMP_EQUAL("441", str1.asCharString()); + STRCMP_EQUAL("222", str2.asCharString()); +} + +TEST(SimpleString, PadStringsToSameLengthString2Larger) +{ + SimpleString str1(" "); + SimpleString str2(""); + + SimpleString::padStringsToSameLength(str1, str2, ' '); + STRCMP_EQUAL(" ", str1.asCharString()); + STRCMP_EQUAL(" ", str2.asCharString()); +} + +TEST(SimpleString, PadStringsToSameLengthWithSameLengthStrings) +{ + SimpleString str1("123"); + SimpleString str2("123"); + + SimpleString::padStringsToSameLength(str1, str2, ' '); + STRCMP_EQUAL("123", str1.asCharString()); + STRCMP_EQUAL("123", str2.asCharString()); +} + +TEST(SimpleString, NullParameters2) +{ + SimpleString* arr = new SimpleString[100]; + delete[] arr; +} + +TEST(SimpleString, CollectionMultipleAllocateNoLeaksMemory) +{ + SimpleStringCollection col; + col.allocate(5); + col.allocate(5); + // CHECK no memory leak +} + +TEST(SimpleString, CollectionReadOutOfBoundsReturnsEmptyString) +{ + SimpleStringCollection col; + col.allocate(3); + STRCMP_EQUAL("", col[3].asCharString()); +} + +TEST(SimpleString, CollectionWritingToEmptyString) +{ + SimpleStringCollection col; + col.allocate(3); + col[3] = SimpleString("HAH"); + STRCMP_EQUAL("", col[3].asCharString()); +} + +#ifdef CPPUTEST_64BIT + +TEST(SimpleString, _64BitAddressPrintsCorrectly) +{ + char* p = (char*) 0x0012345678901234; + SimpleString expected("0x12345678901234"); + SimpleString actual = StringFrom((void*)p); + STRCMP_EQUAL(expected.asCharString(), actual.asCharString()); +} + +#ifndef CPPUTEST_64BIT_32BIT_LONGS + +TEST(SimpleString, BracketsFormattedHexStringFromForLongOnDifferentPlatform) +{ + long value = -1; + + STRCMP_EQUAL("(0xffffffffffffffff)", BracketsFormattedHexStringFrom(value).asCharString()); +} + +#else + +TEST(SimpleString, BracketsFormattedHexStringFromForLongOnDifferentPlatform) +{ + long value = -1; + + STRCMP_EQUAL("(0xffffffff)", BracketsFormattedHexStringFrom(value).asCharString()); +} + +#endif +#else +/* + * This test case cannot pass on 32 bit systems. + */ +IGNORE_TEST(SimpleString, _64BitAddressPrintsCorrectly) +{ +} + +TEST(SimpleString, BracketsFormattedHexStringFromForLongOnDifferentPlatform) +{ + long value = -1; + + STRCMP_EQUAL("(0xffffffff)", BracketsFormattedHexStringFrom(value).asCharString()); +} +#endif + +TEST(SimpleString, BuildStringFromUnsignedLongInteger) +{ + unsigned long int i = 0xffffffff; + + SimpleString result = StringFrom(i); + const char* expected_string = "4294967295"; + CHECK_EQUAL(expected_string, result); +} + +TEST(SimpleString, BuildStringFromUnsignedInteger) +{ + unsigned int i = 0xff; + + SimpleString result = StringFrom(i); + const char* expected_string = "255"; + CHECK_EQUAL(expected_string, result); +} + +#if CPPUTEST_USE_STD_CPP_LIB + +TEST(SimpleString, fromStdString) +{ + std::string s("hello"); + SimpleString s1(StringFrom(s)); + + STRCMP_EQUAL("hello", s1.asCharString()); +} + +TEST(SimpleString, CHECK_EQUAL_unsigned_long) +{ + unsigned long i = 0xffffffffUL; + CHECK_EQUAL(i, i); +} + +TEST(SimpleString, unsigned_long) +{ + unsigned long i = 0xffffffffUL; + + SimpleString result = StringFrom(i); + const char* expected_string = "4294967295"; + CHECK_EQUAL(expected_string, result); +} + +#endif + +TEST(SimpleString, StrCmp) +{ + char empty[] = ""; + char blabla[] = "blabla"; + char bla[] = "bla"; + CHECK(SimpleString::StrCmp(empty, empty) == 0); + CHECK(SimpleString::StrCmp(bla, blabla) == -(int)'b'); + CHECK(SimpleString::StrCmp(blabla, bla) == 'b'); + CHECK(SimpleString::StrCmp(bla, empty) == 'b'); + CHECK(SimpleString::StrCmp(empty, bla) == -(int)'b'); + CHECK(SimpleString::StrCmp(bla, bla) == 0); +} + +TEST(SimpleString, StrNCpy_no_zero_termination) +{ + char str[] = "XXXXXXXXXX"; + STRCMP_EQUAL("womanXXXXX", SimpleString::StrNCpy(str, "woman", 5)); +} + +TEST(SimpleString, StrNCpy_zero_termination) +{ + char str[] = "XXXXXXXXXX"; + STRCMP_EQUAL("woman", SimpleString::StrNCpy(str, "woman", 6)); +} + +TEST(SimpleString, StrNCpy_null_proof) +{ + POINTERS_EQUAL(NULLPTR, SimpleString::StrNCpy(NULLPTR, "woman", 6)); +} + +TEST(SimpleString, StrNCpy_stops_at_end_of_string) +{ + char str[] = "XXXXXXXXXX"; + STRCMP_EQUAL("woman", SimpleString::StrNCpy(str, "woman", 8)); +} + +TEST(SimpleString, StrNCpy_nothing_to_do) +{ + char str[] = "XXXXXXXXXX"; + STRCMP_EQUAL("XXXXXXXXXX", SimpleString::StrNCpy(str, "woman", 0)); +} + +TEST(SimpleString, StrNCpy_write_into_the_middle) +{ + char str[] = "womanXXXXX"; + SimpleString::StrNCpy(str+3, "e", 1); + STRCMP_EQUAL("womenXXXXX", str); +} + +TEST(SimpleString, StrNCmp_equal) +{ + int result = SimpleString::StrNCmp("teststring", "tests", 5); + LONGS_EQUAL(0, result); +} + +TEST(SimpleString, StrNCmp_should_always_return_0_when_n_is_0) +{ + int result = SimpleString::StrNCmp("a", "b", 0); + LONGS_EQUAL(0, result); +} + +TEST(SimpleString, StrNCmp_s1_smaller) +{ + int result = SimpleString::StrNCmp("testing", "tests", 7); + LONGS_EQUAL('i' - 's', result); +} + +TEST(SimpleString, StrNCmp_s1_larger) +{ + int result = SimpleString::StrNCmp("teststring", "tester", 7); + LONGS_EQUAL('s' - 'e', result); +} + +TEST(SimpleString, StrNCmp_n_too_large) +{ + int result = SimpleString::StrNCmp("teststring", "teststring", 20); + LONGS_EQUAL(0, result); +} + +TEST(SimpleString, StrNCmp_s1_empty) +{ + int result = SimpleString::StrNCmp("", "foo", 2); + LONGS_EQUAL(0 - 'f', result); +} + +TEST(SimpleString, StrNCmp_s2_empty) +{ + int result = SimpleString::StrNCmp("foo", "", 2); + LONGS_EQUAL('f', result); +} + +TEST(SimpleString, StrNCmp_s1_and_s2_empty) +{ + int result = SimpleString::StrNCmp("", "", 2); + LONGS_EQUAL(0, result); +} + +TEST(SimpleString, StrStr) +{ + char foo[] = "foo"; + char empty[] = ""; + char foobarfoo[] = "foobarfoo"; + char barf[] = "barf"; + CHECK(SimpleString::StrStr(foo, empty) == foo); + CHECK(SimpleString::StrStr(empty, foo) == NULLPTR); + CHECK(SimpleString::StrStr(foobarfoo, barf) == foobarfoo+3); + CHECK(SimpleString::StrStr(barf, foobarfoo) == NULLPTR); + CHECK(SimpleString::StrStr(foo, foo) == foo); +} + +TEST(SimpleString, AtoI) +{ + char max_short_str[] = "32767"; + char min_short_str[] = "-32768"; + + CHECK(12345 == SimpleString::AtoI("012345")); + CHECK(6789 == SimpleString::AtoI("6789")); + CHECK(12345 == SimpleString::AtoI("12345/")); + CHECK(12345 == SimpleString::AtoI("12345:")); + CHECK(-12345 == SimpleString::AtoI("-12345")); + CHECK(123 == SimpleString::AtoI("\t \r\n123")); + CHECK(123 == SimpleString::AtoI("123-foo")); + CHECK(0 == SimpleString::AtoI("-foo")); + CHECK(-32768 == SimpleString::AtoI(min_short_str)); + CHECK(32767 == SimpleString::AtoI(max_short_str)); +} + +TEST(SimpleString, AtoU) +{ + char max_short_str[] = "65535"; + CHECK(12345 == SimpleString::AtoU("012345")); + CHECK(6789 == SimpleString::AtoU("6789")); + CHECK(12345 == SimpleString::AtoU("12345/")); + CHECK(12345 == SimpleString::AtoU("12345:")); + CHECK(123 == SimpleString::AtoU("\t \r\n123")); + CHECK(123 == SimpleString::AtoU("123-foo")); + CHECK(65535 == SimpleString::AtoU(max_short_str)); + CHECK(0 == SimpleString::AtoU("foo")); + CHECK(0 == SimpleString::AtoU("-foo")); + CHECK(0 == SimpleString::AtoU("+1")); + CHECK(0 == SimpleString::AtoU("-1")); + CHECK(0 == SimpleString::AtoU("0")); +} + +TEST(SimpleString, Binary) +{ + const unsigned char value[] = { 0x00, 0x01, 0x2A, 0xFF }; + const char expectedString[] = "00 01 2A FF"; + + STRCMP_EQUAL(expectedString, StringFromBinary(value, sizeof(value)).asCharString()); + STRCMP_EQUAL(expectedString, StringFromBinaryOrNull(value, sizeof(value)).asCharString()); + STRCMP_EQUAL("", StringFromBinary(value, 0).asCharString()); + STRCMP_EQUAL("(null)", StringFromBinaryOrNull(NULLPTR, 0).asCharString()); +} + +TEST(SimpleString, BinaryWithSize) +{ + const unsigned char value[] = { 0x12, 0xFE, 0xA1 }; + const char expectedString[] = "Size = 3 | HexContents = 12 FE A1"; + + STRCMP_EQUAL(expectedString, StringFromBinaryWithSize(value, sizeof(value)).asCharString()); + STRCMP_EQUAL(expectedString, StringFromBinaryWithSizeOrNull(value, sizeof(value)).asCharString()); + STRCMP_EQUAL("Size = 0 | HexContents = ", StringFromBinaryWithSize(value, 0).asCharString()); + STRCMP_EQUAL("(null)", StringFromBinaryWithSizeOrNull(NULLPTR, 0).asCharString()); +} + +TEST(SimpleString, BinaryWithSizeLargerThan128) +{ + unsigned char value[129]; + value[127] = 0x00; + value[128] = 0xff; + + STRCMP_CONTAINS("00 ...", StringFromBinaryWithSize(value, sizeof(value)).asCharString()); +} + +TEST(SimpleString, MemCmp) +{ + unsigned char smaller[] = { 0x00, 0x01, 0x2A, 0xFF }; + unsigned char greater[] = { 0x00, 0x01, 0xFF, 0xFF }; + + LONGS_EQUAL(0, SimpleString::MemCmp(smaller, smaller, sizeof(smaller))); + CHECK(SimpleString::MemCmp(smaller, greater, sizeof(smaller)) < 0); + CHECK(SimpleString::MemCmp(greater, smaller, sizeof(smaller)) > 0); + LONGS_EQUAL(0, SimpleString::MemCmp(NULLPTR, NULLPTR, 0)); +} + +TEST(SimpleString, MemCmpFirstLastNotMatching) +{ + unsigned char base[] = { 0x00, 0x01, 0x2A, 0xFF }; + unsigned char firstNotMatching[] = { 0x01, 0x01, 0x2A, 0xFF }; + unsigned char lastNotMatching[] = { 0x00, 0x01, 0x2A, 0x00 }; + CHECK(0 != SimpleString::MemCmp(base, firstNotMatching, sizeof(base))); + CHECK(0 != SimpleString::MemCmp(base, lastNotMatching, sizeof(base))); +} + +#if (CPPUTEST_CHAR_BIT == 16) +TEST(SimpleString, MaskedBitsChar) +{ + STRCMP_EQUAL("xxxxxxxx xxxxxxxx", StringFromMaskedBits(0x00, 0x00, 1).asCharString()); + STRCMP_EQUAL("xxxxxxxx 00000000", StringFromMaskedBits(0x00, 0xFF, 1).asCharString()); + STRCMP_EQUAL("xxxxxxxx 11111111", StringFromMaskedBits(0xFF, 0xFF, 1).asCharString()); + STRCMP_EQUAL("xxxxxxxx 1xxxxxxx", StringFromMaskedBits(0x80, 0x80, 1).asCharString()); + STRCMP_EQUAL("xxxxxxxx xxxxxxx1", StringFromMaskedBits(0x01, 0x01, 1).asCharString()); + STRCMP_EQUAL("xxxxxxxx 11xx11xx", StringFromMaskedBits(0xFF, 0xCC, 1).asCharString()); +} +#else +TEST(SimpleString, MaskedBitsChar) +{ + STRCMP_EQUAL("xxxxxxxx", StringFromMaskedBits(0x00, 0x00, 1).asCharString()); + STRCMP_EQUAL("00000000", StringFromMaskedBits(0x00, 0xFF, 1).asCharString()); + STRCMP_EQUAL("11111111", StringFromMaskedBits(0xFF, 0xFF, 1).asCharString()); + STRCMP_EQUAL("1xxxxxxx", StringFromMaskedBits(0x80, 0x80, 1).asCharString()); + STRCMP_EQUAL("xxxxxxx1", StringFromMaskedBits(0x01, 0x01, 1).asCharString()); + STRCMP_EQUAL("11xx11xx", StringFromMaskedBits(0xFF, 0xCC, 1).asCharString()); +} +#endif + +TEST(SimpleString, MaskedBits16Bit) +{ + STRCMP_EQUAL("xxxxxxxx xxxxxxxx", StringFromMaskedBits(0x0000, 0x0000, 2*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("00000000 00000000", StringFromMaskedBits(0x0000, 0xFFFF, 2*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("11111111 11111111", StringFromMaskedBits(0xFFFF, 0xFFFF, 2*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("1xxxxxxx xxxxxxxx", StringFromMaskedBits(0x8000, 0x8000, 2*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("xxxxxxxx xxxxxxx1", StringFromMaskedBits(0x0001, 0x0001, 2*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("11xx11xx 11xx11xx", StringFromMaskedBits(0xFFFF, 0xCCCC, 2*8/CPPUTEST_CHAR_BIT).asCharString()); +} + +TEST(SimpleString, MaskedBits32Bit) +{ + STRCMP_EQUAL("xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx", StringFromMaskedBits(0x00000000, 0x00000000, 4*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("00000000 00000000 00000000 00000000", StringFromMaskedBits(0x00000000, 0xFFFFFFFF, 4*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("11111111 11111111 11111111 11111111", StringFromMaskedBits(0xFFFFFFFF, 0xFFFFFFFF, 4*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("1xxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx", StringFromMaskedBits(0x80000000, 0x80000000, 4*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxx1", StringFromMaskedBits(0x00000001, 0x00000001, 4*8/CPPUTEST_CHAR_BIT).asCharString()); + STRCMP_EQUAL("11xx11xx 11xx11xx 11xx11xx 11xx11xx", StringFromMaskedBits(0xFFFFFFFF, 0xCCCCCCCC, 4*8/CPPUTEST_CHAR_BIT).asCharString()); +} + +TEST(SimpleString, StringFromOrdinalNumberOnes) +{ + STRCMP_EQUAL("2nd", StringFromOrdinalNumber(2).asCharString()); + STRCMP_EQUAL("3rd", StringFromOrdinalNumber(3).asCharString()); + STRCMP_EQUAL("4th", StringFromOrdinalNumber(4).asCharString()); + STRCMP_EQUAL("5th", StringFromOrdinalNumber(5).asCharString()); + STRCMP_EQUAL("6th", StringFromOrdinalNumber(6).asCharString()); + STRCMP_EQUAL("7th", StringFromOrdinalNumber(7).asCharString()); +} + +TEST(SimpleString, StringFromOrdinalNumberTens) +{ + STRCMP_EQUAL("10th", StringFromOrdinalNumber(10).asCharString()); + STRCMP_EQUAL("11th", StringFromOrdinalNumber(11).asCharString()); + STRCMP_EQUAL("12th", StringFromOrdinalNumber(12).asCharString()); + STRCMP_EQUAL("13th", StringFromOrdinalNumber(13).asCharString()); + STRCMP_EQUAL("14th", StringFromOrdinalNumber(14).asCharString()); + STRCMP_EQUAL("18th", StringFromOrdinalNumber(18).asCharString()); +} + +TEST(SimpleString, StringFromOrdinalNumberOthers) +{ + STRCMP_EQUAL("21st", StringFromOrdinalNumber(21).asCharString()); + STRCMP_EQUAL("22nd", StringFromOrdinalNumber(22).asCharString()); + STRCMP_EQUAL("23rd", StringFromOrdinalNumber(23).asCharString()); + STRCMP_EQUAL("24th", StringFromOrdinalNumber(24).asCharString()); + STRCMP_EQUAL("32nd", StringFromOrdinalNumber(32).asCharString()); + STRCMP_EQUAL("100th", StringFromOrdinalNumber(100).asCharString()); + STRCMP_EQUAL("101st", StringFromOrdinalNumber(101).asCharString()); +} + +TEST(SimpleString, BracketsFormattedHexStringFromForSignedChar) +{ + signed char value = 'c'; + + STRCMP_EQUAL("(0x63)", BracketsFormattedHexStringFrom(value).asCharString()); +} + + +TEST(SimpleString, BracketsFormattedHexStringFromForUnsignedInt) +{ + unsigned int value = 1; + + STRCMP_EQUAL("(0x1)", BracketsFormattedHexStringFrom(value).asCharString()); +} + +TEST(SimpleString, BracketsFormattedHexStringFromForUnsignedLong) +{ + unsigned long value = 1; + + STRCMP_EQUAL("(0x1)", BracketsFormattedHexStringFrom(value).asCharString()); +} + +#ifdef CPPUTEST_16BIT_INTS +TEST(SimpleString, BracketsFormattedHexStringFromForInt) +{ + int value = -1; + + STRCMP_EQUAL("(0xffff)", BracketsFormattedHexStringFrom(value).asCharString()); +} +#else +TEST(SimpleString, BracketsFormattedHexStringFromForInt) +{ + int value = -1; + STRCMP_EQUAL("(0xffffffff)", BracketsFormattedHexStringFrom(value).asCharString()); +} +#endif + +TEST(SimpleString, BracketsFormattedHexStringFromForLong) +{ + long value = 1; + + STRCMP_EQUAL("(0x1)", BracketsFormattedHexStringFrom(value).asCharString()); +} +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(SimpleString, BracketsFormattedHexStringFromForLongLong) +{ + cpputest_longlong value = 1; + + STRCMP_EQUAL("(0x1)", BracketsFormattedHexStringFrom(value).asCharString()); +} +TEST(SimpleString, BracketsFormattedHexStringFromForULongLong) +{ + cpputest_ulonglong value = 1; + + STRCMP_EQUAL("(0x1)", BracketsFormattedHexStringFrom(value).asCharString()); +} +#else +TEST(SimpleString, BracketsFormattedHexStringFromForLongLong) +{ + cpputest_longlong value = 1; + + STRCMP_EQUAL("", BracketsFormattedHexStringFrom(value).asCharString()); +} +TEST(SimpleString, BracketsFormattedHexStringFromForULongLong) +{ + cpputest_ulonglong value = 1; + + STRCMP_EQUAL("", BracketsFormattedHexStringFrom(value).asCharString()); +} + +#endif + diff -Nru cpputest-3.8/tests/CppUTest/TeamCityOutputTest.cpp cpputest-4.0/tests/CppUTest/TeamCityOutputTest.cpp --- cpputest-3.8/tests/CppUTest/TeamCityOutputTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TeamCityOutputTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,226 @@ +#include "CppUTest/TestHarness.h" +#include "CppUTest/TeamCityTestOutput.h" +#include "CppUTest/PlatformSpecificFunctions.h" + +class TeamCityOutputToBuffer : public TeamCityTestOutput +{ +public: + explicit TeamCityOutputToBuffer() + { + } + + virtual ~TeamCityOutputToBuffer() _destructor_override + { + } + + void printBuffer(const char* s) _override + { + output += s; + } + + void flush() _override + { + output = ""; + } + + const SimpleString& getOutput() + { + return output; + } + +private: + SimpleString output; +}; + +static long millisTime; + +extern "C" { + + static long MockGetPlatformSpecificTimeInMillis() + { + return millisTime; + } + +} + +TEST_GROUP(TeamCityOutputTest) +{ + TeamCityTestOutput* tcout; + TeamCityOutputToBuffer* mock; + UtestShell* tst; + TestFailure *f, *f2, *f3; + TestResult* result; + + void setup() + { + mock = new TeamCityOutputToBuffer(); + tcout = mock; + tst = new UtestShell("group", "test", "file", 10); + f = new TestFailure(tst, "failfile", 20, "failure message"); + f2 = new TestFailure(tst, "file", 20, "message"); + f3 = new TestFailure(tst, "file", 30, "apos' pipe| [brackets]\r\nCRLF"); + result = new TestResult(*mock); + result->setTotalExecutionTime(10); + millisTime = 0; + UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); + } + void teardown() + { + delete tcout; + delete tst; + delete f; + delete f2; + delete f3; + delete result; + } +}; + +TEST(TeamCityOutputTest, PrintGroupStarted) +{ + result->currentGroupStarted(tst); + STRCMP_EQUAL("##teamcity[testSuiteStarted name='group']\n", mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, PrintGroupStartedAndEnded) +{ + const char* expected = "##teamcity[testSuiteStarted name='group']\n" + "##teamcity[testSuiteFinished name='group']\n"; + result->currentGroupStarted(tst); + result->currentGroupEnded(tst); + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, PrintGroupEndedButNotStarted) +{ + result->currentGroupEnded(tst); + STRCMP_EQUAL("", mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, PrintTestStarted) +{ + tcout->printCurrentTestStarted(*tst); + STRCMP_EQUAL("##teamcity[testStarted name='test']\n", mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, PrintTestStartedAndEnded) +{ + result->currentTestStarted(tst); + millisTime = 42; + result->currentTestEnded(tst); + STRCMP_EQUAL("##teamcity[testStarted name='test']\n##teamcity[testFinished name='test' duration='42']\n", + mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, PrintTestEndedButNotStarted) +{ + result->currentTestEnded(tst); + STRCMP_EQUAL("", mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, PrintTestIgnored) +{ + const char* expected = + "##teamcity[testStarted name='test']\n" + "##teamcity[testIgnored name='test']\n" + "##teamcity[testFinished name='test' duration='41']\n"; + + IgnoredUtestShell* itst = new IgnoredUtestShell("group", "test", "file", 10); + result->currentTestStarted(itst); + millisTime = 41; + result->currentTestEnded(itst); + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); + delete itst; +} + +TEST(TeamCityOutputTest, PrintWithFailureInSameFile) +{ + tcout->printFailure(*f2); + const char* expected = + "##teamcity[testFailed name='test' message='file:20' " + "details='message']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, PrintWithEscapedCharacters) +{ + tcout->printFailure(*f3); + const char* expected = + "##teamcity[testFailed name='test' message='file:30' " + "details='apos|' pipe|| |[brackets|]" + "|r|nCRLF']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, PrintFailureWithFailInDifferentFile) +{ + tcout->printFailure(*f); + const char* expected = + "##teamcity[testFailed name='test' message='TEST failed (file:10): failfile:20' " + "details='failure message']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, TestGroupEscaped_Start) +{ + tst->setGroupName("'[]\n\r"); + result->currentGroupStarted(tst); + const char* expected = + "##teamcity[testSuiteStarted name='|'|[|]|n|r']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, TestGroupEscaped_End) +{ + tst->setGroupName("'[]\n\r"); + result->currentGroupStarted(tst); + result->currentGroupEnded(tst); + const char* expected = + "##teamcity[testSuiteStarted name='|'|[|]|n|r']\n" + "##teamcity[testSuiteFinished name='|'|[|]|n|r']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, TestNameEscaped_Start) +{ + tst->setTestName("'[]\n\r"); + result->currentTestStarted(tst); + const char* expected = + "##teamcity[testStarted name='|'|[|]|n|r']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, TestNameEscaped_End) +{ + tst->setTestName("'[]\n\r"); + result->currentTestStarted(tst); + result->currentTestEnded(tst); + const char* expected = + "##teamcity[testStarted name='|'|[|]|n|r']\n" + "##teamcity[testFinished name='|'|[|]|n|r' duration='0']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, TestNameEscaped_Ignore) +{ + IgnoredUtestShell itst("group", "'[]\n\r", "file", 10); + result->currentTestStarted(&itst); + const char* expected = + "##teamcity[testStarted name='|'|[|]|n|r']\n" + "##teamcity[testIgnored name='|'|[|]|n|r']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TeamCityOutputTest, TestNameEscaped_Fail) +{ + tst->setTestName("'[]\n\r"); + TestFailure fail(tst, "failfile", 20, "failure message"); + tcout->printFailure(fail); + const char* expected = + "##teamcity[testFailed name='|'|[|]|n|r' message='TEST failed (file:10): failfile:20' " + "details='failure message']\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +/* Todo: + * -Detect when running in TeamCity and switch output to -o teamcity automatically + */ diff -Nru cpputest-3.8/tests/CppUTest/TestFailureNaNTest.cpp cpputest-4.0/tests/CppUTest/TestFailureNaNTest.cpp --- cpputest-3.8/tests/CppUTest/TestFailureNaNTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestFailureNaNTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/PlatformSpecificFunctions.h" + +namespace +{ +const int failLineNumber = 2; +const char* failFileName = "fail.cpp"; +} + +static double zero = 0.0; +static double one = 1.0; +static double not_a_number = zero / zero; +static double infinity = one / zero; + +extern "C" { + static int IsNanForSystemsWithoutNan(double d) { return ((long)not_a_number == (long)d); } + static int IsInfForSystemsWithoutInf(double d) { return ((long)infinity == (long)d); } +} + +TEST_GROUP(TestFailureNanAndInf) +{ + UtestShell* test; + + void setup() _override + { + test = new UtestShell("groupname", "testname", failFileName, failLineNumber-1); + if(PlatformSpecificIsNan(not_a_number) == false) + { + not_a_number = -1.0; + UT_PTR_SET(PlatformSpecificIsNan, IsNanForSystemsWithoutNan); + } + if(PlatformSpecificIsInf(infinity) == false) + { + infinity = -2.0; + UT_PTR_SET(PlatformSpecificIsInf, IsInfForSystemsWithoutInf); + } + } + void teardown() _override + { + delete test; + } +}; +#define FAILURE_EQUAL(a, b) STRCMP_EQUAL_LOCATION(a, b.getMessage().asCharString(), "", __FILE__, __LINE__) + +TEST(TestFailureNanAndInf, DoublesEqualExpectedIsNaN) +{ + DoublesEqualFailure f(test, failFileName, failLineNumber, not_a_number, 2.0, 3.0, ""); + FAILURE_EQUAL("expected \n" + "\tbut was <2> threshold used was <3>\n" + "\tCannot make comparisons with Nan", f); +} + +TEST(TestFailureNanAndInf, DoublesEqualActualIsNaN) +{ + DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, not_a_number, 3.0, ""); + FAILURE_EQUAL("expected <1>\n" + "\tbut was threshold used was <3>\n" + "\tCannot make comparisons with Nan", f); +} + +TEST(TestFailureNanAndInf, DoublesEqualThresholdIsNaN) +{ + DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, 2.0, not_a_number, ""); + FAILURE_EQUAL("expected <1>\n" + "\tbut was <2> threshold used was \n" + "\tCannot make comparisons with Nan", f); +} + +TEST(TestFailureNanAndInf, DoublesEqualExpectedIsInf) +{ + DoublesEqualFailure f(test, failFileName, failLineNumber, infinity, 2.0, 3.0, ""); + FAILURE_EQUAL("expected \n" + "\tbut was <2> threshold used was <3>", f); +} + +TEST(TestFailureNanAndInf, DoublesEqualActualIsInf) +{ + DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, infinity, 3.0, ""); + FAILURE_EQUAL("expected <1>\n" + "\tbut was threshold used was <3>", f); +} + +TEST(TestFailureNanAndInf, DoublesEqualThresholdIsInf) +{ + DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, not_a_number, infinity, ""); + FAILURE_EQUAL("expected <1>\n" + "\tbut was threshold used was \n" + "\tCannot make comparisons with Nan", f); +} diff -Nru cpputest-3.8/tests/CppUTest/TestFailureTest.cpp cpputest-4.0/tests/CppUTest/TestFailureTest.cpp --- cpputest-3.8/tests/CppUTest/TestFailureTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestFailureTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,428 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestOutput.h" + +namespace +{ +const int failLineNumber = 2; +const char* failFileName = "fail.cpp"; +} + +TEST_GROUP(TestFailure) +{ + UtestShell* test; + + void setup() + { + test = new UtestShell("groupname", "testname", failFileName, failLineNumber-1); + } + void teardown() + { + delete test; + } +}; +#define FAILURE_EQUAL(a, b) STRCMP_EQUAL_LOCATION(a, b.getMessage().asCharString(), "", __FILE__, __LINE__) + +TEST(TestFailure, CreateFailure) +{ + TestFailure f1(test, failFileName, failLineNumber, "the failure message"); + TestFailure f2(test, "the failure message"); + TestFailure f3(test, failFileName, failLineNumber); +} + +TEST(TestFailure, GetTestFileAndLineFromFailure) +{ + TestFailure f1(test, failFileName, failLineNumber, "the failure message"); + STRCMP_EQUAL(failFileName, f1.getTestFileName().asCharString()); + LONGS_EQUAL(1, f1.getTestLineNumber()); +} + +TEST(TestFailure, EqualsFailureWithText) +{ + EqualsFailure f(test, failFileName, failLineNumber, "expected", "actual", "text"); + FAILURE_EQUAL("Message: text\n" + "\texpected \n\tbut was ", f); +} + +TEST(TestFailure, EqualsFailure) +{ + EqualsFailure f(test, failFileName, failLineNumber, "expected", "actual", ""); + FAILURE_EQUAL("expected \n\tbut was ", f); +} + +TEST(TestFailure, EqualsFailureWithNullAsActual) +{ + EqualsFailure f(test, failFileName, failLineNumber, "expected", NULLPTR, ""); + FAILURE_EQUAL("expected \n\tbut was <(null)>", f); +} + +TEST(TestFailure, EqualsFailureWithNullAsExpected) +{ + EqualsFailure f(test, failFileName, failLineNumber, NULLPTR, "actual", ""); + FAILURE_EQUAL("expected <(null)>\n\tbut was ", f); +} + +TEST(TestFailure, CheckEqualFailureWithText) +{ + CheckEqualFailure f(test, failFileName, failLineNumber, "expected", "actual", "text"); + FAILURE_EQUAL("Message: text\n" + "\texpected \n" + "\tbut was \n" + "\tdifference starts at position 0 at: < actual >\n" + "\t ^", f); +} + +TEST(TestFailure, CheckEqualFailure) +{ + CheckEqualFailure f(test, failFileName, failLineNumber, "expected", "actual", ""); + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 0 at: < actual >\n" + "\t ^", f); +} + +TEST(TestFailure, CheckFailure) +{ + CheckFailure f(test, failFileName, failLineNumber, "CHECK", "chk"); + FAILURE_EQUAL("CHECK(chk) failed", f); +} + +TEST(TestFailure, CheckFailureWithText) +{ + CheckFailure f(test, failFileName, failLineNumber, "CHECK", "chk", "text"); + FAILURE_EQUAL("Message: text\n" + "\tCHECK(chk) failed", f); +} + +TEST(TestFailure, FailFailure) +{ + FailFailure f(test, failFileName, failLineNumber, "chk"); + FAILURE_EQUAL("chk", f); +} + +TEST(TestFailure, LongsEqualFailureWithText) +{ + LongsEqualFailure f(test, failFileName, failLineNumber, 1, 2, "text"); + FAILURE_EQUAL("Message: text\n" + "\texpected <1 (0x1)>\n\tbut was <2 (0x2)>", f); +} + +TEST(TestFailure, LongsEqualFailure) +{ + LongsEqualFailure f(test, failFileName, failLineNumber, 1, 2, ""); + FAILURE_EQUAL("expected <1 (0x1)>\n\tbut was <2 (0x2)>", f); +} + +TEST(TestFailure, LongLongsEqualFailure) +{ +#ifdef CPPUTEST_USE_LONG_LONG + LongLongsEqualFailure f(test, failFileName, failLineNumber, 1, 2, ""); + FAILURE_EQUAL("expected <1 (0x1)>\n\tbut was <2 (0x2)>", f); +#else + cpputest_longlong dummy_longlong; + LongLongsEqualFailure f(test, failFileName, failLineNumber, dummy_longlong, dummy_longlong, ""); + FAILURE_EQUAL("expected < >\n\tbut was < >", f); +#endif +} + +TEST(TestFailure, UnsignedLongLongsEqualFailure) +{ +#ifdef CPPUTEST_USE_LONG_LONG + UnsignedLongLongsEqualFailure f(test, failFileName, failLineNumber, 1, 2, ""); + FAILURE_EQUAL("expected <1 (0x1)>\n\tbut was <2 (0x2)>", f); +#else + cpputest_ulonglong dummy_ulonglong; + UnsignedLongLongsEqualFailure f(test, failFileName, failLineNumber, dummy_ulonglong, dummy_ulonglong, ""); + FAILURE_EQUAL("expected < >\n\tbut was < >", f); +#endif +} + +TEST(TestFailure, SignedBytesEqualFailure) +{ + SignedBytesEqualFailure f(test, failFileName, failLineNumber, (signed char)-1, (signed char)2, ""); + FAILURE_EQUAL("expected <-1 (0xff)>\n\tbut was < 2 (0x2)>", f); +} + +TEST(TestFailure, StringsEqualFailureWithText) +{ + StringEqualFailure f(test, failFileName, failLineNumber, "abc", "abd", "text"); + FAILURE_EQUAL("Message: text\n" + "\texpected \n" + "\tbut was \n" + "\tdifference starts at position 2 at: < abd >\n" + "\t ^", f); +} + +TEST(TestFailure, StringsEqualFailure) +{ + StringEqualFailure f(test, failFileName, failLineNumber, "abc", "abd", ""); + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 2 at: < abd >\n" + "\t ^", f); +} + +TEST(TestFailure, StringsEqualFailureAtTheEnd) +{ + StringEqualFailure f(test, failFileName, failLineNumber, "abc", "ab", ""); + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 2 at: < ab >\n" + "\t ^", f); +} + +TEST(TestFailure, StringsEqualFailureNewVariantAtTheEnd) +{ + StringEqualFailure f(test, failFileName, failLineNumber, "EndOfALongerString", "EndOfALongerStrinG", ""); + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 17 at: \n" + "\t ^", f); +} + +TEST(TestFailure, StringsEqualFailureWithNewLinesAndTabs) +{ + StringEqualFailure f(test, failFileName, failLineNumber, + "StringWith\t\nDifferentString", + "StringWith\t\ndifferentString", ""); + + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 12 at: \n" + "\t \t\n^", f); +} + +TEST(TestFailure, StringsEqualFailureInTheMiddle) +{ + StringEqualFailure f(test, failFileName, failLineNumber, "aa", "ab", ""); + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 1 at: < ab >\n" + "\t ^", f); +} + +TEST(TestFailure, StringsEqualFailureAtTheBeginning) +{ + StringEqualFailure f(test, failFileName, failLineNumber, "aaa", "bbb", ""); + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 0 at: < bbb >\n" + "\t ^", f); +} + +TEST(TestFailure, StringsEqualFailureWithNullAsActual) +{ + StringEqualFailure f(test, failFileName, failLineNumber, "abc", NULLPTR, ""); + FAILURE_EQUAL("expected \n" + "\tbut was <(null)>", f); +} + +TEST(TestFailure, StringsEqualFailureWithNullAsExpected) +{ + StringEqualFailure f(test, failFileName, failLineNumber, NULLPTR, "abd", ""); + FAILURE_EQUAL("expected <(null)>\n" + "\tbut was ", f); +} + +TEST(TestFailure, StringsEqualNoCaseFailureWithText) +{ + StringEqualNoCaseFailure f(test, failFileName, failLineNumber, "ABC", "abd", "text"); + FAILURE_EQUAL("Message: text\n" + "\texpected \n" + "\tbut was \n" + "\tdifference starts at position 2 at: < abd >\n" + "\t ^", f); +} + +TEST(TestFailure, StringsEqualNoCaseFailure) +{ + StringEqualNoCaseFailure f(test, failFileName, failLineNumber, "ABC", "abd", ""); + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 2 at: < abd >\n" + "\t ^", f); +} + +TEST(TestFailure, StringsEqualNoCaseFailureWithActualAsNull) +{ + StringEqualNoCaseFailure f(test, failFileName, failLineNumber, "ABC", NULLPTR, ""); + FAILURE_EQUAL("expected \n" + "\tbut was <(null)>", f); +} + +TEST(TestFailure, StringsEqualNoCaseFailureWithExpectedAsNull) +{ + StringEqualNoCaseFailure f(test, failFileName, failLineNumber, NULLPTR, "abd", ""); + FAILURE_EQUAL("expected <(null)>\n" + "\tbut was ", f); +} + +TEST(TestFailure, StringsEqualNoCaseFailure2) +{ + StringEqualNoCaseFailure f(test, failFileName, failLineNumber, "ac", "AB", ""); + FAILURE_EQUAL("expected \n" + "\tbut was \n" + "\tdifference starts at position 1 at: < AB >\n" + "\t ^", f); +} + +TEST(TestFailure, DoublesEqualNormalWithText) +{ + DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, 2.0, 3.0, "text"); + FAILURE_EQUAL("Message: text\n" + "\texpected <1>\n" + "\tbut was <2> threshold used was <3>", f); +} + +TEST(TestFailure, DoublesEqualNormal) +{ + DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, 2.0, 3.0, ""); + FAILURE_EQUAL("expected <1>\n" + "\tbut was <2> threshold used was <3>", f); +} + +TEST(TestFailure, BinaryEqualWithText) +{ + const unsigned char expectedData[] = { 0x00 }; + const unsigned char actualData[] = { 0x01 }; + BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), "text"); + FAILURE_EQUAL("Message: text\n" + "\texpected <00>\n" + "\tbut was <01>\n" + "\tdifference starts at position 0 at: < 01 >\n" + "\t ^", f); +} + +TEST(TestFailure, BinaryEqualOneByte) +{ + const unsigned char expectedData[] = { 0x00 }; + const unsigned char actualData[] = { 0x01 }; + BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); + FAILURE_EQUAL("expected <00>\n" + "\tbut was <01>\n" + "\tdifference starts at position 0 at: < 01 >\n" + "\t ^", f); +} + +TEST(TestFailure, BinaryEqualTwoBytes) +{ + const unsigned char expectedData[] = {0x00, 0x01}; + const unsigned char actualData[] = {0x00, 0x02}; + BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); + FAILURE_EQUAL("expected <00 01>\n" + "\tbut was <00 02>\n" + "\tdifference starts at position 1 at: < 00 02 >\n" + "\t ^", f); +} + +TEST(TestFailure, BinaryEqualThreeBytes) +{ + const unsigned char expectedData[] = {0x00, 0x01, 0x00}; + const unsigned char actualData[] = {0x00, 0x02, 0x00}; + BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); + FAILURE_EQUAL("expected <00 01 00>\n" + "\tbut was <00 02 00>\n" + "\tdifference starts at position 1 at: < 00 02 00 >\n" + "\t ^", f); +} + +TEST(TestFailure, BinaryEqualFullWidth) +{ + const unsigned char expectedData[] = {0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00}; + const unsigned char actualData[] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00}; + BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); + FAILURE_EQUAL("expected <00 00 00 01 00 00 00>\n" + "\tbut was <00 00 00 02 00 00 00>\n" + "\tdifference starts at position 3 at: <00 00 00 02 00 00 00>\n" + "\t ^", f); +} + +TEST(TestFailure, BinaryEqualLast) +{ + const unsigned char expectedData[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + const unsigned char actualData[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; + BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); + FAILURE_EQUAL("expected <00 00 00 00 00 00 00>\n" + "\tbut was <00 00 00 00 00 00 01>\n" + "\tdifference starts at position 6 at: <00 00 00 01 >\n" + "\t ^", f); +} + +TEST(TestFailure, BinaryEqualActualNull) +{ + const unsigned char expectedData[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, NULLPTR, sizeof(expectedData), ""); + FAILURE_EQUAL("expected <00 00 00 00 00 00 00>\n\tbut was <(null)>", f); +} + +TEST(TestFailure, BinaryEqualExpectedNull) +{ + const unsigned char actualData[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; + BinaryEqualFailure f(test, failFileName, failLineNumber, NULLPTR, actualData, sizeof(actualData), ""); + FAILURE_EQUAL("expected <(null)>\n\tbut was <00 00 00 00 00 00 01>", f); +} + +TEST(TestFailure, BitsEqualWithText) +{ + BitsEqualFailure f(test, failFileName, failLineNumber, 0x0001, 0x0003, 0x00FF, 2*8/CPPUTEST_CHAR_BIT, "text"); + FAILURE_EQUAL("Message: text\n" + "\texpected \n\tbut was ", f); +} + +#if (CPPUTEST_CHAR_BIT == 16) +TEST(TestFailure, BitsEqualChar) +{ + BitsEqualFailure f(test, failFileName, failLineNumber, 0x01, 0x03, 0xFF, sizeof(char), ""); + FAILURE_EQUAL("expected \n\tbut was ", f); +} +#else +TEST(TestFailure, BitsEqualChar) +{ + BitsEqualFailure f(test, failFileName, failLineNumber, 0x01, 0x03, 0xFF, sizeof(char), ""); + FAILURE_EQUAL("expected <00000001>\n\tbut was <00000011>", f); +} +#endif + +TEST(TestFailure, BitsEqual16Bit) +{ + BitsEqualFailure f(test, failFileName, failLineNumber, 0x0001, 0x0003, 0xFFFF, 2*8/CPPUTEST_CHAR_BIT, ""); + FAILURE_EQUAL("expected <00000000 00000001>\n\tbut was <00000000 00000011>", f); +} + +TEST(TestFailure, BitsEqual32Bit) +{ + BitsEqualFailure f(test, failFileName, failLineNumber, 0x00000001, 0x00000003, 0xFFFFFFFF, 4*8/CPPUTEST_CHAR_BIT, ""); + FAILURE_EQUAL("expected <00000000 00000000 00000000 00000001>\n\tbut was <00000000 00000000 00000000 00000011>", f); +} + +TEST(TestFailure, FeatureUnsupported) +{ + FeatureUnsupportedFailure f(test, failFileName, failLineNumber, "SOME_FEATURE", ""); + FAILURE_EQUAL("The feature \"SOME_FEATURE\" is not supported in this environment or with the feature set selected when building the library.", f); +} diff -Nru cpputest-3.8/tests/CppUTest/TestFilterTest.cpp cpputest-4.0/tests/CppUTest/TestFilterTest.cpp --- cpputest-3.8/tests/CppUTest/TestFilterTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestFilterTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestFilter.h" + +TEST_GROUP(TestFilter) +{ +}; + +TEST(TestFilter, emptyFilterMatchesEverything) +{ + TestFilter filter; + CHECK(filter.match("random_name")); + CHECK(filter.match("")); + CHECK(filter.match("*&%#^&%$(*&^@#(&*@#^(&*$^@#")); +} + +TEST(TestFilter, defaultAbsoluteMismatches) +{ + TestFilter filter("filtername"); + CHECK(!filter.match("notevenclose")); + CHECK(!filter.match("filterrname")); + CHECK(!filter.match("")); +} + +TEST(TestFilter, strictMatching) +{ + TestFilter filter("filter"); + filter.strictMatching(); + CHECK(filter.match("filter")); + CHECK(!filter.match("filterr")); + CHECK(!filter.match(" filter")); +} + +TEST(TestFilter, invertMatching) +{ + TestFilter filter("filter"); + filter.invertMatching(); + CHECK(!filter.match("filter")); + CHECK(!filter.match("filterr")); + CHECK(filter.match("notevenclose")); + CHECK(filter.match("")); +} + +TEST(TestFilter, invertStrictMatching) +{ + TestFilter filter("filter"); + filter.invertMatching(); + filter.strictMatching(); + CHECK(!filter.match("filter")); + CHECK(filter.match("filterr")); + CHECK(filter.match(" filter")); +} + +TEST(TestFilter, equality) +{ + TestFilter filter1("filter"); + TestFilter filter2("filter"); + TestFilter filter3("filter3"); + CHECK(filter1 == filter2); + CHECK(! (filter1 == filter3)); +} + +TEST(TestFilter, equalityWithStrictness) +{ + TestFilter filter1("filter"); + TestFilter filter2("filter"); + filter2.strictMatching(); + CHECK(! (filter1 == filter2)); +} + +TEST(TestFilter, equalityWithInvertion) +{ + TestFilter filter1("filter"); + TestFilter filter2("filter"); + filter2.invertMatching(); + CHECK(! (filter1 == filter2)); +} + +TEST(TestFilter, notEqual) +{ + TestFilter filter1("filter"); + TestFilter filter2("filter"); + TestFilter filter3("filter3"); + CHECK(filter1 != filter3); + CHECK(! (filter1 != filter2)); +} + +TEST(TestFilter, stringFrom) +{ + TestFilter filter("filter"); + STRCMP_EQUAL("TestFilter: \"filter\"", StringFrom(filter).asCharString()); +} + +TEST(TestFilter, stringFromWithStrictMatching) +{ + TestFilter filter("filter"); + filter.strictMatching(); + STRCMP_EQUAL("TestFilter: \"filter\" with strict matching", StringFrom(filter).asCharString()); +} + +TEST(TestFilter, stringFromWithInvertMatching) +{ + TestFilter filter("filter"); + filter.invertMatching(); + STRCMP_EQUAL("TestFilter: \"filter\" with invert matching", StringFrom(filter).asCharString()); +} + +TEST(TestFilter, stringFromWithStrictInvertMatching) +{ + TestFilter filter("filter"); + filter.strictMatching(); + filter.invertMatching(); + STRCMP_EQUAL("TestFilter: \"filter\" with strict, invert matching", StringFrom(filter).asCharString()); +} + +TEST(TestFilter, listOfFilters) +{ + TestFilter *listOfFilters = NULLPTR; + TestFilter first("foo"); + TestFilter secnd("bar"); + listOfFilters = first.add(listOfFilters); + listOfFilters = secnd.add(listOfFilters); + TestFilter *current = listOfFilters; + STRCMP_EQUAL("TestFilter: \"bar\"", StringFrom(*current).asCharString()); + current = current->getNext(); + STRCMP_EQUAL("TestFilter: \"foo\"", StringFrom(*current).asCharString()); + POINTERS_EQUAL(NULLPTR, current->getNext()); +} + +TEST(TestFilter, constructors) +{ + TestFilter filter1; + TestFilter filter2(SimpleString("a")); + TestFilter filter3("a"); + CHECK(filter1.getNext() == NULLPTR); + CHECK(filter2.getNext() == NULLPTR); + CHECK(filter3.getNext() == NULLPTR); + CHECK(filter2.match("ab")); + CHECK(filter3.match("ab")); +} diff -Nru cpputest-3.8/tests/CppUTest/TestHarness_cTestCFile.c cpputest-4.0/tests/CppUTest/TestHarness_cTestCFile.c --- cpputest-3.8/tests/CppUTest/TestHarness_cTestCFile.c 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestHarness_cTestCFile.c 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,36 @@ + +#include "CppUTest/TestHarness_c.h" +#include "CppUTest/PlatformSpecificFunctions_c.h" + +extern void functionWithUnusedParameter(void* PUNUSED(unlessParamater)); + +void functionWithUnusedParameter(void* PUNUSED(unlessParamater)) +{ + +} + +/* Declared in the cpp file */ +extern int setup_teardown_was_called_in_test_group_in_C; +extern int test_was_called_in_test_group_in_C; + +TEST_GROUP_C_SETUP(TestGroupInC) +{ + setup_teardown_was_called_in_test_group_in_C++; +} + +TEST_GROUP_C_TEARDOWN(TestGroupInC) +{ + setup_teardown_was_called_in_test_group_in_C--; + CHECK_C(test_was_called_in_test_group_in_C == 1); + test_was_called_in_test_group_in_C--; +} + +TEST_C(TestGroupInC, checkThatTheTestHasRun) +{ + test_was_called_in_test_group_in_C++; +} + +IGNORE_TEST_C(TestGroupInC, ignoreMacroForCFile) +{ + test_was_called_in_test_group_in_C++; +} diff -Nru cpputest-3.8/tests/CppUTest/TestHarness_cTest.cpp cpputest-4.0/tests/CppUTest/TestHarness_cTest.cpp --- cpputest-3.8/tests/CppUTest/TestHarness_cTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestHarness_cTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,808 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness_c.h" + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestTestingFixture.h" +#include "CppUTest/PlatformSpecificFunctions.h" + + +extern "C" int setup_teardown_was_called_in_test_group_in_C; +extern "C" int test_was_called_in_test_group_in_C; +int setup_teardown_was_called_in_test_group_in_C = 0; +int test_was_called_in_test_group_in_C = 0; + +TEST_GROUP_C_WRAPPER(TestGroupInC) +{ + TEST_GROUP_C_SETUP_WRAPPER(TestGroupInC) + TEST_GROUP_C_TEARDOWN_WRAPPER(TestGroupInC) +}; + +TEST_C_WRAPPER(TestGroupInC, checkThatTheTestHasRun) +IGNORE_TEST_C_WRAPPER(TestGroupInC, ignoreMacroForCFile) + +/* + * This test is a bit strange. They use the fact that you can do -r2 for repeating the same run. + * When you do so, the same statics will be shared and therefore we can test whether the setup/teardown is run + * correctly. + */ + +TEST(TestGroupInC, setupHasBeenCalled) +{ + test_was_called_in_test_group_in_C++; + /* Increased in setup, decreased in teardown. So at this point it must be 1 also on a multiple run */ + LONGS_EQUAL(1, setup_teardown_was_called_in_test_group_in_C); +} + +static bool hasDestructorOfTheDestructorCheckedBeenCalled; + +class HasTheDestructorBeenCalledChecker +{ +public: + HasTheDestructorBeenCalledChecker(){} + ~HasTheDestructorBeenCalledChecker() { hasDestructorOfTheDestructorCheckedBeenCalled = true; } +}; + +TEST_GROUP(TestHarness_c) +{ + TestTestingFixture* fixture; + TEST_SETUP() + { + hasDestructorOfTheDestructorCheckedBeenCalled = false; + fixture = new TestTestingFixture(); + } + TEST_TEARDOWN() + { + delete fixture; + } +}; + +static void _failBoolMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_BOOL(1, 0); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkBool) +{ + CHECK_EQUAL_C_BOOL(1, 1); + CHECK_EQUAL_C_BOOL(1, 2); + fixture->setTestFunction(_failBoolMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected \n but was "); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failBoolTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_BOOL_TEXT(1, 0, "BoolTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkBoolText) +{ + CHECK_EQUAL_C_BOOL_TEXT(1, 1, "Text"); + CHECK_EQUAL_C_BOOL_TEXT(1, 2, "Text"); + fixture->setTestFunction(_failBoolTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected \n but was "); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: BoolTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failIntMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_INT(1, 2); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkInt) +{ + CHECK_EQUAL_C_INT(2, 2); + fixture->setTestFunction(_failIntMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failIntTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_INT_TEXT(1, 2, "IntTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkIntText) +{ + CHECK_EQUAL_C_INT_TEXT(2, 2, "Text"); + fixture->setTestFunction(_failIntTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: IntTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failUnsignedIntMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_UINT(1, 2); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkUnsignedInt) +{ + CHECK_EQUAL_C_UINT(2, 2); + fixture->setTestFunction(_failUnsignedIntMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failUnsignedIntTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_UINT_TEXT(1, 2, "UnsignedIntTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkUnsignedIntText) +{ + CHECK_EQUAL_C_UINT_TEXT(2, 2, "Text"); + fixture->setTestFunction(_failUnsignedIntTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: UnsignedIntTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failLongIntMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_LONG(1, 2); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkLongInt) +{ + CHECK_EQUAL_C_LONG(2, 2); + fixture->setTestFunction(_failLongIntMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failLongIntTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_LONG_TEXT(1, 2, "LongIntTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkLongIntText) +{ + CHECK_EQUAL_C_LONG_TEXT(2, 2, "Text"); + fixture->setTestFunction(_failLongIntTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: LongIntTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failUnsignedLongIntMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_ULONG(1, 2); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkUnsignedLongInt) +{ + CHECK_EQUAL_C_ULONG(2, 2); + fixture->setTestFunction(_failUnsignedLongIntMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failUnsignedLongIntTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_ULONG_TEXT(1, 2, "UnsignedLongIntTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkUnsignedLongIntText) +{ + CHECK_EQUAL_C_ULONG_TEXT(2, 2, "Text"); + fixture->setTestFunction(_failUnsignedLongIntTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: UnsignedLongIntTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +#ifdef CPPUTEST_USE_LONG_LONG + +static void _failLongLongIntMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_LONGLONG(1, 2); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkLongLongInt) +{ + CHECK_EQUAL_C_LONGLONG(2, 2); + fixture->setTestFunction(_failLongLongIntMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failLongLongIntTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_LONGLONG_TEXT(1, 2, "LongLongTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkLongLongIntText) +{ + CHECK_EQUAL_C_LONGLONG_TEXT(2, 2, "Text"); + fixture->setTestFunction(_failLongLongIntTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: LongLongTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failUnsignedLongLongIntMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_ULONGLONG(1, 2); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkUnsignedLongLongInt) +{ + CHECK_EQUAL_C_ULONGLONG(2, 2); + fixture->setTestFunction(_failUnsignedLongLongIntMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failUnsignedLongLongIntTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_ULONGLONG_TEXT(1, 2, "UnsignedLongLongTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkUnsignedLongLongIntText) +{ + CHECK_EQUAL_C_ULONGLONG_TEXT(2, 2, "Text"); + fixture->setTestFunction(_failUnsignedLongLongIntTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1 (0x1)>\n but was <2 (0x2)>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: UnsignedLongLongTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +#else + +static void _failLongLongIntMethod() +{ + cpputest_longlong dummy_longlong; + CHECK_EQUAL_C_LONGLONG(dummy_longlong, dummy_longlong); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkLongLongInt) +{ + fixture->setTestFunction(_failLongLongIntMethod); + fixture->runAllTests(); + fixture->assertPrintContains("is not supported"); + fixture->assertPrintContains("arness_c"); +} + +static void _failLongLongIntTextMethod() +{ + cpputest_longlong dummy_longlong; + CHECK_EQUAL_C_LONGLONG_TEXT(dummy_longlong, dummy_longlong, "Text"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkLongLongIntText) +{ + fixture->setTestFunction(_failLongLongIntTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("is not supported"); + fixture->assertPrintContains("arness_c"); +} + +static void _failUnsignedLongLongIntMethod() +{ + cpputest_ulonglong dummy_ulonglong; + CHECK_EQUAL_C_ULONGLONG(dummy_ulonglong, dummy_ulonglong); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkUnsignedLongLongInt) +{ + fixture->setTestFunction(_failUnsignedLongLongIntMethod); + fixture->runAllTests(); + fixture->assertPrintContains("is not supported"); + fixture->assertPrintContains("arness_c"); +} + +static void _failUnsignedLongLongIntTextMethod() +{ + cpputest_ulonglong dummy_ulonglong; + CHECK_EQUAL_C_ULONGLONG_TEXT(dummy_ulonglong, dummy_ulonglong, "Text"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkUnsignedLongLongIntText) +{ + fixture->setTestFunction(_failUnsignedLongLongIntTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("is not supported"); + fixture->assertPrintContains("arness_c"); +} + +#endif + +static void _failRealMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_REAL(1.0, 2.0, 0.5); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkReal) +{ + CHECK_EQUAL_C_REAL(1.0, 1.1, 0.5); + fixture->setTestFunction(_failRealMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1>\n but was <2>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failRealTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_REAL_TEXT(1.0, 2.0, 0.5, "RealTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkRealText) +{ + CHECK_EQUAL_C_REAL_TEXT(1.0, 1.1, 0.5, "Text"); + fixture->setTestFunction(_failRealTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <1>\n but was <2>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: RealTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failCharMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_CHAR('a', 'c'); +} + +TEST(TestHarness_c, checkChar) +{ + CHECK_EQUAL_C_CHAR('a', 'a'); + fixture->setTestFunction(_failCharMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected \n but was "); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failCharTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_CHAR_TEXT('a', 'c', "CharTestText"); +} + +TEST(TestHarness_c, checkCharText) +{ + CHECK_EQUAL_C_CHAR_TEXT('a', 'a', "Text"); + fixture->setTestFunction(_failCharTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected \n but was "); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: CharTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failUnsignedByteMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_UBYTE(254, 253); +} + +TEST(TestHarness_c, checkUnsignedByte) +{ + CHECK_EQUAL_C_UBYTE(254, 254); + fixture->setTestFunction(_failUnsignedByteMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <254>\n but was <253>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failUnsignedByteTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_UBYTE_TEXT(254, 253, "UnsignedByteTestText"); +} + +TEST(TestHarness_c, checkUnsignedByteText) +{ + CHECK_EQUAL_C_UBYTE_TEXT(254, 254, "Text"); + fixture->setTestFunction(_failUnsignedByteTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <254>\n but was <253>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: UnsignedByteTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failSignedByteMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_SBYTE(-3, -5); +} + +TEST(TestHarness_c, checkSignedByte) +{ + CHECK_EQUAL_C_SBYTE(-3, -3); + fixture->setTestFunction(_failSignedByteMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <-3>\n but was <-5>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failSignedByteTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_SBYTE_TEXT(-3, -5, "SignedByteTestText"); +} + +TEST(TestHarness_c, checkSignedByteText) +{ + CHECK_EQUAL_C_SBYTE_TEXT(-3, -3, "Text"); + fixture->setTestFunction(_failSignedByteTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <-3>\n but was <-5>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: SignedByteTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failStringMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_STRING("Hello", "Hello World"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkString) +{ + CHECK_EQUAL_C_STRING("Hello", "Hello"); + fixture->setTestFunction(_failStringMethod); + fixture->runAllTests(); + + StringEqualFailure failure(UtestShell::getCurrent(), "file", 1, "Hello", "Hello World", ""); + fixture->assertPrintContains(failure.getMessage()); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failStringTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_STRING_TEXT("Hello", "Hello World", "StringTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkStringText) +{ + CHECK_EQUAL_C_STRING_TEXT("Hello", "Hello", "Text"); + fixture->setTestFunction(_failStringTextMethod); + fixture->runAllTests(); + + StringEqualFailure failure(UtestShell::getCurrent(), "file", 1, "Hello", "Hello World", ""); + fixture->assertPrintContains(failure.getMessage()); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: StringTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failPointerMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_POINTER(NULLPTR, (void *)0x1); +} + +TEST(TestHarness_c, checkPointer) +{ + CHECK_EQUAL_C_POINTER(NULLPTR, NULLPTR); + fixture->setTestFunction(_failPointerMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <0x0>\n but was <0x1>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failPointerTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_POINTER_TEXT(NULLPTR, (void *)0x1, "PointerTestText"); +} + +TEST(TestHarness_c, checkPointerText) +{ + CHECK_EQUAL_C_POINTER_TEXT(NULLPTR, NULLPTR, "Text"); + fixture->setTestFunction(_failPointerTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <0x0>\n but was <0x1>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: PointerTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failBitsMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_BITS(0x0001, (unsigned short)0x0003, 0xFFFF); +} + +TEST(TestHarness_c, checkBits) +{ + CHECK_EQUAL_C_BITS(0xABCD, (unsigned short)0xABCD, 0xFFFF); + fixture->setTestFunction(_failBitsMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <00000000 00000001>\n\tbut was <00000000 00000011>"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failBitsTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_EQUAL_C_BITS_TEXT(0x0001, (unsigned short)0x0003, 0xFFFF, "BitsTestText"); +} + +TEST(TestHarness_c, checkBitsText) +{ + CHECK_EQUAL_C_BITS_TEXT(0xABCD, (unsigned short)0xABCD, 0xFFFF, "Text"); + fixture->setTestFunction(_failBitsTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("expected <00000000 00000001>\n\tbut was <00000000 00000011>"); + fixture->assertPrintContains("arness_c"); + fixture->assertPrintContains("Message: BitsTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + FAIL_TEXT_C("Booo"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkFailText) +{ + fixture->setTestFunction(_failTextMethod); + fixture->runAllTests(); + fixture->assertPrintContains("Booo"); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _failMethod() +{ + HasTheDestructorBeenCalledChecker checker; + FAIL_C(); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkFail) +{ + fixture->setTestFunction(_failMethod); + fixture->runAllTests(); + LONGS_EQUAL(1, fixture->getFailureCount()); + fixture->assertPrintContains("arness_c"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _CheckMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_C(false); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkCheck) +{ + CHECK_C(true); + fixture->setTestFunction(_CheckMethod); + fixture->runAllTests(); + LONGS_EQUAL(1, fixture->getFailureCount()); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +static void _CheckTextMethod() +{ + HasTheDestructorBeenCalledChecker checker; + CHECK_C_TEXT(false, "CheckTestText"); +} // LCOV_EXCL_LINE + +TEST(TestHarness_c, checkCheckText) +{ + CHECK_C_TEXT(true, "Text"); + fixture->setTestFunction(_CheckTextMethod); + fixture->runAllTests(); + LONGS_EQUAL(1, fixture->getFailureCount()); + fixture->assertPrintContains("Message: CheckTestText"); + CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled); +} + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +TEST(TestHarness_c, cpputest_malloc_out_of_memory) +{ + cpputest_malloc_set_out_of_memory(); + CHECK(NULLPTR == cpputest_malloc(100)); + + cpputest_malloc_set_not_out_of_memory(); + void * mem = cpputest_malloc(100); + CHECK(NULLPTR != mem); + cpputest_free(mem); +} + +TEST(TestHarness_c, cpputest_malloc_out_of_memory_after_n_mallocs) +{ + cpputest_malloc_set_out_of_memory_countdown(3); + void * m1 = cpputest_malloc(10); + void * m2 = cpputest_malloc(11); + void * m3 = cpputest_malloc(12); + CHECK(m1 != NULLPTR); + CHECK(m2 != NULLPTR); + CHECK(m3 == NULLPTR); + cpputest_malloc_set_not_out_of_memory(); + cpputest_free(m1); + cpputest_free(m2); +} + +TEST(TestHarness_c, cpputest_malloc_out_of_memory_after_0_mallocs) +{ + cpputest_malloc_set_out_of_memory_countdown(0); + void * m1 = cpputest_malloc(10); + CHECK(m1 == NULLPTR); + cpputest_malloc_set_not_out_of_memory(); +} + +TEST(TestHarness_c, count_mallocs) +{ + cpputest_malloc_count_reset(); + void * m1 = cpputest_malloc(10); + void * m2 = cpputest_malloc(11); + void * m3 = cpputest_malloc(12); + cpputest_free(m1); + cpputest_free(m2); + cpputest_free(m3); + LONGS_EQUAL(3, cpputest_malloc_get_count()); +} + +#ifdef CPPUTEST_USE_STRDUP_MACROS + +TEST(TestHarness_c, cpputest_strdup) +{ + char * mem = cpputest_strdup("0123456789"); + CHECK(NULLPTR != mem); + STRCMP_EQUAL("0123456789", mem); + cpputest_free(mem); +} + +TEST(TestHarness_c, cpputest_strndup) +{ + char * mem = cpputest_strndup("0123456789", 3); + CHECK(NULLPTR != mem); + STRCMP_EQUAL("012", mem); + cpputest_free(mem); +} + +#endif + +TEST(TestHarness_c, cpputest_calloc) +{ + void * mem = cpputest_calloc(10, 10); + CHECK(NULLPTR != mem); + cpputest_free(mem); +} + +TEST(TestHarness_c, cpputest_realloc_larger) +{ + const char* number_string = "123456789"; + + char* mem1 = (char*) cpputest_malloc(10); + + SimpleString::StrNCpy(mem1, number_string, 10); + + CHECK(mem1 != NULLPTR); + + char* mem2 = (char*) cpputest_realloc(mem1, 1000); + + CHECK(mem2 != NULLPTR); + STRCMP_EQUAL(number_string, mem2); + + cpputest_free(mem2); +} + +#include "CppUTest/MemoryLeakDetector.h" + +TEST(TestHarness_c, macros) +{ +#if CPPUTEST_USE_MALLOC_MACROS + MemoryLeakDetector* memLeakDetector = MemoryLeakWarningPlugin::getGlobalDetector(); + size_t memLeaks = memLeakDetector->totalMemoryLeaks(mem_leak_period_checking); +#endif + void* mem1 = malloc(10); + void* mem2 = calloc(10, 20); + void* mem3 = realloc(mem2, 100); +#if CPPUTEST_USE_MALLOC_MACROS + LONGS_EQUAL(memLeaks + 2, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); +#endif + free(mem1); + free(mem3); +#if CPPUTEST_USE_MALLOC_MACROS + LONGS_EQUAL(memLeaks, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); +#endif + +} + +TEST(TestHarness_c, callocInitializedToZero) +{ + char* mem = (char*) calloc(20, sizeof(char)); + for (int i = 0; i < 20; i++) + CHECK(mem[i] == 0); + free(mem); +} + +TEST(TestHarness_c, callocShouldReturnNULLWhenOutOfMemory) +{ + cpputest_malloc_set_out_of_memory_countdown(0); + void * m = cpputest_calloc(1, 1); + CHECK(m == NULLPTR); + cpputest_malloc_set_not_out_of_memory(); +} +#endif + diff -Nru cpputest-3.8/tests/CppUTest/TestInstallerTest.cpp cpputest-4.0/tests/CppUTest/TestInstallerTest.cpp --- cpputest-3.8/tests/CppUTest/TestInstallerTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestInstallerTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestRegistry.h" + +class TestInstallerTestUtestShell : public UtestShell +{ +}; + + +// this is file scope because the test is installed +// with all other tests, which also happen to be +// created as static instances at file scope + +TEST_GROUP(TestInstaller) +{ + TestInstaller* testInstaller; + TestRegistry* myRegistry; + TestInstallerTestUtestShell shell; + void setup() + { + myRegistry = new TestRegistry(); + myRegistry->setCurrentRegistry(myRegistry); + testInstaller = new TestInstaller(shell, "TestInstaller", "test", __FILE__, __LINE__); + } + void teardown() + { + myRegistry->setCurrentRegistry(NULLPTR); + testInstaller->unDo(); + delete testInstaller; + delete myRegistry; + } +}; + +TEST(TestInstaller, Create) +{ +} + diff -Nru cpputest-3.8/tests/CppUTest/TestMemoryAllocatorTest.cpp cpputest-4.0/tests/CppUTest/TestMemoryAllocatorTest.cpp --- cpputest-3.8/tests/CppUTest/TestMemoryAllocatorTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestMemoryAllocatorTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,766 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestMemoryAllocator.h" +#include "CppUTest/PlatformSpecificFunctions.h" +#include "CppUTest/TestTestingFixture.h" +#include "CppUTest/MemoryLeakDetector.h" + +TEST_GROUP(TestMemoryAllocatorTest) +{ + TestMemoryAllocator* allocator; + GlobalMemoryAllocatorStash memoryAllocatorStash; + + void setup() + { + allocator = NULLPTR; + memoryAllocatorStash.save(); + } + + void teardown() + { + memoryAllocatorStash.restore(); + delete allocator; + } +}; + +TEST(TestMemoryAllocatorTest, SetCurrentNewAllocator) +{ + allocator = new TestMemoryAllocator("new allocator for test"); + setCurrentNewAllocator(allocator); + POINTERS_EQUAL(allocator, getCurrentNewAllocator()); +} + +TEST(TestMemoryAllocatorTest, SetCurrentNewAllocatorToDefault) +{ + TestMemoryAllocator* originalAllocator = getCurrentNewAllocator(); + + setCurrentNewAllocatorToDefault(); + POINTERS_EQUAL(defaultNewAllocator(), getCurrentNewAllocator()); + + setCurrentNewAllocator(originalAllocator); +} + +TEST(TestMemoryAllocatorTest, SetCurrentNewArrayAllocator) +{ + allocator = new TestMemoryAllocator("new array allocator for test"); + setCurrentNewArrayAllocator(allocator); + POINTERS_EQUAL(allocator, getCurrentNewArrayAllocator()); + setCurrentNewArrayAllocatorToDefault(); + POINTERS_EQUAL(defaultNewArrayAllocator(), getCurrentNewArrayAllocator()); +} + +TEST(TestMemoryAllocatorTest, SetCurrentMallocAllocator) +{ + allocator = new TestMemoryAllocator("malloc_allocator"); + setCurrentMallocAllocator(allocator); + POINTERS_EQUAL(allocator, getCurrentMallocAllocator()); + setCurrentMallocAllocatorToDefault(); + POINTERS_EQUAL(defaultMallocAllocator(), getCurrentMallocAllocator()); +} + +TEST(TestMemoryAllocatorTest, MemoryAllocation) +{ + allocator = new TestMemoryAllocator(); + allocator->free_memory(allocator->alloc_memory(100, "file", 1), 100, "file", 1); +} + +TEST(TestMemoryAllocatorTest, MallocNames) +{ + STRCMP_EQUAL("Standard Malloc Allocator", defaultMallocAllocator()->name()); + STRCMP_EQUAL("malloc", defaultMallocAllocator()->alloc_name()); + STRCMP_EQUAL("free", defaultMallocAllocator()->free_name()); +} + +TEST(TestMemoryAllocatorTest, NewNames) +{ + STRCMP_EQUAL("Standard New Allocator", defaultNewAllocator()->name()); + STRCMP_EQUAL("new", defaultNewAllocator()->alloc_name()); + STRCMP_EQUAL("delete", defaultNewAllocator()->free_name()); +} + +TEST(TestMemoryAllocatorTest, NewArrayNames) +{ + STRCMP_EQUAL("Standard New [] Allocator", defaultNewArrayAllocator()->name()); + STRCMP_EQUAL("new []", defaultNewArrayAllocator()->alloc_name()); + STRCMP_EQUAL("delete []", defaultNewArrayAllocator()->free_name()); +} + +TEST(TestMemoryAllocatorTest, NullUnknownAllocation) +{ + allocator = new NullUnknownAllocator; + allocator->free_memory(allocator->alloc_memory(100, "file", 1), 100, "file", 1); +} + +TEST(TestMemoryAllocatorTest, NullUnknownNames) +{ + allocator = new NullUnknownAllocator; + STRCMP_EQUAL("Null Allocator", allocator->name()); + STRCMP_EQUAL("unknown", allocator->alloc_name()); + STRCMP_EQUAL("unknown", allocator->free_name()); +} + +#if (! CPPUTEST_SANITIZE_ADDRESS) + +#define MAX_SIZE_FOR_ALLOC ((size_t) -1 > (unsigned short)-1) ? (size_t) -97 : (size_t) -1 + +static void failTryingToAllocateTooMuchMemory(void) +{ + TestMemoryAllocator allocator; + allocator.alloc_memory(MAX_SIZE_FOR_ALLOC, "file", 1); +} // LCOV_EXCL_LINE + +TEST(TestMemoryAllocatorTest, TryingToAllocateTooMuchFailsTest) +{ + TestTestingFixture fixture; + fixture.setTestFunction(&failTryingToAllocateTooMuchMemory); + fixture.runAllTests(); + fixture.assertPrintContains("malloc returned null pointer"); +} + +#endif + +TEST_GROUP(MemoryLeakAllocator) +{ + MemoryLeakAllocator* allocator; + + void setup() + { + allocator = new MemoryLeakAllocator(defaultMallocAllocator()); + } + + void teardown() + { + delete allocator; + } +}; + +TEST(MemoryLeakAllocator, allocMemory) +{ + char* memory = allocator->alloc_memory(10, __FILE__, __LINE__); + memory[0] = 'B'; + MemoryLeakWarningPlugin::getGlobalDetector()->deallocMemory(allocator->actualAllocator(), memory); + + /* No leaks or crashes */ +} + +TEST(MemoryLeakAllocator, freeMemory) +{ + char* memory = MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(allocator->actualAllocator(), 10); + allocator->free_memory(memory, 10, __FILE__, __LINE__); + + /* No leaks or crashes */ +} + +TEST(MemoryLeakAllocator, originalAllocator) +{ + POINTERS_EQUAL(defaultMallocAllocator(), allocator->actualAllocator()); + STRCMP_EQUAL(defaultMallocAllocator()->alloc_name(), allocator->alloc_name()); + STRCMP_EQUAL(defaultMallocAllocator()->free_name(), allocator->free_name()); +} + +TEST(MemoryLeakAllocator, name) +{ + STRCMP_EQUAL("MemoryLeakAllocator", allocator->name()); +} + +#if CPPUTEST_USE_MEM_LEAK_DETECTION +#if CPPUTEST_USE_MALLOC_MACROS + +class FailableMemoryAllocatorExecFunction : public ExecFunction +{ +public: + FailableMemoryAllocator* allocator_; + void (*testFunction_)(FailableMemoryAllocator*); + + void exec() _override + { + testFunction_(allocator_); + } + + FailableMemoryAllocatorExecFunction() : allocator_(NULLPTR), testFunction_(NULLPTR) {} + virtual ~FailableMemoryAllocatorExecFunction() _destructor_override {} +}; + +TEST_GROUP(FailableMemoryAllocator) +{ + FailableMemoryAllocator *failableMallocAllocator; + FailableMemoryAllocatorExecFunction testFunction; + TestTestingFixture fixture; + GlobalMemoryAllocatorStash stash; + + void setup() + { + stash.save(); + testFunction.allocator_ = failableMallocAllocator = new FailableMemoryAllocator("Failable Malloc Allocator", "malloc", "free"); + fixture.setTestFunction(&testFunction); + setCurrentMallocAllocator(failableMallocAllocator); + } + void teardown() + { + failableMallocAllocator->checkAllFailedAllocsWereDone(); + failableMallocAllocator->clearFailedAllocs(); + delete failableMallocAllocator; + stash.restore(); + } +}; + +TEST(FailableMemoryAllocator, MallocWorksNormallyIfNotAskedToFail) +{ + int *memory = (int*)malloc(sizeof(int)); + CHECK(memory != NULLPTR); + free(memory); +} + +TEST(FailableMemoryAllocator, FailFirstMalloc) +{ + failableMallocAllocator->failAllocNumber(1); + POINTERS_EQUAL(NULLPTR, (int*)malloc(sizeof(int))); +} + +TEST(FailableMemoryAllocator, FailSecondAndFourthMalloc) +{ + failableMallocAllocator->failAllocNumber(2); + failableMallocAllocator->failAllocNumber(4); + int *memory1 = (int*)malloc(sizeof(int)); + int *memory2 = (int*)malloc(sizeof(int)); + int *memory3 = (int*)malloc(sizeof(int)); + int *memory4 = (int*)malloc(sizeof(int)); + + CHECK(NULLPTR != memory1); + POINTERS_EQUAL(NULLPTR, memory2); + CHECK(NULLPTR != memory3); + POINTERS_EQUAL(NULLPTR, memory4); + + free(memory1); + free(memory3); +} + +static void _failingAllocIsNeverDone(FailableMemoryAllocator* failableMallocAllocator) +{ + failableMallocAllocator->failAllocNumber(1); + failableMallocAllocator->failAllocNumber(2); + failableMallocAllocator->failAllocNumber(3); + malloc(sizeof(int)); + malloc(sizeof(int)); + failableMallocAllocator->checkAllFailedAllocsWereDone(); +} + +TEST(FailableMemoryAllocator, CheckAllFailingAllocsWereDone) +{ + testFunction.testFunction_ = _failingAllocIsNeverDone; + + fixture.runAllTests(); + + LONGS_EQUAL(1, fixture.getFailureCount()); + fixture.assertPrintContains("Expected allocation number 3 was never done"); + failableMallocAllocator->clearFailedAllocs(); +} + +TEST(FailableMemoryAllocator, FailFirstAllocationAtGivenLine) +{ + failableMallocAllocator->failNthAllocAt(1, __FILE__, __LINE__ + 2); + + POINTERS_EQUAL(NULLPTR, malloc(sizeof(int))); +} + +TEST(FailableMemoryAllocator, FailThirdAllocationAtGivenLine) +{ + int *memory[10] = { NULLPTR }; + int allocation; + failableMallocAllocator->failNthAllocAt(3, __FILE__, __LINE__ + 4); + + for (allocation = 1; allocation <= 10; allocation++) + { + memory[allocation - 1] = (int *)malloc(sizeof(int)); + if (memory[allocation - 1] == NULLPTR) + break; + free(memory[allocation -1]); + } + + LONGS_EQUAL(3, allocation); +} + +static void _failingLocationAllocIsNeverDone(FailableMemoryAllocator* failableMallocAllocator) +{ + failableMallocAllocator->failNthAllocAt(1, "TestMemoryAllocatorTest.cpp", __LINE__); + failableMallocAllocator->checkAllFailedAllocsWereDone(); +} + +TEST(FailableMemoryAllocator, CheckAllFailingLocationAllocsWereDone) +{ + testFunction.testFunction_ = _failingLocationAllocIsNeverDone; + + fixture.runAllTests(); + + LONGS_EQUAL(1, fixture.getFailureCount()); + fixture.assertPrintContains("Expected failing alloc at TestMemoryAllocatorTest.cpp:"); + fixture.assertPrintContains("was never done"); + + failableMallocAllocator->clearFailedAllocs(); +} + +#endif +#endif + +class MemoryAccountantExecFunction + : public ExecFunction +{ +public: + virtual ~MemoryAccountantExecFunction() _destructor_override + { + } + + void (*testFunction_)(MemoryAccountant*); + MemoryAccountant* parameter_; + + virtual void exec() _override + { + testFunction_(parameter_); + } +}; + +TEST_GROUP(TestMemoryAccountant) +{ + MemoryAccountant accountant; + TestTestingFixture fixture; + MemoryAccountantExecFunction testFunction; + + void setup() + { + testFunction.parameter_ = &accountant; + fixture.setTestFunction(&testFunction); + } + + void teardown() + { + accountant.clear(); + } +}; + +TEST(TestMemoryAccountant, totalAllocsIsZero) +{ + LONGS_EQUAL(0, accountant.totalAllocations()); + LONGS_EQUAL(0, accountant.totalDeallocations()); +} + +TEST(TestMemoryAccountant, countAllocationsPerSize) +{ + accountant.alloc(4); + LONGS_EQUAL(1, accountant.totalAllocationsOfSize(4)); + LONGS_EQUAL(0, accountant.totalAllocationsOfSize(10)); + LONGS_EQUAL(1, accountant.totalAllocations()); + LONGS_EQUAL(0, accountant.maximumAllocationAtATimeOfSize(10)); +} + +TEST(TestMemoryAccountant, countAllocationsPerSizeMultipleAllocations) +{ + accountant.alloc(4); + accountant.alloc(4); + accountant.alloc(8); + LONGS_EQUAL(2, accountant.totalAllocationsOfSize(4)); + LONGS_EQUAL(1, accountant.totalAllocationsOfSize(8)); + LONGS_EQUAL(0, accountant.totalAllocationsOfSize(10)); + LONGS_EQUAL(3, accountant.totalAllocations()); +} + +TEST(TestMemoryAccountant, countAllocationsPerSizeMultipleAllocationsOutOfOrder) +{ + accountant.alloc(4); + accountant.alloc(8); + accountant.alloc(4); + accountant.alloc(5); + accountant.alloc(2); + accountant.alloc(4); + accountant.alloc(10); + + LONGS_EQUAL(3, accountant.totalAllocationsOfSize(4)); + LONGS_EQUAL(1, accountant.totalAllocationsOfSize(8)); + LONGS_EQUAL(1, accountant.totalAllocationsOfSize(10)); + LONGS_EQUAL(7, accountant.totalAllocations()); +} + +TEST(TestMemoryAccountant, countDeallocationsPerSizeMultipleAllocations) +{ + accountant.dealloc(8); + accountant.dealloc(4); + accountant.dealloc(8); + LONGS_EQUAL(1, accountant.totalDeallocationsOfSize(4)); + LONGS_EQUAL(2, accountant.totalDeallocationsOfSize(8)); + LONGS_EQUAL(0, accountant.totalDeallocationsOfSize(20)); + LONGS_EQUAL(3, accountant.totalDeallocations()); +} + +TEST(TestMemoryAccountant, countMaximumAllocationsAtATime) +{ + accountant.alloc(4); + accountant.alloc(4); + accountant.dealloc(4); + accountant.dealloc(4); + accountant.alloc(4); + LONGS_EQUAL(2, accountant.maximumAllocationAtATimeOfSize(4)); +} + +TEST(TestMemoryAccountant, reportNoAllocations) +{ + STRCMP_EQUAL("CppUTest Memory Accountant has not noticed any allocations or deallocations. Sorry\n", accountant.report().asCharString()); +} + +TEST(TestMemoryAccountant, reportAllocations) +{ + accountant.dealloc(8); + accountant.dealloc(8); + accountant.dealloc(8); + + accountant.alloc(4); + accountant.dealloc(4); + accountant.alloc(4); + STRCMP_EQUAL("CppUTest Memory Accountant report:\n" + "Allocation size # allocations # deallocations max # allocations at one time\n" + " 4 2 1 1\n" + " 8 0 3 0\n" + " Thank you for your business\n" + , accountant.report().asCharString()); +} + +TEST(TestMemoryAccountant, reportAllocationsWithSizeZero) +{ + accountant.dealloc(0); + + accountant.dealloc(4); + accountant.dealloc(4); + accountant.alloc(4); + + STRCMP_EQUAL("CppUTest Memory Accountant report:\n" + "Allocation size # allocations # deallocations max # allocations at one time\n" + "other 0 1 0\n" + " 4 1 2 1\n" + " Thank you for your business\n" + , accountant.report().asCharString()); +} + + +static void _failUseCacheSizesAfterAllocation(MemoryAccountant* accountant) +{ + size_t cacheSizes[] = {0}; + + accountant->alloc(4); + accountant->useCacheSizes(cacheSizes, 1); +} + +TEST(TestMemoryAccountant, withCacheSizesFailsWhenAlreadyAllocatedMemory) +{ + testFunction.testFunction_ = _failUseCacheSizesAfterAllocation; + + fixture.runAllTests(); + + fixture.assertPrintContains("MemoryAccountant: Cannot set cache sizes as allocations already occured!"); +} + +TEST(TestMemoryAccountant, reportWithCacheSizesEmpty) +{ + size_t cacheSizes[] = {0}; + + accountant.useCacheSizes(cacheSizes, 0); + accountant.alloc(4); + + STRCMP_EQUAL("CppUTest Memory Accountant report (with cache sizes):\n" + "Cache size # allocations # deallocations max # allocations at one time\n" + "other 1 0 1\n" + " Thank you for your business\n" + , accountant.report().asCharString()); +} + + +TEST(TestMemoryAccountant, reportWithCacheSizes) +{ + size_t cacheSizes[] = {4}; + + accountant.useCacheSizes(cacheSizes, 1); + accountant.dealloc(8); + accountant.dealloc(12); + accountant.dealloc(20); + + accountant.alloc(4); + accountant.dealloc(4); + accountant.alloc(4); + STRCMP_EQUAL("CppUTest Memory Accountant report (with cache sizes):\n" + "Cache size # allocations # deallocations max # allocations at one time\n" + " 4 2 1 1\n" + "other 0 3 0\n" + " Thank you for your business\n" + , accountant.report().asCharString()); +} + +TEST(TestMemoryAccountant, reportWithCacheSizesMultipleCaches) +{ + size_t cacheSizes[] = {4, 10, 20}; + + accountant.useCacheSizes(cacheSizes, 3); + accountant.alloc(8); + accountant.alloc(12); + accountant.alloc(20); + + accountant.alloc(4); + accountant.dealloc(4); + accountant.alloc(4); + STRCMP_EQUAL("CppUTest Memory Accountant report (with cache sizes):\n" + "Cache size # allocations # deallocations max # allocations at one time\n" + " 4 2 1 1\n" + " 10 1 0 1\n" + " 20 2 0 2\n" + "other 0 0 0\n" + " Thank you for your business\n" + , accountant.report().asCharString()); +} + + +TEST_GROUP(AccountingTestMemoryAllocator) +{ + MemoryAccountant accountant; + AccountingTestMemoryAllocator *allocator; + + void setup() + { + allocator = new AccountingTestMemoryAllocator(accountant, getCurrentMallocAllocator()); + } + + void teardown() + { + accountant.clear(); + delete allocator; + } +}; + +TEST(AccountingTestMemoryAllocator, canAllocateAndAccountMemory) +{ + char* memory = allocator->alloc_memory(10, __FILE__, __LINE__); + allocator->free_memory(memory, 10, __FILE__, __LINE__); + + LONGS_EQUAL(1, accountant.totalAllocationsOfSize(10)); + LONGS_EQUAL(1, accountant.totalDeallocationsOfSize(10)); +} + +TEST(AccountingTestMemoryAllocator, canAllocateAndAccountMemoryMultipleAllocations) +{ + char* memory1 = allocator->alloc_memory(10, __FILE__, __LINE__); + char* memory2 = allocator->alloc_memory(8, __FILE__, __LINE__); + char* memory3 = allocator->alloc_memory(12, __FILE__, __LINE__); + + allocator->free_memory(memory1, 10, __FILE__, __LINE__); + allocator->free_memory(memory3, 12, __FILE__, __LINE__); + + char* memory4 = allocator->alloc_memory(15, __FILE__, __LINE__); + char* memory5 = allocator->alloc_memory(20, __FILE__, __LINE__); + + allocator->free_memory(memory2, 8, __FILE__, __LINE__); + allocator->free_memory(memory4, 15, __FILE__, __LINE__); + allocator->free_memory(memory5, 20, __FILE__, __LINE__); + + char* memory6 = allocator->alloc_memory(1, __FILE__, __LINE__); + char* memory7 = allocator->alloc_memory(100, __FILE__, __LINE__); + + allocator->free_memory(memory6, 1, __FILE__, __LINE__); + allocator->free_memory(memory7, 100, __FILE__, __LINE__); + + LONGS_EQUAL(7, accountant.totalAllocations()); + LONGS_EQUAL(7, accountant.totalDeallocations()); +} + +TEST(AccountingTestMemoryAllocator, useOriginalAllocatorWhenDeallocatingMemoryNotAllocatedByAllocator) +{ + char* memory = getCurrentMallocAllocator()->alloc_memory(10, __FILE__, __LINE__); + allocator->free_memory(memory, 10, __FILE__, __LINE__); + + LONGS_EQUAL(0, accountant.totalAllocations()); + LONGS_EQUAL(1, accountant.totalDeallocations()); +} + +TEST(AccountingTestMemoryAllocator, allocatorForwardsAllocAndFreeName) +{ + STRCMP_EQUAL("malloc", allocator->alloc_name()); + STRCMP_EQUAL("free", allocator->free_name()); +} + + +class GlobalMemoryAccountantExecFunction + : public ExecFunction +{ +public: + void (*testFunction_)(GlobalMemoryAccountant*); + GlobalMemoryAccountant* parameter_; + + virtual void exec() _override + { + testFunction_(parameter_); + } +}; + +TEST_GROUP(GlobalMemoryAccountant) +{ + GlobalMemoryAccountant accountant; + TestTestingFixture fixture; + GlobalMemoryAccountantExecFunction testFunction; + GlobalMemoryAllocatorStash stash; + + void setup() + { + testFunction.parameter_ = &accountant; + fixture.setTestFunction(&testFunction); + stash.save(); + } + + void teardown() + { + stash.restore(); + } +}; + +TEST(GlobalMemoryAccountant, start) +{ + accountant.start(); + + POINTERS_EQUAL(accountant.getMallocAllocator(), getCurrentMallocAllocator()); + POINTERS_EQUAL(accountant.getNewAllocator(), getCurrentNewAllocator()); + POINTERS_EQUAL(accountant.getNewArrayAllocator(), getCurrentNewArrayAllocator()); + + accountant.stop(); +} + +TEST(GlobalMemoryAccountant, stop) +{ + TestMemoryAllocator* originalMallocAllocator = getCurrentMallocAllocator(); + TestMemoryAllocator* originalNewAllocator = getCurrentNewAllocator(); + TestMemoryAllocator* originalNewArrayAllocator = getCurrentNewArrayAllocator(); + + accountant.start(); + accountant.stop(); + + POINTERS_EQUAL(originalMallocAllocator, getCurrentMallocAllocator()); + POINTERS_EQUAL(originalNewAllocator, getCurrentNewAllocator()); + POINTERS_EQUAL(originalNewArrayAllocator, getCurrentNewArrayAllocator()); +} + +#if CPPUTEST_USE_MEM_LEAK_DETECTION + +TEST(GlobalMemoryAccountant, report) +{ + accountant.start(); + char* memory = new char[185]; + delete [] memory; + accountant.stop(); + + /* Allocation includes memory leak info */ + STRCMP_CONTAINS("1 1 1", accountant.report().asCharString()); +} + +TEST(GlobalMemoryAccountant, reportWithCacheSizes) +{ + size_t cacheSizes[] = {512}; + accountant.useCacheSizes(cacheSizes, 1); + accountant.start(); + char* memory = new char[185]; + delete [] memory; + accountant.stop(); + + /* Allocation includes memory leak info */ + STRCMP_CONTAINS("512 1 1 1", accountant.report().asCharString()); +} + + +#endif + +static void _failStopWithoutStartingWillFail(GlobalMemoryAccountant* accountant) +{ + accountant->stop(); +} + +TEST(GlobalMemoryAccountant, StopCantBeCalledWithoutStarting) +{ + testFunction.testFunction_ = _failStopWithoutStartingWillFail; + fixture.runAllTests(); + fixture.assertPrintContains("GlobalMemoryAccount: Stop called without starting"); +} + +static void _failStartingTwiceWillFail(GlobalMemoryAccountant* accountant) +{ + accountant->start(); + accountant->start(); +} + +TEST(GlobalMemoryAccountant, startTwiceWillFail) +{ + testFunction.testFunction_ = _failStartingTwiceWillFail; + fixture.runAllTests(); + accountant.stop(); + + fixture.assertPrintContains("Global allocator start called twice!"); +} + +static void _failChangeMallocMemoryAllocator(GlobalMemoryAccountant* accountant) +{ + accountant->start(); + setCurrentMallocAllocator(defaultMallocAllocator()); + accountant->stop(); +} + +TEST(GlobalMemoryAccountant, checkWhetherMallocAllocatorIsNotChanged) +{ + testFunction.testFunction_ = _failChangeMallocMemoryAllocator; + fixture.runAllTests(); + fixture.assertPrintContains("GlobalMemoryAccountant: Malloc memory allocator has been changed while accounting for memory"); +} + +static void _failChangeNewMemoryAllocator(GlobalMemoryAccountant* accountant) +{ + accountant->start(); + setCurrentNewAllocator(defaultNewAllocator()); + accountant->stop(); +} + +TEST(GlobalMemoryAccountant, checkWhetherNewAllocatorIsNotChanged) +{ + testFunction.testFunction_ = _failChangeNewMemoryAllocator; + fixture.runAllTests(); + fixture.assertPrintContains("GlobalMemoryAccountant: New memory allocator has been changed while accounting for memory"); +} + +static void _failChangeNewArrayMemoryAllocator(GlobalMemoryAccountant* accountant) +{ + accountant->start(); + setCurrentNewArrayAllocator(defaultNewArrayAllocator()); + accountant->stop(); +} + +TEST(GlobalMemoryAccountant, checkWhetherNewArrayAllocatorIsNotChanged) +{ + testFunction.testFunction_ = _failChangeNewArrayMemoryAllocator; + fixture.runAllTests(); + fixture.assertPrintContains("GlobalMemoryAccountant: New Array memory allocator has been changed while accounting for memory"); +} + diff -Nru cpputest-3.8/tests/CppUTest/TestOutputTest.cpp cpputest-4.0/tests/CppUTest/TestOutputTest.cpp --- cpputest-3.8/tests/CppUTest/TestOutputTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestOutputTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,473 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestResult.h" +#include "CppUTest/PlatformSpecificFunctions.h" + +static long millisTime; + +extern "C" { + + static long MockGetPlatformSpecificTimeInMillis() + { + return millisTime; + } + +} + +TEST_GROUP(TestOutput) +{ + TestOutput* printer; + StringBufferTestOutput* mock; + UtestShell* tst; + TestFailure *f; + TestFailure *f2; + TestFailure *f3; + TestResult* result; + + void setup() + { + mock = new StringBufferTestOutput(); + printer = mock; + tst = new UtestShell("group", "test", "file", 10); + f = new TestFailure(tst, "failfile", 20, "message"); + f2 = new TestFailure(tst, "file", 20, "message"); + f3 = new TestFailure(tst, "file", 2, "message"); + result = new TestResult(*mock); + result->setTotalExecutionTime(10); + millisTime = 0; + UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); + TestOutput::setWorkingEnvironment(TestOutput::eclipse); + + } + void teardown() + { + TestOutput::setWorkingEnvironment(TestOutput::detectEnvironment); + delete printer; + delete tst; + delete f; + delete f2; + delete f3; + delete result; + } + + void runOneTest() + { + result->countTest(); + result->countRun(); + } +}; + +TEST(TestOutput, PrintConstCharStar) +{ + printer->print("hello"); + printer->print("hello\n"); + STRCMP_EQUAL("hellohello\n", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintLong) +{ + long number = 1234; + printer->print(number); + STRCMP_EQUAL("1234", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintSize) +{ + size_t ten = 10; + printer->print(ten); + STRCMP_EQUAL("10", mock->getOutput().asCharString()); +} + + +TEST(TestOutput, PrintDouble) +{ + printer->printDouble(12.34); + STRCMP_EQUAL("12.34", mock->getOutput().asCharString()); +} + +TEST(TestOutput, StreamOperators) +{ + *printer << "n=" << 1234; + STRCMP_EQUAL("n=1234", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintTestEnded) +{ + printer->printCurrentTestEnded(*result); + STRCMP_EQUAL(".", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintTestALot) +{ + for (int i = 0; i < 60; ++i) { + printer->printCurrentTestEnded(*result); + } + STRCMP_EQUAL("..................................................\n..........", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintTestALotAndSimulateRepeatRun) +{ + for (int i = 0; i < 60; ++i) { + runOneTest(); + printer->printCurrentTestEnded(*result); + } + + printer->printTestsEnded(*result); + + for (int i = 0; i < 60; ++i) { + runOneTest(); + printer->printCurrentTestEnded(*result); + } + STRCMP_EQUAL("..................................................\n.........." \ + "\nOK (60 tests, 60 ran, 0 checks, 0 ignored, 0 filtered out, 10 ms)\n\n" \ + "..................................................\n..........", mock->getOutput().asCharString()); +} + +TEST(TestOutput, SetProgressIndicator) +{ + printer->setProgressIndicator("."); + printer->printCurrentTestEnded(*result); + printer->setProgressIndicator("!"); + printer->printCurrentTestEnded(*result); + printer->setProgressIndicator("."); + printer->printCurrentTestEnded(*result); + + STRCMP_EQUAL(".!.", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintTestVerboseStarted) +{ + mock->verbose(TestOutput::level_verbose); + printer->printCurrentTestStarted(*tst); + STRCMP_EQUAL("TEST(group, test)", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintTestVerboseEnded) +{ + mock->verbose(TestOutput::level_verbose); + result->currentTestStarted(tst); + millisTime = 5; + result->currentTestEnded(tst); + STRCMP_EQUAL("TEST(group, test) - 5 ms\n", mock->getOutput().asCharString()); +} + +TEST(TestOutput, printColorWithSuccess) +{ + mock->color(); + runOneTest(); + printer->printTestsEnded(*result); + STRCMP_EQUAL("\n\033[32;1mOK (1 tests, 1 ran, 0 checks, 0 ignored, 0 filtered out, 10 ms)\033[m\n\n", + mock->getOutput().asCharString()); +} + +TEST(TestOutput, printColorWithFailures) +{ + mock->color(); + runOneTest(); + result->addFailure(*f); + printer->flush(); + printer->printTestsEnded(*result); + STRCMP_EQUAL("\n\033[31;1mErrors (1 failures, 1 tests, 1 ran, 0 checks, 0 ignored, 0 filtered out, 10 ms)" + "\033[m\n\n", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintTestRun) +{ + printer->printTestRun(2, 3); + STRCMP_EQUAL("Test run 2 of 3\n", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintTestRunOnlyOne) +{ + printer->printTestRun(1, 1); + STRCMP_EQUAL("", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintWithFailureInSameFile) +{ + printer->printFailure(*f2); + STRCMP_EQUAL("\nfile:20: error: Failure in TEST(group, test)\n\tmessage\n\n", mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintFailureWithFailInDifferentFile) +{ + printer->printFailure(*f); + const char* expected = + "\nfile:10: error: Failure in TEST(group, test)" + "\nfailfile:20: error:\n\tmessage\n\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintFailureWithFailInHelper) +{ + printer->printFailure(*f3); + const char* expected = + "\nfile:10: error: Failure in TEST(group, test)" + "\nfile:2: error:\n\tmessage\n\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintInVisualStudioFormat) +{ + TestOutput::setWorkingEnvironment(TestOutput::visualStudio); + printer->printFailure(*f3); + const char* expected = + "\nfile(10): error: Failure in TEST(group, test)" + "\nfile(2): error:\n\tmessage\n\n"; + STRCMP_EQUAL(expected, mock->getOutput().asCharString()); +} + +TEST(TestOutput, PrintTestStarts) +{ + printer->printTestsStarted(); + STRCMP_EQUAL("", mock->getOutput().asCharString()); +} + +TEST(TestOutput, printTestsEnded) +{ + result->countTest(); + result->countCheck(); + result->countIgnored(); + result->countIgnored(); + result->countRun(); + result->countRun(); + result->countRun(); + printer->printTestsEnded(*result); + STRCMP_EQUAL("\nOK (1 tests, 3 ran, 1 checks, 2 ignored, 0 filtered out, 10 ms)\n\n", mock->getOutput().asCharString()); +} + +TEST(TestOutput, printTestsEndedWithFailures) +{ + result->addFailure(*f); + printer->flush(); + printer->printTestsEnded(*result); + STRCMP_EQUAL("\nErrors (1 failures, 0 tests, 0 ran, 0 checks, 0 ignored, 0 filtered out, 10 ms)\n\n", mock->getOutput().asCharString()); +} + +TEST(TestOutput, printTestsEndedWithNoTestsRunOrIgnored) +{ + result->countTest(); + printer->flush(); + printer->printTestsEnded(*result); + STRCMP_EQUAL("\nErrors (ran nothing, 1 tests, 0 ran, 0 checks, 0 ignored, 0 filtered out, 10 ms)\n" + "Note: test run failed because no tests were run or ignored. Assuming something went wrong. " + "This often happens because of linking errors or typos in test filter.\n\n", + mock->getOutput().asCharString()); +} + +class CompositeTestOutputTestStringBufferTestOutput : public StringBufferTestOutput +{ + public: + virtual void printTestsStarted() + { + output += "Test Start\n"; + } + + virtual void printTestsEnded(const TestResult& result) + { + output += StringFromFormat("Test End %d\n", (int) result.getTestCount()); + } + + void printCurrentGroupStarted(const UtestShell& test) + { + output += StringFromFormat("Group %s Start\n", test.getGroup().asCharString()); + } + + void printCurrentGroupEnded(const TestResult& res) + { + output += StringFromFormat("Group End %d\n", (int) res.getTestCount()); + } + + virtual void printCurrentTestStarted(const UtestShell&) + { + output += "s"; + } + + void flush() + { + output += "flush"; + } + + virtual bool isVerbose() + { + return verbose_ == level_verbose || verbose_ == level_veryVerbose; + } + + virtual bool isColor() + { + return color_; + } + + virtual const char* getProgressIndicator() + { + return progressIndication_; + } +}; + +TEST_GROUP(CompositeTestOutput) +{ + CompositeTestOutputTestStringBufferTestOutput* output1; + CompositeTestOutputTestStringBufferTestOutput* output2; + CompositeTestOutput compositeOutput; + TestResult* result; + UtestShell* test; + + void setup() + { + output1 = new CompositeTestOutputTestStringBufferTestOutput; + output2 = new CompositeTestOutputTestStringBufferTestOutput; + compositeOutput.setOutputOne(output1); + compositeOutput.setOutputTwo(output2); + result = new TestResult(compositeOutput); + test = new UtestShell("Group", "Name", "file", 10); + } + + void teardown() + { + delete test; + delete result; + } +}; + +TEST(CompositeTestOutput, TestStartedAndEnded) +{ + compositeOutput.printTestsStarted(); + compositeOutput.printTestsEnded(*result); + STRCMP_EQUAL("Test Start\nTest End 0\n", output1->getOutput().asCharString()); + STRCMP_EQUAL("Test Start\nTest End 0\n", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, CurrentTestStartedAndEnded) +{ + compositeOutput.printCurrentTestStarted(*test); + compositeOutput.printCurrentTestEnded(*result); + STRCMP_EQUAL("s.", output1->getOutput().asCharString()); + STRCMP_EQUAL("s.", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, CurrentGroupStartedAndEnded) +{ + compositeOutput.printCurrentGroupStarted(*test); + compositeOutput.printCurrentGroupEnded(*result); + STRCMP_EQUAL("Group Group Start\nGroup End 0\n", output1->getOutput().asCharString()); + STRCMP_EQUAL("Group Group Start\nGroup End 0\n", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, PrintBuffer) +{ + compositeOutput.printBuffer("Boo"); + STRCMP_EQUAL("Boo", output1->getOutput().asCharString()); + STRCMP_EQUAL("Boo", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, printChar) +{ + compositeOutput.print("Boo"); + STRCMP_EQUAL("Boo", output1->getOutput().asCharString()); + STRCMP_EQUAL("Boo", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, printLong) +{ + long ten = 10; + compositeOutput.print(ten); + STRCMP_EQUAL("10", output1->getOutput().asCharString()); + STRCMP_EQUAL("10", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, PrintSize) +{ + size_t ten = 10; + compositeOutput.print(ten); + STRCMP_EQUAL("10", output1->getOutput().asCharString()); + STRCMP_EQUAL("10", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, printDouble) +{ + compositeOutput.printDouble(1.01); + STRCMP_EQUAL("1.01", output1->getOutput().asCharString()); + STRCMP_EQUAL("1.01", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, verbose) +{ + compositeOutput.verbose(TestOutput::level_verbose); + CHECK(output1->isVerbose()); + CHECK(output2->isVerbose()); +} + +TEST(CompositeTestOutput, color) +{ + compositeOutput.color(); + CHECK(output1->isColor()); + CHECK(output2->isColor()); +} + +TEST(CompositeTestOutput, PrintTestFailure) +{ + TestOutput::WorkingEnvironment previousEnvironment = TestOutput::getWorkingEnvironment(); + TestOutput::setWorkingEnvironment(TestOutput::eclipse); + TestFailure failure(test, "file", 10, "failed"); + compositeOutput.printFailure(failure); + STRCMP_EQUAL("\nfile:10: error: Failure in TEST(Group, Name)\n\tfailed\n\n", output1->getOutput().asCharString()); + STRCMP_EQUAL("\nfile:10: error: Failure in TEST(Group, Name)\n\tfailed\n\n", output2->getOutput().asCharString()); + TestOutput::setWorkingEnvironment(previousEnvironment); +} + +TEST(CompositeTestOutput, PrintTestRun) +{ + compositeOutput.printTestRun(1, 2); + STRCMP_EQUAL("Test run 1 of 2\n", output1->getOutput().asCharString()); + STRCMP_EQUAL("Test run 1 of 2\n", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, setProgressIndicator) +{ + compositeOutput.setProgressIndicator("?"); + STRCMP_EQUAL("?", output1->getProgressIndicator()); + STRCMP_EQUAL("?", output2->getProgressIndicator()); +} + +TEST(CompositeTestOutput, flush) +{ + compositeOutput.flush(); + STRCMP_EQUAL("flush", output1->getOutput().asCharString()); + STRCMP_EQUAL("flush", output2->getOutput().asCharString()); +} + +TEST(CompositeTestOutput, deletePreviousInstanceWhenSettingNew) +{ + compositeOutput.setOutputOne(new CompositeTestOutput); + compositeOutput.setOutputTwo(new CompositeTestOutput); + + // CHECK NO MEMORY LEAKS +} + diff -Nru cpputest-3.8/tests/CppUTest/TestRegistryTest.cpp cpputest-4.0/tests/CppUTest/TestRegistryTest.cpp --- cpputest-3.8/tests/CppUTest/TestRegistryTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestRegistryTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,427 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestRegistry.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/PlatformSpecificFunctions.h" + +namespace +{ +const int testLineNumber = 1; +} + +class MockTest: public UtestShell +{ +public: + MockTest(const char* group = "Group") : + UtestShell(group, "Name", "File", testLineNumber), hasRun_(false) + { + } + virtual void runOneTest(TestPlugin*, TestResult&) + { + hasRun_ = true; + } + + bool hasRun_; +}; + +class MockTestResult: public TestResult +{ +public: + + int countTestsStarted; + int countTestsEnded; + int countCurrentTestStarted; + int countCurrentTestEnded; + int countCurrentGroupStarted; + int countCurrentGroupEnded; + + MockTestResult(TestOutput& p) : + TestResult(p) + { + resetCount(); + } + + virtual ~MockTestResult() _destructor_override + { + } + + void resetCount() + { + countTestsStarted = 0; + countTestsEnded = 0; + countCurrentTestStarted = 0; + countCurrentTestEnded = 0; + countCurrentGroupStarted = 0; + countCurrentGroupEnded = 0; + } + + virtual void testsStarted() _override + { + countTestsStarted++; + } + virtual void testsEnded() _override + { + countTestsEnded++; + } + virtual void currentTestStarted(UtestShell* /*test*/) _override + { + countCurrentTestStarted++; + } + virtual void currentTestEnded(UtestShell* /*test*/) _override + { + countCurrentTestEnded++; + } + virtual void currentGroupStarted(UtestShell* /*test*/) _override + { + countCurrentGroupStarted++; + } + virtual void currentGroupEnded(UtestShell* /*test*/) _override + { + countCurrentGroupEnded++; + } + +}; + +TEST_GROUP(TestRegistry) +{ + TestRegistry* myRegistry; + StringBufferTestOutput* output; + MockTest* test1; + MockTest* test2; + MockTest* test3; + MockTest* test4; + TestResult *result; + MockTestResult *mockResult; + void setup() + { + output = new StringBufferTestOutput(); + mockResult = new MockTestResult(*output); + result = mockResult; + test1 = new MockTest(); + test2 = new MockTest(); + test3 = new MockTest("group2"); + test4 = new MockTest(); + myRegistry = new TestRegistry(); + myRegistry->setCurrentRegistry(myRegistry); + } + + void teardown() + { + myRegistry->setCurrentRegistry(NULLPTR); + delete myRegistry; + delete test1; + delete test2; + delete test3; + delete test4; + delete result; + delete output; + } + + void addAndRunAllTests() + { + myRegistry->addTest(test1); + myRegistry->addTest(test2); + myRegistry->addTest(test3); + myRegistry->runAllTests(*result); + } +}; + +TEST(TestRegistry, registryMyRegistryAndReset) +{ + CHECK(myRegistry->getCurrentRegistry() == myRegistry); +} + +TEST(TestRegistry, emptyRegistryIsEmpty) +{ + CHECK(myRegistry->countTests() == 0); +} + +TEST(TestRegistry, addOneTestIsNotEmpty) +{ + myRegistry->addTest(test1); + CHECK(myRegistry->countTests() == 1); +} + +TEST(TestRegistry, addOneTwoTests) +{ + myRegistry->addTest(test1); + myRegistry->addTest(test2); + CHECK(myRegistry->countTests() == 2); +} + +TEST(TestRegistry, runTwoTests) +{ + myRegistry->addTest(test1); + myRegistry->addTest(test2); + CHECK(!test1->hasRun_); + CHECK(!test2->hasRun_); + myRegistry->runAllTests(*result); + CHECK(test1->hasRun_); + CHECK(test2->hasRun_); +} + +TEST(TestRegistry, runTwoTestsCheckResultFunctionsCalled) +{ + myRegistry->addTest(test1); + myRegistry->addTest(test2); + myRegistry->runAllTests(*result); + LONGS_EQUAL(1, mockResult->countTestsStarted); + LONGS_EQUAL(1, mockResult->countTestsEnded); + LONGS_EQUAL(1, mockResult->countCurrentGroupStarted); + LONGS_EQUAL(1, mockResult->countCurrentGroupEnded); + LONGS_EQUAL(2, mockResult->countCurrentTestStarted); + LONGS_EQUAL(2, mockResult->countCurrentTestEnded); +} + +TEST(TestRegistry, runThreeTestsandTwoGroupsCheckResultFunctionsCalled) +{ + addAndRunAllTests(); + LONGS_EQUAL(2, mockResult->countCurrentGroupStarted); + LONGS_EQUAL(2, mockResult->countCurrentGroupEnded); + LONGS_EQUAL(3, mockResult->countCurrentTestStarted); + LONGS_EQUAL(3, mockResult->countCurrentTestEnded); +} + +TEST(TestRegistry, unDoTest) +{ + myRegistry->addTest(test1); + CHECK(myRegistry->countTests() == 1); + myRegistry->unDoLastAddTest(); + CHECK(myRegistry->countTests() == 0); +} + +TEST(TestRegistry, unDoButNoTest) +{ + CHECK(myRegistry->countTests() == 0); + myRegistry->unDoLastAddTest(); + CHECK(myRegistry->countTests() == 0); +} + +TEST(TestRegistry, reallyUndoLastTest) +{ + myRegistry->addTest(test1); + myRegistry->addTest(test2); + CHECK(myRegistry->countTests() == 2); + myRegistry->unDoLastAddTest(); + CHECK(myRegistry->countTests() == 1); + myRegistry->runAllTests(*result); + CHECK(test1->hasRun_); + CHECK(!test2->hasRun_); +} + +TEST(TestRegistry, findTestWithNameDoesntExist) +{ + CHECK(myRegistry->findTestWithName("ThisTestDoesntExists") == NULLPTR); +} + +TEST(TestRegistry, findTestWithName) +{ + test1->setTestName("NameOfATestThatDoesExist"); + test2->setTestName("SomeOtherTest"); + myRegistry->addTest(test1); + myRegistry->addTest(test2); + CHECK(myRegistry->findTestWithName("NameOfATestThatDoesExist") != NULLPTR); +} + +TEST(TestRegistry, findTestWithGroupDoesntExist) +{ + CHECK(myRegistry->findTestWithGroup("ThisTestGroupDoesntExists") == NULLPTR); +} + +TEST(TestRegistry, findTestWithGroup) +{ + test1->setGroupName("GroupOfATestThatDoesExist"); + test2->setGroupName("SomeOtherGroup"); + myRegistry->addTest(test1); + myRegistry->addTest(test2); + CHECK(myRegistry->findTestWithGroup("GroupOfATestThatDoesExist") != NULLPTR); +} + +TEST(TestRegistry, nameFilterWorks) +{ + test1->setTestName("testname"); + test2->setTestName("noname"); + TestFilter nameFilter("testname"); + myRegistry->setNameFilters(&nameFilter); + addAndRunAllTests(); + CHECK(test1->hasRun_); + CHECK(!test2->hasRun_); +} + +TEST(TestRegistry, groupFilterWorks) +{ + test1->setGroupName("groupname"); + test2->setGroupName("noname"); + TestFilter groupFilter("groupname"); + myRegistry->setGroupFilters(&groupFilter); + addAndRunAllTests(); + CHECK(test1->hasRun_); + CHECK(!test2->hasRun_); +} + +TEST(TestRegistry, runTestInSeperateProcess) +{ + myRegistry->setRunTestsInSeperateProcess(); + myRegistry->addTest(test1); + myRegistry->runAllTests(*result); + CHECK(test1->isRunInSeperateProcess()); +} + +TEST(TestRegistry, CurrentRepetitionIsCorrectNone) +{ + CHECK(0 == myRegistry->getCurrentRepetition()); + myRegistry->runAllTests(*result); + LONGS_EQUAL(1, myRegistry->getCurrentRepetition()); +} + +TEST(TestRegistry, CurrentRepetitionIsCorrectTwo) +{ + CHECK(0 == myRegistry->getCurrentRepetition()); + myRegistry->runAllTests(*result); + myRegistry->runAllTests(*result); + LONGS_EQUAL(2, myRegistry->getCurrentRepetition()); +} + +class MyTestPluginDummy: public TestPlugin +{ +public: + MyTestPluginDummy(const SimpleString& name) : TestPlugin(name) {} + virtual ~MyTestPluginDummy() _destructor_override {} + virtual void runAllPreTestAction(UtestShell&, TestResult&) _override {} + virtual void runAllPostTestAction(UtestShell&, TestResult&) _override {} +}; + +TEST(TestRegistry, ResetPluginsWorks) +{ + MyTestPluginDummy plugin1("Plugin-1"); + MyTestPluginDummy plugin2("Plugin-2"); + myRegistry->installPlugin(&plugin1); + myRegistry->installPlugin(&plugin2); + LONGS_EQUAL(2, myRegistry->countPlugins()); + myRegistry->resetPlugins(); + LONGS_EQUAL(0, myRegistry->countPlugins()); +} + +TEST(TestRegistry, listTestGroupNames_shouldListBackwardsGroup1AfterGroup11AndGroup2OnlyOnce) +{ + test1->setGroupName("GROUP_1"); + myRegistry->addTest(test1); + test2->setGroupName("GROUP_2"); + myRegistry->addTest(test2); + test3->setGroupName("GROUP_11"); + myRegistry->addTest(test3); + test4->setGroupName("GROUP_2"); + myRegistry->addTest(test4); + + myRegistry->listTestGroupNames(*result); + SimpleString s = output->getOutput(); + STRCMP_EQUAL("GROUP_2 GROUP_11 GROUP_1", s.asCharString()); +} + +TEST(TestRegistry, listTestGroupAndCaseNames_shouldListBackwardsGroupATestaAfterGroupAtestaa) +{ + test1->setGroupName("GROUP_A"); + test1->setTestName("test_a"); + myRegistry->addTest(test1); + test2->setGroupName("GROUP_B"); + test2->setTestName("test_b"); + myRegistry->addTest(test2); + test3->setGroupName("GROUP_A"); + test3->setTestName("test_aa"); + myRegistry->addTest(test3); + + myRegistry->listTestGroupAndCaseNames(*result); + SimpleString s = output->getOutput(); + STRCMP_EQUAL("GROUP_A.test_aa GROUP_B.test_b GROUP_A.test_a", s.asCharString()); +} + +TEST(TestRegistry, shuffleEmptyListIsNoOp) +{ + CHECK_TRUE(myRegistry->getFirstTest() == NULLPTR); + myRegistry->shuffleTests(0); + CHECK_TRUE(myRegistry->getFirstTest() == NULLPTR); +} + +TEST(TestRegistry, shuffleSingleTestIsNoOp) +{ + myRegistry->addTest(test1); + myRegistry->shuffleTests(0); + CHECK_TRUE(myRegistry->getFirstTest() == test1); +} + +static int getZero() +{ + return 0; +} + +IGNORE_TEST(TestRegistry, shuffleTestList) +{ + UT_PTR_SET(PlatformSpecificRand, getZero); + myRegistry->addTest(test3); + myRegistry->addTest(test2); + myRegistry->addTest(test1); + + UtestShell* first_before = myRegistry->getFirstTest(); + UtestShell* second_before = first_before->getNext(); + UtestShell* third_before = second_before->getNext(); + + CHECK_TRUE(first_before == test1); + CHECK_TRUE(second_before == test2); + CHECK_TRUE(third_before == test3); + CHECK_TRUE(third_before->getNext() == NULLPTR); + + // shuffle always with element at index 0: [1] 2 [3] --> [3] [2] 1 --> 2 3 1 + myRegistry->shuffleTests(0); + + UtestShell* first_after = myRegistry->getFirstTest(); + UtestShell* second_after = first_after->getNext(); + UtestShell* third_after = second_after->getNext(); + + CHECK_TRUE(first_after == test2); + CHECK_TRUE(second_after == test3); + CHECK_TRUE(third_after == test1); + CHECK_TRUE(third_after->getNext() == NULLPTR); +} + +TEST(TestRegistry, reverseTests) +{ + myRegistry->addTest(test1); + myRegistry->addTest(test2); + + myRegistry->reverseTests(); + + CHECK(test1 == myRegistry->getFirstTest()); +} + +TEST(TestRegistry, reverseZeroTests) +{ + myRegistry->reverseTests(); + + CHECK(NULLPTR == myRegistry->getFirstTest()); +} diff -Nru cpputest-3.8/tests/CppUTest/TestResultTest.cpp cpputest-4.0/tests/CppUTest/TestResultTest.cpp --- cpputest-3.8/tests/CppUTest/TestResultTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestResultTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/PlatformSpecificFunctions.h" +#include "CppUTest/TestOutput.h" + +extern "C" { + + static long MockGetPlatformSpecificTimeInMillis() + { + return 10; + } + +} + +TEST_GROUP(TestResult) +{ + TestOutput* printer; + StringBufferTestOutput* mock; + + TestResult* res; + + void setup() + { + mock = new StringBufferTestOutput(); + printer = mock; + res = new TestResult(*printer); + UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); + } + void teardown() + { + delete printer; + delete res; + } +}; + +TEST(TestResult, TestEndedWillPrintResultsAndExecutionTime) +{ + res->testsEnded(); + CHECK(mock->getOutput().contains("10 ms")); +} + +TEST(TestResult, ResultIsOkIfTestIsRunWithNoFailures) +{ + res->countTest(); + res->countRun(); + CHECK_FALSE(res->isFailure()); +} + +TEST(TestResult, ResultIsOkIfTestIsIgnored) +{ + res->countTest(); + res->countIgnored(); + CHECK_FALSE(res->isFailure()); +} + +TEST(TestResult, ResultIsNotOkIfFailures) +{ + res->countTest(); + res->countRun(); + res->addFailure(TestFailure(UtestShell::getCurrent(), StringFrom("dummy message"))); + CHECK_TRUE(res->isFailure()); +} + +TEST(TestResult, ResultIsNotOkIfNoTestsAtAll) +{ + CHECK_TRUE(res->isFailure()); +} + +TEST(TestResult, ResultIsNotOkIfNoTestsRunOrIgnored) +{ + res->countTest(); + CHECK_TRUE(res->isFailure()); +} diff -Nru cpputest-3.8/tests/CppUTest/TestUTestMacro.cpp cpputest-4.0/tests/CppUTest/TestUTestMacro.cpp --- cpputest-3.8/tests/CppUTest/TestUTestMacro.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestUTestMacro.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,1314 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestTestingFixture.h" + +#define CHECK_TEST_FAILS_PROPER_WITH_TEXT(text) fixture.checkTestFailsWithProperTestLocation(text, __FILE__, __LINE__) + +// Mainly this is for Visual C++, but we'll define it for any system that has the same behavior +// of a 32-bit long on a 64-bit system +#if defined(CPPUTEST_64BIT) && defined(CPPUTEST_64BIT_32BIT_LONGS) +// Forcing the value to be unsigned long long means that there's no sign-extension to perform +#define to_void_pointer(x) ((void *)x##ULL) +#define to_func_pointer(x) ((void (*)())x##ULL) +#else +// Probably not needed, but let's guarantee that the value is an unsigned long +#define to_void_pointer(x) ((void *)x##UL) +#define to_func_pointer(x) ((void (*)())x##UL) +#endif + +TEST_GROUP(UnitTestMacros) +{ + TestTestingFixture fixture; +}; + +static void _failingTestMethodWithFAIL() +{ + FAIL("This test fails"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FAILMakesTheTestFailPrintsTheRightResultAndStopsExecuting) +{ + fixture.runTestWithMethod(_failingTestMethodWithFAIL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("This test fails"); +} + +TEST(UnitTestMacros, FAILWillPrintTheFileThatItFailed) +{ + fixture.runTestWithMethod(_failingTestMethodWithFAIL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT(__FILE__); +} + +TEST(UnitTestMacros, FAILBehavesAsAProperMacro) +{ + if (false) FAIL(""); + else CHECK(true); + + if (true) CHECK(true); + else FAIL(""); +} + +IGNORE_TEST(UnitTestMacros, FAILworksInAnIgnoredTest) +{ + FAIL("die!"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _UNSIGNED_LONGS_EQUALTestMethod() +{ + UNSIGNED_LONGS_EQUAL(1, 1); + UNSIGNED_LONGS_EQUAL(1, 0); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestUNSIGNED_LONGS_EQUAL) +{ + fixture.runTestWithMethod(_UNSIGNED_LONGS_EQUALTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0)>"); +} + +TEST(UnitTestMacros, UNSIGNED_LONGS_EQUALBehavesAsProperMacro) +{ + if (false) UNSIGNED_LONGS_EQUAL(1, 0); + else UNSIGNED_LONGS_EQUAL(1, 1); +} + +IGNORE_TEST(UnitTestMacros, UNSIGNED_LONGS_EQUALWorksInAnIgnoredTest) +{ + UNSIGNED_LONGS_EQUAL(1, 0); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _UNSIGNED_LONGS_EQUAL_TEXTTestMethod() +{ + UNSIGNED_LONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestUNSIGNED_LONGS_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_UNSIGNED_LONGS_EQUAL_TEXTTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, UNSIGNED_LONGS_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) UNSIGNED_LONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); + else UNSIGNED_LONGS_EQUAL_TEXT(1, 1, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, UNSIGNED_LONGS_EQUAL_TEXTWorksInAnIgnoredTest) +{ + UNSIGNED_LONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +#ifdef CPPUTEST_USE_LONG_LONG + +static void _LONGLONGS_EQUALTestMethod() +{ + LONGLONGS_EQUAL(1, 1); + LONGLONGS_EQUAL(1, 0); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestLONGLONGS_EQUAL) +{ + fixture.runTestWithMethod(_LONGLONGS_EQUALTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0)>"); +} + +TEST(UnitTestMacros, LONGLONGS_EQUALBehavesAsProperMacro) +{ + if (false) LONGLONGS_EQUAL(1, 0); + else LONGLONGS_EQUAL(1, 1); +} + +IGNORE_TEST(UnitTestMacros, LONGLONGS_EQUALWorksInAnIgnoredTest) +{ + LONGLONGS_EQUAL(1, 0); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _LONGLONGS_EQUAL_TEXTTestMethod() +{ + LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestLONGLONGS_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_LONGLONGS_EQUAL_TEXTTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, LONGLONGS_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); + else LONGLONGS_EQUAL_TEXT(1, 1, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, LONGLONGS_EQUAL_TEXTWorksInAnIgnoredTest) +{ + LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _UNSIGNED_LONGLONGS_EQUALTestMethod() +{ + UNSIGNED_LONGLONGS_EQUAL(1, 1); + UNSIGNED_LONGLONGS_EQUAL(1, 0); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestUNSIGNED_LONGLONGS_EQUAL) +{ + fixture.runTestWithMethod(_UNSIGNED_LONGLONGS_EQUALTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0)>"); +} + +TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUALBehavesAsProperMacro) +{ + if (false) UNSIGNED_LONGLONGS_EQUAL(1, 0); + else UNSIGNED_LONGLONGS_EQUAL(1, 1); +} + +IGNORE_TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUALWorksInAnIgnoredTest) +{ + UNSIGNED_LONGLONGS_EQUAL(1, 0); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _UNSIGNED_LONGLONGS_EQUAL_TEXTTestMethod() +{ + UNSIGNED_LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestUNSIGNED_LONGLONGS_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_UNSIGNED_LONGLONGS_EQUAL_TEXTTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) UNSIGNED_LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); + else UNSIGNED_LONGLONGS_EQUAL_TEXT(1, 1, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUAL_TEXTWorksInAnIgnoredTest) +{ + UNSIGNED_LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +#else + +static void _LONGLONGS_EQUALFailsWithUnsupportedFeatureTestMethod() +{ + LONGLONGS_EQUAL(1, 1); +} // LCOV_EXCL_LINE + +static void _UNSIGNED_LONGLONGS_EQUALFailsWithUnsupportedFeatureTestMethod() +{ + UNSIGNED_LONGLONGS_EQUAL(1, 1); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, LONGLONGS_EQUALFailsWithUnsupportedFeature) +{ + fixture.runTestWithMethod(_LONGLONGS_EQUALFailsWithUnsupportedFeatureTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("\"CPPUTEST_USE_LONG_LONG\" is not supported"); +} + +TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUALFailsWithUnsupportedFeature) +{ + fixture.runTestWithMethod(_UNSIGNED_LONGLONGS_EQUALFailsWithUnsupportedFeatureTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("\"CPPUTEST_USE_LONG_LONG\" is not supported"); +} + +#endif /* CPPUTEST_USE_LONG_LONG */ + +static void _failingTestMethodWithCHECK() +{ + CHECK(false); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK(false) failed"); +} + +TEST(UnitTestMacros, CHECKBehavesAsProperMacro) +{ + if (false) CHECK(false); + else CHECK(true); +} + +IGNORE_TEST(UnitTestMacros, CHECKWorksInAnIgnoredTest) +{ + CHECK(false); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithCHECK_TEXT() +{ + CHECK_TEXT(false, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK(false) failed"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, CHECK_TEXTBehavesAsProperMacro) +{ + if (false) CHECK_TEXT(false, "false"); + else CHECK_TEXT(true, "true"); +} + +IGNORE_TEST(UnitTestMacros, CHECK_TEXTWorksInAnIgnoredTest) +{ + CHECK_TEXT(false, "false"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithCHECK_TRUE() +{ + CHECK_TRUE(false); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_TRUE) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_TRUE); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_TRUE(false) failed"); +} + +TEST(UnitTestMacros, CHECK_TRUEBehavesAsProperMacro) +{ + if (false) CHECK_TRUE(false); + else CHECK_TRUE(true); +} + +IGNORE_TEST(UnitTestMacros, CHECK_TRUEWorksInAnIgnoredTest) +{ + CHECK_TRUE(false); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithCHECK_TRUE_TEXT() +{ + CHECK_TRUE_TEXT(false, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_TRUE_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_TRUE_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_TRUE(false) failed"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, CHECK_TRUE_TEXTBehavesAsProperMacro) +{ + if (false) CHECK_TRUE_TEXT(false, "Failed because it failed"); + else CHECK_TRUE_TEXT(true, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, CHECK_TRUE_TEXTWorksInAnIgnoredTest) +{ + CHECK_TRUE_TEXT(false, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithCHECK_FALSE() +{ + CHECK_FALSE(true); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_FALSE) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_FALSE); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_FALSE(true) failed"); +} + +TEST(UnitTestMacros, CHECK_FALSEBehavesAsProperMacro) +{ + if (false) CHECK_FALSE(true); + else CHECK_FALSE(false); +} + +IGNORE_TEST(UnitTestMacros, CHECK_FALSEWorksInAnIgnoredTest) +{ + CHECK_FALSE(true); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithCHECK_FALSE_TEXT() +{ + CHECK_FALSE_TEXT(true, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_FALSE_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_FALSE_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_FALSE(true)"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, CHECK_FALSE_TEXTBehavesAsProperMacro) +{ + if (false) CHECK_FALSE_TEXT(true, "Failed because it failed"); + else CHECK_FALSE_TEXT(false, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, CHECK_FALSE_TEXTWorksInAnIgnoredTest) +{ + CHECK_FALSE_TEXT(true, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithCHECK_EQUAL() +{ + CHECK_EQUAL(1, 2); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <2>"); +} + +static void _failingTestMethodWithCHECK_COMPARE() +{ + double small = 0.5, big = 0.8; + CHECK_COMPARE(small, >=, big); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_COMPARE) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_COMPARE); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_COMPARE(0.5 >= 0.8)"); +} + +TEST(UnitTestMacros, CHECK_COMPAREBehavesAsProperMacro) +{ + if (false) CHECK_COMPARE(1, >, 2); + else CHECK_COMPARE(1, <, 2); +} + +IGNORE_TEST(UnitTestMacros, CHECK_COMPAREWorksInAnIgnoredTest) +{ + CHECK_COMPARE(1, >, 2); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithCHECK_COMPARE_TEXT() +{ + double small = 0.5, big = 0.8; + CHECK_COMPARE_TEXT(small, >=, big, "small bigger than big"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_COMPARE_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_COMPARE_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_COMPARE(0.5 >= 0.8)"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("small bigger than big"); +} + +TEST(UnitTestMacros, CHECK_COMPARE_TEXTBehavesAsProperMacro) +{ + if (false) CHECK_COMPARE_TEXT(1, >, 2, "1 bigger than 2"); + else CHECK_COMPARE_TEXT(1, <, 2, "1 smaller than 2"); +} + +IGNORE_TEST(UnitTestMacros, CHECK_COMPARE_TEXTWorksInAnIgnoredTest) +{ + CHECK_COMPARE_TEXT(1, >, 2, "1 smaller than 2"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static int countInCountingMethod; +static int _countingMethod() +{ + return countInCountingMethod++; +} + +TEST(UnitTestMacros, LONGS_EQUAL_macroExpressionSafety) +{ + LONGS_EQUAL(1, 0.4 + 0.7); + LONGS_EQUAL(0.4 + 0.7, 1); + LONGS_EQUAL_TEXT(1, 0.4 + 0.7, "-Wconversion=great"); + LONGS_EQUAL_TEXT(0.4 + 0.7, 1, "-Wconversion=great"); +} + +TEST(UnitTestMacros, UNSIGNED_LONGS_EQUAL_macroExpressionSafety) +{ + UNSIGNED_LONGS_EQUAL(1, 0.4 + 0.7); + UNSIGNED_LONGS_EQUAL(0.4 + 0.7, 1); + UNSIGNED_LONGS_EQUAL_TEXT(1, 0.4 + 0.7, "-Wconversion=great"); + UNSIGNED_LONGS_EQUAL_TEXT(0.4 + 0.7, 1, "-Wconversion=great"); +} + +TEST(UnitTestMacros, passingCheckEqualWillNotBeEvaluatedMultipleTimesWithCHECK_EQUAL) +{ + countInCountingMethod = 0; + CHECK_EQUAL(0, _countingMethod()); + + LONGS_EQUAL(1, countInCountingMethod); +} + +static void _failing_CHECK_EQUAL_WithActualBeingEvaluatesMultipleTimesWillGiveAWarning() +{ + CHECK_EQUAL(12345, _countingMethod()); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, failing_CHECK_EQUAL_WithActualBeingEvaluatesMultipleTimesWillGiveAWarning) +{ + fixture.runTestWithMethod(_failing_CHECK_EQUAL_WithActualBeingEvaluatesMultipleTimesWillGiveAWarning); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("WARNING:\n\tThe \"Actual Parameter\" parameter is evaluated multiple times resulting in different values.\n\tThus the value in the error message is probably incorrect."); +} + +static void _failing_CHECK_EQUAL_WithExpectedBeingEvaluatesMultipleTimesWillGiveAWarning() +{ + CHECK_EQUAL(_countingMethod(), 12345); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, failing_CHECK_EQUAL_WithExpectedBeingEvaluatesMultipleTimesWillGiveAWarning) +{ + fixture.runTestWithMethod(_failing_CHECK_EQUAL_WithExpectedBeingEvaluatesMultipleTimesWillGiveAWarning); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("WARNING:\n\tThe \"Expected Parameter\" parameter is evaluated multiple times resulting in different values.\n\tThus the value in the error message is probably incorrect."); +} + +TEST(UnitTestMacros, failing_CHECK_EQUAL_withParamatersThatDontChangeWillNotGiveAnyWarning) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_EQUAL); + fixture.assertPrintContainsNot("WARNING"); +} + +TEST(UnitTestMacros, CHECK_EQUALBehavesAsProperMacro) +{ + if (false) CHECK_EQUAL(1, 2); + else CHECK_EQUAL(1, 1); +} + +IGNORE_TEST(UnitTestMacros, CHECK_EQUALWorksInAnIgnoredTest) +{ + CHECK_EQUAL(1, 2); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithCHECK_EQUAL_TEXT() +{ + CHECK_EQUAL_TEXT(1, 2, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithCHECK_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <2>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, CHECK_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) CHECK_EQUAL_TEXT(1, 2, "Failed because it failed"); + else CHECK_EQUAL_TEXT(1, 1, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, CHECK_EQUAL_TEXTWorksInAnIgnoredTest) +{ + CHECK_EQUAL_TEXT(1, 2, "Failed because it failed"); // LCOV_EXCL_LINE; +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithLONGS_EQUAL() +{ + LONGS_EQUAL(1, 0xff); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithLONGS_EQUALS) +{ + fixture.runTestWithMethod(_failingTestMethodWithLONGS_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected < 1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <255 (0xff)>"); +} + +static void _failingTestMethodWithLONGS_EQUALWithSymbolicParameters() +{ +#define _MONDAY 1 + int day_of_the_week = _MONDAY+1; + LONGS_EQUAL(_MONDAY, day_of_the_week); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithLONGS_EQUALShowsSymbolicParameters) +{ + fixture.runTestWithMethod(_failingTestMethodWithLONGS_EQUALWithSymbolicParameters); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("LONGS_EQUAL(_MONDAY, day_of_the_week) failed"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <2 (0x2)>"); + CHECK_FALSE(fixture.getOutput().contains("Message: ")); +} + +TEST(UnitTestMacros, LONGS_EQUALBehavesAsProperMacro) +{ + if (false) LONGS_EQUAL(1, 2); + else LONGS_EQUAL(10, 10); +} + +IGNORE_TEST(UnitTestMacros, LONGS_EQUALWorksInAnIgnoredTest) +{ + LONGS_EQUAL(11, 22); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithLONGS_EQUAL_TEXT() +{ + LONGS_EQUAL_TEXT(1, 0xff, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithLONGS_EQUALS_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithLONGS_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected < 1 (0x1)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <255 (0xff)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, LONGS_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) LONGS_EQUAL_TEXT(1, 2, "Failed because it failed"); + else LONGS_EQUAL_TEXT(10, 10, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, LONGS_EQUAL_TEXTWorksInAnIgnoredTest) +{ + LONGS_EQUAL_TEXT(11, 22, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithBYTES_EQUAL() +{ + BYTES_EQUAL('a', 'b'); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} + +TEST(UnitTestMacros, FailureWithBYTES_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithBYTES_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <97 (0x61)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <98 (0x62)>"); +} + +TEST(UnitTestMacros, BYTES_EQUALBehavesAsProperMacro) +{ + if (false) BYTES_EQUAL('a', 'b'); + else BYTES_EQUAL('c', 'c'); +} + +IGNORE_TEST(UnitTestMacros, BYTES_EQUALWorksInAnIgnoredTest) +{ + BYTES_EQUAL('q', 'w'); // LCOV_EXCL_LINE; +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithBYTES_EQUAL_TEXT() +{ + BYTES_EQUAL_TEXT('a', 'b', "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} + +TEST(UnitTestMacros, FailureWithBYTES_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithBYTES_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <97 (0x61)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <98 (0x62)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, BYTES_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) BYTES_EQUAL_TEXT('a', 'b', "Failed because it failed"); + else BYTES_EQUAL_TEXT('c', 'c', "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, BYTES_EQUAL_TEXTWorksInAnIgnoredTest) +{ + BYTES_EQUAL_TEXT('q', 'w', "Failed because it failed"); // LCOV_EXCL_LINE; +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSIGNED_BYTES_EQUAL() +{ + SIGNED_BYTES_EQUAL(-1, -2); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} + +TEST(UnitTestMacros, FailureWithSIGNED_BYTES_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithSIGNED_BYTES_EQUAL); +#if CPPUTEST_CHAR_BIT == 16 + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <-1 (0xffff)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <-2 (0xfffe)>"); +#else + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <-1 (0xff)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <-2 (0xfe)>"); +#endif +} + +TEST(UnitTestMacros, CHARS_EQUALBehavesAsProperMacro) +{ + if (false) SIGNED_BYTES_EQUAL(-1, -2); + else SIGNED_BYTES_EQUAL(-3, -3); +} + +IGNORE_TEST(UnitTestMacros, CHARS_EQUALWorksInAnIgnoredTest) +{ + SIGNED_BYTES_EQUAL(-7, 19); // LCOV_EXCL_LINE; +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSIGNED_BYTES_EQUAL_TEXT() +{ + SIGNED_BYTES_EQUAL_TEXT(-127, -126, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} + +TEST(UnitTestMacros, FailureWithSIGNED_BYTES_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithSIGNED_BYTES_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <-127 (0x81)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <-126 (0x82)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, CHARS_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) SIGNED_BYTES_EQUAL_TEXT(-1, -2, "Failed because it failed"); + else SIGNED_BYTES_EQUAL_TEXT(-3, -3, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, SIGNED_BYTES_EQUAL_TEXTWorksInAnIgnoredTest) +{ + SIGNED_BYTES_EQUAL_TEXT(-7, 19, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithPOINTERS_EQUAL() +{ + POINTERS_EQUAL((void*)0xa5a5, (void*)0xf0f0); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithPOINTERS_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithPOINTERS_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0xa5a5>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0xf0f0>"); +} + +TEST(UnitTestMacros, POINTERS_EQUALBehavesAsProperMacro) +{ + if (false) POINTERS_EQUAL(NULLPTR, to_void_pointer(0xbeefbeef)); + else POINTERS_EQUAL(to_void_pointer(0xdeadbeef), to_void_pointer(0xdeadbeef)); +} + +IGNORE_TEST(UnitTestMacros, POINTERS_EQUALWorksInAnIgnoredTest) +{ + POINTERS_EQUAL((void*) 0xbeef, (void*) 0xdead); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithPOINTERS_EQUAL_TEXT() +{ + POINTERS_EQUAL_TEXT((void*)0xa5a5, (void*)0xf0f0, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithPOINTERS_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithPOINTERS_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0xa5a5>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0xf0f0>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, POINTERS_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) POINTERS_EQUAL_TEXT(NULLPTR, to_void_pointer(0xbeefbeef), "Failed because it failed"); + else POINTERS_EQUAL_TEXT(to_void_pointer(0xdeadbeef), to_void_pointer(0xdeadbeef), "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, POINTERS_EQUAL_TEXTWorksInAnIgnoredTest) +{ + POINTERS_EQUAL_TEXT((void*) 0xbeef, (void*) 0xdead, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + + +static void _failingTestMethodWithFUNCTIONPOINTERS_EQUAL() +{ + FUNCTIONPOINTERS_EQUAL((void (*)())0xa5a5, (void (*)())0xf0f0); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithFUNCTIONPOINTERS_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithFUNCTIONPOINTERS_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0xa5a5>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0xf0f0>"); +} + +TEST(UnitTestMacros, FUNCTIONPOINTERS_EQUALBehavesAsProperMacro) +{ + if (false) FUNCTIONPOINTERS_EQUAL(NULLPTR, to_func_pointer(0xbeefbeef)); + else FUNCTIONPOINTERS_EQUAL(to_func_pointer(0xdeadbeef), to_func_pointer(0xdeadbeef)); +} + +IGNORE_TEST(UnitTestMacros, FUNCTIONPOINTERS_EQUALWorksInAnIgnoredTest) +{ + FUNCTIONPOINTERS_EQUAL((void (*)())0xbeef, (void (*)())0xdead); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithFUNCTIONPOINTERS_EQUAL_TEXT() +{ + FUNCTIONPOINTERS_EQUAL_TEXT((void (*)())0xa5a5, (void (*)())0xf0f0, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithFUNCTIONPOINTERS_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithFUNCTIONPOINTERS_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0xa5a5>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0xf0f0>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, FUNCTIONPOINTERS_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) FUNCTIONPOINTERS_EQUAL_TEXT(NULLPTR, to_func_pointer(0xbeefbeef), "Failed because it failed"); + else FUNCTIONPOINTERS_EQUAL_TEXT(to_func_pointer(0xdeadbeef), to_func_pointer(0xdeadbeef), "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, FUNCTIONPOINTERS_EQUAL_TEXTWorksInAnIgnoredTest) +{ + FUNCTIONPOINTERS_EQUAL_TEXT((void (*)())0xbeef, (void (*)())0xdead, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + + + + +static void _failingTestMethodWithDOUBLES_EQUAL() +{ + DOUBLES_EQUAL(0.12, 44.1, 0.3); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithDOUBLES_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithDOUBLES_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0.12>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <44.1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("threshold used was <0.3>"); +} + +TEST(UnitTestMacros, DOUBLES_EQUALBehavesAsProperMacro) +{ + if (false) DOUBLES_EQUAL(0.0, 1.1, 0.0005); + else DOUBLES_EQUAL(0.1, 0.2, 0.2); +} + +IGNORE_TEST(UnitTestMacros, DOUBLES_EQUALWorksInAnIgnoredTest) +{ + DOUBLES_EQUAL(100.0, 0.0, 0.2); // LCOV_EXCL_LINE; +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithDOUBLES_EQUAL_TEXT() +{ + DOUBLES_EQUAL_TEXT(0.12, 44.1, 0.3, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithDOUBLES_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithDOUBLES_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0.12>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <44.1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("threshold used was <0.3>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, DOUBLES_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) DOUBLES_EQUAL_TEXT(0.0, 1.1, 0.0005, "Failed because it failed"); + else DOUBLES_EQUAL_TEXT(0.1, 0.2, 0.2, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, DOUBLES_EQUAL_TEXTWorksInAnIgnoredTest) +{ + DOUBLES_EQUAL_TEXT(100.0, 0.0, 0.2, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static bool lineOfCodeExecutedAfterCheck = false; + +static void _passingTestMethod() +{ + CHECK(true); + lineOfCodeExecutedAfterCheck = true; +} + +TEST(UnitTestMacros, SuccessPrintsNothing) +{ + fixture.runTestWithMethod(_passingTestMethod); + + LONGS_EQUAL(0, fixture.getFailureCount()); + fixture.assertPrintContains(".\nOK (1 tests"); + CHECK(lineOfCodeExecutedAfterCheck); +} + +static void _methodThatOnlyPrints() +{ + UT_PRINT("Hello World!"); +} + +TEST(UnitTestMacros, PrintPrintsWhateverPrintPrints) +{ + fixture.runTestWithMethod(_methodThatOnlyPrints); + + LONGS_EQUAL(0, fixture.getFailureCount()); + fixture.assertPrintContains("Hello World!"); + fixture.assertPrintContains(__FILE__); +} + +static void _methodThatOnlyPrintsUsingSimpleStringFromFormat() +{ + UT_PRINT(StringFromFormat("Hello %s %d", "World!", 2009)); +} + +TEST(UnitTestMacros, PrintPrintsSimpleStringsForExampleThoseReturnedByFromString) +{ + fixture.runTestWithMethod(_methodThatOnlyPrintsUsingSimpleStringFromFormat); + fixture.assertPrintContains("Hello World! 2009"); +} + +static int functionThatReturnsAValue() +{ + CHECK(0 == 0); + CHECK_TEXT(0 == 0, "Shouldn't fail"); + CHECK_TRUE(0 == 0); + CHECK_TRUE_TEXT(0 == 0, "Shouldn't fail"); + CHECK_FALSE(0 != 0); + CHECK_FALSE_TEXT(0 != 0, "Shouldn't fail"); + LONGS_EQUAL(1,1); + LONGS_EQUAL_TEXT(1, 1, "Shouldn't fail"); + BYTES_EQUAL(0xab,0xab); + BYTES_EQUAL_TEXT(0xab, 0xab, "Shouldn't fail"); + CHECK_EQUAL(100,100); + CHECK_EQUAL_TEXT(100, 100, "Shouldn't fail"); + STRCMP_EQUAL("THIS", "THIS"); + STRCMP_EQUAL_TEXT("THIS", "THIS", "Shouldn't fail"); + DOUBLES_EQUAL(1.0, 1.0, .01); + DOUBLES_EQUAL_TEXT(1.0, 1.0, .01, "Shouldn't fail"); + POINTERS_EQUAL(NULLPTR, NULLPTR); + POINTERS_EQUAL_TEXT(NULLPTR, NULLPTR, "Shouldn't fail"); + MEMCMP_EQUAL("THIS", "THIS", 5); + MEMCMP_EQUAL_TEXT("THIS", "THIS", 5, "Shouldn't fail"); + BITS_EQUAL(0x01, (unsigned char )0x01, 0xFF); + BITS_EQUAL(0x0001, (unsigned short )0x0001, 0xFFFF); + BITS_EQUAL(0x00000001, (unsigned long )0x00000001, 0xFFFFFFFF); + BITS_EQUAL_TEXT(0x01, (unsigned char )0x01, 0xFF, "Shouldn't fail"); + return 0; +} + +TEST(UnitTestMacros, allMacrosFromFunctionThatReturnsAValue) +{ + functionThatReturnsAValue(); +} + +TEST(UnitTestMacros, MEMCMP_EQUALBehavesAsAProperMacro) +{ + if (false) MEMCMP_EQUAL("TEST", "test", 5); + else MEMCMP_EQUAL("TEST", "TEST", 5); +} + +IGNORE_TEST(UnitTestMacros, MEMCMP_EQUALWorksInAnIgnoredTest) +{ + MEMCMP_EQUAL("TEST", "test", 5); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _MEMCMP_EQUALFailingTestMethodWithUnequalInput() +{ + unsigned char expectedData[] = { 0x00, 0x01, 0x02, 0x03 }; + unsigned char actualData[] = { 0x00, 0x01, 0x03, 0x03 }; + + MEMCMP_EQUAL(expectedData, actualData, sizeof(expectedData)); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, MEMCMP_EQUALFailureWithUnequalInput) +{ + fixture.runTestWithMethod(_MEMCMP_EQUALFailingTestMethodWithUnequalInput); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <00 01 02 03>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <00 01 03 03>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 2"); +} + +static void _MEMCMP_EQUALFailingTestMethodWithNullExpected() +{ + unsigned char actualData[] = { 0x00, 0x01, 0x02, 0x03 }; + + MEMCMP_EQUAL(NULLPTR, actualData, sizeof(actualData)); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, MEMCMP_EQUALFailureWithNullExpected) +{ + fixture.runTestWithMethod(_MEMCMP_EQUALFailingTestMethodWithNullExpected); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <(null)>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <00 01 02 03>"); +} + +static void _MEMCMP_EQUALFailingTestMethodWithNullActual() +{ + unsigned char expectedData[] = { 0x00, 0x01, 0x02, 0x03 }; + + MEMCMP_EQUAL(expectedData, NULLPTR, sizeof(expectedData)); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, MEMCMP_EQUALFailureWithNullActual) +{ + fixture.runTestWithMethod(_MEMCMP_EQUALFailingTestMethodWithNullActual); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <00 01 02 03>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <(null)>"); +} + +TEST(UnitTestMacros, MEMCMP_EQUALNullExpectedNullActual) +{ + MEMCMP_EQUAL(NULLPTR, NULLPTR, 0); + MEMCMP_EQUAL(NULLPTR, NULLPTR, 1024); +} + +TEST(UnitTestMacros, MEMCMP_EQUALNullPointerIgnoredInExpectationWhenSize0) +{ + unsigned char actualData[] = { 0x00, 0x01, 0x03, 0x03 }; + MEMCMP_EQUAL(NULLPTR, actualData, 0); +} + +TEST(UnitTestMacros, MEMCMP_EQUALNullPointerIgnoredInActualWhenSize0) +{ + unsigned char expectedData[] = { 0x00, 0x01, 0x02, 0x03 }; + MEMCMP_EQUAL(expectedData, NULLPTR, 0); +} + +static void _failingTestMethodWithMEMCMP_EQUAL_TEXT() +{ + unsigned char expectedData[] = { 0x00, 0x01, 0x02, 0x03 }; + unsigned char actualData[] = { 0x00, 0x01, 0x03, 0x03 }; + + MEMCMP_EQUAL_TEXT(expectedData, actualData, sizeof(expectedData), "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithMEMCMP_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithMEMCMP_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <00 01 02 03>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <00 01 03 03>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 2"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, MEMCMP_EQUAL_TEXTBehavesAsAProperMacro) +{ + if (false) MEMCMP_EQUAL_TEXT("TEST", "test", 5, "Failed because it failed"); + else MEMCMP_EQUAL_TEXT("TEST", "TEST", 5, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, MEMCMP_EQUAL_TEXTWorksInAnIgnoredTest) +{ + MEMCMP_EQUAL_TEXT("TEST", "test", 5, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, BITS_EQUALBehavesAsAProperMacro) +{ + if (false) BITS_EQUAL(0x00, 0xFF, 0xFF); + else BITS_EQUAL(0x00, 0x00, 0xFF); +} + +IGNORE_TEST(UnitTestMacros, BITS_EQUALWorksInAnIgnoredTest) +{ + BITS_EQUAL(0x00, 0xFF, 0xFF); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _BITS_EQUALFailingTestMethodWithUnequalInput() +{ + BITS_EQUAL(0x00, 0xFF, 0xFF); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, BITS_EQUALFailureWithUnequalInput) +{ + fixture.runTestWithMethod(_BITS_EQUALFailingTestMethodWithUnequalInput); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("00000000>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("11111111>"); +} + +TEST(UnitTestMacros, BITS_EQUALZeroMaskEqual) +{ + BITS_EQUAL(0x00, 0xFF, 0x00); +} + +static void _failingTestMethodWithBITS_EQUAL_TEXT() +{ + BITS_EQUAL_TEXT(0x00, 0xFFFFFFFF, 0xFF, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithBITS_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithBITS_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, BITS_EQUAL_TEXTBehavesAsAProperMacro) +{ + if (false) BITS_EQUAL_TEXT(0x00, 0xFF, 0xFF, "Failed because it failed"); + else BITS_EQUAL_TEXT(0x00, 0x00, 0xFF, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, BITS_EQUAL_TEXTWorksInAnIgnoredTest) +{ + BITS_EQUAL_TEXT(0x00, 0xFF, 0xFF, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +#if defined(__cplusplus) && __cplusplus >= 201103L +enum class ScopedIntEnum { + A, B +}; + +static void _ENUMS_EQUAL_INTWithScopedIntEnumTestMethod() +{ + ENUMS_EQUAL_INT(ScopedIntEnum::B, ScopedIntEnum::B); + ENUMS_EQUAL_INT(ScopedIntEnum::B, ScopedIntEnum::A); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestENUMS_EQUAL_INTWithScopedIntEnum) +{ + fixture.runTestWithMethod(_ENUMS_EQUAL_INTWithScopedIntEnumTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0>"); +} + +TEST(UnitTestMacros, ENUMS_EQUAL_INTWithScopedIntEnumBehavesAsProperMacro) +{ + if (false) ENUMS_EQUAL_INT(ScopedIntEnum::B, ScopedIntEnum::A); + else ENUMS_EQUAL_INT(ScopedIntEnum::B, ScopedIntEnum::B); +} + +IGNORE_TEST(UnitTestMacros, ENUMS_EQUAL_INTWithScopedIntEnumWorksInAnIgnoredTest) +{ + ENUMS_EQUAL_INT(ScopedIntEnum::B, ScopedIntEnum::A); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _ENUMS_EQUAL_INT_TEXTWithScopedIntEnumTestMethod() +{ + ENUMS_EQUAL_INT_TEXT(ScopedIntEnum::B, ScopedIntEnum::A, "Failed because it failed"); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestENUMS_EQUAL_INT_TEXTWithScopedIntEnum) +{ + fixture.runTestWithMethod(_ENUMS_EQUAL_INT_TEXTWithScopedIntEnumTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, ENUMS_EQUAL_INT_TEXTWithScopedIntEnumBehavesAsProperMacro) +{ + if (false) ENUMS_EQUAL_INT_TEXT(ScopedIntEnum::B, ScopedIntEnum::A, "Failed because it failed"); + else ENUMS_EQUAL_INT_TEXT(ScopedIntEnum::B, ScopedIntEnum::B, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, ENUMS_EQUAL_EQUAL_INT_TEXTWithScopedIntEnumWorksInAnIgnoredTest) +{ + ENUMS_EQUAL_INT_TEXT(ScopedIntEnum::B, ScopedIntEnum::A, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +enum class ScopedLongEnum : long { + A, B +}; + +static void _ENUMS_EQUAL_TYPEWithScopedLongEnumTestMethod() +{ + ENUMS_EQUAL_TYPE(long, ScopedLongEnum::B, ScopedLongEnum::B); + ENUMS_EQUAL_TYPE(long, ScopedLongEnum::B, ScopedLongEnum::A); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestENUMS_EQUAL_TYPEWithScopedLongEnum) +{ + fixture.runTestWithMethod(_ENUMS_EQUAL_TYPEWithScopedLongEnumTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0>"); +} + +TEST(UnitTestMacros, ENUMS_EQUAL_TYPEWithScopedLongEnumBehavesAsProperMacro) +{ + if (false) ENUMS_EQUAL_TYPE(long, ScopedLongEnum::B, ScopedLongEnum::A); + else ENUMS_EQUAL_TYPE(long, ScopedLongEnum::B, ScopedLongEnum::B); +} + +IGNORE_TEST(UnitTestMacros, ENUMS_EQUAL_TYPEWithScopedLongEnumWorksInAnIgnoredTest) +{ + ENUMS_EQUAL_TYPE(long, ScopedLongEnum::B, ScopedLongEnum::A); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _ENUMS_EQUAL_TYPE_TEXTWithScopedLongEnumTestMethod() +{ + ENUMS_EQUAL_TYPE_TEXT(long, ScopedLongEnum::B, ScopedLongEnum::A, "Failed because it failed"); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestENUMS_EQUAL_TYPE_TEXTWithScopedLongEnum) +{ + fixture.runTestWithMethod(_ENUMS_EQUAL_TYPE_TEXTWithScopedLongEnumTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, ENUMS_EQUAL_TYPE_TEXTWithScopedLongEnumBehavesAsProperMacro) +{ + if (false) ENUMS_EQUAL_TYPE_TEXT(long, ScopedLongEnum::B, ScopedLongEnum::A, "Failed because it failed"); + else ENUMS_EQUAL_TYPE_TEXT(long, ScopedLongEnum::B, ScopedLongEnum::B, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, ENUMS_EQUAL_EQUAL_TYPE_TEXTWithScopedLongEnumWorksInAnIgnoredTest) +{ + ENUMS_EQUAL_TYPE_TEXT(long, ScopedLongEnum::B, ScopedLongEnum::A, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +#endif + +enum UnscopedEnum { + UNSCOPED_ENUM_A, UNSCOPED_ENUM_B +}; + +static void _ENUMS_EQUAL_INTWithUnscopedEnumTestMethod() +{ + ENUMS_EQUAL_INT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_B); + ENUMS_EQUAL_INT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_A); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestENUMS_EQUAL_INTWithUnscopedEnum) +{ + fixture.runTestWithMethod(_ENUMS_EQUAL_INTWithUnscopedEnumTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0>"); +} + +TEST(UnitTestMacros, ENUMS_EQUAL_INTWithUnscopedEnumBehavesAsProperMacro) +{ + if (false) ENUMS_EQUAL_INT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_A); + else ENUMS_EQUAL_INT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_B); +} + +IGNORE_TEST(UnitTestMacros, ENUMS_EQUAL_INTWithUnscopedEnumWorksInAnIgnoredTest) +{ + ENUMS_EQUAL_INT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_A); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _ENUMS_EQUAL_INT_TEXTWithUnscopedEnumTestMethod() +{ + ENUMS_EQUAL_INT_TEXT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_A, "Failed because it failed"); +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, TestENUMS_EQUAL_INT_TEXTWithUnscopedEnum) +{ + fixture.runTestWithMethod(_ENUMS_EQUAL_INT_TEXTWithUnscopedEnumTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestMacros, ENUMS_EQUAL_INT_TEXTWithUnscopedEnumBehavesAsProperMacro) +{ + if (false) ENUMS_EQUAL_INT_TEXT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_A, "Failed because it failed"); + else ENUMS_EQUAL_INT_TEXT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_B, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestMacros, ENUMS_EQUAL_EQUAL_INT_TEXTWithUnscopedEnumWorksInAnIgnoredTest) +{ + ENUMS_EQUAL_INT_TEXT(UNSCOPED_ENUM_B, UNSCOPED_ENUM_A, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +#if CPPUTEST_USE_STD_CPP_LIB +static void _failingTestMethod_NoThrowWithCHECK_THROWS() +{ + CHECK_THROWS(int, (void) (1+2)); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_THROWS_whenDoesntThrow) +{ + fixture.runTestWithMethod(_failingTestMethod_NoThrowWithCHECK_THROWS); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected to throw int"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but threw nothing"); + LONGS_EQUAL(1, fixture.getCheckCount()); +} + +static void _succeedingTestMethod_CorrectThrowWithCHECK_THROWS() +{ + CHECK_THROWS(int, throw 4); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} + +TEST(UnitTestMacros, SuccessWithCHECK_THROWS) +{ + fixture.runTestWithMethod(_succeedingTestMethod_CorrectThrowWithCHECK_THROWS); + LONGS_EQUAL(1, fixture.getCheckCount()); +} + +static void _failingTestMethod_WrongThrowWithCHECK_THROWS() +{ + CHECK_THROWS(int, throw 4.3); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestMacros, FailureWithCHECK_THROWS_whenWrongThrow) +{ + fixture.runTestWithMethod(_failingTestMethod_WrongThrowWithCHECK_THROWS); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected to throw int"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but threw a different type"); + LONGS_EQUAL(1, fixture.getCheckCount()); +} + +TEST(UnitTestMacros, MultipleCHECK_THROWS_inOneScope) +{ + CHECK_THROWS(int, throw 4); + CHECK_THROWS(int, throw 4); +} +#endif diff -Nru cpputest-3.8/tests/CppUTest/TestUTestStringMacro.cpp cpputest-4.0/tests/CppUTest/TestUTestStringMacro.cpp --- cpputest-3.8/tests/CppUTest/TestUTestStringMacro.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/TestUTestStringMacro.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,468 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestTestingFixture.h" + +#define CHECK_TEST_FAILS_PROPER_WITH_TEXT(text) fixture.checkTestFailsWithProperTestLocation(text, __FILE__, __LINE__) + +TEST_GROUP(UnitTestStringMacros) +{ + TestTestingFixture fixture; +}; + +static void _STRCMP_EQUALWithActualIsNULLTestMethod() +{ + STRCMP_EQUAL("ok", NULLPTR); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_EQUALAndActualIsNULL) +{ + fixture.runTestWithMethod(_STRCMP_EQUALWithActualIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <(null)>"); +} + +static void _STRCMP_EQUALWithExpectedIsNULLTestMethod() +{ + STRCMP_EQUAL(NULLPTR, "ok"); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_EQUALAndExpectedIsNULL) +{ + fixture.runTestWithMethod(_STRCMP_EQUALWithExpectedIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <(null)>"); +} + +static void _STRCMP_CONTAINSWithActualIsNULLTestMethod() +{ + STRCMP_CONTAINS("ok", NULLPTR); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_CONTAINSAndActualIsNULL) +{ + fixture.runTestWithMethod(_STRCMP_CONTAINSWithActualIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); +} + +static void _STRCMP_CONTAINSWithExpectedIsNULLTestMethod() +{ + STRCMP_CONTAINS(NULLPTR, "ok"); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_CONTAINSAndExpectedIsNULL) +{ + fixture.runTestWithMethod(_STRCMP_CONTAINSWithExpectedIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain <>"); +} + +static void _STRNCMP_EQUALWithActualIsNULLTestMethod() +{ + STRNCMP_EQUAL("ok", NULLPTR, 2); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRNCMP_EQUALAndActualIsNULL) +{ + fixture.runTestWithMethod(_STRNCMP_EQUALWithActualIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <(null)>"); +} + +static void _STRNCMP_EQUALWithExpectedIsNULLTestMethod() +{ + STRNCMP_EQUAL(NULLPTR, "ok", 2); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRNCMP_EQUALAndExpectedIsNULL) +{ + fixture.runTestWithMethod(_STRNCMP_EQUALWithExpectedIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <(null)>"); +} + +static void _STRCMP_NOCASE_EQUALWithActualIsNULLTestMethod() +{ + STRCMP_NOCASE_EQUAL("ok", NULLPTR); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUALAndActualIsNULL) +{ + fixture.runTestWithMethod(_STRCMP_NOCASE_EQUALWithActualIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <(null)>"); +} + +static void _STRCMP_NOCASE_EQUALWithExpectedIsNULLTestMethod() +{ + STRCMP_NOCASE_EQUAL(NULLPTR, "ok"); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUALAndExpectedIsNULL) +{ + fixture.runTestWithMethod(_STRCMP_NOCASE_EQUALWithExpectedIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <(null)>"); +} + +static void _STRCMP_NOCASE_EQUALWithUnequalInputTestMethod() +{ + STRCMP_NOCASE_EQUAL("no", "ok"); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUALAndUnequalInput) +{ + fixture.runTestWithMethod(_STRCMP_NOCASE_EQUALWithUnequalInputTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); +} + +static void _STRCMP_NOCASE_CONTAINSWithActualIsNULLTestMethod() +{ + STRCMP_NOCASE_CONTAINS("ok", NULLPTR); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_CONTAINSAndActualIsNULL) +{ + fixture.runTestWithMethod(_STRCMP_NOCASE_CONTAINSWithActualIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); +} + +static void _STRCMP_NOCASE_CONTAINSWithExpectedIsNULLTestMethod() +{ + STRCMP_NOCASE_CONTAINS(NULLPTR, "ok"); +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_CONTAINSAndExpectedIsNULL) +{ + fixture.runTestWithMethod(_STRCMP_NOCASE_CONTAINSWithExpectedIsNULLTestMethod); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain <>"); +} + +static void _failingTestMethodWithSTRCMP_EQUAL() +{ + STRCMP_EQUAL("hello", "hell"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); +} + +TEST(UnitTestStringMacros, STRCMP_EQUALBehavesAsProperMacro) +{ + if (false) STRCMP_EQUAL("1", "2"); + else STRCMP_EQUAL("1", "1"); +} + +IGNORE_TEST(UnitTestStringMacros, STRCMP_EQUALWorksInAnIgnoredTest) +{ + STRCMP_EQUAL("Hello", "World"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRCMP_EQUAL_TEXT() +{ + STRCMP_EQUAL_TEXT("hello", "hell", "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestStringMacros, STRCMP_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) STRCMP_EQUAL_TEXT("1", "2", "Failed because it failed"); + else STRCMP_EQUAL_TEXT("1", "1", "Failed because it failed"); +} + +IGNORE_TEST(UnitTestStringMacros, STRCMP_EQUAL_TEXTWorksInAnIgnoredTest) +{ + STRCMP_EQUAL_TEXT("Hello", "World", "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRNCMP_EQUAL() +{ + STRNCMP_EQUAL("hello", "hallo", 5); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRNCMP_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRNCMP_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); +} + +TEST(UnitTestStringMacros, STRNCMP_EQUALBehavesAsProperMacro) +{ + if (false) STRNCMP_EQUAL("1", "2", 1); + else STRNCMP_EQUAL("1", "1", 1); +} + +IGNORE_TEST(UnitTestStringMacros, STRNCMP_EQUALWorksInAnIgnoredTest) +{ + STRNCMP_EQUAL("Hello", "World", 3); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRNCMP_EQUAL_TEXT() +{ + STRNCMP_EQUAL_TEXT("hello", "hallo", 5, "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRNCMP_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRNCMP_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestStringMacros, STRNCMP_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) STRNCMP_EQUAL_TEXT("1", "2", 1, "Failed because it failed"); + else STRNCMP_EQUAL_TEXT("1", "1", 1, "Failed because it failed"); +} + +IGNORE_TEST(UnitTestStringMacros, STRNCMP_EQUAL_TEXTWorksInAnIgnoredTest) +{ + STRNCMP_EQUAL_TEXT("Hello", "World", 3, "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRCMP_NOCASE_EQUAL() +{ + STRCMP_NOCASE_EQUAL("hello", "Hell"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUAL) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_NOCASE_EQUAL); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); +} + +TEST(UnitTestStringMacros, STRCMP_NOCASE_EQUALBehavesAsProperMacro) +{ + if (false) STRCMP_NOCASE_EQUAL("1", "2"); + else STRCMP_NOCASE_EQUAL("1", "1"); +} + +IGNORE_TEST(UnitTestStringMacros, STRCMP_NOCASE_EQUALWorksInAnIgnoredTest) +{ + STRCMP_NOCASE_EQUAL("Hello", "World"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRCMP_NOCASE_EQUAL_TEXT() +{ + STRCMP_NOCASE_EQUAL_TEXT("hello", "hell", "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUAL_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_NOCASE_EQUAL_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestStringMacros, STRCMP_NOCASE_EQUAL_TEXTBehavesAsProperMacro) +{ + if (false) STRCMP_NOCASE_EQUAL_TEXT("1", "2", "Failed because it failed"); + else STRCMP_NOCASE_EQUAL_TEXT("1", "1", "Failed because it failed"); +} + +IGNORE_TEST(UnitTestStringMacros, STRCMP_NOCASE_EQUAL_TEXTWorksInAnIgnoredTest) +{ + STRCMP_NOCASE_EQUAL_TEXT("Hello", "World", "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRCMP_CONTAINS() +{ + STRCMP_CONTAINS("hello", "world"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_CONTAINS) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_CONTAINS); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("actual "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); +} + +TEST(UnitTestStringMacros, STRCMP_CONTAINSBehavesAsProperMacro) +{ + if (false) STRCMP_CONTAINS("1", "2"); + else STRCMP_CONTAINS("1", "1"); +} + +IGNORE_TEST(UnitTestStringMacros, STRCMP_CONTAINSWorksInAnIgnoredTest) +{ + STRCMP_CONTAINS("Hello", "World"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRCMP_CONTAINS_TEXT() +{ + STRCMP_CONTAINS_TEXT("hello", "world", "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, FailureWithSTRCMP_CONTAINS_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_CONTAINS_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("actual "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestStringMacros, STRCMP_CONTAINS_TEXTBehavesAsProperMacro) +{ + if (false) STRCMP_CONTAINS_TEXT("1", "2", "Failed because it failed"); + else STRCMP_CONTAINS_TEXT("1", "1", "Failed because it failed"); +} + +IGNORE_TEST(UnitTestStringMacros, STRCMP_CONTAINS_TEXTWorksInAnIgnoredTest) +{ + STRCMP_CONTAINS_TEXT("Hello", "World", "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRCMP_NOCASE_CONTAINS() +{ + STRCMP_NOCASE_CONTAINS("hello", "WORLD"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_CONTAINS) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_NOCASE_CONTAINS); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("actual "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); +} + +TEST(UnitTestStringMacros, STRCMP_NOCASE_CONTAINSBehavesAsProperMacro) +{ + if (false) STRCMP_NOCASE_CONTAINS("never", "executed"); + else STRCMP_NOCASE_CONTAINS("hello", "HELLO WORLD"); +} + +IGNORE_TEST(UnitTestStringMacros, STRCMP_NO_CASE_CONTAINSWorksInAnIgnoredTest) +{ + STRCMP_NOCASE_CONTAINS("Hello", "World"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +static void _failingTestMethodWithSTRCMP_NOCASE_CONTAINS_TEXT() +{ + STRCMP_NOCASE_CONTAINS_TEXT("hello", "WORLD", "Failed because it failed"); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} + +TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_CONTAINS_TEXT) +{ + fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_NOCASE_CONTAINS_TEXT); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("actual "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); +} + +TEST(UnitTestStringMacros, STRCMP_NOCASE_CONTAINS_TEXTBehavesAsProperMacro) +{ + if (false) STRCMP_NOCASE_CONTAINS_TEXT("never", "executed", "Failed because it failed"); + else STRCMP_NOCASE_CONTAINS_TEXT("hello", "HELLO WORLD", "Failed because it failed"); +} + +IGNORE_TEST(UnitTestStringMacros, STRCMP_NO_CASE_CONTAINS_TEXTWorksInAnIgnoredTest) +{ + STRCMP_NOCASE_CONTAINS_TEXT("Hello", "World", "Failed because it failed"); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, NFirstCharsComparison) +{ + STRNCMP_EQUAL("Hello World!", "Hello Peter!", 0); + STRNCMP_EQUAL("Hello World!", "Hello Peter!", 1); + STRNCMP_EQUAL("Hello World!", "Hello Peter!", 6); + STRNCMP_EQUAL("Hello World!", "Hello", 5); +} + +static void _compareNFirstCharsWithUpperAndLowercase() +{ + STRNCMP_EQUAL("hello world!", "HELLO WORLD!", 12); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, CompareNFirstCharsWithUpperAndLowercase) +{ + fixture.runTestWithMethod(_compareNFirstCharsWithUpperAndLowercase); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 0"); +} + +static void _compareNFirstCharsWithDifferenceInTheMiddle() +{ + STRNCMP_EQUAL("Hello World!", "Hello Peter!", 12); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, CompareNFirstCharsWithDifferenceInTheMiddle) +{ + fixture.runTestWithMethod(_compareNFirstCharsWithDifferenceInTheMiddle); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 6"); +} + +static void _compareNFirstCharsWithEmptyString() +{ + STRNCMP_EQUAL("", "Not empty string", 5); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, CompareNFirstCharsWithEmptyString) +{ + fixture.runTestWithMethod(_compareNFirstCharsWithEmptyString); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <>"); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 0"); +} + +static void _compareNFirstCharsWithLastCharDifferent() +{ + STRNCMP_EQUAL("Not empty string?", "Not empty string!", 17); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(UnitTestStringMacros, CompareNFirstCharsWithLastCharDifferent) +{ + fixture.runTestWithMethod(_compareNFirstCharsWithLastCharDifferent); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 16"); +} + diff -Nru cpputest-3.8/tests/CppUTest/UtestPlatformTest.cpp cpputest-4.0/tests/CppUTest/UtestPlatformTest.cpp --- cpputest-3.8/tests/CppUTest/UtestPlatformTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/UtestPlatformTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/CommandLineTestRunner.h" +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestTestingFixture.h" +#include "CppUTest/PlatformSpecificFunctions.h" +#include "CppUTest/StandardCLibrary.h" +#include "CppUTest/TestMemoryAllocator.h" + +#if CPPUTEST_USE_STD_C_LIB + +// This will cause a crash in VS2010 due to PlatformSpecificFree being uninitialized +static const SimpleString str1("abc"); +static const SimpleString str2("def"); +static const SimpleString str3(str1 + str2); + +TEST_GROUP(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess) +{ + TestTestingFixture fixture; +}; + +#ifndef CPPUTEST_HAVE_FORK + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, DummyFailsWithMessage) +{ + fixture.setRunTestsInSeperateProcess(); + fixture.runAllTests(); + fixture.assertPrintContains("-p doesn't work on this platform, as it is lacking fork.\b"); +} + +#else + +static void _failFunction() +{ + FAIL("This test fails"); +} + +static void _exitNonZeroFunction() _no_return_; +static void _exitNonZeroFunction() +{ + /* destructor of static objects will be called. If StringCache was there then the allocator will report invalid deallocations of static SimpleString */ + SimpleString::setStringAllocator(SimpleString::getStringAllocator()->actualAllocator()); + exit(1); +} + +#include + +static int waitpid_while_debugging_stub_number_called = 0; +static int waitpid_while_debugging_stub_forced_failures = 0; + +extern "C" { + + static int (*original_waitpid)(int, int*, int) = NULLPTR; + + static int fork_failed_stub(void) { return -1; } + + static int waitpid_while_debugging_stub(int pid, int* status, int options) + { + static int saved_status; + + if (waitpid_while_debugging_stub_number_called++ < waitpid_while_debugging_stub_forced_failures) { + saved_status = *status; + errno=EINTR; + return -1; + } + else { + *status = saved_status; + return original_waitpid(pid, status, options); + } + } + + static int waitpid_failed_stub(int, int*, int) { return -1; } +} + +#include +#include + +static void _stoppedTestFunction() +{ + kill(getpid(), SIGSTOP); +} + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, TestInSeparateProcessWorks) +{ + fixture.setRunTestsInSeperateProcess(); + fixture.runAllTests(); + fixture.assertPrintContains("OK (1 tests, 1 ran, 0 checks, 0 ignored, 0 filtered out"); +} + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, FailureInSeparateProcessWorks) +{ + fixture.setRunTestsInSeperateProcess(); + fixture.setTestFunction(_failFunction); + fixture.runAllTests(); + fixture.assertPrintContains("Failed in separate process"); + fixture.assertPrintContains("Errors (1 failures, 1 tests, 1 ran, 0 checks, 0 ignored, 0 filtered out"); +} + +#if (! CPPUTEST_SANITIZE_ADDRESS) + +static int _accessViolationTestFunction() +{ + return *(volatile int*) NULLPTR; +} + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, AccessViolationInSeparateProcessWorks) +{ + fixture.setRunTestsInSeperateProcess(); + fixture.setTestFunction((void(*)())_accessViolationTestFunction); + fixture.runAllTests(); + fixture.assertPrintContains("Failed in separate process - killed by signal 11"); + fixture.assertPrintContains("Errors (1 failures, 1 tests, 1 ran"); +} + +#endif + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, StoppedInSeparateProcessWorks) +{ + fixture.setRunTestsInSeperateProcess(); + fixture.setTestFunction(_stoppedTestFunction); + fixture.runAllTests(); + fixture.assertPrintContains("Stopped in separate process - continuing"); + fixture.assertPrintContains("Errors (1 failures, 1 tests, 1 ran"); +} + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, CallToForkFailedInSeparateProcessWorks) +{ + UT_PTR_SET(PlatformSpecificFork, fork_failed_stub); + fixture.setRunTestsInSeperateProcess(); + fixture.runAllTests(); + fixture.assertPrintContains("Call to fork() failed"); + fixture.assertPrintContains("Errors (1 failures, 1 tests, 1 ran"); +} + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, CallToWaitPidWhileDebuggingInSeparateProcessWorks) +{ + UT_PTR_SET(original_waitpid, PlatformSpecificWaitPid); + UT_PTR_SET(PlatformSpecificWaitPid, waitpid_while_debugging_stub); + waitpid_while_debugging_stub_number_called = 0; + waitpid_while_debugging_stub_forced_failures = 10; + fixture.setRunTestsInSeperateProcess(); + fixture.runAllTests(); + fixture.assertPrintContains("OK (1 tests, 1 ran, 0 checks, 0 ignored, 0 filtered out"); + // extra check to confirm that waitpid() was polled until it passed (and passed call adds one) + CHECK(waitpid_while_debugging_stub_number_called > waitpid_while_debugging_stub_forced_failures); +} + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, CallToWaitPidStopsAndReportsAnErrorAfter20TimesRetry) +{ + UT_PTR_SET(original_waitpid, PlatformSpecificWaitPid); + UT_PTR_SET(PlatformSpecificWaitPid, waitpid_while_debugging_stub); + waitpid_while_debugging_stub_number_called = 0; + waitpid_while_debugging_stub_forced_failures = 40; + fixture.setRunTestsInSeperateProcess(); + fixture.runAllTests(); + fixture.assertPrintContains("Call to waitpid() failed with EINTR. Tried 30 times and giving up! Sometimes happens in debugger"); + // extra check to confirm that waitpid() was polled until it passed (and passed call adds one) + CHECK(waitpid_while_debugging_stub_number_called > 30); +} + + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, CallToWaitPidFailedInSeparateProcessWorks) +{ + UT_PTR_SET(PlatformSpecificWaitPid, waitpid_failed_stub); + fixture.setRunTestsInSeperateProcess(); + fixture.runAllTests(); + fixture.assertPrintContains("Call to waitpid() failed"); + fixture.assertPrintContains("Errors (1 failures, 1 tests, 1 ran"); +} + +TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, MultipleTestsInSeparateProcessAreCountedProperly) +{ + fixture.setRunTestsInSeperateProcess(); + fixture.runTestWithMethod(NULLPTR); + fixture.runTestWithMethod(_stoppedTestFunction); + fixture.runTestWithMethod(NULLPTR); + fixture.runTestWithMethod(_exitNonZeroFunction); + fixture.runTestWithMethod(NULLPTR); + fixture.assertPrintContains("Failed in separate process"); + fixture.assertPrintContains("Stopped in separate process"); + fixture.assertPrintContains("Errors (2 failures, 5 tests, 5 ran, 0 checks, 0 ignored, 0 filtered out"); +} + +#endif +#endif + diff -Nru cpputest-3.8/tests/CppUTest/UtestTest.cpp cpputest-4.0/tests/CppUTest/UtestTest.cpp --- cpputest-3.8/tests/CppUTest/UtestTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTest/UtestTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,501 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestTestingFixture.h" +#include "CppUTest/PlatformSpecificFunctions.h" + +TEST_GROUP(UtestShell) +{ + TestTestingFixture fixture; +}; + +static void _failMethod() +{ + FAIL("This test fails"); +} + +static void _passingTestMethod() +{ + CHECK(true); +} + +static void _passingCheckEqualTestMethod() +{ + CHECK_EQUAL(1, 1); +} + +static void _exitTestMethod() +{ + TEST_EXIT; + FAIL("Should not get here"); +} + +static volatile double zero = 0.0; + +TEST(UtestShell, compareDoubles) +{ + double not_a_number = zero / zero; + double infinity = 1 / zero; + CHECK(doubles_equal(1.0, 1.001, 0.01)); + CHECK(!doubles_equal(not_a_number, 1.001, 0.01)); + CHECK(!doubles_equal(1.0, not_a_number, 0.01)); + CHECK(!doubles_equal(1.0, 1.001, not_a_number)); + CHECK(!doubles_equal(1.0, 1.1, 0.05)); + CHECK(!doubles_equal(infinity, 1.0, 0.01)); + CHECK(!doubles_equal(1.0, infinity, 0.01)); + CHECK(doubles_equal(1.0, -1.0, infinity)); + CHECK(doubles_equal(infinity, infinity, 0.01)); + CHECK(doubles_equal(infinity, infinity, infinity)); + double a = 1.2345678; + CHECK(doubles_equal(a, a, 0.000000001)); +} + +TEST(UtestShell, FailWillIncreaseTheAmountOfChecks) +{ + fixture.setTestFunction(_failMethod); + fixture.runAllTests(); + LONGS_EQUAL(1, fixture.getCheckCount()); +} + +TEST(UtestShell, PassedCheckEqualWillIncreaseTheAmountOfChecks) +{ + fixture.setTestFunction(_passingCheckEqualTestMethod); + fixture.runAllTests(); + LONGS_EQUAL(1, fixture.getCheckCount()); +} + +IGNORE_TEST(UtestShell, IgnoreTestAccessingFixture) +{ + CHECK(&fixture != NULLPTR); +} + +TEST(UtestShell, MacrosUsedInSetup) +{ + IGNORE_ALL_LEAKS_IN_TEST(); + fixture.setSetup(_failMethod); + fixture.setTestFunction(_passingTestMethod); + fixture.runAllTests(); + LONGS_EQUAL(1, fixture.getFailureCount()); +} + +TEST(UtestShell, MacrosUsedInTearDown) +{ + IGNORE_ALL_LEAKS_IN_TEST(); + fixture.setTeardown(_failMethod); + fixture.setTestFunction(_passingTestMethod); + fixture.runAllTests(); + LONGS_EQUAL(1, fixture.getFailureCount()); +} + +TEST(UtestShell, ExitLeavesQuietly) +{ + fixture.setTestFunction(_exitTestMethod); + fixture.runAllTests(); + LONGS_EQUAL(0, fixture.getFailureCount()); +} + + + +static int teardownCalled = 0; + +static void _teardownMethod() +{ + teardownCalled++; +} + +TEST(UtestShell, TeardownCalledAfterTestFailure) +{ + teardownCalled = 0; + IGNORE_ALL_LEAKS_IN_TEST(); + fixture.setTeardown(_teardownMethod); + fixture.setTestFunction(_failMethod); + fixture.runAllTests(); + LONGS_EQUAL(1, fixture.getFailureCount()); + LONGS_EQUAL(1, teardownCalled); +} + +static int stopAfterFailure = 0; +static void _stopAfterFailureMethod() +{ + FAIL("fail"); + stopAfterFailure++; +} + +TEST(UtestShell, TestStopsAfterTestFailure) +{ + IGNORE_ALL_LEAKS_IN_TEST(); + stopAfterFailure = 0; + fixture.setTestFunction(_stopAfterFailureMethod); + fixture.runAllTests(); + CHECK(fixture.hasTestFailed()); + LONGS_EQUAL(1, fixture.getFailureCount()); + LONGS_EQUAL(0, stopAfterFailure); +} + +TEST(UtestShell, TestStopsAfterSetupFailure) +{ + stopAfterFailure = 0; + fixture.setSetup(_stopAfterFailureMethod); + fixture.setTeardown(_stopAfterFailureMethod); + fixture.setTestFunction(_failMethod); + fixture.runAllTests(); + LONGS_EQUAL(2, fixture.getFailureCount()); + LONGS_EQUAL(0, stopAfterFailure); +} + +TEST(UtestShell, veryVebose) +{ + UtestShell shell("Group", "name", __FILE__, __LINE__); + StringBufferTestOutput normalOutput; + normalOutput.verbose(TestOutput::level_veryVerbose); + NullTestPlugin plugin; + + TestResult result(normalOutput); + shell.runOneTestInCurrentProcess(&plugin, result); + STRCMP_CONTAINS("\n------ before runTest", normalOutput.getOutput().asCharString()); +} + +class defaultUtestShell: public UtestShell +{ +}; + +TEST(UtestShell, this_test_covers_the_UtestShell_createTest_and_Utest_testBody_methods) +{ + defaultUtestShell shell; + fixture.addTest(&shell); + fixture.runAllTests(); + LONGS_EQUAL(2, fixture.getTestCount()); +} + + +static void StubPlatformSpecificRunTestInASeperateProcess(UtestShell* shell, TestPlugin*, TestResult* result) +{ + result->addFailure(TestFailure(shell, "Failed in separate process")); +} + +TEST(UtestShell, RunInSeparateProcessTest) +{ + UT_PTR_SET(PlatformSpecificRunTestInASeperateProcess, StubPlatformSpecificRunTestInASeperateProcess); + fixture.getRegistry()->setRunTestsInSeperateProcess(); + fixture.runAllTests(); + fixture.assertPrintContains("Failed in separate process"); +} + +#ifndef CPPUTEST_HAVE_FORK + +IGNORE_TEST(UtestShell, TestDefaultCrashMethodInSeparateProcessTest) {} + +#else + +#if !CPPUTEST_SANITIZE_ADDRESS + +TEST(UtestShell, TestDefaultCrashMethodInSeparateProcessTest) +{ + fixture.setTestFunction(UtestShell::crash); + fixture.setRunTestsInSeperateProcess(); + fixture.runAllTests(); + fixture.assertPrintContains("Failed in separate process - killed by signal"); + + /* Signal 11 usually happens, but with clang3.7 on Linux, it produced signal 4 */ + CHECK(fixture.getOutput().contains("signal 11") || fixture.getOutput().contains("signal 4")); +} + +#endif + +#endif + +#if CPPUTEST_USE_STD_CPP_LIB + +static bool destructorWasCalledOnFailedTest = false; + +static void _destructorCalledForLocalObjects() +{ + SetBooleanOnDestructorCall pleaseCallTheDestructor(destructorWasCalledOnFailedTest); + destructorWasCalledOnFailedTest = false; + FAIL("fail"); +} + +TEST(UtestShell, DestructorIsCalledForLocalObjectsWhenTheTestFails) +{ + fixture.setTestFunction(_destructorCalledForLocalObjects); + fixture.runAllTests(); + CHECK(destructorWasCalledOnFailedTest); +} + +#endif + +TEST_GROUP(IgnoredUtestShell) +{ + TestTestingFixture fixture; + IgnoredUtestShell ignoredTest; + ExecFunctionTestShell normalUtestShell; + + void setup() _override + { + fixture.addTest(&ignoredTest); + fixture.addTest(&normalUtestShell); + } +}; + +TEST(IgnoredUtestShell, doesIgnoreCount) +{ + fixture.runAllTests(); + LONGS_EQUAL(1, fixture.getIgnoreCount()); +} + +TEST(IgnoredUtestShell, printsIGNORE_TESTwhenVerbose) +{ + fixture.setOutputVerbose(); + fixture.runAllTests(); + fixture.assertPrintContains("IGNORE_TEST"); +} + +TEST(IgnoredUtestShell, runIgnoredOptionSpecifiedThenIncreaseRunCount) +{ + ignoredTest.setRunIgnored(); + fixture.runAllTests(); + LONGS_EQUAL(3, fixture.getRunCount()); + LONGS_EQUAL(0, fixture.getIgnoreCount()); +} + +TEST(IgnoredUtestShell, runIgnoredOptionNotSpecifiedThenIncreaseIgnoredCount) +{ + fixture.runAllTests(); + LONGS_EQUAL(2, fixture.getRunCount()); + LONGS_EQUAL(1, fixture.getIgnoreCount()); +} + +TEST(IgnoredUtestShell, runIgnoredOptionSpecifiedWillNotInfluenceNormalTestCount) +{ + normalUtestShell.setRunIgnored(); + fixture.runAllTests(); + LONGS_EQUAL(2, fixture.getRunCount()); + LONGS_EQUAL(1, fixture.getIgnoreCount()); +} + +TEST(IgnoredUtestShell, runIgnoredOptionSpecifiedThenReturnTESTInFormattedName) +{ + ignoredTest.setGroupName("TestGroup"); + ignoredTest.setTestName("TestName"); + ignoredTest.setRunIgnored(); + fixture.runAllTests(); + STRCMP_EQUAL("TEST(TestGroup, TestName)", ignoredTest.getFormattedName().asCharString()); +} + +TEST(IgnoredUtestShell, runIgnoredOptionNotSpecifiedThenReturnIGNORETESTInFormattedName) +{ + ignoredTest.setGroupName("TestGroup"); + ignoredTest.setTestName("TestName"); + fixture.runAllTests(); + STRCMP_EQUAL("IGNORE_TEST(TestGroup, TestName)", ignoredTest.getFormattedName().asCharString()); +} + +TEST(IgnoredUtestShell, runIgnoredOptionNotSpecifiedThenWillRunReturnFalse) +{ + CHECK_FALSE(ignoredTest.willRun()); +} + +TEST(IgnoredUtestShell, runIgnoredOptionSpecifiedThenWillRunReturnTrue) +{ + ignoredTest.setRunIgnored(); + CHECK_TRUE(ignoredTest.willRun()); +} + +TEST_BASE(MyOwnTest) +{ + MyOwnTest() : + inTest(false) + { + } + bool inTest; + + void setup() + { + CHECK(!inTest); + inTest = true; + } + void teardown() + { + CHECK(inTest); + inTest = false; + } +}; + +TEST_GROUP_BASE(UtestMyOwn, MyOwnTest) +{ +}; + +TEST(UtestMyOwn, test) +{ + CHECK(inTest); +} + +class NullParameterTest: public UtestShell +{ +}; + +TEST(UtestMyOwn, NullParameters) +{ + NullParameterTest nullTest; /* Bug fix tests for creating a test without a name, fix in SimpleString */ + TestFilter emptyFilter; + CHECK(nullTest.shouldRun(&emptyFilter, &emptyFilter)); +} + +class AllocateAndDeallocateInConstructorAndDestructor +{ + char* memory_; + char* morememory_; +public: + AllocateAndDeallocateInConstructorAndDestructor() + { + memory_ = new char[100]; + morememory_ = NULLPTR; + } + void allocateMoreMemory() + { + morememory_ = new char[123]; + } + + ~AllocateAndDeallocateInConstructorAndDestructor() + { + delete [] memory_; + delete [] morememory_; + } +}; + +TEST_GROUP(CanHaveMemberVariablesInTestGroupThatAllocateMemoryWithoutCausingMemoryLeaks) +{ + AllocateAndDeallocateInConstructorAndDestructor dummy; +}; + +TEST(CanHaveMemberVariablesInTestGroupThatAllocateMemoryWithoutCausingMemoryLeaks, testInTestGroupName) +{ + dummy.allocateMoreMemory(); +} + +static int getZero() +{ + return 0; +} + +static int getOne() +{ + return 1; +} + +TEST_GROUP(UtestShellPointerArrayTest) +{ + UtestShell* test0; + UtestShell* test1; + UtestShell* test2; + + void setup() + { + test0 = new IgnoredUtestShell(); + test1 = new IgnoredUtestShell(); + test2 = new IgnoredUtestShell(); + + test0->addTest(test1); + test1->addTest(test2); + } + + void teardown() + { + delete test0; + delete test1; + delete test2; + } +}; + + +TEST(UtestShellPointerArrayTest, empty) +{ + UtestShellPointerArray tests(NULLPTR); + tests.shuffle(0); + CHECK(NULLPTR == tests.getFirstTest()); +} + +TEST(UtestShellPointerArrayTest, testsAreInOrder) +{ + UtestShellPointerArray tests(test0); + CHECK(tests.get(0) == test0); + CHECK(tests.get(1) == test1); + CHECK(tests.get(2) == test2); +} + +TEST(UtestShellPointerArrayTest, relinkingTestsWillKeepThemTheSameWhenNothingWasDone) +{ + UtestShellPointerArray tests(test0); + tests.relinkTestsInOrder(); + CHECK(tests.get(0) == test0); + CHECK(tests.get(1) == test1); + CHECK(tests.get(2) == test2); +} + + +TEST(UtestShellPointerArrayTest, firstTestisNotTheFirstTestWithSeed1234) +{ + UtestShellPointerArray tests(test0); + tests.shuffle(1234); + CHECK(tests.getFirstTest() != test0); +} + +TEST(UtestShellPointerArrayTest, ShuffleListTestWithRandomAlwaysReturningZero) +{ + UT_PTR_SET(PlatformSpecificRand, getZero); + + UtestShellPointerArray tests(test0); + tests.shuffle(3); + CHECK(tests.get(0) == test1); + CHECK(tests.get(1) == test2); + CHECK(tests.get(2) == test0); +} + +// swaps with 4 mod 3 (1) then 4 mod 2 (0): 1, [2], [0] --> [1], [0], 2 --> 0, 1, 2 +TEST(UtestShellPointerArrayTest, ShuffleListTestWithRandomAlwaysReturningOne) +{ + UT_PTR_SET(PlatformSpecificRand, getOne); + + UtestShellPointerArray tests(test0); + tests.shuffle(3); + CHECK(tests.get(0) == test0); + CHECK(tests.get(1) == test2); + CHECK(tests.get(2) == test1); +} + +TEST(UtestShellPointerArrayTest, reverse) +{ + UT_PTR_SET(PlatformSpecificRand, getOne); + + UtestShellPointerArray tests(test0); + tests.reverse(); + CHECK(tests.get(0) == test2); + CHECK(tests.get(1) == test1); + CHECK(tests.get(2) == test0); +} diff -Nru cpputest-3.8/tests/CppUTestExt/AllTests.cpp cpputest-4.0/tests/CppUTestExt/AllTests.cpp --- cpputest-3.8/tests/CppUTestExt/AllTests.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/AllTests.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -27,6 +27,7 @@ #include "CppUTest/CommandLineTestRunner.h" #include "CppUTest/TestRegistry.h" +#include "CppUTest/SimpleStringInternalCache.h" #include "CppUTestExt/MemoryReporterPlugin.h" #include "CppUTestExt/MockSupportPlugin.h" @@ -34,28 +35,35 @@ #include "CppUTestExt/GTestConvertor.h" #endif -int main(int ac, const char** av) +int main(int ac, const char *const *av) { + int result = 0; + GlobalSimpleStringCache simpleStringCache; + + { #ifdef CPPUTEST_INCLUDE_GTEST_TESTS - GTestConvertor convertor; - convertor.addAllGTestToTestRegistry(); + GTestConvertor convertor; + convertor.addAllGTestToTestRegistry(); #endif - MemoryReporterPlugin plugin; - MockSupportPlugin mockPlugin; - TestRegistry::getCurrentRegistry()->installPlugin(&plugin); - TestRegistry::getCurrentRegistry()->installPlugin(&mockPlugin); + MemoryReporterPlugin plugin; + MockSupportPlugin mockPlugin; + TestRegistry::getCurrentRegistry()->installPlugin(&plugin); + TestRegistry::getCurrentRegistry()->installPlugin(&mockPlugin); #ifndef GMOCK_RENAME_MAIN - return CommandLineTestRunner::RunAllTests(ac, av); + result = CommandLineTestRunner::RunAllTests(ac, av); #else - /* Don't have any memory leak detector when running the Google Test tests */ + /* Don't have any memory leak detector when running the Google Test tests */ - testing::GMOCK_FLAG(verbose) = testing::internal::kWarningVerbosity; + testing::GMOCK_FLAG(verbose) = testing::internal::kWarningVerbosity; - ConsoleTestOutput output; - CommandLineTestRunner runner(ac, av, &output, TestRegistry::getCurrentRegistry()); - return runner.runAllTestsMain(); + ConsoleTestOutput output; + CommandLineTestRunner runner(ac, av, TestRegistry::getCurrentRegistry()); + result = runner.runAllTestsMain(); #endif + } + + return result; } diff -Nru cpputest-3.8/tests/CppUTestExt/CMakeLists.txt cpputest-4.0/tests/CppUTestExt/CMakeLists.txt --- cpputest-3.8/tests/CppUTestExt/CMakeLists.txt 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/CMakeLists.txt 2020-05-26 11:24:07.000000000 +0000 @@ -25,6 +25,7 @@ MockSupport_cTest.cpp MockStrictOrderTest.cpp MockReturnValueTest.cpp + OrderedTestTest_c.c OrderedTestTest.cpp ) @@ -36,4 +37,7 @@ add_executable(CppUTestExtTests ${CppUTestExtTests_src}) cpputest_normalize_test_output_location(CppUTestExtTests) target_link_libraries(CppUTestExtTests CppUTest CppUTestExt ${THREAD_LIB} ${CPPUNIT_EXTERNAL_LIBRARIES}) -cpputest_buildtime_discover_tests(CppUTestExtTests) + +if (TESTS_BUILD_DISCOVER) + cpputest_buildtime_discover_tests(CppUTestExtTests) +endif() diff -Nru cpputest-3.8/tests/CppUTestExt/CodeMemoryReporterTest.cpp cpputest-4.0/tests/CppUTestExt/CodeMemoryReporterTest.cpp --- cpputest-3.8/tests/CppUTestExt/CodeMemoryReporterTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/CodeMemoryReporterTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,8 +30,8 @@ #include "CppUTestExt/MemoryReportAllocator.h" #include "CppUTestExt/CodeMemoryReportFormatter.h" -#define TESTOUTPUT_EQUAL(a) STRCMP_EQUAL_LOCATION(a, testOutput.getOutput().asCharString(), "", __FILE__, __LINE__); -#define TESTOUTPUT_CONTAINS(a) STRCMP_CONTAINS_LOCATION(a, testOutput.getOutput().asCharString(), "", __FILE__, __LINE__); +#define TESTOUTPUT_EQUAL(a) STRCMP_EQUAL_LOCATION(a, testOutput.getOutput().asCharString(), "", __FILE__, __LINE__) +#define TESTOUTPUT_CONTAINS(a) STRCMP_CONTAINS_LOCATION(a, testOutput.getOutput().asCharString(), "", __FILE__, __LINE__) TEST_GROUP(CodeMemoryReportFormatter) { @@ -124,7 +124,7 @@ TEST(CodeMemoryReportFormatter, DeleteNullWorksFine) { - formatter->report_free_memory(testResult, newAllocator, NULL, "boo", 4); + formatter->report_free_memory(testResult, newAllocator, NULLPTR, "boo", 4); TESTOUTPUT_CONTAINS("delete [] NULL; /* using delete at boo:4 */"); } diff -Nru cpputest-3.8/tests/CppUTestExt/ExpectedFunctionsListTest.cpp cpputest-4.0/tests/CppUTestExt/ExpectedFunctionsListTest.cpp --- cpputest-3.8/tests/CppUTestExt/ExpectedFunctionsListTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/ExpectedFunctionsListTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -57,13 +57,14 @@ delete call4; delete list; CHECK_NO_MOCK_FAILURE(); + MockFailureReporterForTest::clearReporter(); } }; TEST(MockExpectedCallsList, emptyList) { CHECK(! list->hasUnfulfilledExpectations()); - CHECK(! list->hasFulfilledExpectations()); + CHECK(! list->hasFinalizedMatchingExpectations()); LONGS_EQUAL(0, list->size()); } @@ -74,7 +75,7 @@ LONGS_EQUAL(2, list->size()); } -TEST(MockExpectedCallsList, listWithFulfilledExpectationHasNoUnfillfilledOnes) +TEST(MockExpectedCallsList, listWithFulfilledExpectationHasNoUnfulfilledOnes) { call1->callWasMade(1); call2->callWasMade(2); @@ -112,17 +113,15 @@ list->deleteAllExpectationsAndClearList(); } -TEST(MockExpectedCallsList, onlyKeepUnfulfilledExpectations) +TEST(MockExpectedCallsList, onlyKeepUnmatchingExpectations) { call1->withName("relate"); call2->withName("unrelate"); - call3->withName("relate"); - call2->callWasMade(1); - call3->callWasMade(2); + call3->withName("relate").withParameter("param",1); list->addExpectedCall(call1); list->addExpectedCall(call2); list->addExpectedCall(call3); - list->onlyKeepUnfulfilledExpectations(); + list->onlyKeepUnmatchingExpectations(); LONGS_EQUAL(1, list->size()); } @@ -200,38 +199,42 @@ LONGS_EQUAL(2, list->size()); } -TEST(MockExpectedCallsList, addUnfilfilledExpectationsWithEmptyList) +TEST(MockExpectedCallsList, addPotentiallyMatchingExpectationsWithEmptyList) { MockExpectedCallsList newList; - newList.addUnfulfilledExpectations(*list); + newList.addPotentiallyMatchingExpectations(*list); LONGS_EQUAL(0, newList.size()); } -TEST(MockExpectedCallsList, addUnfilfilledExpectationsMultipleUnfulfilledExpectations) +TEST(MockExpectedCallsList, addPotentiallyMatchingExpectationsMultipleUnmatchedExpectations) { call2->callWasMade(1); list->addExpectedCall(call1); list->addExpectedCall(call2); list->addExpectedCall(call3); MockExpectedCallsList newList; - newList.addUnfulfilledExpectations(*list); + newList.addPotentiallyMatchingExpectations(*list); LONGS_EQUAL(2, newList.size()); } -TEST(MockExpectedCallsList, amountOfExpectationsFor) +TEST(MockExpectedCallsList, amountOfActualCallsFulfilledFor_HasOneRelated) { call1->withName("foo"); + call1->callWasMade(1); call2->withName("bar"); + call2->callWasMade(2); list->addExpectedCall(call1); list->addExpectedCall(call2); - LONGS_EQUAL(1, list->amountOfExpectationsFor("bar")); + LONGS_EQUAL(1, list->amountOfActualCallsFulfilledFor("bar")); } -TEST(MockExpectedCallsList, amountOfExpectationsForHasNone) +TEST(MockExpectedCallsList, amountOfActualCallsFulfilledFor_HasNone) { call1->withName("foo"); + call1->callWasMade(1); + call2->withName("bar"); list->addExpectedCall(call1); - LONGS_EQUAL(0, list->amountOfExpectationsFor("bar")); + LONGS_EQUAL(0, list->amountOfActualCallsFulfilledFor("bar")); } TEST(MockExpectedCallsList, callToStringForUnfulfilledFunctions) @@ -262,21 +265,72 @@ list->addExpectedCall(call2); SimpleString expectedString; - expectedString = StringFromFormat("%s\n%s", call2->callToString().asCharString(), call1->callToString().asCharString()); + expectedString = StringFromFormat("%s\n%s", call1->callToString().asCharString(), call2->callToString().asCharString()); STRCMP_EQUAL(expectedString.asCharString(), list->fulfilledCallsToString().asCharString()); } -TEST(MockExpectedCallsList, removeOneFulfilledExpectationFromEmptyList) +TEST(MockExpectedCallsList, removeOneFinalizedMatchingExpectationFromEmptyList) { - POINTERS_EQUAL(NULL, list->removeOneFulfilledExpectation()); + POINTERS_EQUAL(NULLPTR, list->removeFirstFinalizedMatchingExpectation()); } -TEST(MockExpectedCallsList, getOneFulfilledExpectationWithIgnoredParametersFromEmptyList) +TEST(MockExpectedCallsList, getOneMatchingExpectationFromEmptyList) { - POINTERS_EQUAL(NULL, list->getOneFulfilledExpectationWithIgnoredParameters()); + POINTERS_EQUAL(NULLPTR, list->getFirstMatchingExpectation()); } TEST(MockExpectedCallsList, toStringOnEmptyList) { STRCMP_EQUAL("", list->unfulfilledCallsToString().asCharString()); } + +TEST(MockExpectedCallsList, hasFinalizedMatchingExpectations_emptyList) +{ + CHECK(! list->hasFinalizedMatchingExpectations()); +} + +TEST(MockExpectedCallsList, hasFinalizedMatchingExpectations_listHasNonMatchingCalls) +{ + call1->withParameter("param", 0); + call2->withParameter("param", 0); + call3->withParameter("param", 0); + list->addExpectedCall(call1); + list->addExpectedCall(call2); + list->addExpectedCall(call3); + + CHECK(! list->hasFinalizedMatchingExpectations()); +} + +TEST(MockExpectedCallsList, hasFinalizedMatchingExpectations_listHasMatchingButNotFinalizedCall) +{ + list->addExpectedCall(call1); + list->addExpectedCall(call2); + call1->ignoreOtherParameters(); + call2->withParameter("param", 0); + + CHECK(! list->hasFinalizedMatchingExpectations()); +} + +TEST(MockExpectedCallsList, hasFinalizedMatchingExpectations_listHasFinalizedCallThatIgnoresParameters) +{ + list->addExpectedCall(call1); + list->addExpectedCall(call2); + call1->ignoreOtherParameters(); + call2->withParameter("param", 0); + + call1->finalizeActualCallMatch(); + + CHECK(list->hasFinalizedMatchingExpectations()); +} + +TEST(MockExpectedCallsList, hasFinalizedMatchingExpectations_listHasFinalizedCallThatDoesntIgnoreParameters) +{ + list->addExpectedCall(call1); + list->addExpectedCall(call2); + call1->withParameter("param", 1); + call2->withParameter("param", 0); + + call1->inputParameterWasPassed("param"); + + CHECK(list->hasFinalizedMatchingExpectations()); +} diff -Nru cpputest-3.8/tests/CppUTestExt/GTest1Test.cpp cpputest-4.0/tests/CppUTestExt/GTest1Test.cpp --- cpputest-3.8/tests/CppUTestExt/GTest1Test.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/GTest1Test.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -73,6 +73,9 @@ TEST(GTestSimpleTest, GTestDeathTest) { +#if defined(GTEST_VERSION_GTEST_1_7) + CppuTestGTestIgnoreLeaksInTest(); +#endif ASSERT_DEATH(crashMe(), "Crash me!"); } diff -Nru cpputest-3.8/tests/CppUTestExt/IEEE754PluginTest_c.c cpputest-4.0/tests/CppUTestExt/IEEE754PluginTest_c.c --- cpputest-3.8/tests/CppUTestExt/IEEE754PluginTest_c.c 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/IEEE754PluginTest_c.c 2020-05-26 11:24:07.000000000 +0000 @@ -28,11 +28,12 @@ #include "IEEE754PluginTest_c.h" static volatile float f; +static volatile float zero_float = 0.0f; void set_divisionbyzero_c(void) { f = 1.0f; - f /= 0.0f; + f /= zero_float; } void set_overflow_c(void) diff -Nru cpputest-3.8/tests/CppUTestExt/IEEE754PluginTest.cpp cpputest-4.0/tests/CppUTestExt/IEEE754PluginTest.cpp --- cpputest-3.8/tests/CppUTestExt/IEEE754PluginTest.cpp 2016-05-25 03:57:45.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/IEEE754PluginTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -31,6 +31,7 @@ #include "CppUTest/TestTestingFixture.h" #include "CppUTestExt/IEEE754ExceptionsPlugin.h" +#ifdef CPPUTEST_HAVE_FENV #if CPPUTEST_FENV_IS_WORKING_PROPERLY extern "C" @@ -44,7 +45,7 @@ IEEE754ExceptionsPlugin ieee754Plugin; void setup(void) _override { - fixture.registry_->installPlugin(&ieee754Plugin); + fixture.installPlugin(&ieee754Plugin); } }; @@ -115,7 +116,7 @@ CHECK(1 == 2); } -IGNORE_TEST(FE__with_Plugin, should_not_fail_again_when_test_has_already_failed) +TEST(FE__with_Plugin, should_not_fail_again_when_test_has_already_failed) { fixture.setTestFunction(set_everything_but_already_failed); fixture.runAllTests(); @@ -143,3 +144,4 @@ } #endif +#endif diff -Nru cpputest-3.8/tests/CppUTestExt/MemoryReportAllocatorTest.cpp cpputest-4.0/tests/CppUTestExt/MemoryReportAllocatorTest.cpp --- cpputest-3.8/tests/CppUTestExt/MemoryReportAllocatorTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MemoryReportAllocatorTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -32,13 +32,20 @@ TEST_GROUP(MemoryReportAllocator) { + MemoryReportAllocator allocator; }; TEST(MemoryReportAllocator, FunctionsAreForwardedForMallocAllocator) { - MemoryReportAllocator allocator; allocator.setRealAllocator(getCurrentMallocAllocator()); STRCMP_EQUAL("malloc", allocator.alloc_name()); STRCMP_EQUAL("free", allocator.free_name()); } + +TEST(MemoryReportAllocator, keepingTrackOfActualAllocator) +{ + TestMemoryAllocator* originalAllocator = getCurrentMallocAllocator(); + allocator.setRealAllocator(getCurrentMallocAllocator()); + POINTERS_EQUAL(originalAllocator->actualAllocator(), allocator.actualAllocator()); +} diff -Nru cpputest-3.8/tests/CppUTestExt/MemoryReporterPluginTest.cpp cpputest-4.0/tests/CppUTestExt/MemoryReporterPluginTest.cpp --- cpputest-3.8/tests/CppUTestExt/MemoryReporterPluginTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MemoryReporterPluginTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -76,13 +76,13 @@ mock("formatter").actualCall("report_test_end").withParameter("result", result).withParameter("test", &test); } - virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t, char* , const char* , int ) + virtual void report_alloc_memory(TestResult* result, TestMemoryAllocator* allocator, size_t, char* , const char* , size_t ) { TemporaryDefaultNewAllocator tempAlloc(previousNewAllocator); mock("formatter").actualCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", allocator); } - virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* , const char* , int ) + virtual void report_free_memory(TestResult* result, TestMemoryAllocator* allocator, char* , const char* , size_t ) { TemporaryDefaultNewAllocator tempAlloc(previousNewAllocator); mock("formatter").actualCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", allocator); @@ -106,11 +106,11 @@ public: bool isEqual(const void* object1, const void* object2) { - return ((TestMemoryAllocator*)object1)->name() == ((TestMemoryAllocator*)object2)->name(); + return ((const TestMemoryAllocator*)object1)->name() == ((const TestMemoryAllocator*)object2)->name(); } SimpleString valueToString(const void* object) { - return ((TestMemoryAllocator*)object)->name(); + return ((const TestMemoryAllocator*)object)->name(); } }; @@ -140,6 +140,8 @@ } void teardown() { + setCurrentNewAllocator(previousNewAllocator); + mock().clear(); delete reporter; delete test; delete result; @@ -178,55 +180,55 @@ TEST(MemoryReporterPlugin, postTestActionReportsTest) { - mock("formatter").expectOneCall("report_test_end").withParameter("result", result).withParameter("test", test);; - mock("formatter").expectOneCall("report_testgroup_end").withParameter("result", result).withParameter("test", test);; + mock("formatter").expectOneCall("report_test_end").withParameter("result", result).withParameter("test", test); + mock("formatter").expectOneCall("report_testgroup_end").withParameter("result", result).withParameter("test", test); reporter->postTestAction(*test, *result); } TEST(MemoryReporterPlugin, newAllocationsAreReportedTest) { - mock("formatter").expectOneCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", defaultNewAllocator()); - mock("formatter").expectOneCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", defaultNewAllocator()); + mock("formatter").expectOneCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", reporter->getNewAllocator()); + mock("formatter").expectOneCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", reporter->getNewAllocator()); mock("formatter").ignoreOtherCalls(); reporter->preTestAction(*test, *result); char *memory = getCurrentNewAllocator()->allocMemoryLeakNode(100); - getCurrentNewAllocator()->free_memory(memory, "unknown", 1); + getCurrentNewAllocator()->free_memory(memory, 100, "unknown", 1); } TEST(MemoryReporterPlugin, whenUsingOnlyMallocAllocatorNoOtherOfTheAllocatorsAreUsed) { mock("formatter").expectOneCall("report_test_start").withParameter("result", result).withParameter("test", test); - mock("formatter").expectOneCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", defaultMallocAllocator()); - mock("formatter").expectOneCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", defaultMallocAllocator()); + mock("formatter").expectOneCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", reporter->getMallocAllocator()); + mock("formatter").expectOneCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", reporter->getMallocAllocator()); mock("formatter").ignoreOtherCalls(); reporter->preTestAction(*test, *result); char *memory = getCurrentMallocAllocator()->allocMemoryLeakNode(100); - getCurrentMallocAllocator()->free_memory(memory, "unknown", 1); + getCurrentMallocAllocator()->free_memory(memory, 100, "unknown", 1); } TEST(MemoryReporterPlugin, newArrayAllocationsAreReportedTest) { - mock("formatter").expectOneCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", defaultNewArrayAllocator()); - mock("formatter").expectOneCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", defaultNewArrayAllocator()); + mock("formatter").expectOneCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", reporter->getNewArrayAllocator()); + mock("formatter").expectOneCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", reporter->getNewArrayAllocator()); mock("formatter").ignoreOtherCalls(); reporter->preTestAction(*test, *result); char *memory = getCurrentNewArrayAllocator()->allocMemoryLeakNode(100); - getCurrentNewArrayAllocator()->free_memory(memory, "unknown", 1); + getCurrentNewArrayAllocator()->free_memory(memory, 100, "unknown", 1); } TEST(MemoryReporterPlugin, mallocAllocationsAreReportedTest) { - mock("formatter").expectOneCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", defaultMallocAllocator()); - mock("formatter").expectOneCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", defaultMallocAllocator()); + mock("formatter").expectOneCall("report_alloc_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", reporter->getMallocAllocator()); + mock("formatter").expectOneCall("report_free_memory").withParameter("result", result).withParameterOfType("TestMemoryAllocator", "allocator", reporter->getMallocAllocator()); mock("formatter").ignoreOtherCalls(); reporter->preTestAction(*test, *result); char *memory = getCurrentMallocAllocator()->allocMemoryLeakNode(100); - getCurrentMallocAllocator()->free_memory(memory, "unknown", 1); + getCurrentMallocAllocator()->free_memory(memory, 100, "unknown", 1); } TEST(MemoryReporterPlugin, startOfANewTestWillReportTheTestGroupStart) @@ -255,7 +257,7 @@ TEST(MemoryReporterPlugin, endOfaTestGroupWillReportSo) { - UtestForMemoryReportingPlugingTest fourthTest("differentGroupName", NULL); + UtestForMemoryReportingPlugingTest fourthTest("differentGroupName", NULLPTR); UtestForMemoryReportingPlugingTest thirdTest("differentGroupName", &fourthTest); UtestForMemoryReportingPlugingTest secondTest("groupname", &thirdTest); UtestForMemoryReportingPlugingTest firstTest("groupname", &secondTest); diff -Nru cpputest-3.8/tests/CppUTestExt/MemoryReportFormatterTest.cpp cpputest-4.0/tests/CppUTestExt/MemoryReportFormatterTest.cpp --- cpputest-3.8/tests/CppUTestExt/MemoryReportFormatterTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MemoryReportFormatterTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,7 +30,7 @@ #include "CppUTestExt/MemoryReportAllocator.h" #include "CppUTestExt/MemoryReportFormatter.h" -#define TESTOUTPUT_EQUAL(a) STRCMP_EQUAL_LOCATION(a, testOutput.getOutput().asCharString(), "", __FILE__, __LINE__); +#define TESTOUTPUT_EQUAL(a) STRCMP_EQUAL_LOCATION(a, testOutput.getOutput().asCharString(), "", __FILE__, __LINE__) TEST_GROUP(NormalMemoryReportFormatter) { diff -Nru cpputest-3.8/tests/CppUTestExt/MockActualCallTest.cpp cpputest-4.0/tests/CppUTestExt/MockActualCallTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockActualCallTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockActualCallTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -48,6 +48,9 @@ void teardown() { CHECK_NO_MOCK_FAILURE(); + + MockFailureReporterForTest::clearReporter(); + delete emptyList; delete list; } @@ -74,10 +77,23 @@ TEST(MockCheckedActualCall, unExpectedCallWithAnOutputParameter) { MockCheckedActualCall actualCall(1, reporter, *emptyList); - actualCall.withName("unexpected").withOutputParameter("bar", (void*)0); + actualCall.withName("unexpected").withOutputParameter("bar", NULLPTR); + + MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "unexpected", *list); + CHECK_EXPECTED_MOCK_FAILURE(expectedFailure); +} + +TEST(MockCheckedActualCall, unExpectedCallOnObject) +{ + int object; + + MockCheckedActualCall actualCall(1, reporter, *emptyList); + actualCall.withName("unexpected").onObject(&object); MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "unexpected", *list); CHECK_EXPECTED_MOCK_FAILURE(expectedFailure); + + CHECK(actualCall.hasFailed()); // Checks that onObject() doesn't "reset" call state } TEST(MockCheckedActualCall, actualCallWithNoReturnValueAndMeaninglessCallOrderForCoverage) @@ -138,7 +154,8 @@ actual.withCallOrder(1); CHECK(false == actual.returnBoolValue()); - CHECK(false == actual.returnBoolValueOrDefault(true)); + CHECK(true == actual.returnBoolValueOrDefault(true)); + CHECK(false == actual.returnBoolValueOrDefault(false)); CHECK(0 == actual.returnUnsignedLongIntValue()); CHECK(0 == actual.returnIntValue()); CHECK(1ul == actual.returnUnsignedLongIntValueOrDefault(1ul)); @@ -147,15 +164,21 @@ CHECK(1l == actual.returnLongIntValueOrDefault(1l)); CHECK(0 == actual.returnUnsignedIntValue()); CHECK(1u == actual.returnUnsignedIntValueOrDefault(1u)); +#ifdef CPPUTEST_USE_LONG_LONG + CHECK(0 == actual.returnLongLongIntValue()); + CHECK(1ll == actual.returnLongLongIntValueOrDefault(1ll)); + CHECK(0 == actual.returnUnsignedLongLongIntValue()); + CHECK(1ull == actual.returnUnsignedLongLongIntValueOrDefault(1ull)); +#endif DOUBLES_EQUAL(0.0, actual.returnDoubleValue(), 0.0); DOUBLES_EQUAL(1.5, actual.returnDoubleValueOrDefault(1.5), 0.0); STRCMP_EQUAL("bla", actual.returnStringValueOrDefault("bla")); STRCMP_EQUAL("", actual.returnStringValue()); - CHECK(0 == actual.returnPointerValue()); + CHECK(NULLPTR == actual.returnPointerValue()); CHECK((void*) 0x2 == actual.returnPointerValueOrDefault((void*) 0x2)); - CHECK(0 == actual.returnConstPointerValue()); + CHECK(NULLPTR == actual.returnConstPointerValue()); CHECK((const void*) 0x2 == actual.returnConstPointerValueOrDefault((const void*) 0x2)); - CHECK(0 == actual.returnFunctionPointerValue()); + CHECK(NULLPTR == actual.returnFunctionPointerValue()); CHECK((void(*)()) 1 == actual.returnFunctionPointerValueOrDefault((void(*)()) 0x1)); CHECK_FALSE(actual.hasReturnValue()); CHECK(actual.returnValue().equals(MockNamedValue(""))); @@ -176,6 +199,10 @@ actual.withUnsignedIntParameter("unsigned_int", (unsigned int) 1); actual.withUnsignedLongIntParameter("unsigned_long", (unsigned long)1); actual.withLongIntParameter("long_int", (long int) 1); +#ifdef CPPUTEST_USE_LONG_LONG + actual.withLongLongIntParameter("long_long_int", (long long int) 1); + actual.withUnsignedLongLongIntParameter("unsigned_long_long_int", (unsigned long long int) 1); +#endif actual.withPointerParameter("pointer", &value); actual.withConstPointerParameter("const_pointer", &const_value); actual.withFunctionPointerParameter("function_pointer", function_value); @@ -187,9 +214,13 @@ expectedString += " onObject:0x"; expectedString += HexStringFrom(&value); expectedString += " bool:true"; - expectedString += " unsigned_int: 1 (0x00000001)"; + expectedString += " unsigned_int:1 (0x1)"; expectedString += " unsigned_long:1 (0x1)"; - expectedString += " long_int:1"; + expectedString += " long_int:1 (0x1)"; +#ifdef CPPUTEST_USE_LONG_LONG + expectedString += " long_long_int:1 (0x1)"; + expectedString += " unsigned_long_long_int:1 (0x1)"; +#endif expectedString += " pointer:0x"; expectedString += HexStringFrom(&value); expectedString += " const_pointer:0x"; @@ -212,17 +243,30 @@ CHECK(0 == actual.returnIntValueOrDefault(1)); CHECK(0 == actual.returnLongIntValue()); CHECK(0 == actual.returnLongIntValueOrDefault(1l)); +#ifdef CPPUTEST_USE_LONG_LONG + CHECK(0 == actual.returnLongLongIntValue()); + CHECK(0 == actual.returnLongLongIntValueOrDefault(1ll)); + CHECK(0 == actual.returnUnsignedLongLongIntValue()); + CHECK(0 == actual.returnUnsignedLongLongIntValueOrDefault(1ull)); +#endif CHECK(0 == actual.returnUnsignedIntValue()); CHECK(0 == actual.returnUnsignedIntValueOrDefault(1u)); DOUBLES_EQUAL(0.0, actual.returnDoubleValue(), 0.0); DOUBLES_EQUAL(0.0, actual.returnDoubleValueOrDefault(1.0), 0.0); STRCMP_EQUAL("", actual.returnStringValueOrDefault("bla")); STRCMP_EQUAL("", actual.returnStringValue()); - CHECK(0 == actual.returnPointerValue()); - CHECK(0 == actual.returnPointerValueOrDefault((void*) 0x0)); - CHECK(0 == actual.returnConstPointerValue()); - CHECK(0 == actual.returnConstPointerValueOrDefault((const void*) 0x0)); - CHECK(0 == actual.returnFunctionPointerValue()); - CHECK(0 == actual.returnFunctionPointerValueOrDefault((void (*)()) 0x0)); + CHECK(NULLPTR == actual.returnPointerValue()); + CHECK(NULLPTR == actual.returnPointerValueOrDefault((void*) NULLPTR)); + CHECK(NULLPTR == actual.returnConstPointerValue()); + CHECK(NULLPTR == actual.returnConstPointerValueOrDefault((const void*) NULLPTR)); + CHECK(NULLPTR == actual.returnFunctionPointerValue()); + CHECK(NULLPTR == actual.returnFunctionPointerValueOrDefault((void (*)()) NULLPTR)); } +TEST(MockCheckedActualCall, MockActualCallTraceClear) +{ + MockActualCallTrace actual; + actual.withName("func"); + actual.clear(); + STRCMP_EQUAL("", actual.getTraceOutput()); +} diff -Nru cpputest-3.8/tests/CppUTestExt/MockCallTest.cpp cpputest-4.0/tests/CppUTestExt/MockCallTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockCallTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockCallTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -31,10 +31,11 @@ TEST_GROUP(MockCallTest) { - void teardown() - { - mock().checkExpectations(); - } + void teardown() + { + mock().checkExpectations(); + mock().clear(); + } }; TEST(MockCallTest, clear) @@ -49,20 +50,39 @@ mock().checkExpectations(); } -TEST(MockCallTest, exceptACallThatHappens) +TEST(MockCallTest, expectASingleCallThatHappens) { mock().expectOneCall("func"); - mock().actualCall("func"); + MockCheckedActualCall& actualCall = (MockCheckedActualCall&) mock().actualCall("func"); + actualCall.checkExpectations(); CHECK(! mock().expectedCallsLeft()); } -TEST(MockCallTest, exceptACallInceasesExpectedCallsLeft) +TEST(MockCallTest, expectASingleCallThatDoesntHappen) { mock().expectOneCall("func"); CHECK(mock().expectedCallsLeft()); mock().clear(); } +TEST(MockCallTest, expectAMultiCallThatHappensTheExpectedTimes) +{ + mock().expectNCalls(2, "func"); + mock().actualCall("func"); + MockCheckedActualCall& actualCall = (MockCheckedActualCall&) mock().actualCall("func"); + actualCall.checkExpectations(); + CHECK(! mock().expectedCallsLeft()); +} + +TEST(MockCallTest, expectAMultiCallThatDoesntHappenTheExpectedTimes) +{ + mock().expectNCalls(2, "func"); + MockCheckedActualCall& actualCall = (MockCheckedActualCall&) mock().actualCall("func"); + actualCall.checkExpectations(); + CHECK(mock().expectedCallsLeft()); + mock().clear(); +} + TEST(MockCallTest, checkExpectationsClearsTheExpectations) { MockFailureReporterInstaller failureReporterInstaller; @@ -147,7 +167,7 @@ } -TEST(MockCallTest, expectMultipleCallsThatHappen) +TEST(MockCallTest, expectMultipleSingleCallsThatHappen) { mock().expectOneCall("foo"); mock().expectOneCall("foo"); @@ -179,6 +199,7 @@ MockFailureReporterInstaller failureReporterInstaller; MockExpectedCallsListForTest expectations; + expectations.addFunction(0, "lazy"); MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "lazy", expectations); mock().expectNoCall("lazy"); @@ -192,7 +213,8 @@ MockFailureReporterInstaller failureReporterInstaller; MockExpectedCallsListForTest expectations; - expectations.addFunction("influence", MockCheckedExpectedCall::NO_EXPECTED_CALL_ORDER)->callWasMade(1); + expectations.addFunction(0, "lazy"); + expectations.addFunction("influence")->callWasMade(1); MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "lazy", expectations); mock().expectNoCall("lazy"); @@ -208,6 +230,7 @@ MockFailureReporterInstaller failureReporterInstaller; MockExpectedCallsListForTest expectations; + expectations.addFunction(0, "lazy"); MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "lazy", expectations); mock().expectNoCall("lazy"); @@ -221,6 +244,7 @@ MockFailureReporterInstaller failureReporterInstaller; MockExpectedCallsListForTest expectations; + expectations.addFunction(0, "lazy"); MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "lazy", expectations); mock().expectNoCall("lazy"); @@ -239,6 +263,7 @@ MockFailureReporterInstaller failureReporterInstaller; MockExpectedCallsListForTest expectations; + expectations.addFunction(0, "scope::lazy"); MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "scope::lazy", expectations); mock("scope").expectNoCall("lazy"); @@ -277,7 +302,7 @@ { mock().expectOneCall("foo"); mock().ignoreOtherCalls(); - mock().actualCall("bar").withParameter("foo", 1);; + mock().actualCall("bar").withParameter("foo", 1); mock().clear(); } @@ -347,6 +372,31 @@ mock().actualCall("boo").onObject(objectPtr); } +TEST(MockCallTest, OnObjectIgnored_MatchingAlreadyWhenObjectPassed) +{ + void* objectPtr = (void*) 0x001; + mock().expectOneCall("boo"); + mock().actualCall("boo").onObject(objectPtr); +} + +TEST(MockCallTest, OnObjectIgnored_NotMatchingYetWhenObjectPassed) +{ + void* objectPtr = (void*) 0x001; + mock().expectOneCall("boo").withBoolParameter("p", true); + mock().actualCall("boo").onObject(objectPtr).withBoolParameter("p", true); +} + +TEST(MockCallTest, OnObjectIgnored_InitialMatchDiscarded) +{ + void* objectPtr1 = (void*) 0x001; + void* objectPtr2 = (void*) 0x002; + + mock().expectOneCall("boo"); + mock().expectOneCall("boo").withBoolParameter("p", true); + mock().actualCall("boo").onObject(objectPtr2).withBoolParameter("p", true); + mock().actualCall("boo").onObject(objectPtr1); +} + TEST(MockCallTest, OnObjectFails) { MockFailureReporterInstaller failureReporterInstaller; @@ -383,7 +433,7 @@ CHECK_EXPECTED_MOCK_FAILURE(expectedFailure); } -TEST(MockCallTest, expectMultipleCalls) +TEST(MockCallTest, expectNCalls_Fulfilled) { mock().expectNCalls(2, "boo"); mock().actualCall("boo"); @@ -391,15 +441,34 @@ mock().checkExpectations(); } +TEST(MockCallTest, expectNCalls_NotFulfilled) +{ + MockFailureReporterInstaller failureReporterInstaller; + + MockExpectedCallsListForTest expectations; + expectations.addFunction(2, "boo")->callWasMade(1); + MockExpectedCallsDidntHappenFailure expectedFailure(mockFailureTest(), expectations); + + mock().expectNCalls(2, "boo"); + mock().actualCall("boo"); + mock().checkExpectations(); + + CHECK_EXPECTED_MOCK_FAILURE(expectedFailure); +} + TEST(MockCallTest, shouldntFailTwice) { MockFailureReporterInstaller failureReporterInstaller; + mock().strictOrder(); mock().expectOneCall("foo"); + mock().expectOneCall("boo"); + mock().actualCall("boo"); mock().actualCall("bar"); mock().checkExpectations(); CHECK(!MockFailureReporterForTest::getReporter()->mockFailureString.contains("bar")); + CHECK(MockFailureReporterForTest::getReporter()->mockFailureString.contains("boo")); } TEST(MockCallTest, shouldReturnDefaultWhenThereIsntAnythingToReturn) @@ -429,6 +498,6 @@ TestTestingFixture fixture; fixture.setTestFunction(mocksAreCountedAsChecksTestFunction_); fixture.runAllTests(); - LONGS_EQUAL(5, fixture.getCheckCount()); + LONGS_EQUAL(3, fixture.getCheckCount()); } diff -Nru cpputest-3.8/tests/CppUTestExt/MockCheatSheetTest.cpp cpputest-4.0/tests/CppUTestExt/MockCheatSheetTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockCheatSheetTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockCheatSheetTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -25,6 +25,7 @@ { int return_value; return_value = foo("value_string", 10); + (void)return_value; return_value = foo("value_string", 10); return return_value; } @@ -42,6 +43,8 @@ { /* Check expectations. Alternatively use MockSupportPlugin */ mock().checkExpectations(); + + mock().clear(); } }; diff -Nru cpputest-3.8/tests/CppUTestExt/MockComparatorCopierTest.cpp cpputest-4.0/tests/CppUTestExt/MockComparatorCopierTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockComparatorCopierTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockComparatorCopierTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,10 +30,12 @@ TEST_GROUP(MockComparatorCopierTest) { - void teardown() - { - mock().checkExpectations(); - } + void teardown() + { + mock().checkExpectations(); + mock().clear(); + mock().removeAllComparatorsAndCopiers(); + } }; class MyTypeForTesting @@ -117,12 +119,12 @@ static bool myTypeIsEqual(const void* object1, const void* object2) { - return ((MyTypeForTesting*)object1)->value == ((MyTypeForTesting*)object2)->value; + return ((const MyTypeForTesting*)object1)->value == ((const MyTypeForTesting*)object2)->value; } static SimpleString myTypeValueToString(const void* object) { - return StringFrom(((MyTypeForTesting*)object)->value); + return StringFrom(((const MyTypeForTesting*)object)->value); } TEST(MockComparatorCopierTest, customObjectWithFunctionComparator) @@ -205,7 +207,7 @@ MockExpectedCallsListForTest expectations; expectations.addFunction("foo"); MockNamedValue parameter("parameterName"); - parameter.setObjectPointer("MyTypeForTesting", &actualObject); + parameter.setConstObjectPointer("MyTypeForTesting", &actualObject); MockUnexpectedOutputParameterFailure expectedFailure(mockFailureTest(), "foo", parameter, expectations); mock().expectOneCall("foo"); @@ -250,7 +252,7 @@ MockExpectedCallsListForTest expectations; expectations.addFunction("foo")->withOutputParameterOfTypeReturning("MyTypeForTesting", "output", &expectedObject); MockNamedValue parameter("output"); - parameter.setObjectPointer("OtherTypeForTesting", &actualObject); + parameter.setConstObjectPointer("OtherTypeForTesting", &actualObject); MockUnexpectedOutputParameterFailure expectedFailure(mockFailureTest(), "foo", parameter, expectations); mock().expectOneCall("foo").withOutputParameterOfTypeReturning("MyTypeForTesting", "output", &expectedObject); diff -Nru cpputest-3.8/tests/CppUTestExt/MockExpectedCallTest.cpp cpputest-4.0/tests/CppUTestExt/MockExpectedCallTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockExpectedCallTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockExpectedCallTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -76,13 +76,14 @@ void teardown() { CHECK_NO_MOCK_FAILURE(); + MockFailureReporterForTest::clearReporter(); } }; TEST(MockNamedValueHandlerRepository, getComparatorForNonExistingName) { MockNamedValueComparatorsAndCopiersRepository repository; - POINTERS_EQUAL(NULL, repository.getComparatorForType("typeName")); + POINTERS_EQUAL(NULLPTR, repository.getComparatorForType("typeName")); } TEST(MockNamedValueHandlerRepository, installComparator) @@ -108,7 +109,7 @@ TEST(MockNamedValueHandlerRepository, getCopierForNonExistingName) { MockNamedValueComparatorsAndCopiersRepository repository; - POINTERS_EQUAL(NULL, repository.getCopierForType("typeName")); + POINTERS_EQUAL(NULLPTR, repository.getCopierForType("typeName")); } TEST(MockNamedValueHandlerRepository, installCopier) @@ -153,14 +154,19 @@ TEST_GROUP(MockExpectedCall) { MockCheckedExpectedCall* call; + MockNamedValueComparatorsAndCopiersRepository* originalComparatorRepository; void setup() { - call = new MockCheckedExpectedCall; + originalComparatorRepository = MockNamedValue::getDefaultComparatorsAndCopiersRepository(); + call = new MockCheckedExpectedCall(1); + call->withName("funcName"); } void teardown() { + MockNamedValue::setDefaultComparatorsAndCopiersRepository(originalComparatorRepository); delete call; CHECK_NO_MOCK_FAILURE(); + MockFailureReporterForTest::clearReporter(); } }; @@ -173,110 +179,173 @@ TEST(MockExpectedCall, callWithUnsignedIntegerParameter) { - const SimpleString name = "unsigned integer"; - unsigned int value = 777; - call->withParameter(name, value); - STRCMP_EQUAL("unsigned int", call->getInputParameterType(name).asCharString()); - LONGS_EQUAL(value, call->getInputParameter(name).getUnsignedIntValue()); - CHECK(call->hasInputParameterWithName(name)); + const SimpleString paramName = "paramName"; + unsigned int value = 356; + call->withParameter(paramName, value); + STRCMP_EQUAL("unsigned int", call->getInputParameterType(paramName).asCharString()); + LONGS_EQUAL(value, call->getInputParameter(paramName).getUnsignedIntValue()); + CHECK(call->hasInputParameterWithName(paramName)); + STRCMP_CONTAINS("funcName -> unsigned int paramName: <356 (0x164)>", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithIntegerParameter) { - call->withParameter("integer", 1); - STRCMP_EQUAL("int", call->getInputParameterType("integer").asCharString()); - LONGS_EQUAL(1, call->getInputParameter("integer").getIntValue()); - CHECK(call->hasInputParameterWithName("integer")); + const SimpleString paramName = "paramName"; + int value = 2; + call->withParameter(paramName, value); + STRCMP_EQUAL("int", call->getInputParameterType(paramName).asCharString()); + LONGS_EQUAL(value, call->getInputParameter(paramName).getIntValue()); + CHECK(call->hasInputParameterWithName(paramName)); + STRCMP_CONTAINS("funcName -> int paramName: <2 (0x2)>", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithBooleanParameter) { - call->withParameter("boolean", true); - STRCMP_EQUAL("bool", call->getInputParameterType("boolean").asCharString()); - CHECK_EQUAL(true, call->getInputParameter("boolean").getBoolValue()); - CHECK(call->hasInputParameterWithName("boolean")); + const SimpleString paramName = "paramName"; + bool value = true; + call->withParameter(paramName, value); + STRCMP_EQUAL("bool", call->getInputParameterType(paramName).asCharString()); + CHECK_EQUAL(value, call->getInputParameter(paramName).getBoolValue()); + CHECK(call->hasInputParameterWithName(paramName)); + STRCMP_CONTAINS("funcName -> bool paramName: ", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithUnsignedLongIntegerParameter) { - const SimpleString name = "unsigned long integer"; - unsigned long value = 777; - call->withParameter(name, value); - STRCMP_EQUAL("unsigned long int", call->getInputParameterType(name).asCharString()); - LONGS_EQUAL(value, call->getInputParameter(name).getUnsignedLongIntValue()); - CHECK(call->hasInputParameterWithName(name)); + const SimpleString paramName = "paramName"; + unsigned long value = 888; + call->withParameter(paramName, value); + STRCMP_EQUAL("unsigned long int", call->getInputParameterType(paramName).asCharString()); + LONGS_EQUAL(value, call->getInputParameter(paramName).getUnsignedLongIntValue()); + CHECK(call->hasInputParameterWithName(paramName)); + STRCMP_CONTAINS("funcName -> unsigned long int paramName: <888 (0x378)>", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithLongIntegerParameter) { - const SimpleString name = "long integer"; + const SimpleString paramName = "paramName"; long value = 777; - call->withParameter(name, value); - STRCMP_EQUAL("long int", call->getInputParameterType(name).asCharString()); - LONGS_EQUAL(value, call->getInputParameter(name).getLongIntValue()); - CHECK(call->hasInputParameterWithName(name)); + call->withParameter(paramName, value); + STRCMP_EQUAL("long int", call->getInputParameterType(paramName).asCharString()); + LONGS_EQUAL(value, call->getInputParameter(paramName).getLongIntValue()); + CHECK(call->hasInputParameterWithName(paramName)); + STRCMP_CONTAINS("funcName -> long int paramName: <777 (0x309)>", call->callToString().asCharString()); +} + +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(MockExpectedCall, callWithUnsignedLongLongIntegerParameter) +{ + const SimpleString paramName = "paramName"; + unsigned long long value = 888; + call->withParameter(paramName, value); + STRCMP_EQUAL("unsigned long long int", call->getInputParameterType(paramName).asCharString()); + UNSIGNED_LONGLONGS_EQUAL(value, call->getInputParameter(paramName).getUnsignedLongLongIntValue()); + CHECK(call->hasInputParameterWithName(paramName)); + STRCMP_CONTAINS("funcName -> unsigned long long int paramName: <888 (0x378)>", call->callToString().asCharString()); +} + +TEST(MockExpectedCall, callWithLongLongIntegerParameter) +{ + const SimpleString paramName = "paramName"; + long long value = 777; + call->withParameter(paramName, value); + STRCMP_EQUAL("long long int", call->getInputParameterType(paramName).asCharString()); + LONGLONGS_EQUAL(value, call->getInputParameter(paramName).getLongLongIntValue()); + CHECK(call->hasInputParameterWithName(paramName)); + STRCMP_CONTAINS("funcName -> long long int paramName: <777 (0x309)>", call->callToString().asCharString()); } +#endif + TEST(MockExpectedCall, callWithDoubleParameter) { - call->withParameter("double", 1.2); - STRCMP_EQUAL("double", call->getInputParameterType("double").asCharString()); - DOUBLES_EQUAL(1.2, call->getInputParameter("double").getDoubleValue(), 0.05); + const SimpleString paramName = "paramName"; + double value = 1.2; + call->withParameter(paramName, value); + STRCMP_EQUAL("double", call->getInputParameterType(paramName).asCharString()); + DOUBLES_EQUAL(value, call->getInputParameter(paramName).getDoubleValue(), 0.0); + STRCMP_CONTAINS("funcName -> double paramName: <1.2>", call->callToString().asCharString()); +} + +TEST(MockExpectedCall, callWithDoubleParameterAndTolerance) +{ + const SimpleString paramName = "paramName"; + double value = 1.2; + double tolerance = 0.2; + call->withParameter(paramName, value, tolerance); + STRCMP_EQUAL("double", call->getInputParameterType(paramName).asCharString()); + DOUBLES_EQUAL(value, call->getInputParameter(paramName).getDoubleValue(), 0.0); + DOUBLES_EQUAL(tolerance, call->getInputParameter(paramName).getDoubleTolerance(), 0.0); + STRCMP_CONTAINS("funcName -> double paramName: <1.2>", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithStringParameter) { - call->withParameter("string", "hello world"); - STRCMP_EQUAL("const char*", call->getInputParameterType("string").asCharString()); - STRCMP_EQUAL("hello world", call->getInputParameter("string").getStringValue()); + const SimpleString paramName = "paramName"; + const char* value = "hello world"; + call->withParameter(paramName, value); + STRCMP_EQUAL("const char*", call->getInputParameterType(paramName).asCharString()); + STRCMP_EQUAL(value, call->getInputParameter(paramName).getStringValue()); + STRCMP_CONTAINS("funcName -> const char* paramName: ", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithPointerParameter) { - void* ptr = (void*) 0x123; - call->withParameter("pointer", ptr); - STRCMP_EQUAL("void*", call->getInputParameterType("pointer").asCharString()); - POINTERS_EQUAL(ptr, call->getInputParameter("pointer").getPointerValue()); + const SimpleString paramName = "paramName"; + void* value = (void*) 0x123; + call->withParameter(paramName, value); + STRCMP_EQUAL("void*", call->getInputParameterType(paramName).asCharString()); + POINTERS_EQUAL(value, call->getInputParameter(paramName).getPointerValue()); + STRCMP_CONTAINS("funcName -> void* paramName: <0x123>", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithConstPointerParameter) { - const void* ptr = (const void*) 0x345; - call->withParameter("constPointer", ptr); - STRCMP_EQUAL("const void*", call->getInputParameterType("constPointer").asCharString()); - POINTERS_EQUAL(ptr, call->getInputParameter("constPointer").getConstPointerValue()); + const SimpleString paramName = "paramName"; + const void* value = (const void*) 0x345; + call->withParameter(paramName, value); + STRCMP_EQUAL("const void*", call->getInputParameterType(paramName).asCharString()); + POINTERS_EQUAL(value, call->getInputParameter(paramName).getConstPointerValue()); + STRCMP_CONTAINS("funcName -> const void* paramName: <0x345>", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithFunctionPointerParameter) { - void (*ptr)() = (void (*)()) 0x123; - call->withParameter("functionPointer", ptr); - STRCMP_EQUAL("void (*)()", call->getInputParameterType("functionPointer").asCharString()); - FUNCTIONPOINTERS_EQUAL(ptr, call->getInputParameter("functionPointer").getFunctionPointerValue()); + const SimpleString paramName = "paramName"; + void (*value)() = (void (*)()) 0xdead; + call->withParameter(paramName, value); + STRCMP_EQUAL("void (*)()", call->getInputParameterType(paramName).asCharString()); + FUNCTIONPOINTERS_EQUAL(value, call->getInputParameter(paramName).getFunctionPointerValue()); + STRCMP_CONTAINS("funcName -> void (*)() paramName: <0xdead>", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithMemoryBuffer) { - const unsigned char mem_buffer[] = { 0x12, 0xFE, 0xA1 }; - call->withParameter("memoryBuffer", mem_buffer, sizeof(mem_buffer)); - STRCMP_EQUAL("const unsigned char*", call->getInputParameterType("memoryBuffer").asCharString()); - POINTERS_EQUAL( (void*) mem_buffer, (void*) call->getInputParameter("memoryBuffer").getMemoryBuffer() ); - LONGS_EQUAL(sizeof(mem_buffer), call->getInputParameter("memoryBuffer").getSize()); + const SimpleString paramName = "paramName"; + const unsigned char value[] = { 0x12, 0xFE, 0xA1 }; + call->withParameter(paramName, value, sizeof(value)); + STRCMP_EQUAL("const unsigned char*", call->getInputParameterType(paramName).asCharString()); + POINTERS_EQUAL( (void*) value, (void*) call->getInputParameter(paramName).getMemoryBuffer() ); + LONGS_EQUAL(sizeof(value), call->getInputParameter(paramName).getSize()); + STRCMP_CONTAINS("funcName -> const unsigned char* paramName: ", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithObjectParameter) { - void* ptr = (void*) 0x123; - call->withParameterOfType("class", "object", ptr); - POINTERS_EQUAL(ptr, call->getInputParameter("object").getObjectPointer()); - STRCMP_EQUAL("class", call->getInputParameterType("object").asCharString()); + const SimpleString paramName = "paramName"; + void* value = (void*) 0x123; + call->withParameterOfType("ClassName", paramName, value); + POINTERS_EQUAL(value, call->getInputParameter(paramName).getConstObjectPointer()); + STRCMP_EQUAL("ClassName", call->getInputParameterType(paramName).asCharString()); + STRCMP_CONTAINS("funcName -> ClassName paramName: ", call->callToString().asCharString()); } TEST(MockExpectedCall, callWithObjectParameterUnequalComparison) { TypeForTestingExpectedFunctionCall type(1), unequalType(2); MockNamedValue parameter("name"); - parameter.setObjectPointer("type", &unequalType); + parameter.setConstObjectPointer("type", &unequalType); call->withParameterOfType("type", "name", &type); CHECK(!call->hasInputParameter(parameter)); } @@ -285,7 +354,7 @@ { TypeForTestingExpectedFunctionCall type(1), equalType(1); MockNamedValue parameter("name"); - parameter.setObjectPointer("type", &equalType); + parameter.setConstObjectPointer("type", &equalType); call->withParameterOfType("type", "name", &type); CHECK(!call->hasInputParameter(parameter)); } @@ -297,7 +366,7 @@ TypeForTestingExpectedFunctionCall type(1), equalType(1); MockNamedValue parameter("name"); - parameter.setObjectPointer("type", &equalType); + parameter.setConstObjectPointer("type", &equalType); call->withParameterOfType("type", "name", &type); CHECK(!call->hasInputParameter(parameter)); } @@ -311,7 +380,7 @@ TypeForTestingExpectedFunctionCall type(1), equalType(1); MockNamedValue parameter("name"); - parameter.setObjectPointer("type", &equalType); + parameter.setConstObjectPointer("type", &equalType); call->withParameterOfType("type", "name", &type); CHECK(call->hasInputParameter(parameter)); @@ -326,7 +395,7 @@ TypeForTestingExpectedFunctionCall type(1); call->withParameterOfType("type", "name", &type); - POINTERS_EQUAL(&type, call->getInputParameter("name").getObjectPointer()); + POINTERS_EQUAL(&type, call->getInputParameter("name").getConstObjectPointer()); STRCMP_EQUAL("1", call->getInputParameterValueString("name").asCharString()); } @@ -385,58 +454,121 @@ DOUBLES_EQUAL(0.12, call->getInputParameter("double").getDoubleValue(), 0.05); } -TEST(MockExpectedCall, withoutANameItsFulfilled) +TEST(MockExpectedCall, singleCallNotMadeIsNotFulfilledButCanMatchActualCalls) { - CHECK(call->isFulfilled()); + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + CHECK(!expectedCall.isFulfilled()); + CHECK(expectedCall.canMatchActualCalls()); } -TEST(MockExpectedCall, withANameItsNotFulfilled) +TEST(MockExpectedCall, singleCallMadeIsFulFilledAndCannotMatchActualCalls) { - call->withName("name"); - CHECK(!call->isFulfilled()); + MockCheckedExpectedCall expectedCall(1); + expectedCall.callWasMade(1); + CHECK(expectedCall.isFulfilled()); + CHECK(!expectedCall.canMatchActualCalls()); } -TEST(MockExpectedCall, afterSettingCallFulfilledItsFulFilled) +TEST(MockExpectedCall, multiCallNotMadeIsNotFulfilledButCanMatchActualCalls) { - call->withName("name"); - call->callWasMade(1); - CHECK(call->isFulfilled()); + MockCheckedExpectedCall expectedCall(2); + expectedCall.withName("name"); + CHECK(!expectedCall.isFulfilled()); + CHECK(expectedCall.canMatchActualCalls()); } -TEST(MockExpectedCall, calledButNotWithParameterIsNotFulFilled) +TEST(MockExpectedCall, multiCallNotMadeExpectedTimesIsNotFulfilledButCanMatchActualCalls) { - call->withName("name").withParameter("para", 1); - call->callWasMade(1); - CHECK(!call->isFulfilled()); + MockCheckedExpectedCall expectedCall(2); + expectedCall.withName("name"); + expectedCall.callWasMade(1); + CHECK(!expectedCall.isFulfilled()); + CHECK(expectedCall.canMatchActualCalls()); } -TEST(MockExpectedCall, calledAndParametersAreFulfilled) +TEST(MockExpectedCall, multiCallsMadeExpectedTimesIsFulfilledAndCannotMatchActualCalls) { - call->withName("name").withParameter("para", 1); - call->callWasMade(1); - call->inputParameterWasPassed("para"); - CHECK(call->isFulfilled()); + MockCheckedExpectedCall expectedCall(3); + expectedCall.withName("name"); + expectedCall.callWasMade(1); + expectedCall.callWasMade(2); + expectedCall.callWasMade(3); + CHECK(expectedCall.isFulfilled()); + CHECK(!expectedCall.canMatchActualCalls()); } -TEST(MockExpectedCall, calledButNotAllParametersAreFulfilled) +TEST(MockExpectedCall, multiCallsMadeMoreThanExpectedTimesIsNotFulfilledAndCannotMatchActualCalls) { - call->withName("name").withParameter("para", 1).withParameter("two", 2); - call->callWasMade(1); - call->inputParameterWasPassed("para"); - CHECK(!call->isFulfilled()); + MockCheckedExpectedCall expectedCall(3); + expectedCall.withName("name"); + expectedCall.callWasMade(1); + expectedCall.callWasMade(2); + expectedCall.callWasMade(3); + expectedCall.callWasMade(4); + CHECK(!expectedCall.isFulfilled()); + CHECK(!expectedCall.canMatchActualCalls()); } -TEST(MockExpectedCall, toStringForNoParameters) +TEST(MockExpectedCall, callsWithoutParameterAlwaysMatch) { - call->withName("name"); - STRCMP_EQUAL("name -> no parameters", call->callToString().asCharString()); + MockCheckedExpectedCall expectedCall(1); + CHECK(expectedCall.isMatchingActualCall()); +} + +TEST(MockExpectedCall, callsWithParameterNotFulfilledDontMatch) +{ + MockCheckedExpectedCall expectedCall(1); + expectedCall.withParameter("para", 1); + CHECK(!expectedCall.isMatchingActualCall()); +} + +TEST(MockExpectedCall, callsWithParameterFulfilledDoMatch) +{ + MockCheckedExpectedCall expectedCall(1); + expectedCall.withParameter("para", 1); + expectedCall.inputParameterWasPassed("para"); + CHECK(expectedCall.isMatchingActualCall()); +} + +TEST(MockExpectedCall, callsWithSomeParametersNotFulfilledDontMatch) +{ + MockCheckedExpectedCall expectedCall(1); + expectedCall.withParameter("para", 1).withParameter("two", 2); + expectedCall.inputParameterWasPassed("para"); + CHECK(!expectedCall.isMatchingActualCall()); +} + +TEST(MockExpectedCall, toStringForNoParametersSingleCallNotCalled) +{ + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + STRCMP_EQUAL("name -> no parameters (expected 1 call, called 0 times)", expectedCall.callToString().asCharString()); +} + +TEST(MockExpectedCall, toStringForNoParametersMultiCallCalledLessThanExpectedTimes) +{ + MockCheckedExpectedCall expectedCall(2); + expectedCall.withName("name"); + expectedCall.callWasMade(1); + STRCMP_EQUAL("name -> no parameters (expected 2 calls, called 1 time)", expectedCall.callToString().asCharString()); +} + +TEST(MockExpectedCall, toStringForNoParametersMultiCallCalledExpectedTimes) +{ + MockCheckedExpectedCall expectedCall(2); + expectedCall.withName("name"); + expectedCall.callWasMade(1); + expectedCall.callWasMade(2); + STRCMP_EQUAL("name -> no parameters (expected 2 calls, called 2 times)", expectedCall.callToString().asCharString()); } TEST(MockExpectedCall, toStringForIgnoredParameters) { - call->withName("name"); - call->ignoreOtherParameters(); - STRCMP_EQUAL("name -> all parameters ignored", call->callToString().asCharString()); + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + expectedCall.ignoreOtherParameters(); + STRCMP_EQUAL("name -> all parameters ignored (expected 1 call, called 0 times)", expectedCall.callToString().asCharString()); } TEST(MockExpectedCall, toStringForMultipleInputParameters) @@ -444,11 +576,14 @@ int int_value = 10; unsigned int uint_value = 7; - call->withName("name"); - call->withParameter("string", "value"); - call->withParameter("integer", int_value); - call->withParameter("unsigned-integer", uint_value); - STRCMP_EQUAL("name -> const char* string: , int integer: <10>, unsigned int unsigned-integer: < 7 (0x00000007)>", call->callToString().asCharString()); + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + expectedCall.withParameter("string", "value"); + expectedCall.withParameter("integer", int_value); + expectedCall.withParameter("unsigned-integer", uint_value); + expectedCall.callWasMade(1); + STRCMP_EQUAL("name -> const char* string: , int integer: <10 (0xa)>, unsigned int unsigned-integer: <7 (0x7)> " + "(expected 1 call, called 1 time)", expectedCall.callToString().asCharString()); } TEST(MockExpectedCall, toStringForMultipleInputAndOutputParameters) @@ -457,41 +592,71 @@ unsigned int uint_value = 7; unsigned char buffer_value[3]; - call->withName("name"); - call->withParameter("string", "value"); - call->withParameter("integer", int_value); - call->withParameter("unsigned-integer", uint_value); - call->withOutputParameterReturning("buffer", buffer_value, sizeof(buffer_value)); - STRCMP_EQUAL("name -> const char* string: , int integer: <10>, unsigned int unsigned-integer: < 7 (0x00000007)>, " - "const void* buffer: ", call->callToString().asCharString()); + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + expectedCall.withParameter("string", "value"); + expectedCall.withParameter("integer", int_value); + expectedCall.withParameter("unsigned-integer", uint_value); + expectedCall.withOutputParameterReturning("buffer", buffer_value, sizeof(buffer_value)); + expectedCall.callWasMade(1); + STRCMP_EQUAL("name -> const char* string: , int integer: <10 (0xa)>, unsigned int unsigned-integer: <7 (0x7)>, " + "const void* buffer: (expected 1 call, called 1 time)", expectedCall.callToString().asCharString()); } TEST(MockExpectedCall, toStringForMultipleOutputParameters) { unsigned char buffer_value[3]; - call->withName("name"); - call->withOutputParameterReturning("buffer1", buffer_value, sizeof(buffer_value)); - call->withOutputParameterReturning("buffer2", buffer_value, sizeof(buffer_value)); - STRCMP_EQUAL("name -> const void* buffer1: , const void* buffer2: ", call->callToString().asCharString()); + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + expectedCall.withOutputParameterReturning("buffer1", buffer_value, sizeof(buffer_value)); + expectedCall.withOutputParameterReturning("buffer2", buffer_value, sizeof(buffer_value)); + expectedCall.callWasMade(1); + STRCMP_EQUAL("name -> const void* buffer1: , const void* buffer2: (expected 1 call, called 1 time)", expectedCall.callToString().asCharString()); +} + +TEST(MockExpectedCall, toStringForUnmodifiedOutputParameter) +{ + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + expectedCall.withUnmodifiedOutputParameter("buffer1"); + expectedCall.callWasMade(1); + STRCMP_EQUAL("name -> const void* buffer1: (expected 1 call, called 1 time)", expectedCall.callToString().asCharString()); } TEST(MockExpectedCall, toStringForParameterAndIgnored) { - call->withName("name"); - call->withParameter("string", "value"); - call->ignoreOtherParameters(); - STRCMP_EQUAL("name -> const char* string: , other parameters are ignored", call->callToString().asCharString()); + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + expectedCall.withParameter("string", "value"); + expectedCall.ignoreOtherParameters(); + expectedCall.callWasMade(1); + STRCMP_EQUAL("name -> const char* string: , other parameters are ignored (expected 1 call, called 1 time)", expectedCall.callToString().asCharString()); } -TEST(MockExpectedCall, toStringForCallOrder) +TEST(MockExpectedCall, toStringForCallOrderSingle) { - call->withName("name"); - call->withCallOrder(2); - STRCMP_EQUAL("name -> expected call order: <2> -> no parameters", call->callToString().asCharString()); + MockCheckedExpectedCall expectedCall(1); + expectedCall.withName("name"); + expectedCall.withCallOrder(2); + expectedCall.callWasMade(1); + STRCMP_EQUAL("name -> expected call order: <2> -> no parameters (expected 1 call, called 1 time)", expectedCall.callToString().asCharString()); +} + +TEST(MockExpectedCall, toStringForCallOrderMultiple) +{ + MockCheckedExpectedCall expectedCall(5); + expectedCall.withName("name"); + expectedCall.withCallOrder(5, 9); + expectedCall.callWasMade(5); + expectedCall.callWasMade(6); + expectedCall.callWasMade(7); + expectedCall.callWasMade(8); + expectedCall.callWasMade(9); + STRCMP_EQUAL("name -> expected calls order: <5..9> -> no parameters (expected 5 calls, called 5 times)", expectedCall.callToString().asCharString()); } -TEST(MockExpectedCall, callOrderIsNotFulfilledWithWrongOrder) +TEST(MockExpectedCall, callOrderIsFulfilledButWithWrongOrderSingle) { call->withName("name"); call->withCallOrder(2); @@ -500,7 +665,31 @@ CHECK(call->isOutOfOrder()); } -TEST(MockExpectedCall, callOrderIsFulfilled) +TEST(MockExpectedCall, callOrderIsFulfilledButWithWrongOrderMultipleTooEarly) +{ + MockCheckedExpectedCall expectedCall(3); + expectedCall.withName("name"); + expectedCall.withCallOrder(10, 12); + expectedCall.callWasMade(9); + expectedCall.callWasMade(10); + expectedCall.callWasMade(11); + CHECK(expectedCall.isFulfilled()); + CHECK(expectedCall.isOutOfOrder()); +} + +TEST(MockExpectedCall, callOrderIsFulfilledButWithWrongOrderMultipleTooLate) +{ + MockCheckedExpectedCall expectedCall(3); + expectedCall.withName("name"); + expectedCall.withCallOrder(10, 12); + expectedCall.callWasMade(11); + expectedCall.callWasMade(12); + expectedCall.callWasMade(13); + CHECK(expectedCall.isFulfilled()); + CHECK(expectedCall.isOutOfOrder()); +} + +TEST(MockExpectedCall, callOrderIsFulfilledSingle) { call->withName("name"); call->withCallOrder(1); @@ -509,6 +698,19 @@ CHECK_FALSE(call->isOutOfOrder()); } +TEST(MockExpectedCall, callOrderIsFulfilledMultiple) +{ + MockCheckedExpectedCall expectedCall(4); + expectedCall.withName("name"); + expectedCall.withCallOrder(150, 153); + expectedCall.callWasMade(150); + expectedCall.callWasMade(151); + expectedCall.callWasMade(152); + expectedCall.callWasMade(153); + CHECK(expectedCall.isFulfilled()); + CHECK_FALSE(expectedCall.isOutOfOrder()); +} + TEST(MockExpectedCall, hasOutputParameter) { const int value = 1; @@ -518,6 +720,15 @@ CHECK(call->hasOutputParameter(foo)); } +TEST(MockExpectedCall, hasUnmodifiedOutputParameter) +{ + call->withUnmodifiedOutputParameter("foo"); + MockNamedValue foo("foo"); + foo.setValue((const void *)NULLPTR); + foo.setSize(0); + CHECK(call->hasOutputParameter(foo)); +} + TEST(MockExpectedCall, hasNoOutputParameter) { call->withIntParameter("foo", (int)1); @@ -531,7 +742,7 @@ TypeForTestingExpectedFunctionCall object(6789); call->withOutputParameterOfTypeReturning("TypeForTestingExpectedFunctionCall", "foo", &object); MockNamedValue foo("foo"); - foo.setObjectPointer("TypeForTestingExpectedFunctionCall", &object); + foo.setConstObjectPointer("TypeForTestingExpectedFunctionCall", &object); CHECK(call->hasOutputParameter(foo)); } @@ -540,7 +751,7 @@ TypeForTestingExpectedFunctionCall object(543); call->withParameterOfType("TypeForTestingExpectedFunctionCall", "foo", &object); MockNamedValue foo("foo"); - foo.setObjectPointer("TypeForTestingExpectedFunctionCall", &object); + foo.setConstObjectPointer("TypeForTestingExpectedFunctionCall", &object); CHECK_FALSE(call->hasOutputParameter(foo)); } @@ -549,184 +760,10 @@ TypeForTestingExpectedFunctionCall object(543); call->withOutputParameterOfTypeReturning("TypeForTestingExpectedFunctionCall", "foo", &object); MockNamedValue foo("foo"); - foo.setObjectPointer("OtherTypeForTestingExpectedFunctionCall", &object); + foo.setConstObjectPointer("OtherTypeForTestingExpectedFunctionCall", &object); CHECK_FALSE(call->hasOutputParameter(foo)); } -static MockExpectedCallComposite composite; - -TEST_GROUP(MockExpectedCallComposite) -{ - MockCheckedExpectedCall call; - - void setup() _override - { - composite.add(call); - composite.withName("name"); - } - - void teardown() _override - { - CHECK_NO_MOCK_FAILURE(); - composite.clear(); - } -}; - -TEST(MockExpectedCallComposite, hasBoolParameter) -{ - composite.withParameter("param", true); - STRCMP_EQUAL("name -> bool param: ", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasLongIntParameter) -{ - composite.withParameter("param", (long int) -1); - STRCMP_EQUAL("name -> long int param: <-1>", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasUnsignedLongIntParameter) -{ - composite.withParameter("param", (unsigned long int) 5); - STRCMP_EQUAL("name -> unsigned long int param: <5 (0x5)>", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasPointerParameter) -{ - composite.withParameter("param", (void*) 0); - STRCMP_EQUAL("name -> void* param: <0x0>", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasConstPointerParameter) -{ - composite.withParameter("param", (const void*) 0); - STRCMP_EQUAL("name -> const void* param: <0x0>", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasFunctionPointerParameter) -{ - composite.withParameter("param", (void (*)()) 0); - STRCMP_EQUAL("name -> void (*)() param: <0x0>", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasMemoryBufferParameter) -{ - const unsigned char mem_buffer[] = { 0x89, 0xFE, 0x15 }; - composite.withParameter("param", mem_buffer, sizeof(mem_buffer)); - STRCMP_EQUAL("name -> const unsigned char* param: ", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasParameterOfType) -{ - composite.withParameterOfType("type", "param", (const void*) 0); - STRCMP_EQUAL("name -> type param: ", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasOutputParameterReturning) -{ - composite.withOutputParameterReturning("out", (const void*) 0, 1); - STRCMP_EQUAL("name -> const void* out: ", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasOutputParameterOfTypeReturning) -{ - composite.withOutputParameterOfTypeReturning("type", "out", (const void*) 0); - STRCMP_EQUAL("name -> type out: ", call.callToString().asCharString()); -} - -TEST(MockExpectedCallComposite, hasBoolReturnValue) -{ - composite.andReturnValue(true); - STRCMP_EQUAL("bool", call.returnValue().getType().asCharString()); - CHECK_EQUAL(true, call.returnValue().getBoolValue()); -} - -TEST(MockExpectedCallComposite, hasUnsignedIntReturnValue) -{ - composite.andReturnValue((unsigned int) 2); - STRCMP_EQUAL("unsigned int", call.returnValue().getType().asCharString()); - LONGS_EQUAL(2, call.returnValue().getUnsignedIntValue()); -} - -TEST(MockExpectedCallComposite, hasIntReturnValue) -{ - composite.andReturnValue((int) -5); - STRCMP_EQUAL("int", call.returnValue().getType().asCharString()); - LONGS_EQUAL(-5, call.returnValue().getIntValue()); -} - -TEST(MockExpectedCallComposite, hasLongIntReturnValue) -{ - composite.andReturnValue((long int) -17); - STRCMP_EQUAL("long int", call.returnValue().getType().asCharString()); - LONGS_EQUAL(-17, call.returnValue().getLongIntValue()); -} - -TEST(MockExpectedCallComposite, hasUnsignedLongIntReturnValue) -{ - composite.andReturnValue((unsigned long int) 6); - STRCMP_EQUAL("unsigned long int", call.returnValue().getType().asCharString()); - LONGS_EQUAL(6, call.returnValue().getUnsignedLongIntValue()); -} - -TEST(MockExpectedCallComposite, hasDoubleReturnValue) -{ - composite.andReturnValue((double) 3.005); - STRCMP_EQUAL("double", call.returnValue().getType().asCharString()); - DOUBLES_EQUAL(3.005, call.returnValue().getDoubleValue(), 0.0001); -} - -TEST(MockExpectedCallComposite, hasStringReturnValue) -{ - composite.andReturnValue("hello"); - STRCMP_EQUAL("const char*", call.returnValue().getType().asCharString()); - STRCMP_EQUAL("hello", call.returnValue().getStringValue()); -} - -TEST(MockExpectedCallComposite, hasPointerReturnValue) -{ - composite.andReturnValue((void*) 0); - STRCMP_EQUAL("void*", call.returnValue().getType().asCharString()); - POINTERS_EQUAL((void*) 0, call.returnValue().getPointerValue()); -} - -TEST(MockExpectedCallComposite, hasConstPointerReturnValue) -{ - composite.andReturnValue((const void*) 0); - STRCMP_EQUAL("const void*", call.returnValue().getType().asCharString()); - POINTERS_EQUAL((const void*) 0, call.returnValue().getConstPointerValue()); -} - -TEST(MockExpectedCallComposite, hasFunctionPointerReturnValue) -{ - composite.andReturnValue((void(*)()) 0); - STRCMP_EQUAL("void (*)()", call.returnValue().getType().asCharString()); - FUNCTIONPOINTERS_EQUAL((void(*)()) 0, call.returnValue().getFunctionPointerValue()); -} - -TEST(MockExpectedCallComposite, isOnObject) -{ - composite.onObject(&composite); - SimpleString info("(object address: "); - info += StringFromFormat("%p", (void*) &composite); - info += ")::name -> no parameters"; - STRCMP_EQUAL(info.asCharString(), call.callToString().asCharString()); -} - -#include "CppUTest/TestTestingFixture.h" - -static void withCallOrderNotSupportedFailMethod_(void) -{ - composite.withCallOrder(5); -} // LCOV_EXCL_LINE - -TEST(MockExpectedCallComposite, doesNotSupportCallOrder) -{ - TestTestingFixture fixture; - fixture.setTestFunction(&withCallOrderNotSupportedFailMethod_); - fixture.runAllTests(); - fixture.assertPrintContains("withCallOrder not supported for CompositeCalls"); -} - TEST_GROUP(MockIgnoredExpectedCall) { MockIgnoredExpectedCall ignored; @@ -736,21 +773,28 @@ { ignored.withName("func"); ignored.withCallOrder(1); - ignored.onObject((void*) 0); + ignored.withCallOrder(1, 1); + ignored.onObject(NULLPTR); ignored.withBoolParameter("umm", true); ignored.withIntParameter("bla", (int) 1); ignored.withUnsignedIntParameter("foo", (unsigned int) 1); ignored.withLongIntParameter("hey", (long int) 1); ignored.withUnsignedLongIntParameter("bah", (unsigned long int) 1); +#ifdef CPPUTEST_USE_LONG_LONG + ignored.withLongLongIntParameter("yo", (long long int) 1); + ignored.withUnsignedLongLongIntParameter("grr", (unsigned long long int) 1); +#endif ignored.withDoubleParameter("hah", (double) 1.1f); + ignored.withDoubleParameter("gah", 2.1, 0.3); ignored.withStringParameter("goo", "hello"); - ignored.withPointerParameter("pie", (void*) 0); - ignored.withConstPointerParameter("woo", (const void*) 0); - ignored.withFunctionPointerParameter("fop", (void(*)()) 0); - ignored.withMemoryBufferParameter("waa", (const unsigned char*) 0, 0); - ignored.withParameterOfType( "mytype", "top", (const void*) 0); - ignored.withOutputParameterReturning("bar", (void*) 0, 1); - ignored.withOutputParameterOfTypeReturning("mytype", "bar", (const void*) 0); + ignored.withPointerParameter("pie", (void*) NULLPTR); + ignored.withConstPointerParameter("woo", (const void*) NULLPTR); + ignored.withFunctionPointerParameter("fop", (void(*)()) NULLPTR); + ignored.withMemoryBufferParameter("waa", (const unsigned char*) NULLPTR, 0); + ignored.withParameterOfType( "mytype", "top", (const void*) NULLPTR); + ignored.withOutputParameterReturning("bar", (void*) NULLPTR, 1); + ignored.withOutputParameterOfTypeReturning("mytype", "bar", (const void*) NULLPTR); + ignored.withUnmodifiedOutputParameter("unmod"); ignored.ignoreOtherParameters(); ignored.andReturnValue(true); ignored.andReturnValue((double) 1.0f); @@ -758,8 +802,12 @@ ignored.andReturnValue((int) 1); ignored.andReturnValue((unsigned long int) 1); ignored.andReturnValue((long int) 1); +#ifdef CPPUTEST_USE_LONG_LONG + ignored.andReturnValue((unsigned long long int) 1); + ignored.andReturnValue((long long int) 1); +#endif ignored.andReturnValue("boo"); - ignored.andReturnValue((void*) 0); - ignored.andReturnValue((const void*) 0); - ignored.andReturnValue((void(*)()) 0); + ignored.andReturnValue((void*) NULLPTR); + ignored.andReturnValue((const void*) NULLPTR); + ignored.andReturnValue((void(*)()) NULLPTR); } diff -Nru cpputest-3.8/tests/CppUTestExt/MockFailureReporterForTest.cpp cpputest-4.0/tests/CppUTestExt/MockFailureReporterForTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockFailureReporterForTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockFailureReporterForTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -32,10 +32,20 @@ mockFailureString = failure.getMessage(); } +MockFailureReporterForTest* MockFailureReporterForTest::instance_ = NULLPTR; + MockFailureReporterForTest* MockFailureReporterForTest::getReporter() { - static MockFailureReporterForTest reporter; - return &reporter; + if (instance_ == NULLPTR) + instance_ = new MockFailureReporterForTest; + + return instance_; +} + +void MockFailureReporterForTest::clearReporter() +{ + delete instance_; + instance_ = NULLPTR; } MockFailureReporterInstaller::MockFailureReporterInstaller() @@ -45,7 +55,8 @@ MockFailureReporterInstaller::~MockFailureReporterInstaller() { - mock().setMockFailureStandardReporter(NULL); + mock().setMockFailureStandardReporter(NULLPTR); + MockFailureReporterForTest::clearReporter(); } UtestShell* mockFailureTest() @@ -63,7 +74,7 @@ MockFailureReporterForTest::getReporter()->mockFailureString = ""; } -void CHECK_EXPECTED_MOCK_FAILURE_LOCATION(const MockFailure& expectedFailure, const char* file, int line) +void CHECK_EXPECTED_MOCK_FAILURE_LOCATION(const MockFailure& expectedFailure, const char* file, size_t line) { SimpleString expectedFailureString = expectedFailure.getMessage(); SimpleString actualFailureString = mockFailureString(); @@ -79,7 +90,7 @@ } } -void CHECK_NO_MOCK_FAILURE_LOCATION(const char* file, int line) +void CHECK_NO_MOCK_FAILURE_LOCATION(const char* file, size_t line) { if (mockFailureString() != "") { SimpleString error = "Unexpected mock failure:\n"; @@ -104,7 +115,15 @@ return newCall; } -MockCheckedExpectedCall* MockExpectedCallsListForTest::addFunction(const SimpleString& name, int order) +MockCheckedExpectedCall* MockExpectedCallsListForTest::addFunction(unsigned int numCalls, const SimpleString& name) +{ + MockCheckedExpectedCall* newCall = new MockCheckedExpectedCall(numCalls); + newCall->withName(name); + addExpectedCall(newCall); + return newCall; +} + +MockCheckedExpectedCall* MockExpectedCallsListForTest::addFunctionOrdered(const SimpleString& name, unsigned int order) { MockCheckedExpectedCall* newCall = addFunction(name); newCall->withCallOrder(order); diff -Nru cpputest-3.8/tests/CppUTestExt/MockFailureReporterForTest.h cpputest-4.0/tests/CppUTestExt/MockFailureReporterForTest.h --- cpputest-3.8/tests/CppUTestExt/MockFailureReporterForTest.h 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockFailureReporterForTest.h 2020-05-26 11:24:07.000000000 +0000 @@ -40,6 +40,9 @@ virtual void failTest(const MockFailure& failure); static MockFailureReporterForTest* getReporter(); + static void clearReporter(); +private: + static MockFailureReporterForTest* instance_; }; class MockFailureReporterInstaller @@ -52,15 +55,16 @@ UtestShell* mockFailureTest(); SimpleString mockFailureString(); void CLEAR_MOCK_FAILURE(); -void CHECK_EXPECTED_MOCK_FAILURE_LOCATION(const MockFailure& expectedFailure, const char* file, int line); -void CHECK_NO_MOCK_FAILURE_LOCATION(const char* file, int line); +void CHECK_EXPECTED_MOCK_FAILURE_LOCATION(const MockFailure& expectedFailure, const char* file, size_t line); +void CHECK_NO_MOCK_FAILURE_LOCATION(const char* file, size_t line); class MockExpectedCallsListForTest : public MockExpectedCallsList { public: - ~MockExpectedCallsListForTest(); + ~MockExpectedCallsListForTest() _destructor_override; MockCheckedExpectedCall* addFunction(const SimpleString& name); - MockCheckedExpectedCall* addFunction(const SimpleString& name, int order); + MockCheckedExpectedCall* addFunction(unsigned int numCalls, const SimpleString& name); + MockCheckedExpectedCall* addFunctionOrdered(const SimpleString& name, unsigned int order); }; #endif diff -Nru cpputest-3.8/tests/CppUTestExt/MockFailureTest.cpp cpputest-4.0/tests/CppUTestExt/MockFailureTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockFailureTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockFailureTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -54,7 +54,9 @@ delete call2; delete call3; CHECK_NO_MOCK_FAILURE(); + MockFailureReporterForTest::clearReporter(); } + void addAllToList() { list->addExpectedCall(call1); @@ -65,12 +67,22 @@ void checkUnexpectedNthCallMessage(unsigned int count, const char* expectedOrdinal) { MockExpectedCallsList callList; - MockCheckedExpectedCall expCall; + MockCheckedExpectedCall expectedCallSingle(1); + MockCheckedExpectedCall expectedCallMulti(count-1); + + expectedCallSingle.withName("bar"); + expectedCallMulti.withName("bar"); - expCall.withName("bar"); - for (unsigned int i = 0; i < (count - 1); i++) { - expCall.callWasMade(1); - callList.addExpectedCall(&expCall); + if (count > 1) { + callList.addExpectedCall(&expectedCallSingle); + expectedCallSingle.callWasMade(1); + } + + if (count > 2) { + callList.addExpectedCall(&expectedCallMulti); + for (unsigned int i = 1; i < (count - 1); i++) { + expectedCallMulti.callWasMade(i+1); + } } MockUnexpectedCallHappenedFailure failure(UtestShell::getCurrent(), "bar", callList); @@ -90,9 +102,9 @@ { MockUnexpectedCallHappenedFailure failure(UtestShell::getCurrent(), "foobar", *list); STRCMP_EQUAL("Mock Failure: Unexpected call to function: foobar\n" - "\tEXPECTED calls that did NOT happen:\n" + "\tEXPECTED calls that WERE NOT fulfilled:\n" "\t\t\n" - "\tACTUAL calls that did happen (in call order):\n" + "\tEXPECTED calls that WERE fulfilled:\n" "\t\t", failure.getMessage().asCharString()); } @@ -105,12 +117,12 @@ addAllToList(); MockExpectedCallsDidntHappenFailure failure(UtestShell::getCurrent(), *list); - STRCMP_EQUAL("Mock Failure: Expected call did not happen.\n" - "\tEXPECTED calls that did NOT happen:\n" - "\t\tfoobar -> no parameters\n" - "\t\tworld -> int boo: <2>, const char* hello: \n" - "\tACTUAL calls that did happen (in call order):\n" - "\t\thaphaphap -> no parameters", failure.getMessage().asCharString()); + STRCMP_EQUAL("Mock Failure: Expected call WAS NOT fulfilled.\n" + "\tEXPECTED calls that WERE NOT fulfilled:\n" + "\t\tfoobar -> no parameters (expected 1 call, called 0 times)\n" + "\t\tworld -> int boo: <2 (0x2)>, const char* hello: (expected 1 call, called 0 times)\n" + "\tEXPECTED calls that WERE fulfilled:\n" + "\t\thaphaphap -> no parameters (expected 1 call, called 1 time)", failure.getMessage().asCharString()); } TEST(MockFailureTest, MockUnexpectedNthAdditionalCallFailure) @@ -139,13 +151,13 @@ MockUnexpectedInputParameterFailure failure(UtestShell::getCurrent(), "foo", actualParameter, *list); STRCMP_EQUAL("Mock Failure: Unexpected parameter name to function \"foo\": bar\n" - "\tEXPECTED calls that DID NOT happen related to function: foo\n" - "\t\tfoo -> int boo: <2>\n" - "\t\tfoo -> double boo: <3.3>\n" - "\tACTUAL calls that DID happen related to function: foo\n" + "\tEXPECTED calls that WERE NOT fulfilled related to function: foo\n" + "\t\tfoo -> int boo: <2 (0x2)> (expected 1 call, called 0 times)\n" + "\t\tfoo -> double boo: <3.3> (expected 1 call, called 0 times)\n" + "\tEXPECTED calls that WERE fulfilled related to function: foo\n" "\t\t\n" "\tACTUAL unexpected parameter passed to function: foo\n" - "\t\tint bar: <2>", failure.getMessage().asCharString()); + "\t\tint bar: <2 (0x2)>", failure.getMessage().asCharString()); } TEST(MockFailureTest, MockUnexpectedOutputParameterFailure) @@ -162,10 +174,32 @@ MockUnexpectedOutputParameterFailure failure(UtestShell::getCurrent(), "foo", actualParameter, *list); STRCMP_EQUAL("Mock Failure: Unexpected output parameter name to function \"foo\": bar\n" - "\tEXPECTED calls that DID NOT happen related to function: foo\n" - "\t\tfoo -> const void* boo: \n" - "\t\tfoo -> const void* boo: \n" - "\tACTUAL calls that DID happen related to function: foo\n" + "\tEXPECTED calls that WERE NOT fulfilled related to function: foo\n" + "\t\tfoo -> const void* boo: (expected 1 call, called 0 times)\n" + "\t\tfoo -> const void* boo: (expected 1 call, called 0 times)\n" + "\tEXPECTED calls that WERE fulfilled related to function: foo\n" + "\t\t\n" + "\tACTUAL unexpected output parameter passed to function: foo\n" + "\t\tvoid* bar", failure.getMessage().asCharString()); +} + +TEST(MockFailureTest, MockUnexpectedUnmodifiedOutputParameterFailure) +{ + int out1; + call1->withName("foo").withOutputParameterReturning("boo", &out1, sizeof(out1)); + call2->withName("foo").withUnmodifiedOutputParameter("boo"); + call3->withName("unrelated"); + addAllToList(); + + MockNamedValue actualParameter("bar"); + actualParameter.setValue((void *)0x123); + + MockUnexpectedOutputParameterFailure failure(UtestShell::getCurrent(), "foo", actualParameter, *list); + STRCMP_EQUAL("Mock Failure: Unexpected output parameter name to function \"foo\": bar\n" + "\tEXPECTED calls that WERE NOT fulfilled related to function: foo\n" + "\t\tfoo -> const void* boo: (expected 1 call, called 0 times)\n" + "\t\tfoo -> const void* boo: (expected 1 call, called 0 times)\n" + "\tEXPECTED calls that WERE fulfilled related to function: foo\n" "\t\t\n" "\tACTUAL unexpected output parameter passed to function: foo\n" "\t\tvoid* bar", failure.getMessage().asCharString()); @@ -182,14 +216,14 @@ actualParameter.setValue(20); MockUnexpectedInputParameterFailure failure(UtestShell::getCurrent(), "foo", actualParameter, *list); - STRCMP_EQUAL("Mock Failure: Unexpected parameter value to parameter \"boo\" to function \"foo\": <20>\n" - "\tEXPECTED calls that DID NOT happen related to function: foo\n" - "\t\tfoo -> int boo: <2>\n" - "\t\tfoo -> int boo: <10>\n" - "\tACTUAL calls that DID happen related to function: foo\n" + STRCMP_EQUAL("Mock Failure: Unexpected parameter value to parameter \"boo\" to function \"foo\": <20 (0x14)>\n" + "\tEXPECTED calls that WERE NOT fulfilled related to function: foo\n" + "\t\tfoo -> int boo: <2 (0x2)> (expected 1 call, called 0 times)\n" + "\t\tfoo -> int boo: <10 (0xa)> (expected 1 call, called 0 times)\n" + "\tEXPECTED calls that WERE fulfilled related to function: foo\n" "\t\t\n" "\tACTUAL unexpected parameter passed to function: foo\n" - "\t\tint boo: <20>", failure.getMessage().asCharString()); + "\t\tint boo: <20 (0x14)>", failure.getMessage().asCharString()); } TEST(MockFailureTest, MockExpectedParameterDidntHappenFailure) @@ -204,10 +238,10 @@ MockExpectedParameterDidntHappenFailure failure(UtestShell::getCurrent(), "foo", *list); STRCMP_EQUAL("Mock Failure: Expected parameter for function \"foo\" did not happen.\n" - "\tEXPECTED calls that DID NOT happen related to function: foo\n" - "\t\tfoo -> int bar: <2>, const char* boo: \n" - "\tACTUAL calls that DID happen related to function: foo\n" - "\t\tfoo -> int bar: <10>, const char* boo: \n" + "\tEXPECTED calls that WERE NOT fulfilled related to function: foo\n" + "\t\tfoo -> int bar: <2 (0x2)>, const char* boo: (expected 1 call, called 0 times)\n" + "\tEXPECTED calls that WERE fulfilled related to function: foo\n" + "\t\tfoo -> int bar: <10 (0xa)>, const char* boo: (expected 1 call, called 1 time)\n" "\tMISSING parameters that didn't happen:\n" "\t\tint bar, const char* boo", failure.getMessage().asCharString()); } @@ -231,10 +265,10 @@ STRCMP_EQUAL(StringFromFormat ( "MockFailure: Function called on an unexpected object: foo\n" "\tActual object for call has address: <%p>\n" - "\tEXPECTED calls that DID NOT happen related to function: foo\n" - "\t\t(object address: %p)::foo -> no parameters\n" - "\tACTUAL calls that DID happen related to function: foo\n" - "\t\t(object address: %p)::foo -> no parameters", + "\tEXPECTED calls that WERE NOT fulfilled related to function: foo\n" + "\t\t(object address: %p)::foo -> no parameters (expected 1 call, called 0 times)\n" + "\tEXPECTED calls that WERE fulfilled related to function: foo\n" + "\t\t(object address: %p)::foo -> no parameters (expected 1 call, called 1 time)", (void*) 0x01, (void*) 0x02, (void*) 0x03).asCharString(), failure.getMessage().asCharString()); } @@ -250,9 +284,9 @@ MockExpectedObjectDidntHappenFailure failure(UtestShell::getCurrent(), "foo", *list); STRCMP_EQUAL(StringFromFormat( "Mock Failure: Expected call on object for function \"foo\" but it did not happen.\n" - "\tEXPECTED calls that DID NOT happen related to function: foo\n" - "\t\t(object address: %p)::foo -> no parameters\n" - "\tACTUAL calls that DID happen related to function: foo\n" - "\t\t(object address: %p)::foo -> no parameters", + "\tEXPECTED calls that WERE NOT fulfilled related to function: foo\n" + "\t\t(object address: %p)::foo -> no parameters (expected 1 call, called 0 times)\n" + "\tEXPECTED calls that WERE fulfilled related to function: foo\n" + "\t\t(object address: %p)::foo -> no parameters (expected 1 call, called 1 time)", (void*) 0x2, (void*) 0x3).asCharString(), failure.getMessage().asCharString()); } diff -Nru cpputest-3.8/tests/CppUTestExt/MockFakeLongLong.cpp cpputest-4.0/tests/CppUTestExt/MockFakeLongLong.cpp --- cpputest-3.8/tests/CppUTestExt/MockFakeLongLong.cpp 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockFakeLongLong.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "CppUTest/TestHarness.h" +#include "CppUTest/TestOutput.h" +#include "CppUTest/TestTestingFixture.h" +#include "CppUTestExt/MockCheckedActualCall.h" +#include "CppUTestExt/MockCheckedExpectedCall.h" +#include "CppUTestExt/MockExpectedCallsList.h" +#include "CppUTestExt/MockFailure.h" +#include "MockFailureReporterForTest.h" + + +TEST_GROUP(FakeLongLongs) +{ + TestTestingFixture fixture; +}; + +#ifndef CPPUTEST_USE_LONG_LONG + +#define CHECK_TEST_FAILS_PROPER_WITH_TEXT(text) fixture.checkTestFailsWithProperTestLocation(text, __FILE__, __LINE__) + +static void _actualCallWithFakeLongLongParameter() +{ + cpputest_longlong value = {0}; + + mock().expectOneCall("foo").withParameter("bar", 0); + mock().actualCall("foo").withParameter("bar", value); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(FakeLongLongs, ActualCallWithFakeLongLongParameterFAILS) +{ + fixture.runTestWithMethod(_actualCallWithFakeLongLongParameter); + mock().clear(); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Long Long type is not supported"); +} + +static void _actualCallWithFakeUnsignedLongLongParameter() +{ + cpputest_ulonglong value = {0}; + + mock().expectOneCall("foo").withParameter("bar", 0); + mock().actualCall("foo").withParameter("bar", value); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(FakeLongLongs, ActualCallWithFakeUnsignedLongLongParameterFAILS) +{ + fixture.runTestWithMethod(_actualCallWithFakeUnsignedLongLongParameter); + mock().clear(); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Unsigned Long Long type is not supported"); +} + +static void _actualCallWithFakeLongLongReturn() +{ + mock().expectOneCall("foo").andReturnValue(0); + mock().actualCall("foo").returnLongLongIntValue(); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(FakeLongLongs, ActualCallWithFakeLongLongReturnFAILS) +{ + fixture.runTestWithMethod(_actualCallWithFakeLongLongReturn); + mock().clear(); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Long Long type is not supported"); +} + +static void _actualCallWithFakeUnsignedLongLongReturn() +{ + mock().expectOneCall("foo").andReturnValue(0); + mock().actualCall("foo").returnUnsignedLongLongIntValue(); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(FakeLongLongs, ActualCallWithFakeUnsignedLongLongReturnFAILS) +{ + fixture.runTestWithMethod(_actualCallWithFakeUnsignedLongLongReturn); + mock().clear(); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Unsigned Long Long type is not supported"); +} + +static void _expectOneCallWithFakeLongLongParameter() +{ + cpputest_longlong value = {0}; + + mock().expectOneCall("foo").withParameter("bar", value); + mock().actualCall("foo").withParameter("bar", 0); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(FakeLongLongs, ExpectedCallWithFakeLongLongParameterFAILS) +{ + fixture.runTestWithMethod(_expectOneCallWithFakeLongLongParameter); + mock().clear(); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Long Long type is not supported"); +} + +static void _expectOneCallWithFakeUnsignedLongLongParameter() +{ + cpputest_ulonglong value = {0}; + + mock().expectOneCall("foo").withParameter("bar", value); + mock().actualCall("foo").withParameter("bar", 0); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(FakeLongLongs, ExpectedCallWithFakeUnsignedLongLongParameterFAILS) +{ + fixture.runTestWithMethod(_expectOneCallWithFakeUnsignedLongLongParameter); + mock().clear(); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Unsigned Long Long type is not supported"); +} + +static void _expectOneCallWithFakeLongLongReturn() +{ + cpputest_longlong value = {0}; + + mock().expectOneCall("foo").andReturnValue(value); + mock().actualCall("foo").returnIntValue(); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(FakeLongLongs, ExpectedCallWithFakeLongLongReturnFAILS) +{ + fixture.runTestWithMethod(_expectOneCallWithFakeLongLongReturn); + mock().clear(); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Long Long type is not supported"); +} + +static void _expectOneCallWithFakeUnsignedLongLongReturn() +{ + cpputest_ulonglong value = {0}; + + mock().expectOneCall("foo").andReturnValue(value); + mock().actualCall("foo").returnIntValue(); + TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE +} // LCOV_EXCL_LINE + +TEST(FakeLongLongs, ExpectedCallWithFakeUnsignedLongLongReturnFAILS) +{ + fixture.runTestWithMethod(_expectOneCallWithFakeUnsignedLongLongReturn); + mock().clear(); + CHECK_TEST_FAILS_PROPER_WITH_TEXT("Unsigned Long Long type is not supported"); +} + +#endif diff -Nru cpputest-3.8/tests/CppUTestExt/MockHierarchyTest.cpp cpputest-4.0/tests/CppUTestExt/MockHierarchyTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockHierarchyTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockHierarchyTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,6 +30,10 @@ TEST_GROUP(MockHierarchyTest) { + void teardown() + { + mock().clear(); + } }; TEST(MockHierarchyTest, getMockSupportScope) diff -Nru cpputest-3.8/tests/CppUTestExt/MockNamedValueTest.cpp cpputest-4.0/tests/CppUTestExt/MockNamedValueTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockNamedValueTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockNamedValueTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -37,7 +37,7 @@ public: MyComparator() {} - virtual ~MyComparator() {} + virtual ~MyComparator() _destructor_override {} virtual bool isEqual(const void*, const void*) _override { return false; } virtual SimpleString valueToString(const void*) _override { return ""; } @@ -48,7 +48,7 @@ public: MyCopier() {} - virtual ~MyCopier() {} + virtual ~MyCopier() _destructor_override {} virtual void copy(void*, const void*) _override {} }; @@ -74,3 +74,68 @@ repository.clear(); } +TEST(ComparatorsAndCopiersRepository, InstallComparatorsAndCopiersFromRepository) +{ + MyComparator comparator; + MyCopier copier; + MockNamedValueComparatorsAndCopiersRepository source; + MockNamedValueComparatorsAndCopiersRepository target; + + source.installCopier("MyType", copier); + source.installComparator("MyType", comparator); + + target.installComparatorsAndCopiers(source); + + POINTERS_EQUAL(&comparator, target.getComparatorForType("MyType")); + POINTERS_EQUAL(&copier, target.getCopierForType("MyType")); + + source.clear(); + target.clear(); +} + +TEST_GROUP(MockNamedValue) +{ + MockNamedValue * value; + void setup() + { + value = new MockNamedValue("param"); + } + + void teardown() + { + delete value; + } +}; + +TEST(MockNamedValue, DefaultToleranceUsedWhenNoToleranceGiven) +{ + value->setValue(0.2); + DOUBLES_EQUAL(MockNamedValue::defaultDoubleTolerance, value->getDoubleTolerance(), 0.0); +} + +TEST(MockNamedValue, GivenToleranceUsed) +{ + value->setValue(0.2, 3.2); + STRCMP_EQUAL("double", value->getType().asCharString()); + DOUBLES_EQUAL(0.2, value->getDoubleValue(), 0.0); + DOUBLES_EQUAL(3.2, value->getDoubleTolerance(), 0.0); +} + +TEST(MockNamedValue, DoublesEqualIfWithinTolerance) +{ + value->setValue(5.0, 0.4); + MockNamedValue other("param2"); + other.setValue(5.3); + + CHECK_TRUE(value->equals(other)); +} + + +TEST(MockNamedValue, DoublesNotEqualIfOutsideTolerance) +{ + value->setValue(5.0, 0.4); + MockNamedValue other("param2"); + other.setValue(5.5); + + CHECK_FALSE(value->equals(other)); +} diff -Nru cpputest-3.8/tests/CppUTestExt/MockParameterTest.cpp cpputest-4.0/tests/CppUTestExt/MockParameterTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockParameterTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockParameterTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -33,7 +33,8 @@ { void teardown() { - mock().checkExpectations(); + mock().checkExpectations(); + mock().clear(); } }; @@ -62,6 +63,29 @@ mock().checkExpectations(); } +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(MockParameterTest, expectOneUnsignedLongLongIntegerParameterAndValue) +{ + unsigned long long value = 0xFFFFAAAAFFFFAAAA; + mock().expectOneCall("foo").withParameter("parameter", value); + mock().actualCall("foo").withParameter("parameter", value); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, expectOneLongLongIntegerParameterAndValue) +{ + long long value = 0x7FFFAAAAFFFFAAAA; + + mock().expectOneCall("foo").withParameter("parameter", value); + mock().actualCall("foo").withParameter("parameter", value); + + mock().checkExpectations(); +} + +#endif + TEST(MockParameterTest, mismatchedIntegerTypesIntAndLongAreAllowed) { mock().expectOneCall("foo").withParameter("parameter", (int)1); @@ -128,6 +152,109 @@ mock().checkExpectations(); } +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(MockParameterTest, mismatchedIntegerTypesIntAndLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (int)1); + mock().actualCall("foo").withParameter("parameter", (long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (long long)1); + mock().actualCall("foo").withParameter("parameter", (int)1); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, mismatchedIntegerTypesIntAndUnsignedLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (int)1); + mock().actualCall("foo").withParameter("parameter", (unsigned long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (unsigned long long)1); + mock().actualCall("foo").withParameter("parameter", (int)1); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, mismatchedIntegerTypesUnsignedAndLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (unsigned)1); + mock().actualCall("foo").withParameter("parameter", (long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (long long)1); + mock().actualCall("foo").withParameter("parameter", (unsigned)1); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, mismatchedIntegerTypesUnsignedAndUnsignedLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (unsigned)1); + mock().actualCall("foo").withParameter("parameter", (unsigned long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (unsigned long long)1); + mock().actualCall("foo").withParameter("parameter", (unsigned)1); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, mismatchedIntegerTypesUnsignedLongAndUnsignedLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (unsigned long)1); + mock().actualCall("foo").withParameter("parameter", (unsigned long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (unsigned long long)1); + mock().actualCall("foo").withParameter("parameter", (unsigned long)1); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, mismatchedIntegerTypesLongAndLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (long)1); + mock().actualCall("foo").withParameter("parameter", (long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (long long)1); + mock().actualCall("foo").withParameter("parameter", (long)1); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, mismatchedIntegerTypesLongAndUnsignedLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (long)1); + mock().actualCall("foo").withParameter("parameter", (unsigned long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (unsigned long long)1); + mock().actualCall("foo").withParameter("parameter", (long)1); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, mismatchedIntegerTypesUnsignedLongAndLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (unsigned long)1); + mock().actualCall("foo").withParameter("parameter", (long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (long long)1); + mock().actualCall("foo").withParameter("parameter", (unsigned long)1); + + mock().checkExpectations(); +} + +TEST(MockParameterTest, mismatchedIntegerTypesLongLongAndUnsignedLongLongAreAllowed) +{ + mock().expectOneCall("foo").withParameter("parameter", (long long)1); + mock().actualCall("foo").withParameter("parameter", (unsigned long long)1); + + mock().expectOneCall("foo").withParameter("parameter", (unsigned long long)1); + mock().actualCall("foo").withParameter("parameter", (long long)1); + + mock().checkExpectations(); +} + +#endif + TEST(MockParameterTest, longAndUnsignedLongWithSameBitRepresentationShouldNotBeTreatedAsEqual) { MockFailureReporterInstaller failureReporterInstaller; @@ -168,6 +295,31 @@ mock().checkExpectations(); } +TEST(MockParameterTest, expectOneDoubleParameterAndValueAndTolerance) +{ + mock( ).expectOneCall("foo").withParameter("parameter", 100.0, 5.0); + mock( ).actualCall("foo").withParameter("parameter", 96.0); + + mock( ).checkExpectations(); +} + +TEST(MockParameterTest, doubleParameterNotEqualIfOutsideTolerance) +{ + MockFailureReporterInstaller failureReporterInstaller; + + MockExpectedCallsListForTest expectations; + expectations.addFunction("foo")->withParameter("parameter", 100.0); + MockNamedValue parameter("parameter"); + parameter.setValue(106.0); + MockUnexpectedInputParameterFailure expectedFailure(mockFailureTest(), "foo", parameter, expectations); + + mock( ).expectOneCall("foo").withParameter("parameter", 100.0, 5.0); + mock( ).actualCall("foo").withParameter("parameter", 106.0); + + CHECK_EXPECTED_MOCK_FAILURE(expectedFailure); +} + + TEST(MockParameterTest, expectOneStringParameterAndValue) { mock().expectOneCall("foo").withParameter("parameter", "string"); @@ -442,7 +594,7 @@ MockCheckedExpectedCall* call = expectations.addFunction("boo"); call->ignoreOtherParameters(); call->callWasMade(1); - call->parametersWereIgnored(); + call->finalizeActualCallMatch(); call->ignoreOtherParameters(); expectations.addFunction("boo")->ignoreOtherParameters(); MockExpectedCallsDidntHappenFailure expectedFailure(mockFailureTest(), expectations); @@ -465,7 +617,7 @@ mock().expectOneCall("foo").withParameter("p1", 1); mock().actualCall("foo"); - mock().actualCall("foo").withParameter("p1", 1);; + mock().actualCall("foo").withParameter("p1", 1); CHECK_EXPECTED_MOCK_FAILURE(expectedFailure); } @@ -483,6 +635,17 @@ mock().checkExpectations(); } +TEST(MockParameterTest, unmodifiedOutputParameterSucceeds) +{ + int param = 1; + + mock().expectOneCall("function").withUnmodifiedOutputParameter("parameterName"); + mock().actualCall("function").withOutputParameter("parameterName", ¶m); + + CHECK_EQUAL(param, 1); + mock().checkExpectations(); +} + TEST(MockParameterTest, noActualCallForOutputParameter) { MockFailureReporterInstaller failureReporterInstaller; @@ -498,6 +661,20 @@ CHECK_EXPECTED_MOCK_FAILURE(expectedFailure); } +TEST(MockParameterTest, noActualCallForUnmodifiedOutputParameter) +{ + MockFailureReporterInstaller failureReporterInstaller; + + MockExpectedCallsListForTest expectations; + mock().expectOneCall("foo").withUnmodifiedOutputParameter("output"); + + expectations.addFunction("foo")->withUnmodifiedOutputParameter("output"); + MockExpectedCallsDidntHappenFailure expectedFailure(mockFailureTest(), expectations); + + mock().checkExpectations(); + CHECK_EXPECTED_MOCK_FAILURE(expectedFailure); +} + TEST(MockParameterTest, unexpectedOutputParameter) { MockFailureReporterInstaller failureReporterInstaller; @@ -678,6 +855,29 @@ mock().actualCall("foo").withOutputParameter("bar", &retval).withParameter("other", 1); LONGS_EQUAL(param, retval); + + mock().checkExpectations(); +} + +/* + * This test checks that the proper output parameters are copied when multiple calls to the same + * function are expected. + */ +TEST(MockParameterTest, properOutputParametersAreCopied) +{ + int expectedValue1 = 1; + int expectedValue2 = 2; + mock().expectOneCall("foo").withOutputParameterReturning("param", &expectedValue1, sizeof(expectedValue1)).ignoreOtherParameters(); + mock().expectOneCall("foo").withOutputParameterReturning("param", &expectedValue2, sizeof(expectedValue2)); + + int returnedValue1 = 0; + int returnedValue2 = 0; + mock().actualCall("foo").withOutputParameter("param", &returnedValue1); + mock().actualCall("foo").withOutputParameter("param", &returnedValue2).withParameter("optional", 50); + + CHECK_EQUAL_TEXT(expectedValue2, returnedValue1, "Wrong output value in 1st call"); + CHECK_EQUAL_TEXT(expectedValue1, returnedValue2, "Wrong output value in 2nd call"); + mock().checkExpectations(); } @@ -689,13 +889,17 @@ .withParameter("bar", 1u) .withParameter("foo", 1l) .withParameter("hey", 1ul) +#ifdef CPPUTEST_USE_LONG_LONG + .withParameter("ick", 1ll) + .withParameter("grr", 1ull) +#endif .withParameter("duh", 1.0) - .withParameter("yoo", (const void*) 0) - .withParameter("func", (void(*)()) 0) - .withParameter("mem", (const unsigned char*) 0, 0) - .withParameterOfType("hoo", "int", (const void*) 0) - .withOutputParameter("gah", (void*) 0) - .withOutputParameterOfType("goo", "int", (void*) 0); + .withParameter("yoo", (const void*) NULLPTR) + .withParameter("func", (void(*)()) NULLPTR) + .withParameter("mem", (const unsigned char*) NULLPTR, 0) + .withParameterOfType("hoo", "int", (const void*) NULLPTR) + .withOutputParameter("gah", (void*) NULLPTR) + .withOutputParameterOfType("goo", "int", (void*) NULLPTR); mock().checkExpectations(); } diff -Nru cpputest-3.8/tests/CppUTestExt/MockPluginTest.cpp cpputest-4.0/tests/CppUTestExt/MockPluginTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockPluginTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockPluginTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -50,6 +50,8 @@ { delete test; delete result; + mock().clear(); + mock().removeAllComparatorsAndCopiers(); } }; @@ -65,7 +67,7 @@ plugin.postTestAction(*test, *result); - STRCMP_CONTAINS(expectedFailure.getMessage().asCharString(), output.getOutput().asCharString()) + STRCMP_CONTAINS(expectedFailure.getMessage().asCharString(), output.getOutput().asCharString()); LONGS_EQUAL(0, mock().expectedCallsLeft()); CHECK_NO_MOCK_FAILURE(); } @@ -83,7 +85,7 @@ plugin.postTestAction(*test, *result); - STRCMP_CONTAINS(expectedFailure.getMessage().asCharString(), output.getOutput().asCharString()) + STRCMP_CONTAINS(expectedFailure.getMessage().asCharString(), output.getOutput().asCharString()); CHECK_NO_MOCK_FAILURE(); } @@ -106,11 +108,13 @@ DummyComparator comparator; plugin.installComparator("myType", comparator); - mock().expectOneCall("foo").withParameterOfType("myType", "name", NULL); - mock().actualCall("foo").withParameterOfType("myType", "name", NULL); + mock().expectOneCall("foo").withParameterOfType("myType", "name", NULLPTR); + mock().actualCall("foo").withParameterOfType("myType", "name", NULLPTR); MockNoWayToCompareCustomTypeFailure failure(test, "myType"); CHECK_EXPECTED_MOCK_FAILURE(failure); + + plugin.clear(); } class DummyCopier : public MockNamedValueCopier @@ -128,11 +132,13 @@ DummyCopier copier; plugin.installCopier("myType", copier); - mock().expectOneCall("foo").withOutputParameterOfTypeReturning("myType", "name", NULL); - mock().actualCall("foo").withOutputParameterOfType("myType", "name", NULL); + mock().expectOneCall("foo").withOutputParameterOfTypeReturning("myType", "name", NULLPTR); + mock().actualCall("foo").withOutputParameterOfType("myType", "name", NULLPTR); MockNoWayToCopyCustomTypeFailure failure(test, "myType"); CHECK_EXPECTED_MOCK_FAILURE(failure); + + plugin.clear(); } TEST(MockPlugin, preTestActionWillEnableMultipleComparatorsToTheGlobalMockSupportSpace) @@ -150,6 +156,8 @@ mock().checkExpectations(); LONGS_EQUAL(0, result->getFailureCount()); + + plugin.clear(); } static void _failTwiceFunction() @@ -161,7 +169,7 @@ TEST(MockPlugin, shouldNotFailAgainWhenTestAlreadyFailed) { TestTestingFixture fixture; - fixture.registry_->installPlugin(&plugin); + fixture.installPlugin(&plugin); fixture.setTestFunction(_failTwiceFunction); fixture.runAllTests(); fixture.assertPrintContains("1 failures, 1 tests, 1 ran, 2 checks,"); diff -Nru cpputest-3.8/tests/CppUTestExt/MockReturnValueTest.cpp cpputest-4.0/tests/CppUTestExt/MockReturnValueTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockReturnValueTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockReturnValueTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -32,7 +32,8 @@ { void teardown() { - mock().checkExpectations(); + mock().checkExpectations(); + mock().clear(); } }; @@ -105,6 +106,87 @@ UNSIGNED_LONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getUnsignedLongIntValue()); } +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(MockReturnValueTest, PositiveIntReturnValueCanBeRetrievedAsUnsignedLongLongInt) +{ + int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getUnsignedLongLongIntValue()); +} + +TEST(MockReturnValueTest, PositiveLongIntReturnValueCanBeRetrievedAsUnsignedLongLongInt) +{ + long int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getUnsignedLongLongIntValue()); +} + +TEST(MockReturnValueTest, PositiveLongLongIntReturnValueCanBeRetrievedAsUnsignedLongLongInt) +{ + long long int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getUnsignedLongLongIntValue()); +} + +TEST(MockReturnValueTest, UnsignedIntReturnValueCanBeRetrievedAsUnsignedLongLongInt) +{ + unsigned int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getUnsignedLongLongIntValue()); +} + +TEST(MockReturnValueTest, UnsignedLongIntReturnValueCanBeRetrievedAsUnsignedLongLongInt) +{ + unsigned long int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getUnsignedLongLongIntValue()); +} + +TEST(MockReturnValueTest, UnsignedLongLongIntReturnValueCanBeRetrieved) +{ + unsigned long long int expected_value = ULLONG_MAX; + mock().expectOneCall("foo").andReturnValue(expected_value); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getUnsignedLongLongIntValue()); +} + +TEST(MockReturnValueTest, PositiveIntReturnValueCanBeRetrievedAsLongLongInt) +{ + int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getLongLongIntValue()); +} + +TEST(MockReturnValueTest, PositiveLongIntReturnValueCanBeRetrievedAsLongLongInt) +{ + long int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getLongLongIntValue()); +} + +TEST(MockReturnValueTest, UnsignedIntReturnValueCanBeRetrievedAsLongLongInt) +{ + unsigned int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getLongLongIntValue()); +} + +TEST(MockReturnValueTest, UnsignedLongIntReturnValueCanBeRetrievedAsLongLongInt) +{ + unsigned long int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getLongLongIntValue()); +} + +TEST(MockReturnValueTest, LongLongIntReturnValueCanBeRetrieved) +{ + long long int expected_value = LLONG_MAX; + mock().expectOneCall("foo").andReturnValue(expected_value); + LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getLongLongIntValue()); +} + +#endif + TEST(MockReturnValueTest, UnsignedIntegerReturnValueSetsDifferentValues) { unsigned int expected_value = 1; @@ -202,6 +284,44 @@ LONGS_EQUAL(default_return_value, mock().returnLongIntValueOrDefault(default_return_value)); } +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(MockReturnValueTest, WhenAUnsignedLongLongIntegerReturnValueIsExpectedAndAlsoThereIsADefaultShouldlIgnoreTheDefault) +{ + unsigned long long int default_return_value = ULLONG_MAX; + unsigned long long int expected_return_value = default_return_value - 1; + mock().expectOneCall("foo").andReturnValue(expected_return_value); + LONGS_EQUAL(expected_return_value, mock().actualCall("foo").returnUnsignedLongLongIntValueOrDefault(default_return_value)); + LONGS_EQUAL(expected_return_value, mock().returnUnsignedLongLongIntValueOrDefault(default_return_value)); +} + +TEST(MockReturnValueTest, WhenNoUnsignedLongLongIntegerReturnValueIsExpectedButThereIsADefaultShouldlUseTheDefaultValue) +{ + unsigned long long int default_return_value = ULLONG_MAX; + mock().expectOneCall("foo"); + LONGS_EQUAL(default_return_value, mock().actualCall("foo").returnUnsignedLongLongIntValueOrDefault(default_return_value)); + LONGS_EQUAL(default_return_value, mock().returnUnsignedLongLongIntValueOrDefault(default_return_value)); +} + +TEST(MockReturnValueTest, WhenALongLongIntegerReturnValueIsExpectedAndAlsoThereIsADefaultShouldlIgnoreTheDefault) +{ + long long int default_return_value = LLONG_MAX; + long long int expected_return_value = default_return_value - 1; + mock().expectOneCall("foo").andReturnValue(expected_return_value); + LONGS_EQUAL(expected_return_value, mock().actualCall("foo").returnLongLongIntValueOrDefault(default_return_value)); + LONGS_EQUAL(expected_return_value, mock().returnLongLongIntValueOrDefault(default_return_value)); +} + +TEST(MockReturnValueTest, WhenNoLongLongIntegerReturnValueIsExpectedButThereIsADefaultShouldlUseTheDefaultValue) +{ + long long int default_return_value = LLONG_MAX; + mock().expectOneCall("foo"); + LONGS_EQUAL(default_return_value, mock().actualCall("foo").returnLongLongIntValueOrDefault(default_return_value)); + LONGS_EQUAL(default_return_value, mock().returnLongLongIntValueOrDefault(default_return_value)); +} + +#endif + TEST(MockReturnValueTest, WhenABooleanReturnValueIsExpectedAndAlsoThereIsADefaultShouldlIgnoreTheDefault) { bool default_return_value = true; @@ -398,6 +518,90 @@ LONGS_EQUAL(another_ret_value, mock().returnValue().getUnsignedLongIntValue()); } +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(MockReturnValueTest, LongLongIntegerReturnValue) +{ + long long int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + + MockActualCall& actual_call = mock().actualCall("foo"); + LONGLONGS_EQUAL(expected_value, actual_call.returnValue().getLongLongIntValue()); + LONGLONGS_EQUAL(expected_value, actual_call.returnLongLongIntValue()); + LONGLONGS_EQUAL(expected_value, mock().returnValue().getLongLongIntValue()); + LONGLONGS_EQUAL(expected_value, mock().longLongIntReturnValue()); +} + +TEST(MockReturnValueTest, LongLongIntegerReturnValueSetsDifferentValues) +{ + long long int expected_value = 1; + long long int another_expected_value = 2; + + mock().expectOneCall("foo").andReturnValue(expected_value); + mock().expectOneCall("foo").andReturnValue(another_expected_value); + + LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getLongLongIntValue()); + LONGLONGS_EQUAL(expected_value, mock().returnValue().getLongLongIntValue()); + LONGLONGS_EQUAL(another_expected_value, mock().actualCall("foo").returnValue().getLongLongIntValue()); + LONGLONGS_EQUAL(another_expected_value, mock().returnValue().getLongLongIntValue()); +} + +TEST(MockReturnValueTest, LongLongIntegerReturnValueSetsDifferentValuesWhileParametersAreIgnored) +{ + long long int ret_value = 1; + long long int another_ret_value = 2; + + mock().expectOneCall("foo").withParameter("p1", 1).ignoreOtherParameters().andReturnValue(ret_value); + mock().expectOneCall("foo").withParameter("p1", 1).ignoreOtherParameters().andReturnValue(another_ret_value); + + LONGLONGS_EQUAL(ret_value, mock().actualCall("foo").withParameter("p1", 1).returnValue().getLongLongIntValue()); + LONGLONGS_EQUAL(ret_value, mock().returnValue().getLongLongIntValue()); + LONGLONGS_EQUAL(another_ret_value, mock().actualCall("foo").withParameter("p1", 1).returnValue().getLongLongIntValue()); + LONGLONGS_EQUAL(another_ret_value, mock().returnValue().getLongLongIntValue()); +} + +TEST(MockReturnValueTest, UnsignedLongLongIntegerReturnValue) +{ + unsigned long long int expected_value = 7; + mock().expectOneCall("foo").andReturnValue(expected_value); + + MockActualCall& actual_call = mock().actualCall("foo"); + UNSIGNED_LONGLONGS_EQUAL(expected_value, actual_call.returnValue().getUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(expected_value, actual_call.returnUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().returnValue().getUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().unsignedLongLongIntReturnValue()); +} + +TEST(MockReturnValueTest, UnsignedLongLongIntegerReturnValueSetsDifferentValues) +{ + unsigned long long int expected_value = 1; + unsigned long long int another_expected_value = 2; + + mock().expectOneCall("foo").andReturnValue(expected_value); + mock().expectOneCall("foo").andReturnValue(another_expected_value); + + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().actualCall("foo").returnValue().getUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock().returnValue().getUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(another_expected_value, mock().actualCall("foo").returnValue().getUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(another_expected_value, mock().returnValue().getUnsignedLongLongIntValue()); +} + +TEST(MockReturnValueTest, UnsignedLongLongIntegerReturnValueSetsDifferentValuesWhileParametersAreIgnored) +{ + unsigned long long int ret_value = 1; + unsigned long long int another_ret_value = 2; + + mock().expectOneCall("foo").withParameter("p1", 1).ignoreOtherParameters().andReturnValue(ret_value); + mock().expectOneCall("foo").withParameter("p1", 1).ignoreOtherParameters().andReturnValue(another_ret_value); + + UNSIGNED_LONGLONGS_EQUAL(ret_value, mock().actualCall("foo").withParameter("p1", 1).returnValue().getUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(ret_value, mock().returnValue().getUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(another_ret_value, mock().actualCall("foo").withParameter("p1", 1).returnValue().getUnsignedLongLongIntValue()); + UNSIGNED_LONGLONGS_EQUAL(another_ret_value, mock().returnValue().getUnsignedLongLongIntValue()); +} + +#endif + TEST(MockReturnValueTest, MatchingReturnValueOnWhileSignature) { mock().expectOneCall("foo").withParameter("p1", 1).andReturnValue(1); diff -Nru cpputest-3.8/tests/CppUTestExt/MockStrictOrderTest.cpp cpputest-4.0/tests/CppUTestExt/MockStrictOrderTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockStrictOrderTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockStrictOrderTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -66,9 +66,9 @@ mock().strictOrder(); MockExpectedCallsListForTest expectations; - expectations.addFunction("foo1", 1)->callWasMade(1); - expectations.addFunction("foo1", 2)->callWasMade(3); - expectations.addFunction("foo2", 3)->callWasMade(2); + expectations.addFunctionOrdered("foo1", 1)->callWasMade(1); + expectations.addFunctionOrdered("foo1", 2)->callWasMade(3); + expectations.addFunctionOrdered("foo2", 3)->callWasMade(2); MockCallOrderFailure expectedFailure(mockFailureTest(), expectations); mock().expectOneCall("foo1"); @@ -89,8 +89,8 @@ mock("bla").strictOrder(); MockExpectedCallsListForTest expectations; - expectations.addFunction("foo::foo1", 1)->callWasMade(2); - expectations.addFunction("foo::foo2", 2)->callWasMade(1); + expectations.addFunctionOrdered("foo::foo1", 1)->callWasMade(2); + expectations.addFunctionOrdered("foo::foo2", 2)->callWasMade(1); MockCallOrderFailure expectedFailure(mockFailureTest(), expectations); mock("bla").expectOneCall("foo1"); @@ -113,8 +113,8 @@ mock().ignoreOtherCalls(); MockExpectedCallsListForTest expectations; - expectations.addFunction("foo::foo1", 1)->callWasMade(2); - expectations.addFunction("foo::foo2", 2)->callWasMade(1); + expectations.addFunctionOrdered("foo::foo1", 1)->callWasMade(2); + expectations.addFunctionOrdered("foo::foo2", 2)->callWasMade(1); MockCallOrderFailure expectedFailure(mockFailureTest(), expectations); mock("bla").expectOneCall("foo1"); @@ -137,8 +137,8 @@ mock().strictOrder(); MockExpectedCallsListForTest expectations; - expectations.addFunction("scope::foo1", 1)->callWasMade(2); - expectations.addFunction("scope::foo2", 2)->callWasMade(1); + expectations.addFunctionOrdered("scope::foo1", 1)->callWasMade(2); + expectations.addFunctionOrdered("scope::foo2", 2)->callWasMade(1); MockCallOrderFailure expectedFailure(mockFailureTest(), expectations); mock("scope").expectOneCall("foo1"); @@ -185,11 +185,15 @@ mock().expectOneCall("foo1"); mock().expectNCalls(2, "foo2"); mock().expectOneCall("foo1"); + mock().expectNCalls(3, "foo2"); + mock().actualCall("foo1"); mock().actualCall("foo2"); mock().actualCall("foo2"); mock().actualCall("foo1"); + mock().actualCall("foo2"); + mock().actualCall("foo2"); + mock().actualCall("foo2"); mock().checkExpectations(); } - diff -Nru cpputest-3.8/tests/CppUTestExt/MockSupport_cTestCFile.c cpputest-4.0/tests/CppUTestExt/MockSupport_cTestCFile.c --- cpputest-3.8/tests/CppUTestExt/MockSupport_cTestCFile.c 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockSupport_cTestCFile.c 2020-05-26 11:24:07.000000000 +0000 @@ -53,7 +53,13 @@ withUnsignedIntParameters("unsigned", 1)-> withLongIntParameters("long int", (long int) -1)-> withUnsignedLongIntParameters("unsigned long int", (unsigned long int) 1)-> +#ifdef CPPUTEST_USE_LONG_LONG + withLongLongIntParameters("long long int", (long long int) -1)-> + withUnsignedLongLongIntParameters("unsigned long long int", (unsigned long long int) 1)-> +#endif + withDoubleParameters("double", 1.0)-> + withDoubleParametersAndTolerance("doubleWithTolerance", 1.0, 1.0)-> withStringParameters("string", "string")-> withPointerParameters("pointer", (void*) 1)-> withConstPointerParameters("constpointer", (const void*) 1)-> @@ -66,7 +72,12 @@ withUnsignedIntParameters("unsigned", 1)-> withLongIntParameters("long int", (long int) -1)-> withUnsignedLongIntParameters("unsigned long int", (unsigned long int) 1)-> +#ifdef CPPUTEST_USE_LONG_LONG + withLongLongIntParameters("long long int", (long long int) -1)-> + withUnsignedLongLongIntParameters("unsigned long long int", (unsigned long long int) 1)-> +#endif withDoubleParameters("double", 1.0)-> + withDoubleParameters("doubleWithTolerance", 0.0 )-> withStringParameters("string", "string")-> withPointerParameters("pointer", (void*) 1)-> withConstPointerParameters("constpointer", (const void*) 1)-> @@ -100,18 +111,28 @@ mock_c()->intReturnValue(); mock_c()->returnValue(); - mock_c()->expectOneCall("boo2")->andReturnUnsignedIntValue(1.0); + mock_c()->expectOneCall("boo2")->andReturnUnsignedIntValue(1); mock_c()->actualCall("boo2")->unsignedIntReturnValue(); mock_c()->unsignedIntReturnValue(); - mock_c()->expectOneCall("boo3")->andReturnLongIntValue(1.0); + mock_c()->expectOneCall("boo3")->andReturnLongIntValue(1); mock_c()->actualCall("boo3")->longIntReturnValue(); mock_c()->longIntReturnValue(); - mock_c()->expectOneCall("boo3")->andReturnUnsignedLongIntValue(1.0); + mock_c()->expectOneCall("boo3")->andReturnUnsignedLongIntValue(1); mock_c()->actualCall("boo3")->unsignedLongIntReturnValue(); mock_c()->unsignedLongIntReturnValue(); +#ifdef CPPUTEST_USE_LONG_LONG + mock_c()->expectOneCall("mgrgrgr1")->andReturnLongLongIntValue(1); + mock_c()->actualCall("mgrgrgr1")->longLongIntReturnValue(); + mock_c()->longLongIntReturnValue(); + + mock_c()->expectOneCall("mgrgrgr2")->andReturnUnsignedLongLongIntValue(1); + mock_c()->actualCall("mgrgrgr2")->unsignedLongLongIntReturnValue(); + mock_c()->unsignedLongLongIntReturnValue(); +#endif + mock_c()->expectOneCall("boo4")->andReturnDoubleValue(1.0); mock_c()->actualCall("boo4")->doubleReturnValue(); mock_c()->doubleReturnValue(); @@ -168,6 +189,10 @@ mock_c()->returnUnsignedIntValueOrDefault(1); mock_c()->returnLongIntValueOrDefault(-1L); mock_c()->returnUnsignedLongIntValueOrDefault(1L); +#ifdef CPPUTEST_USE_LONG_LONG + mock_c()->returnLongLongIntValueOrDefault(-1LL); + mock_c()->returnUnsignedLongLongIntValueOrDefault(1ULL); +#endif mock_c()->returnStringValueOrDefault(""); mock_c()->returnDoubleValueOrDefault(0.01); mock_c()->returnPointerValueOrDefault(0); diff -Nru cpputest-3.8/tests/CppUTestExt/MockSupport_cTest.cpp cpputest-4.0/tests/CppUTestExt/MockSupport_cTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockSupport_cTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockSupport_cTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -43,6 +43,10 @@ TEST_GROUP(MockSupport_c) { + void teardown() + { + mock_c()->clear(); + } }; TEST(MockSupport_c, OrderObserved) @@ -60,12 +64,12 @@ TEST(MockSupport_c, hasReturnValue) { mock_c()->expectOneCall("foo"); - CHECK(!mock_c()->actualCall("foo")->hasReturnValue()); - CHECK(!mock_c()->hasReturnValue()); + CHECK(mock_c()->actualCall("foo")->hasReturnValue() == 0); + CHECK(mock_c()->hasReturnValue() == 0); mock_c()->expectOneCall("foo2")->andReturnIntValue(1); - CHECK(mock_c()->actualCall("foo2")->hasReturnValue()); - CHECK(mock_c()->hasReturnValue()); + CHECK(mock_c()->actualCall("foo2")->hasReturnValue() != 0); + CHECK(mock_c()->hasReturnValue() != 0); } TEST(MockSupport_c, expectAndActualOneCall) @@ -116,7 +120,7 @@ static void typeCopy(void* dst, const void* src) { - *(int*) dst = *(int*) src; + *(int*) dst = *(const int*) src; } } @@ -154,6 +158,28 @@ mock_c()->actualCall("foo")->withUnsignedLongIntParameters("p", 1); } +TEST(MockSupport_c, doubleParameterWithTolerance) +{ + mock_c( )->expectOneCall("foo")->withDoubleParametersAndTolerance("p", 2.0, 0.2); + mock_c( )->actualCall("foo")->withDoubleParameters("p", 1.9); +} + +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(MockSupport_c, longLongIntParameter) +{ + mock_c()->expectOneCall("foo")->withLongLongIntParameters("p", 1); + mock_c()->actualCall("foo")->withLongLongIntParameters("p", 1); +} + +TEST(MockSupport_c, unsignedLongLongIntParameter) +{ + mock_c()->expectOneCall("foo")->withUnsignedLongLongIntParameters("p", 1); + mock_c()->actualCall("foo")->withUnsignedLongLongIntParameters("p", 1); +} + +#endif + TEST(MockSupport_c, memoryBufferParameter) { const unsigned char mem_buffer[] = { 1, 2, 3}; @@ -173,6 +199,15 @@ LONGS_EQUAL(2, retval); } +TEST(MockSupport_c, unmodifiedOutputParameter) +{ + int param = 1; + mock_c()->expectOneCall("foo")->withUnmodifiedOutputParameter("out"); + mock_c()->actualCall("foo")->withOutputParameter("out", ¶m); + mock_c()->checkExpectations(); + LONGS_EQUAL(1, param); +} + TEST(MockSupport_c, outputParameters_differentType) { long param = 1; @@ -186,8 +221,8 @@ TEST(MockSupport_c, outputParametersOfType) { - long param = 1; - const long retval = 2; + int param = 1; + const int retval = 2; mock_c()->installCopier("typeName", typeCopy); mock_c()->expectOneCall("foo")->withOutputParameterOfTypeReturning("typeName", "out", &retval); mock_c()->actualCall("foo")->withOutputParameterOfType("typeName", "out", ¶m); @@ -334,6 +369,62 @@ LONGS_EQUAL(defaultValue, mock_c()->returnUnsignedLongIntValueOrDefault(defaultValue)); } +#ifdef CPPUTEST_USE_LONG_LONG + +TEST(MockSupport_c, returnLongLongIntValue) +{ + long long int expected_value = -10L; + mock_c()->expectOneCall("boo")->andReturnLongLongIntValue(expected_value); + LONGLONGS_EQUAL(expected_value, mock_c()->actualCall("boo")->longLongIntReturnValue()); + LONGLONGS_EQUAL(expected_value, mock_c()->longLongIntReturnValue()); + LONGLONGS_EQUAL(MOCKVALUETYPE_LONG_LONG_INTEGER, mock_c()->returnValue().type); +} + +TEST(MockSupport_c, whenReturnValueIsGivenReturnLongLongIntValueOrDefaultShouldIgnoreTheDefault) +{ + long long int defaultValue = -10L; + long long int expectedValue = defaultValue - 1L; + mock_c()->expectOneCall("foo")->andReturnLongLongIntValue(expectedValue); + LONGLONGS_EQUAL(expectedValue, mock_c()->actualCall("foo")->returnLongLongIntValueOrDefault(defaultValue)); + LONGLONGS_EQUAL(expectedValue, mock_c()->returnLongLongIntValueOrDefault(defaultValue)); +} + +TEST(MockSupport_c, whenNoReturnValueIsGivenReturnLongLongIntValueOrDefaultShouldlUseTheDefaultValue) +{ + long long int defaultValue = -10L; + mock_c()->expectOneCall("foo"); + LONGLONGS_EQUAL(defaultValue, mock_c()->actualCall("foo")->returnLongLongIntValueOrDefault(defaultValue)); + LONGLONGS_EQUAL(defaultValue, mock_c()->returnLongLongIntValueOrDefault(defaultValue)); +} + +TEST(MockSupport_c, returnUnsignedLongLongIntValue) +{ + unsigned long long int expected_value = 10; + mock_c()->expectOneCall("boo")->andReturnUnsignedLongLongIntValue(expected_value); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock_c()->actualCall("boo")->unsignedLongLongIntReturnValue()); + UNSIGNED_LONGLONGS_EQUAL(expected_value, mock_c()->unsignedLongLongIntReturnValue()); + UNSIGNED_LONGLONGS_EQUAL(MOCKVALUETYPE_UNSIGNED_LONG_LONG_INTEGER, mock_c()->returnValue().type); +} + +TEST(MockSupport_c, whenReturnValueIsGivenReturnUnsignedLongLongIntValueOrDefaultShouldIgnoreTheDefault) +{ + unsigned long long int defaultValue = 10L; + unsigned long long int expectedValue = defaultValue + 1L; + mock_c()->expectOneCall("foo")->andReturnUnsignedLongLongIntValue(expectedValue); + UNSIGNED_LONGLONGS_EQUAL(expectedValue, mock_c()->actualCall("foo")->returnUnsignedLongLongIntValueOrDefault(defaultValue)); + UNSIGNED_LONGLONGS_EQUAL(expectedValue, mock_c()->returnUnsignedLongLongIntValueOrDefault(defaultValue)); +} + +TEST(MockSupport_c, whenNoReturnValueIsGivenReturnUnsignedLongLongIntValueOrDefaultShouldlUseTheDefaultValue) +{ + unsigned long long int defaultValue = 10L; + mock_c()->expectOneCall("foo"); + UNSIGNED_LONGLONGS_EQUAL(defaultValue, mock_c()->actualCall("foo")->returnUnsignedLongLongIntValueOrDefault(defaultValue)); + UNSIGNED_LONGLONGS_EQUAL(defaultValue, mock_c()->returnUnsignedLongLongIntValueOrDefault(defaultValue)); +} + +#endif + TEST(MockSupport_c, returnStringValue) { mock_c()->expectOneCall("boo")->andReturnStringValue("hello world"); @@ -519,6 +610,12 @@ POINTERS_EQUAL((void*) 1, mock_c()->getData("name").value.objectValue); } +TEST(MockSupport_c, MockSupportSetDataConstObject) +{ + mock_c()->setDataConstObject("name", "type", (const void*) 5); + POINTERS_EQUAL((void*) 5, mock_c()->getData("name").value.constObjectValue); +} + TEST(MockSupport_c, WorksInCFile) { all_mock_support_c_calls(); diff -Nru cpputest-3.8/tests/CppUTestExt/MockSupportTest.cpp cpputest-4.0/tests/CppUTestExt/MockSupportTest.cpp --- cpputest-3.8/tests/CppUTestExt/MockSupportTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/MockSupportTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -39,8 +39,10 @@ void teardown() { - mock().checkExpectations(); - CHECK_NO_MOCK_FAILURE(); + mock().checkExpectations(); + CHECK_NO_MOCK_FAILURE(); + MockFailureReporterForTest::clearReporter(); + mock().clear(); } }; @@ -134,6 +136,14 @@ STRCMP_EQUAL("type", mock().getData("data").getType().asCharString()); } +TEST(MockSupportTest, setDataConstObject) +{ + void * ptr = (void*) 0x011; + mock().setDataConstObject("data", "type", ptr); + POINTERS_EQUAL(ptr, mock().getData("data").getConstObjectPointer()); + STRCMP_EQUAL("type", mock().getData("data").getType().asCharString()); +} + TEST(MockSupportTest, tracing) { mock().tracing(true); @@ -162,6 +172,12 @@ TEST_GROUP(MockSupportTestWithFixture) { TestTestingFixture fixture; + + void teardown() + { + mock().clear(); + MockFailureReporterForTest::clearReporter(); + } }; static void CHECK_EXPECTED_MOCK_FAILURE_LOCATION_failedTestMethod_() @@ -249,9 +265,7 @@ fixture.runAllTests(); fixture.assertPrintContains("Unexpected call to function: unexpected"); fixture.assertPrintContains("Errors (1 failures, 1 tests, 1 ran, 0 checks, 0 ignored, 0 filtered out"); - fixture.output_->flush(); - delete fixture.result_; - fixture.result_ = new TestResult(*fixture.output_); + fixture.flushOutputAndResetResult(); } } diff -Nru cpputest-3.8/tests/CppUTestExt/OrderedTestTest_c.c cpputest-4.0/tests/CppUTestExt/OrderedTestTest_c.c --- cpputest-3.8/tests/CppUTestExt/OrderedTestTest_c.c 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/OrderedTestTest_c.c 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,17 @@ +#include "CppUTest/TestHarness_c.h" +#include "OrderedTestTest.h" + +TEST_C(TestOrderedTestMacros, Test11) +{ + CHECK_C(orderedTestFixtureCWrapper() == 13); +} + +TEST_C(TestOrderedTestMacros, Test7) +{ + CHECK_C(orderedTestFixtureCWrapper() == 9); +} + +TEST_C(TestOrderedTestMacros, Test9) +{ + CHECK_C(orderedTestFixtureCWrapper() == 11); +} diff -Nru cpputest-3.8/tests/CppUTestExt/OrderedTestTest.cpp cpputest-4.0/tests/CppUTestExt/OrderedTestTest.cpp --- cpputest-3.8/tests/CppUTestExt/OrderedTestTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/OrderedTestTest.cpp 2020-05-26 11:24:07.000000000 +0000 @@ -30,6 +30,7 @@ #include "CppUTest/TestRegistry.h" #include "CppUTest/TestTestingFixture.h" #include "CppUTestExt/OrderedTest.h" +#include "OrderedTestTest.h" TEST_GROUP(TestOrderedTest) { @@ -46,10 +47,10 @@ void setup() { orderedTestCache = OrderedTestShell::getOrderedTestHead(); - OrderedTestShell::setOrderedTestHead(0); + OrderedTestShell::setOrderedTestHead(NULLPTR); fixture = new TestTestingFixture(); - fixture->registry_->unDoLastAddTest(); + fixture->getRegistry()->unDoLastAddTest(); } void teardown() @@ -70,12 +71,12 @@ UtestShell* firstTest() { - return fixture->registry_->getFirstTest(); + return fixture->getRegistry()->getFirstTest(); } UtestShell* secondTest() { - return fixture->registry_->getFirstTest()->getNext(); + return firstTest()->getNext(); } }; @@ -198,3 +199,48 @@ { CHECK(OrderedTestTestingFixture::count() == 3); } + +// Test with same level +TEST_ORDERED(TestOrderedTestMacros, Test5_1, 5) +{ + CHECK(OrderedTestTestingFixture::count() == 5); +} + +TEST_ORDERED(TestOrderedTestMacros, Test6_1, 6) +{ + CHECK(OrderedTestTestingFixture::count() == 7); +} + +TEST_ORDERED(TestOrderedTestMacros, Test5_2, 5) +{ + CHECK(OrderedTestTestingFixture::count() == 6); +} + +TEST_ORDERED(TestOrderedTestMacros, Test6_2, 6) +{ + CHECK(OrderedTestTestingFixture::count() == 8); +} + +// Test C-Interface +TEST_ORDERED(TestOrderedTestMacros, Test10, 10) +{ + CHECK(OrderedTestTestingFixture::count() == 12); +} + +TEST_ORDERED(TestOrderedTestMacros, Test8, 8) +{ + CHECK(OrderedTestTestingFixture::count() == 10); +} + +// Export to be usable in OrderedTestTest_c.c +extern "C" { +int orderedTestFixtureCWrapper(void) { + return OrderedTestTestingFixture::count(); +} +} + +TEST_ORDERED_C_WRAPPER(TestOrderedTestMacros, Test11, 11) + +TEST_ORDERED_C_WRAPPER(TestOrderedTestMacros, Test7, 7) + +TEST_ORDERED_C_WRAPPER(TestOrderedTestMacros, Test9, 9) diff -Nru cpputest-3.8/tests/CppUTestExt/OrderedTestTest.h cpputest-4.0/tests/CppUTestExt/OrderedTestTest.h --- cpputest-3.8/tests/CppUTestExt/OrderedTestTest.h 1970-01-01 00:00:00.000000000 +0000 +++ cpputest-4.0/tests/CppUTestExt/OrderedTestTest.h 2020-05-26 11:24:07.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ORDEREDTESTTEST_H +#define ORDEREDTESTTEST_H + +#ifdef __cplusplus +extern "C" { +#endif + +extern int orderedTestFixtureCWrapper(void); + +#ifdef __cplusplus +} +#endif + +#endif /* ORDEREDTESTTEST_H */ + diff -Nru cpputest-3.8/tests/JUnitOutputTest.cpp cpputest-4.0/tests/JUnitOutputTest.cpp --- cpputest-3.8/tests/JUnitOutputTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/JUnitOutputTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,601 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/JUnitTestOutput.h" -#include "CppUTest/TestResult.h" -#include "CppUTest/PlatformSpecificFunctions.h" -#include "CppUTest/SimpleString.h" - -class FileForJUnitOutputTests -{ - SimpleString name_; - bool isOpen_; - SimpleString buffer_; - FileForJUnitOutputTests* next_; - - SimpleStringCollection linesOfFile_; - -public: - - FileForJUnitOutputTests(SimpleString filename, FileForJUnitOutputTests* next) : - name_(filename), isOpen_(true), next_(next) {} - - FileForJUnitOutputTests* nextFile() - { - return next_; - } - - SimpleString name() - { - return name_; - } - - void write(const SimpleString& buffer) - { - buffer_ += buffer; - } - - void close() - { - isOpen_ = false; - } - - const char* line(size_t lineNumber) - { - buffer_.split("\n", linesOfFile_); - return linesOfFile_[lineNumber-1].asCharString(); - - } - - const char* lineFromTheBack(size_t lineNumberFromTheBack) - { - return line(amountOfLines() - (lineNumberFromTheBack - 1)); - } - - size_t amountOfLines() - { - buffer_.split("\n", linesOfFile_); - return linesOfFile_.size(); - } - - SimpleString content() - { - return buffer_; - } -}; - -class FileSystemForJUnitTestOutputTests -{ - FileForJUnitOutputTests* firstFile_; - -public: - FileSystemForJUnitTestOutputTests() : firstFile_(0) {} - ~FileSystemForJUnitTestOutputTests() { clear(); } - - void clear(void) - { - while (firstFile_) { - FileForJUnitOutputTests* fileToBeDeleted = firstFile_; - firstFile_ = firstFile_->nextFile(); - delete fileToBeDeleted; - } - } - - FileForJUnitOutputTests* openFile(const SimpleString& filename) - { - firstFile_ = new FileForJUnitOutputTests(filename, firstFile_); - return firstFile_; - } - - int amountOfFiles() { - int totalAmountOfFiles = 0; - for (FileForJUnitOutputTests* current = firstFile_; current != NULL; current = current->nextFile()) - totalAmountOfFiles++; - return totalAmountOfFiles; - } - - bool fileExists(const char* filename) - { - FileForJUnitOutputTests *searchedFile = file(filename); - return (searchedFile != NULL); - } - - FileForJUnitOutputTests* file(const char* filename) - { - for (FileForJUnitOutputTests* current = firstFile_; current != NULL; current = current->nextFile()) - if (current->name() == filename) - return current; - return NULL; - } -}; - -extern "C" { - static long millisTime = 0; - static const char* theTime = ""; - - static long MockGetPlatformSpecificTimeInMillis() - { - return millisTime; - } - - static const char* MockGetPlatformSpecificTimeString() - { - return theTime; - } -} - -class JUnitTestOutputTestRunner -{ - TestResult result_; - - const char* currentGroupName_; - UtestShell* currentTest_; - bool firstTestInGroup_; - int timeTheTestTakes_; - TestFailure* testFailure_; - -public: - - JUnitTestOutputTestRunner(TestResult result) : - result_(result), currentGroupName_(0), currentTest_(0), firstTestInGroup_(true), timeTheTestTakes_(0), testFailure_(0) - { - millisTime = 0; - theTime = "1978-10-03T00:00:00"; - - UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); - UT_PTR_SET(GetPlatformSpecificTimeString, MockGetPlatformSpecificTimeString); - } - - JUnitTestOutputTestRunner& start() - { - result_.testsStarted(); - return *this; - } - - JUnitTestOutputTestRunner& end() - { - endOfPreviousTestGroup(); - delete currentTest_; - result_.testsEnded(); - return *this; - } - - void endOfPreviousTestGroup() - { - runPreviousTest(); - if (currentTest_) { - result_.currentGroupEnded(currentTest_); - firstTestInGroup_ = true; - } - - currentGroupName_ = 0; - } - - JUnitTestOutputTestRunner& withGroup(const char* groupName) - { - runPreviousTest(); - endOfPreviousTestGroup(); - - currentGroupName_ = groupName; - return *this; - } - - JUnitTestOutputTestRunner& withTest(const char* testName) - { - runPreviousTest(); - delete currentTest_; - - currentTest_ = new UtestShell(currentGroupName_, testName, "file", 1); - return *this; - } - - JUnitTestOutputTestRunner& withIgnoredTest(const char* testName) - { - runPreviousTest(); - delete currentTest_; - - currentTest_ = new IgnoredUtestShell(currentGroupName_, testName, "file", 1); - return *this; - } - - void runPreviousTest() - { - if (currentTest_ == 0) return; - - if (firstTestInGroup_) { - result_.currentGroupStarted(currentTest_); - firstTestInGroup_ = false; - } - result_.currentTestStarted(currentTest_); - - millisTime += timeTheTestTakes_; - - if (testFailure_) { - result_.addFailure(*testFailure_); - delete testFailure_; - testFailure_ = 0; - } - - result_.currentTestEnded(currentTest_); - } - - JUnitTestOutputTestRunner& thatTakes(int timeElapsed) - { - timeTheTestTakes_ = timeElapsed; - return *this; - } - - JUnitTestOutputTestRunner& seconds() - { - return *this; - } - - JUnitTestOutputTestRunner& thatFails(const char* message, const char* file, int line) - { - testFailure_ = new TestFailure( currentTest_, file, line, message); - return *this; - } - - JUnitTestOutputTestRunner& atTime(const char* newTime) - { - theTime = newTime; - return *this; - } -}; - -extern "C" { - static FileSystemForJUnitTestOutputTests fileSystem; - - static PlatformSpecificFile mockFOpen(const char* filename, const char*) - { - return fileSystem.openFile(filename); - } - - static void mockFPuts(const char* str, PlatformSpecificFile file) - { - ((FileForJUnitOutputTests*)file)->write(str); - } - - static void mockFClose(PlatformSpecificFile file) - { - ((FileForJUnitOutputTests*)file)->close(); - } -} - -TEST_GROUP(JUnitOutputTest) -{ - JUnitTestOutput *junitOutput; - TestResult *result; - JUnitTestOutputTestRunner *testCaseRunner; - FileForJUnitOutputTests* outputFile; - - void setup() - { - UT_PTR_SET(PlatformSpecificFOpen, mockFOpen); - UT_PTR_SET(PlatformSpecificFPuts, mockFPuts); - UT_PTR_SET(PlatformSpecificFClose, mockFClose); - junitOutput = new JUnitTestOutput(); - result = new TestResult(*junitOutput); - testCaseRunner = new JUnitTestOutputTestRunner(*result); - } - - void teardown() - { - delete testCaseRunner; - delete result; - delete junitOutput; - fileSystem.clear(); - } -}; - -TEST(JUnitOutputTest, withOneTestGroupAndOneTestOnlyWriteToOneFile) -{ - testCaseRunner->start() - .withGroup("groupname").withTest("testname") - .end(); - - LONGS_EQUAL(1, fileSystem.amountOfFiles()); - CHECK(fileSystem.fileExists("cpputest_groupname.xml")); -} - -TEST(JUnitOutputTest, withOneTestGroupAndOneTestOutputsValidXMLFiles) -{ - testCaseRunner->start() - .withGroup("groupname").withTest("testname") - .end(); - - outputFile = fileSystem.file("cpputest_groupname.xml"); - STRCMP_EQUAL("\n", outputFile->line(1)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndOneTestoutputsTestSuiteStartAndEndBlocks) -{ - testCaseRunner->start() - .withGroup("groupname").withTest("testname") - .end(); - - outputFile = fileSystem.file("cpputest_groupname.xml"); - STRCMP_EQUAL("\n", outputFile->line(2)); - STRCMP_EQUAL("", outputFile->lineFromTheBack(1)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndOneTestFileShouldContainAnEmptyPropertiesBlock) -{ - testCaseRunner->start() - .withGroup("groupname").withTest("testname") - .end(); - - outputFile = fileSystem.file("cpputest_groupname.xml"); - STRCMP_EQUAL("\n", outputFile->line(3)); - STRCMP_EQUAL("\n", outputFile->line(4)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndOneTestFileShouldContainAnEmptyStdoutBlock) -{ - testCaseRunner->start() - .withGroup("groupname").withTest("testname") - .end(); - - outputFile = fileSystem.file("cpputest_groupname.xml"); - STRCMP_EQUAL("\n", outputFile->lineFromTheBack(3)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndOneTestFileShouldContainAnEmptyStderrBlock) -{ - testCaseRunner->start() - .withGroup("groupname").withTest("testname") - .end(); - - outputFile = fileSystem.file("cpputest_groupname.xml"); - STRCMP_EQUAL("\n", outputFile->lineFromTheBack(2)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndOneTestFileShouldContainsATestCaseBlock) -{ - testCaseRunner->start() - .withGroup("groupname").withTest("testname") - .end(); - - outputFile = fileSystem.file("cpputest_groupname.xml"); - - STRCMP_EQUAL("\n", outputFile->line(5)); - STRCMP_EQUAL("\n", outputFile->line(6)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndTwoTestCasesCreateCorrectTestgroupBlockAndCorrectTestCaseBlock) -{ - testCaseRunner->start() - .withGroup("twoTestsGroup").withTest("firstTestName").withTest("secondTestName") - .end(); - - outputFile = fileSystem.file("cpputest_twoTestsGroup.xml"); - - STRCMP_EQUAL("\n", outputFile->line(2)); - STRCMP_EQUAL("\n", outputFile->line(5)); - STRCMP_EQUAL("\n", outputFile->line(6)); - STRCMP_EQUAL("\n", outputFile->line(7)); - STRCMP_EQUAL("\n", outputFile->line(8)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndTimeHasElapsedAndTimestampChanged) -{ - testCaseRunner->start().atTime("2013-07-04T22:28:00") - .withGroup("timeGroup").withTest("Dummy").thatTakes(10).seconds() - .end(); - - outputFile = fileSystem.file("cpputest_timeGroup.xml"); - - STRCMP_EQUAL("\n", outputFile->line(2)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndMultipleTestCasesWithElapsedTime) -{ - testCaseRunner->start() - .withGroup("twoTestsGroup") - .withTest("firstTestName").thatTakes(10).seconds() - .withTest("secondTestName").thatTakes(50).seconds() - .end(); - - outputFile = fileSystem.file("cpputest_twoTestsGroup.xml"); - STRCMP_EQUAL("\n", outputFile->line(2)); - STRCMP_EQUAL("\n", outputFile->line(5)); - STRCMP_EQUAL("\n", outputFile->line(6)); - STRCMP_EQUAL("\n", outputFile->line(7)); - STRCMP_EQUAL("\n", outputFile->line(8)); -} - -TEST(JUnitOutputTest, withOneTestGroupAndOneFailingTest) -{ - testCaseRunner->start() - .withGroup("testGroupWithFailingTest") - .withTest("FailingTestName").thatFails("Test failed", "thisfile", 10) - .end(); - - outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); - STRCMP_EQUAL("\n", outputFile->line(2)); - STRCMP_EQUAL("\n", outputFile->line(5)); - STRCMP_EQUAL("\n", outputFile->line(6)); - STRCMP_EQUAL("\n", outputFile->line(7)); - STRCMP_EQUAL("\n", outputFile->line(8)); -} - -TEST(JUnitOutputTest, withTwoTestGroupAndOneFailingTest) -{ - testCaseRunner->start() - .withGroup("testGroupWithFailingTest") - .withTest("FirstTest") - .withTest("FailingTestName").thatFails("Test failed", "thisfile", 10) - .end(); - - outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); - - STRCMP_EQUAL("\n", outputFile->line(2)); - STRCMP_EQUAL("\n", outputFile->line(7)); - STRCMP_EQUAL("\n", outputFile->line(8)); -} - -TEST(JUnitOutputTest, testFailureWithLessThanAndGreaterThanInsideIt) -{ - testCaseRunner->start() - .withGroup("testGroupWithFailingTest") - .withTest("FailingTestName").thatFails("Test ", "thisfile", 10) - .end(); - - outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); - - STRCMP_EQUAL("\n", outputFile->line(6)); -} - -TEST(JUnitOutputTest, testFailureWithQuotesInIt) -{ - testCaseRunner->start() - .withGroup("testGroupWithFailingTest") - .withTest("FailingTestName").thatFails("Test \"failed\"", "thisfile", 10) - .end(); - - outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); - - STRCMP_EQUAL("\n", outputFile->line(6)); -} - -TEST(JUnitOutputTest, testFailureWithNewlineInIt) -{ - testCaseRunner->start() - .withGroup("testGroupWithFailingTest") - .withTest("FailingTestName").thatFails("Test \nfailed", "thisfile", 10) - .end(); - - outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); - - STRCMP_EQUAL("\n", outputFile->line(6)); -} - -TEST(JUnitOutputTest, testFailureWithDifferentFileAndLine) -{ - testCaseRunner->start() - .withGroup("testGroupWithFailingTest") - .withTest("FailingTestName").thatFails("Test failed", "importantFile", 999) - .end(); - - outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); - - STRCMP_EQUAL("\n", outputFile->line(6)); -} - -TEST(JUnitOutputTest, testFailureWithAmpersands) -{ - testCaseRunner->start() - .withGroup("testGroupWithFailingTest") - .withTest("FailingTestName").thatFails("&object1 != &object2", "importantFile", 999) - .end(); - - outputFile = fileSystem.file("cpputest_testGroupWithFailingTest.xml"); - - STRCMP_EQUAL("\n", outputFile->line(6)); -} - -TEST(JUnitOutputTest, aCoupleOfTestFailures) -{ - testCaseRunner->start() - .withGroup("testGroup") - .withTest("passingOne") - .withTest("FailingTest").thatFails("Failure", "file", 99) - .withTest("passingTwo") - .withTest("passingThree") - .withTest("AnotherFailingTest").thatFails("otherFailure", "anotherFile", 10) - .end(); - - outputFile = fileSystem.file("cpputest_testGroup.xml"); - - STRCMP_EQUAL("\n", outputFile->line(8)); - STRCMP_EQUAL("\n", outputFile->line(16)); -} - -TEST(JUnitOutputTest, testFailuresInSeparateGroups) -{ - testCaseRunner->start() - .withGroup("testGroup") - .withTest("passingOne") - .withTest("FailingTest").thatFails("Failure", "file", 99) - .withGroup("AnotherGroup") - .withTest("AnotherFailingTest").thatFails("otherFailure", "anotherFile", 10) - .end(); - - outputFile = fileSystem.file("cpputest_testGroup.xml"); - - STRCMP_EQUAL("\n", outputFile->line(8)); - - outputFile = fileSystem.file("cpputest_AnotherGroup.xml"); - STRCMP_EQUAL("\n", outputFile->line(8)); -} - -TEST(JUnitOutputTest, twoTestGroupsWriteToTwoDifferentFiles) -{ - testCaseRunner->start() - .withGroup("firstTestGroup") - .withTest("testName") - .withGroup("secondTestGroup") - .withTest("testName") - .end(); - - CHECK(fileSystem.file("cpputest_firstTestGroup.xml")); - CHECK(fileSystem.file("cpputest_secondTestGroup.xml")); - -} - -TEST(JUnitOutputTest, testGroupWithWeirdName) -{ - STRCMP_EQUAL("cpputest_group_weird_name.xml", junitOutput->createFileName("group/weird/name").asCharString()); -} - -TEST(JUnitOutputTest, TestCaseBlockWithAPackageName) -{ - junitOutput->setPackageName("packagename"); - testCaseRunner->start() - .withGroup("groupname").withTest("testname") - .end(); - - outputFile = fileSystem.file("cpputest_groupname.xml"); - - STRCMP_EQUAL("\n", outputFile->line(5)); - STRCMP_EQUAL("\n", outputFile->line(6)); -} - -TEST(JUnitOutputTest, TestCaseBlockForIgnoredTest) -{ - junitOutput->setPackageName("packagename"); - testCaseRunner->start() - .withGroup("groupname").withIgnoredTest("testname") - .end(); - - outputFile = fileSystem.file("cpputest_groupname.xml"); - - STRCMP_EQUAL("\n", outputFile->line(5)); - STRCMP_EQUAL("\n", outputFile->line(6)); - STRCMP_EQUAL("\n", outputFile->line(7)); -} diff -Nru cpputest-3.8/tests/MemoryLeakDetectorTest.cpp cpputest-4.0/tests/MemoryLeakDetectorTest.cpp --- cpputest-3.8/tests/MemoryLeakDetectorTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/MemoryLeakDetectorTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,649 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/MemoryLeakDetector.h" -#include "CppUTest/TestMemoryAllocator.h" -#include "CppUTest/PlatformSpecificFunctions.h" - -class MemoryLeakFailureForTest: public MemoryLeakFailure -{ -public: - virtual ~MemoryLeakFailureForTest() - { - } - - virtual void fail(char* fail_string) - { - *message = fail_string; - } - - SimpleString *message; -}; - -class NewAllocatorForMemoryLeakDetectionTest: public TestMemoryAllocator -{ -public: - NewAllocatorForMemoryLeakDetectionTest() : - TestMemoryAllocator("Standard New Allocator", "new", "delete"), - alloc_called(0), free_called(0) - { - } - - int alloc_called; - int free_called; - char* alloc_memory(size_t size, const char*, int) - { - alloc_called++; - return TestMemoryAllocator::alloc_memory(size, "file", 1); - } - void free_memory(char* memory, const char* file, int line) - { - free_called++; - TestMemoryAllocator::free_memory(memory, file, line); - } -}; - -class AllocatorForMemoryLeakDetectionTest: public TestMemoryAllocator -{ -public: - AllocatorForMemoryLeakDetectionTest() : - alloc_called(0), free_called(0), allocMemoryLeakNodeCalled(0), freeMemoryLeakNodeCalled(0) - { - } - - int alloc_called; - int free_called; - int allocMemoryLeakNodeCalled; - int freeMemoryLeakNodeCalled; - - char* alloc_memory(size_t size, const char* file, int line) - { - alloc_called++; - return TestMemoryAllocator::alloc_memory(size, file, line); - } - void free_memory(char* memory, const char* file, int line) - { - free_called++; - TestMemoryAllocator::free_memory(memory, file, line); - } - - char* allocMemoryLeakNode(size_t size) - { - allocMemoryLeakNodeCalled++; - return TestMemoryAllocator::alloc_memory(size, __FILE__, __LINE__); - } - - void freeMemoryLeakNode(char* memory) - { - freeMemoryLeakNodeCalled++; - TestMemoryAllocator::free_memory(memory, __FILE__, __LINE__); - } -}; - -TEST_GROUP(MemoryLeakDetectorTest) -{ - MemoryLeakDetector* detector; - MemoryLeakFailureForTest *reporter; - AllocatorForMemoryLeakDetectionTest* testAllocator; - - void setup() - { - reporter = new MemoryLeakFailureForTest; - detector = new MemoryLeakDetector(reporter); - testAllocator = new AllocatorForMemoryLeakDetectionTest; - detector->enable(); - detector->startChecking(); - reporter->message = new SimpleString(); - } - void teardown() - { - delete reporter->message; - delete detector; - delete reporter; - delete testAllocator; - } -}; - -TEST(MemoryLeakDetectorTest, OneLeak) -{ - char* mem = detector->allocMemory(testAllocator, 3); - detector->stopChecking(); - SimpleString output = detector->report(mem_leak_period_checking); - STRCMP_CONTAINS("Memory leak(s) found", output.asCharString()); - STRCMP_CONTAINS("size: 3", output.asCharString()); - STRCMP_CONTAINS("alloc", output.asCharString()); - STRCMP_CONTAINS(StringFromFormat("%p", (void*) mem).asCharString(), output.asCharString()); - STRCMP_CONTAINS("Total number of leaks", output.asCharString()); - PlatformSpecificFree(mem); - LONGS_EQUAL(1, testAllocator->alloc_called); - LONGS_EQUAL(0, testAllocator->free_called); -} - -TEST(MemoryLeakDetectorTest, sequenceNumbersOfMemoryLeaks) -{ - char* mem = detector->allocMemory(defaultNewAllocator(), 1); - char* mem2 = detector->allocMemory(defaultNewAllocator(), 2); - char* mem3 = detector->allocMemory(defaultNewAllocator(), 3); - SimpleString output = detector->report(mem_leak_period_checking); - - STRCMP_CONTAINS("Alloc num (1)", output.asCharString()); - STRCMP_CONTAINS("Alloc num (2)", output.asCharString()); - STRCMP_CONTAINS("Alloc num (3)", output.asCharString()); - - PlatformSpecificFree(mem); - PlatformSpecificFree(mem2); - PlatformSpecificFree(mem3); -} - -TEST(MemoryLeakDetectorTest, memoryDumpOutput) -{ - char* mem = detector->allocMemory(defaultNewAllocator(), 6); - SimpleString::StrNCpy(mem, "test1", 6); - SimpleString output = detector->report(mem_leak_period_checking); - - STRCMP_CONTAINS("Alloc num (1)", output.asCharString()); - STRCMP_CONTAINS("Leak size: 6 Allocated at", output.asCharString()); - STRCMP_CONTAINS("Content:", output.asCharString()); - STRCMP_CONTAINS("0000: 74 65 73 74 31 00 |test1.|", output.asCharString()); - - PlatformSpecificFree(mem); -} - -TEST(MemoryLeakDetectorTest, OneHundredLeaks) -{ - const int amount_alloc = 100; - char *mem[amount_alloc]; - for (int i = 0; i < amount_alloc; i++) - mem[i] = detector->allocMemory(defaultMallocAllocator(), 3); - detector->stopChecking(); - - SimpleString output = detector->report(mem_leak_period_checking); - - STRCMP_CONTAINS("Memory leak(s) found", output.asCharString()); - STRCMP_CONTAINS("Total number of leaks", output.asCharString()); - STRCMP_CONTAINS("Memory leak reports about malloc and free", output.asCharString()); - - //don't reuse i for vc6 compatibility - for (int j = 0; j < amount_alloc; j++) - PlatformSpecificFree(mem[j]); -} - -TEST(MemoryLeakDetectorTest, OneLeakOutsideCheckingPeriod) -{ - detector->stopChecking(); - char* mem = detector->allocMemory(defaultNewAllocator(), 4); - SimpleString output = detector->report(mem_leak_period_all); - CHECK(output.contains("Memory leak(s) found")); - CHECK(output.contains("size: 4")); - CHECK(output.contains("new")); - CHECK(output.contains("Total number of leaks")); - PlatformSpecificFree(mem); -} - -TEST(MemoryLeakDetectorTest, NoLeaksWhatsoever) -{ - detector->stopChecking(); - STRCMP_CONTAINS("No memory leaks", detector->report(mem_leak_period_checking)); - STRCMP_CONTAINS("No memory leaks", detector->report(mem_leak_period_all)); -} - -TEST(MemoryLeakDetectorTest, TwoLeaksUsingOperatorNew) -{ - char* mem = detector->allocMemory(defaultNewAllocator(), 4); - char* mem2 = detector->allocMemory(defaultNewAllocator(), 8); - detector->stopChecking(); - SimpleString output = detector->report(mem_leak_period_checking); - LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_checking)); - CHECK(output.contains("size: 8")); - CHECK(output.contains("size: 4")); - PlatformSpecificFree(mem); - PlatformSpecificFree(mem2); -} - -TEST(MemoryLeakDetectorTest, OneAllocButNoLeak) -{ - char* mem = detector->allocMemory(testAllocator, 4); - detector->deallocMemory(testAllocator, mem); - detector->stopChecking(); - STRCMP_CONTAINS("No memory leaks", detector->report(mem_leak_period_checking)); - LONGS_EQUAL(1, testAllocator->alloc_called); - LONGS_EQUAL(1, testAllocator->free_called); -} - -TEST(MemoryLeakDetectorTest, TwoAllocOneFreeOneLeak) -{ - char* mem = detector->allocMemory(testAllocator, 4); - char* mem2 = detector->allocMemory(testAllocator, 12); - detector->deallocMemory(testAllocator, mem); - detector->stopChecking(); - SimpleString output = detector->report(mem_leak_period_checking); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); - CHECK(output.contains("Leak size: 12")); - CHECK(!output.contains("Leak size: 4")); - PlatformSpecificFree(mem2); - LONGS_EQUAL(2, testAllocator->alloc_called); - LONGS_EQUAL(1, testAllocator->free_called); -} - -TEST(MemoryLeakDetectorTest, TwoAllocOneFreeOneLeakReverseOrder) -{ - char* mem = detector->allocMemory(defaultNewAllocator(), 4); - char* mem2 = detector->allocMemory(defaultNewAllocator(), 12); - detector->deallocMemory(defaultNewAllocator(), mem2); - detector->stopChecking(); - SimpleString output = detector->report(mem_leak_period_checking); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); - CHECK(!output.contains("size: 12")); - CHECK(output.contains("size: 4")); - PlatformSpecificFree(mem); -} - -TEST(MemoryLeakDetectorTest, DeleteNonAlocatedMemory) -{ - char a; - char* pa = &a; - detector->deallocMemory(defaultMallocAllocator(), pa, "FREE.c", 100); - detector->stopChecking(); - CHECK(reporter->message->contains("Deallocating non-allocated memory")); - CHECK(reporter->message->contains(" allocated at file: line: 0 size: 0 type: unknown")); - CHECK(reporter->message->contains(" deallocated at file: FREE.c line: 100 type: free")); -} - -TEST(MemoryLeakDetectorTest, IgnoreMemoryAllocatedOutsideCheckingPeriod) -{ - detector->stopChecking(); - char* mem = detector->allocMemory(defaultNewAllocator(), 4); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); - detector->deallocMemory(defaultNewAllocator(), mem); -} - -TEST(MemoryLeakDetectorTest, IgnoreMemoryAllocatedOutsideCheckingPeriodComplicatedCase) -{ - char* mem = detector->allocMemory(defaultNewAllocator(), 4); - detector->stopChecking(); - - char* mem2 = detector->allocMemory(defaultNewAllocator(), 8); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); - detector->clearAllAccounting(mem_leak_period_checking); - PlatformSpecificFree(mem); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); - - detector->startChecking(); - char* mem3 = detector->allocMemory(defaultNewAllocator(), 4); - detector->stopChecking(); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); - LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_all)); - - detector->clearAllAccounting(mem_leak_period_checking); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); - - detector->clearAllAccounting(mem_leak_period_all); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); - PlatformSpecificFree(mem2); - PlatformSpecificFree(mem3); -} - -TEST(MemoryLeakDetectorTest, OneLeakUsingOperatorNewWithFileLine) -{ - char* mem = detector->allocMemory(defaultNewAllocator(), 4, "file.cpp", 1234); - detector->stopChecking(); - SimpleString output = detector->report(mem_leak_period_checking); - CHECK(output.contains("file.cpp")); - CHECK(output.contains("1234")); - PlatformSpecificFree(mem); -} - -TEST(MemoryLeakDetectorTest, OneAllocAndFreeUsingArrayNew) -{ - char* mem = detector->allocMemory(defaultNewArrayAllocator(), 10, "file.cpp", 1234); - char* mem2 = detector->allocMemory(defaultNewArrayAllocator(), 12); - LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_all)); - SimpleString output = detector->report(mem_leak_period_checking); - CHECK(output.contains("new []")); - detector->deallocMemory(defaultNewArrayAllocator(), mem); - detector->deallocMemory(defaultNewArrayAllocator(), mem2); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); - detector->stopChecking(); -} - -TEST(MemoryLeakDetectorTest, OneAllocAndFree) -{ - char* mem = detector->allocMemory(defaultMallocAllocator(), 10, "file.cpp", 1234); - char* mem2 = detector->allocMemory(defaultMallocAllocator(), 12); - LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_checking)); - SimpleString output = detector->report(mem_leak_period_checking); - CHECK(output.contains("malloc")); - detector->deallocMemory(defaultMallocAllocator(), mem); - detector->deallocMemory(defaultMallocAllocator(), mem2, "file.c", 5678); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); - detector->stopChecking(); -} - -TEST(MemoryLeakDetectorTest, OneRealloc) -{ - char* mem1 = detector->allocMemory(testAllocator, 10, "file.cpp", 1234, true); - - char* mem2 = detector->reallocMemory(testAllocator, mem1, 1000, "other.cpp", 5678, true); - - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); - SimpleString output = detector->report(mem_leak_period_checking); - CHECK(output.contains("other.cpp")); - - detector->deallocMemory(testAllocator, mem2, true); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_all)); - detector->stopChecking(); - LONGS_EQUAL(1, testAllocator->alloc_called); - LONGS_EQUAL(1, testAllocator->free_called); - LONGS_EQUAL(2, testAllocator->allocMemoryLeakNodeCalled); - LONGS_EQUAL(2, testAllocator->freeMemoryLeakNodeCalled); -} - -TEST(MemoryLeakDetectorTest, ReallocNonAllocatedMemory) -{ - char mem1; - char* mem2 = detector->reallocMemory(testAllocator, &mem1, 5, "other.cpp", 13, true); - detector->deallocMemory(testAllocator, mem2, true); - detector->stopChecking(); - CHECK(reporter->message->contains("Deallocating non-allocated memory\n")); - CHECK(reporter->message->contains(" deallocated at file: other.cpp line: 13")); -} - -TEST(MemoryLeakDetectorTest, AllocOneTypeFreeAnotherType) -{ - char* mem = detector->allocMemory(defaultNewArrayAllocator(), 100, "ALLOC.c", 10); - detector->deallocMemory(defaultMallocAllocator(), mem, "FREE.c", 100); - detector->stopChecking(); - CHECK(reporter->message->contains("Allocation/deallocation type mismatch")); - CHECK(reporter->message->contains(" allocated at file: ALLOC.c line: 10 size: 100 type: new []")); - CHECK(reporter->message->contains(" deallocated at file: FREE.c line: 100 type: free")); -} - -TEST(MemoryLeakDetectorTest, AllocOneTypeFreeAnotherTypeWithCheckingDisabled) -{ - detector->disableAllocationTypeChecking(); - char* mem = detector->allocMemory(defaultNewArrayAllocator(), 100, "ALLOC.c", 10); - detector->deallocMemory(defaultNewAllocator(), mem, "FREE.c", 100); - detector->stopChecking(); - STRCMP_EQUAL("", reporter->message->asCharString()); - detector->enableAllocationTypeChecking(); -} - -TEST(MemoryLeakDetectorTest, mallocLeakGivesAdditionalWarning) -{ - char* mem = detector->allocMemory(defaultMallocAllocator(), 100, "ALLOC.c", 10); - detector->stopChecking(); - SimpleString output = detector->report(mem_leak_period_checking); - STRCMP_CONTAINS("Memory leak reports about malloc and free can be caused by allocating using the cpputest version of malloc", output.asCharString()); - PlatformSpecificFree(mem); -} - -TEST(MemoryLeakDetectorTest, newLeakDoesNotGiveAdditionalWarning) -{ - char* mem = detector->allocMemory(defaultNewAllocator(), 100, "ALLOC.c", 10); - detector->stopChecking(); - SimpleString output = detector->report(mem_leak_period_checking); - CHECK(! output.contains("Memory leak reports about malloc and free")); - PlatformSpecificFree(mem); -} - -TEST(MemoryLeakDetectorTest, MarkCheckingPeriodLeaksAsNonCheckingPeriod) -{ - char* mem = detector->allocMemory(defaultNewArrayAllocator(), 100); - char* mem2 = detector->allocMemory(defaultNewArrayAllocator(), 100); - detector->stopChecking(); - LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_checking)); - LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_all)); - detector->markCheckingPeriodLeaksAsNonCheckingPeriod(); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); - LONGS_EQUAL(2, detector->totalMemoryLeaks(mem_leak_period_all)); - PlatformSpecificFree(mem); - PlatformSpecificFree(mem2); -} - -TEST(MemoryLeakDetectorTest, memoryCorruption) -{ - char* mem = detector->allocMemory(defaultMallocAllocator(), 10, "ALLOC.c", 10); - mem[10] = 'O'; - mem[11] = 'H'; - detector->deallocMemory(defaultMallocAllocator(), mem, "FREE.c", 100); - detector->stopChecking(); - CHECK(reporter->message->contains("Memory corruption")); - CHECK(reporter->message->contains(" allocated at file: ALLOC.c line: 10 size: 10 type: malloc")); - CHECK(reporter->message->contains(" deallocated at file: FREE.c line: 100 type: free")); -} - -TEST(MemoryLeakDetectorTest, safelyDeleteNULL) -{ - detector->deallocMemory(defaultNewAllocator(), 0); - STRCMP_EQUAL("", reporter->message->asCharString()); -} - -TEST(MemoryLeakDetectorTest, periodDisabled) -{ - detector->disable(); - char* mem = detector->allocMemory(defaultMallocAllocator(), 2); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_disabled)); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_enabled)); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); - detector->deallocMemory(defaultMallocAllocator(), mem); -} - -TEST(MemoryLeakDetectorTest, periodEnabled) -{ - detector->enable(); - char* mem = detector->allocMemory(defaultMallocAllocator(), 2); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_disabled)); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_enabled)); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_checking)); - detector->deallocMemory(defaultMallocAllocator(), mem); -} - -TEST(MemoryLeakDetectorTest, periodChecking) -{ - char* mem = detector->allocMemory(defaultMallocAllocator(), 2); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_all)); - LONGS_EQUAL(0, detector->totalMemoryLeaks(mem_leak_period_disabled)); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_enabled)); - LONGS_EQUAL(1, detector->totalMemoryLeaks(mem_leak_period_checking)); - detector->deallocMemory(defaultMallocAllocator(), mem); -} - -TEST(MemoryLeakDetectorTest, allocateWithANullAllocatorCausesNoProblems) -{ - char* mem = detector->allocMemory(NullUnknownAllocator::defaultAllocator(), 2); - detector->deallocMemory(NullUnknownAllocator::defaultAllocator(), mem); -} - -TEST(MemoryLeakDetectorTest, invalidateMemory) -{ - unsigned char* mem = (unsigned char*)detector->allocMemory(defaultMallocAllocator(), 2); - - detector->invalidateMemory((char*)mem); - CHECK(mem[0] == 0xCD); - CHECK(mem[1] == 0xCD); - detector->deallocMemory(defaultMallocAllocator(), mem); -} - -TEST(MemoryLeakDetectorTest, invalidateMemoryNULLShouldWork) -{ - detector->invalidateMemory(NULL); -} - -TEST_GROUP(MemoryLeakDetectorListTest) -{ -}; - -TEST(MemoryLeakDetectorListTest, clearAllAccountingIsWorkingProperly) -{ - MemoryLeakDetectorList listForTesting; - MemoryLeakDetectorNode node1, node2, node3; - node3.period_ = mem_leak_period_disabled; - listForTesting.addNewNode(&node1); - listForTesting.addNewNode(&node2); - listForTesting.addNewNode(&node3); - - listForTesting.clearAllAccounting(mem_leak_period_enabled); - - CHECK(NULL == listForTesting.getFirstLeak(mem_leak_period_enabled)); - CHECK(&node3 == listForTesting.getFirstLeak(mem_leak_period_disabled)); -} - -TEST_GROUP(SimpleStringBuffer) -{ -}; - -TEST(SimpleStringBuffer, initialStringIsEmpty) -{ - SimpleStringBuffer buffer; - STRCMP_EQUAL("", buffer.toString()); -} - -TEST(SimpleStringBuffer, simpleTest) -{ - SimpleStringBuffer buffer; - buffer.add("Hello"); - buffer.add(" World"); - STRCMP_EQUAL("Hello World", buffer.toString()); -} - -TEST(SimpleStringBuffer, writePastLimit) -{ - SimpleStringBuffer buffer; - for (int i = 0; i < SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN * 2; i++) - buffer.add("h"); - SimpleString str("h", SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN-1); - STRCMP_EQUAL(str.asCharString(), buffer.toString()); -} - -TEST(SimpleStringBuffer, setWriteLimit) -{ - SimpleStringBuffer buffer; - buffer.setWriteLimit(10); - for (int i = 0; i < SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN ; i++) - buffer.add("h"); - SimpleString str("h", 10); - STRCMP_EQUAL(str.asCharString(), buffer.toString()); -} - -TEST(SimpleStringBuffer, setWriteLimitTooHighIsIgnored) -{ - SimpleStringBuffer buffer; - buffer.setWriteLimit(SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN+10); - for (int i = 0; i < SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN+10; i++) - buffer.add("h"); - SimpleString str("h", SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN-1); - STRCMP_EQUAL(str.asCharString(), buffer.toString()); -} - -TEST(SimpleStringBuffer, resetWriteLimit) -{ - SimpleStringBuffer buffer; - buffer.setWriteLimit(10); - for (int i = 0; i < SimpleStringBuffer::SIMPLE_STRING_BUFFER_LEN ; i++) - buffer.add("h"); - buffer.resetWriteLimit(); - buffer.add("%s", SimpleString("h", 10).asCharString()); - - SimpleString str("h", 20); - STRCMP_EQUAL(str.asCharString(), buffer.toString()); -} - -TEST(SimpleStringBuffer, addMemoryDumpOneLinePlusOnePartial) -{ - SimpleStringBuffer buffer; - buffer.addMemoryDump("deadbeefdeadbeefhopsxx", 22); - STRCMP_EQUAL(" 0000: 64 65 61 64 62 65 65 66 64 65 61 64 62 65 65 66 |deadbeefdeadbeef|\n" - " 0010: 68 6f 70 73 78 78 |hopsxx|\n", - buffer.toString()); -} - -TEST(SimpleStringBuffer, addMemoryDumpNonPrintable) -{ - SimpleStringBuffer buffer; - // Ensure we test edge cases - NUL, 0x1F, 0x7F, 0xFF - buffer.addMemoryDump("\x15\x7f\xff\x00\x1ftdd", 8); - STRCMP_EQUAL(" 0000: 15 7f ff 00 1f 74 64 64 |.....tdd|\n", - buffer.toString()); -} - -TEST(SimpleStringBuffer, addMemoryDumpOneLine) -{ - SimpleStringBuffer buffer; - buffer.addMemoryDump("deadbeefdeadbeef", 16); - STRCMP_EQUAL(" 0000: 64 65 61 64 62 65 65 66 64 65 61 64 62 65 65 66 |deadbeefdeadbeef|\n", - buffer.toString()); -} - -TEST(SimpleStringBuffer, addMemoryDumpOneHalfLine) -{ - SimpleStringBuffer buffer; - buffer.addMemoryDump("deadbeef", 8); - STRCMP_EQUAL(" 0000: 64 65 61 64 62 65 65 66 |deadbeef|\n", - buffer.toString()); -} - -TEST(SimpleStringBuffer, addMemoryDumpOneByte) -{ - SimpleStringBuffer buffer; - buffer.addMemoryDump("Z", 1); - STRCMP_EQUAL(" 0000: 5a |Z|\n", - buffer.toString()); -} - -TEST(SimpleStringBuffer, addMemoryDumpZeroBytes) -{ - SimpleStringBuffer buffer; - buffer.addMemoryDump("", 0); - STRCMP_EQUAL("", buffer.toString()); -} - -TEST_GROUP(ReallocBugReported) -{ - MemoryLeakFailureForTest reporter; -}; - -TEST(ReallocBugReported, CanSafelyDoAReallocWithANewAllocator) -{ - MemoryLeakDetector detector(&reporter); - char* mem = detector.allocMemory(getCurrentNewAllocator(), 5, "file", 1); - mem = detector.reallocMemory(getCurrentNewAllocator(), mem, 19, "file", 1); - detector.deallocMemory(getCurrentNewAllocator(), mem); -} - -TEST(ReallocBugReported, CanSafelyDoAReallocWithAMallocAllocator) -{ - MemoryLeakDetector detector(&reporter); - char* mem = detector.allocMemory(getCurrentMallocAllocator(), 5, "file", 1, true); - mem = detector.reallocMemory(getCurrentMallocAllocator(), mem, 19, "file", 1, true); - detector.deallocMemory(getCurrentMallocAllocator(), mem, true); -} diff -Nru cpputest-3.8/tests/MemoryLeakWarningTest.cpp cpputest-4.0/tests/MemoryLeakWarningTest.cpp --- cpputest-3.8/tests/MemoryLeakWarningTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/MemoryLeakWarningTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,489 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestRegistry.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/MemoryLeakWarningPlugin.h" -#include "CppUTest/MemoryLeakDetector.h" -#include "CppUTest/TestMemoryAllocator.h" -#include "CppUTest/TestTestingFixture.h" -#include "CppUTest/TestHarness_c.h" -#include "CppUTest/SimpleMutex.h" - -static char* leak1; -static long* leak2; - -class DummyReporter: public MemoryLeakFailure -{ -public: - virtual ~DummyReporter() - { - } - virtual void fail(char* /*fail_string*/) - { - } -}; - -static MemoryLeakDetector* detector; -static MemoryLeakWarningPlugin* memPlugin; -static DummyReporter dummy; -static TestMemoryAllocator* allocator; - -TEST_GROUP(MemoryLeakWarningLocalDetectorTest) -{ -}; - -TEST(MemoryLeakWarningLocalDetectorTest, localDetectorReturnsNewGlobalWhenNoneWasSet) -{ - MemoryLeakWarningPlugin memoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", NULL); - CHECK(0 != memoryLeakWarningPlugin.getMemoryLeakDetector()); -} - -TEST(MemoryLeakWarningLocalDetectorTest, localDetectorIsTheOneSpecifiedInConstructor) -{ - MemoryLeakDetector localDetector(&dummy); - MemoryLeakWarningPlugin memoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", &localDetector); - POINTERS_EQUAL(&localDetector, memoryLeakWarningPlugin.getMemoryLeakDetector()); -} - -TEST(MemoryLeakWarningLocalDetectorTest, localDetectorIsGlobalDetector) -{ - MemoryLeakDetector* globalDetector = MemoryLeakWarningPlugin::getGlobalDetector(); - MemoryLeakWarningPlugin memoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", NULL); - MemoryLeakDetector* localDetector = memoryLeakWarningPlugin.getMemoryLeakDetector(); - POINTERS_EQUAL(globalDetector, localDetector); -} - - -TEST_GROUP(MemoryLeakWarningTest) -{ - TestTestingFixture* fixture; - - void setup() - { - fixture = new TestTestingFixture(); - detector = new MemoryLeakDetector(&dummy); - allocator = new TestMemoryAllocator; - memPlugin = new MemoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", detector); - fixture->registry_->installPlugin(memPlugin); - memPlugin->enable(); - - leak1 = 0; - leak2 = 0; - } - void teardown() - { - detector->deallocMemory(allocator, leak1); - detector->deallocMemory(allocator, leak2); - - delete fixture; - delete memPlugin; - delete detector; - delete allocator; - } -}; - -static void _testTwoLeaks() -{ - leak1 = detector->allocMemory(allocator, 10); - leak2 = (long*) (void*) detector->allocMemory(allocator, 4); -} - -TEST(MemoryLeakWarningTest, TwoLeaks) -{ - fixture->setTestFunction(_testTwoLeaks); - fixture->runAllTests(); - LONGS_EQUAL(1, fixture->getFailureCount()); - fixture->assertPrintContains("Total number of leaks: 2"); -} - -static void _testIgnore2() -{ - memPlugin->expectLeaksInTest(2); - leak1 = detector->allocMemory(allocator, 10); - leak2 = (long*) (void*) detector->allocMemory(allocator, 4); -} - -TEST(MemoryLeakWarningTest, Ignore2) -{ - fixture->setTestFunction(_testIgnore2); - fixture->runAllTests(); - LONGS_EQUAL(0, fixture->getFailureCount()); -} - -static void _failAndLeakMemory() -{ - leak1 = detector->allocMemory(allocator, 10); - FAIL(""); -} - -TEST(MemoryLeakWarningTest, FailingTestDoesNotReportMemoryLeaks) -{ - fixture->setTestFunction(_failAndLeakMemory); - fixture->runAllTests(); - LONGS_EQUAL(1, fixture->getFailureCount()); -} - -static bool memoryLeakDetectorWasDeleted = false; -static bool memoryLeakFailureWasDelete = false; - -class DummyMemoryLeakDetector : public MemoryLeakDetector -{ -public: - DummyMemoryLeakDetector(MemoryLeakFailure* reporter) : MemoryLeakDetector(reporter) {} - virtual ~DummyMemoryLeakDetector() - { - memoryLeakDetectorWasDeleted = true; - } -}; - -class DummyMemoryLeakFailure : public MemoryLeakFailure -{ - virtual ~DummyMemoryLeakFailure() - { - memoryLeakFailureWasDelete = true; - } - virtual void fail(char*) - { - } -}; - - -static bool cpputestHasCrashed; - -TEST_GROUP(MemoryLeakWarningGlobalDetectorTest) -{ - MemoryLeakDetector* detector; - MemoryLeakFailure* failureReporter; - - DummyMemoryLeakDetector * dummyDetector; - MemoryLeakFailure* dummyReporter; - - static void crashMethod() - { - cpputestHasCrashed = true; - } - - void setup() - { - detector = MemoryLeakWarningPlugin::getGlobalDetector(); - failureReporter = MemoryLeakWarningPlugin::getGlobalFailureReporter(); - - memoryLeakDetectorWasDeleted = false; - memoryLeakFailureWasDelete = false; - - MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); - - dummyReporter = new DummyMemoryLeakFailure; - dummyDetector = new DummyMemoryLeakDetector(dummyReporter); - - UtestShell::setCrashMethod(crashMethod); - cpputestHasCrashed = false; -} - - void teardown() - { - MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); - if (!memoryLeakDetectorWasDeleted) delete dummyDetector; - if (!memoryLeakFailureWasDelete) delete dummyReporter; - - MemoryLeakWarningPlugin::setGlobalDetector(detector, failureReporter); - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); - - UtestShell::resetCrashMethod(); - - setCurrentMallocAllocatorToDefault(); - setCurrentNewAllocatorToDefault(); - setCurrentNewArrayAllocatorToDefault(); - } -}; - -TEST(MemoryLeakWarningGlobalDetectorTest, turnOffNewOverloadsCausesNoAdditionalLeaks) -{ - int storedAmountOfLeaks = detector->totalMemoryLeaks(mem_leak_period_all); - - char* arrayMemory = new char[100]; - char* nonArrayMemory = new char; - char* mallocMemory = (char*) cpputest_malloc_location_with_leak_detection(10, "file", 10); - char* reallocMemory = (char*) cpputest_realloc_location_with_leak_detection(NULL, 10, "file", 10); - - LONGS_EQUAL(storedAmountOfLeaks, detector->totalMemoryLeaks(mem_leak_period_all)); - - cpputest_free_location_with_leak_detection(mallocMemory, "file", 10); - cpputest_free_location_with_leak_detection(reallocMemory, "file", 10); - delete [] arrayMemory; - delete nonArrayMemory; -} - -TEST(MemoryLeakWarningGlobalDetectorTest, destroyGlobalDetector) -{ - MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); - - MemoryLeakWarningPlugin::destroyGlobalDetector(); - - CHECK(memoryLeakDetectorWasDeleted); - CHECK(memoryLeakFailureWasDelete); -} - -TEST(MemoryLeakWarningGlobalDetectorTest, MemoryWarningPluginCanBeSetToDestroyTheGlobalDetector) -{ - MemoryLeakWarningPlugin* plugin = new MemoryLeakWarningPlugin("dummy"); - plugin->destroyGlobalDetectorAndTurnOffMemoryLeakDetectionInDestructor(true); - MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); - - delete plugin; - - CHECK(memoryLeakDetectorWasDeleted); -} - -#ifndef CPPUTEST_MEM_LEAK_DETECTION_DISABLED - -TEST(MemoryLeakWarningGlobalDetectorTest, crashOnLeakWithOperatorNew) -{ - MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); - - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); - - crash_on_allocation_number(1); - char* memory = new char[100]; - CHECK(cpputestHasCrashed); - delete [] memory; -} - -TEST(MemoryLeakWarningGlobalDetectorTest, crashOnLeakWithOperatorNewArray) -{ - MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); - - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); - - crash_on_allocation_number(1); - char* memory = new char; - CHECK(cpputestHasCrashed); - delete memory; -} - -TEST(MemoryLeakWarningGlobalDetectorTest, crashOnLeakWithOperatorMalloc) -{ - MemoryLeakWarningPlugin::setGlobalDetector(dummyDetector, dummyReporter); - - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); - - crash_on_allocation_number(1); - char* memory = (char*) cpputest_malloc(10); - CHECK(cpputestHasCrashed); - cpputest_free(memory); -} - -TEST(MemoryLeakWarningGlobalDetectorTest, gettingTheGlobalDetectorDoesNotRestoreTheMemoryLeakOverloadsWhenTheyWereAlreadyOff) -{ - MemoryLeakWarningPlugin::setGlobalDetector(NULL, NULL); - MemoryLeakDetector* temporaryDetector = MemoryLeakWarningPlugin::getGlobalDetector(); - MemoryLeakFailure* temporaryReporter = MemoryLeakWarningPlugin::getGlobalFailureReporter(); - - MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); - bool areNewDeleteOverloaded = MemoryLeakWarningPlugin::areNewDeleteOverloaded(); - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); - - CHECK(!areNewDeleteOverloaded); - - MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); - delete temporaryReporter; - delete temporaryDetector; -} - -TEST(MemoryLeakWarningGlobalDetectorTest, checkIfTheMemoryLeakOverloadsAreOn) -{ - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); - CHECK(MemoryLeakWarningPlugin::areNewDeleteOverloaded()); - - MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); -} - -TEST(MemoryLeakWarningGlobalDetectorTest, checkIfTheMemoryLeakOverloadsAreOff) -{ - MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); - bool areNewDeleteOverloaded = MemoryLeakWarningPlugin::areNewDeleteOverloaded(); - - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); - CHECK(!areNewDeleteOverloaded); -} - - -#endif - -#if CPPUTEST_USE_STD_CPP_LIB - -TEST(MemoryLeakWarningGlobalDetectorTest, turnOffNewOverloadsNoThrowCausesNoAdditionalLeaks) -{ -#undef new - int storedAmountOfLeaks = detector->totalMemoryLeaks(mem_leak_period_all); - - char* nonMemoryNoThrow = new (std::nothrow) char; - char* nonArrayMemoryNoThrow = new (std::nothrow) char[10]; - char* nonArrayMemoryThrow = new char[10]; - - LONGS_EQUAL(storedAmountOfLeaks, detector->totalMemoryLeaks(mem_leak_period_all)); - - delete nonMemoryNoThrow; - delete [] nonArrayMemoryNoThrow; - delete [] nonArrayMemoryThrow; -#ifdef CPPUTEST_USE_NEW_MACROS - #include "CppUTest/MemoryLeakDetectorNewMacros.h" -#endif -} - -#ifndef CPPUTEST_MEM_LEAK_DETECTION_DISABLED - -static int mutexLockCount = 0; -static int mutexUnlockCount = 0; - -static void StubMutexLock(PlatformSpecificMutex) -{ - mutexLockCount++; -} - -static void StubMutexUnlock(PlatformSpecificMutex) -{ - mutexUnlockCount++; -} - - - -TEST_GROUP(MemoryLeakWarningThreadSafe) -{ - void setup() - { - UT_PTR_SET(PlatformSpecificMutexLock, StubMutexLock); - UT_PTR_SET(PlatformSpecificMutexUnlock, StubMutexUnlock); - - mutexLockCount = 0; - mutexUnlockCount = 0; - } - - void teardown() - { - } -}; - -TEST(MemoryLeakWarningThreadSafe, turnOnThreadSafeMallocFreeReallocOverloadsDebug) -{ - int storedAmountOfLeaks = MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all); - - MemoryLeakWarningPlugin::turnOnThreadSafeNewDeleteOverloads(); - - int *n = (int*) cpputest_malloc(sizeof(int)); - - LONGS_EQUAL(storedAmountOfLeaks + 1, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); - CHECK_EQUAL(1, mutexLockCount); - CHECK_EQUAL(1, mutexUnlockCount); - - n = (int*) cpputest_realloc(n, sizeof(int)*3); - - LONGS_EQUAL(storedAmountOfLeaks + 1, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); - CHECK_EQUAL(2, mutexLockCount); - CHECK_EQUAL(2, mutexUnlockCount); - - cpputest_free(n); - - LONGS_EQUAL(storedAmountOfLeaks, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); - CHECK_EQUAL(3, mutexLockCount); - CHECK_EQUAL(3, mutexUnlockCount); - - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); -} - -TEST(MemoryLeakWarningThreadSafe, turnOnThreadSafeNewDeleteOverloadsDebug) -{ - int storedAmountOfLeaks = MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all); - - MemoryLeakWarningPlugin::turnOnThreadSafeNewDeleteOverloads(); - - int *n = new int; - char *str = new char[20]; - - LONGS_EQUAL(storedAmountOfLeaks + 2, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); - CHECK_EQUAL(2, mutexLockCount); - CHECK_EQUAL(2, mutexUnlockCount); - - delete [] str; - delete n; - - LONGS_EQUAL(storedAmountOfLeaks, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); - CHECK_EQUAL(4, mutexLockCount); - CHECK_EQUAL(4, mutexUnlockCount); - - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); -} - -#ifdef __clang__ - -IGNORE_TEST(MemoryLeakWarningThreadSafe, turnOnThreadSafeNewDeleteOverloads) -{ - /* Clang misbehaves with -O2 - it will not overload operator new or - * operator new[] no matter what. Therefore, this test is must be ignored. - */ -} - -#else - -TEST(MemoryLeakWarningThreadSafe, turnOnThreadSafeNewDeleteOverloads) -{ -#undef new - - int storedAmountOfLeaks = MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all); - MemoryLeakWarningPlugin::turnOnThreadSafeNewDeleteOverloads(); - - int *n = new int; - int *n_nothrow = new (std::nothrow) int; - char *str = new char[20]; - char *str_nothrow = new (std::nothrow) char[20]; - - LONGS_EQUAL(storedAmountOfLeaks + 4, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); - CHECK_EQUAL(4, mutexLockCount); - CHECK_EQUAL(4, mutexUnlockCount); - - delete [] str_nothrow; - delete [] str; - delete n; - delete n_nothrow; - - LONGS_EQUAL(storedAmountOfLeaks, MemoryLeakWarningPlugin::getGlobalDetector()->totalMemoryLeaks(mem_leak_period_all)); - CHECK_EQUAL(8, mutexLockCount); - CHECK_EQUAL(8, mutexUnlockCount); - - MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(); -#ifdef CPPUTEST_USE_NEW_MACROS - #include "CppUTest/MemoryLeakDetectorNewMacros.h" -#endif -} - -#endif - -#endif - -#endif diff -Nru cpputest-3.8/tests/MemoryOperatorOverloadTest.cpp cpputest-4.0/tests/MemoryOperatorOverloadTest.cpp --- cpputest-3.8/tests/MemoryOperatorOverloadTest.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/tests/MemoryOperatorOverloadTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,376 +0,0 @@ -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestMemoryAllocator.h" -#include "CppUTest/MemoryLeakDetector.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/TestRegistry.h" -#include "CppUTest/PlatformSpecificFunctions.h" -#include "CppUTest/TestTestingFixture.h" -#include "AllocationInCppFile.h" - -#include "CppUTest/TestHarness_c.h" -#include "AllocationInCFile.h" - -TEST_GROUP(BasicBehavior) -{ -}; - -TEST(BasicBehavior, CanDeleteNullPointers) -{ - delete (char*) NULL; - delete [] (char*) NULL; -} - -#ifndef CPPUTEST_MEM_LEAK_DETECTION_DISABLED - -TEST(BasicBehavior, deleteArrayInvalidatesMemory) -{ - unsigned char* memory = new unsigned char[10]; - PlatformSpecificMemset(memory, 0xAB, 10); - delete [] memory; - CHECK(memory[5] != 0xCB); -} - -TEST(BasicBehavior, deleteInvalidatesMemory) -{ - unsigned char* memory = new unsigned char; - *memory = 0xAD; - delete memory; - CHECK(*memory != 0xAD); -} - -TEST(BasicBehavior, DeleteWithSizeParameterWorks) -{ - char* charMemory = new char; - char* charArrayMemory = new char[10]; - ::operator delete(charMemory, sizeof(char)); - ::operator delete[](charArrayMemory, sizeof(char)* 10); -} - - -static void deleteUnallocatedMemory() -{ - delete (char*) 0x1234678; - FAIL("Should never come here"); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(BasicBehavior, deleteWillNotThrowAnExceptionWhenDeletingUnallocatedMemoryButCanStillCauseTestFailures) -{ - /* - * Test failure might cause an exception. But according to C++ standard, you aren't allowed - * to throw exceptions in the delete function. If you do that, it will call std::terminate. - * Therefore, the delete will need to fail without exceptions. - */ - MemoryLeakFailure* defaultReporter = MemoryLeakWarningPlugin::getGlobalFailureReporter(); - TestTestingFixture fixture; - fixture.setTestFunction(deleteUnallocatedMemory); - fixture.runAllTests(); - LONGS_EQUAL(1, fixture.getFailureCount()); - POINTERS_EQUAL(defaultReporter, MemoryLeakWarningPlugin::getGlobalFailureReporter()); -} - -#endif - -#ifdef CPPUTEST_USE_MALLOC_MACROS - -/* This include is added because *sometimes* the cstdlib does an #undef. This should have been prevented */ -#if CPPUTEST_USE_STD_CPP_LIB -#include -#endif - -TEST(BasicBehavior, bothMallocAndFreeAreOverloaded) -{ - void* memory = cpputest_malloc_location(sizeof(char), "file", 10); - free(memory); - - memory = malloc(sizeof(unsigned char)); - cpputest_free_location(memory, "file", 10); -} - -#endif - -#if CPPUTEST_USE_MEM_LEAK_DETECTION - -TEST(BasicBehavior, freeInvalidatesMemory) -{ - unsigned char* memory = (unsigned char*) cpputest_malloc(sizeof(unsigned char)); - *memory = 0xAD; - cpputest_free(memory); - CHECK(*memory != 0xAD); -} -#endif - -TEST_GROUP(MemoryLeakOverridesToBeUsedInProductionCode) -{ - MemoryLeakDetector* memLeakDetector; - void setup() - { - memLeakDetector = MemoryLeakWarningPlugin::getGlobalDetector(); - } - -}; - -#ifdef CPPUTEST_USE_MALLOC_MACROS - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, MallocOverrideIsUsed) -{ - int memLeaks = memLeakDetector->totalMemoryLeaks(mem_leak_period_checking); - void* memory = malloc(10); - LONGS_EQUAL(memLeaks+1, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); - free (memory); -} - -#endif - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, UseNativeMallocByTemporarlySwitchingOffMalloc) -{ - int memLeaks = memLeakDetector->totalMemoryLeaks(mem_leak_period_checking); -#ifdef CPPUTEST_USE_MALLOC_MACROS - #undef malloc - #undef free -#endif - void* memory = malloc(10); - LONGS_EQUAL(memLeaks, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); - free (memory); - -#ifdef CPPUTEST_USE_MALLOC_MACROS -#include "CppUTest/MemoryLeakDetectorMallocMacros.h" -#endif -} - -/* TEST... allowing for a new overload in a class */ -class NewDummyClass -{ -public: - static bool overloaded_new_called; - -#ifdef CPPUTEST_USE_NEW_MACROS - #undef new -#endif - void* operator new (size_t size) -#ifdef CPPUTEST_USE_NEW_MACROS - #include "CppUTest/MemoryLeakDetectorNewMacros.h" -#endif - { - overloaded_new_called = true; - return malloc(size); - } - void dummyFunction() - { - char* memory = new char; - delete memory; - } -}; -bool NewDummyClass::overloaded_new_called = false; - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, NoSideEffectsFromTurningOffNewMacros) -{ - /* - * Interesting effect of wrapping the operator new around the macro is - * that the actual new that is called is a different one than expected. - * - * The overloaded operator new doesn't actually ever get called. - * - * This might come as a surprise, so it is important to realize! - */ - NewDummyClass dummy; - dummy.dummyFunction(); - // CHECK(dummy.overloaded_new_called); -} - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, UseNativeNewByTemporarlySwitchingOffNew) -{ -#ifdef CPPUTEST_USE_NEW_MACROS - #undef new - #undef delete -#endif - char* memory = new char[10]; - delete [] memory; -#ifdef CPPUTEST_USE_NEW_MACROS - #include "CppUTest/MemoryLeakDetectorNewMacros.h" -#endif -} - - -#if CPPUTEST_USE_MEM_LEAK_DETECTION - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, OperatorNewMacroOverloadViaIncludeFileWorks) -{ - char* leak = newAllocation(); - STRCMP_NOCASE_CONTAINS("AllocationInCppFile.cpp", memLeakDetector->report(mem_leak_period_checking)); - delete leak; -} - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, OperatorNewArrayMacroOverloadViaIncludeFileWorks) -{ - char* leak = newArrayAllocation(); - STRCMP_NOCASE_CONTAINS("AllocationInCppFile.cpp", memLeakDetector->report(mem_leak_period_checking)); - delete[] leak; -} - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, MallocOverrideWorks) -{ - char* leak = mallocAllocation(); - STRCMP_NOCASE_CONTAINS("AllocationInCFile.c", memLeakDetector->report(mem_leak_period_checking)); - freeAllocation(leak); -} - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, MallocWithButFreeWithoutLeakDetectionDoesntCrash) -{ - char* leak = mallocAllocation(); - freeAllocationWithoutMacro(leak); - LONGS_EQUAL(2, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); - memLeakDetector->removeMemoryLeakInformationWithoutCheckingOrDeallocatingTheMemoryButDeallocatingTheAccountInformation(getCurrentMallocAllocator(), leak, true); -} - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, OperatorNewOverloadingWithoutMacroWorks) -{ - char* leak = newAllocationWithoutMacro(); - STRCMP_CONTAINS("unknown", memLeakDetector->report(mem_leak_period_checking)); - delete leak; -} - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, OperatorNewArrayOverloadingWithoutMacroWorks) -{ - char* leak = newArrayAllocationWithoutMacro(); - STRCMP_CONTAINS("unknown", memLeakDetector->report(mem_leak_period_checking)); - delete[] leak; -} - -#else - -TEST(MemoryLeakOverridesToBeUsedInProductionCode, MemoryOverridesAreDisabled) -{ - char* leak = newAllocation(); - STRCMP_EQUAL("No memory leaks were detected.", memLeakDetector->report(mem_leak_period_checking)); - delete leak; -} - -#endif - -TEST_GROUP(OutOfMemoryTestsForOperatorNew) -{ - TestMemoryAllocator* no_memory_allocator; - void setup() - { - no_memory_allocator = new NullUnknownAllocator; - setCurrentNewAllocator(no_memory_allocator); - setCurrentNewArrayAllocator(no_memory_allocator); - } - - void teardown() - { - setCurrentNewAllocatorToDefault(); - setCurrentNewArrayAllocatorToDefault(); - delete no_memory_allocator; - } -}; - -#if CPPUTEST_USE_MEM_LEAK_DETECTION - -#if CPPUTEST_USE_STD_CPP_LIB - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorThrowsAnExceptionWhenUsingStdCppNew) -{ - CHECK_THROWS(std::bad_alloc, new char); -} - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorThrowsAnExceptionWhenUsingStdCppNew) -{ - CHECK_THROWS(std::bad_alloc, new char[10]); -} - -TEST_GROUP(TestForExceptionsInConstructor) -{ -}; - -TEST(TestForExceptionsInConstructor,ConstructorThrowsAnException) -{ - CHECK_THROWS(int, new ClassThatThrowsAnExceptionInTheConstructor); -} - -TEST(TestForExceptionsInConstructor,ConstructorThrowsAnExceptionAllocatedAsArray) -{ - CHECK_THROWS(int, new ClassThatThrowsAnExceptionInTheConstructor[10]); -} - -#else - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorReturnsNull) -{ - POINTERS_EQUAL(NULL, new char); -} - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorReturnsNull) -{ - POINTERS_EQUAL(NULL, new char[10]); -} - -#endif - -#undef new - -#if CPPUTEST_USE_STD_CPP_LIB - - -/* - * CLang 4.2 and memory allocation. - * - * Clang 4.2 has done some optimizations to their memory management that actually causes slightly different behavior than what the C++ Standard defines. - * Usually this is not a problem... but in this case, it is a problem. - * - * More information about the optimization can be found at: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3433.html - * We've done a bug-report to clang to fix some of this non-standard behavior, which is open at: http://llvm.org/bugs/show_bug.cgi?id=15541 - * - * I very much hope that nobody would actually ever hit this bug/optimization as it is hard to figure out what is going on. - * - * The original test simply did "new char". Because the memory wasn't assigned to anything and is local in context, the optimization *doesn't* call - * the operator new overload. Because it doesn't call the operator new (optimizing away a call to operator new), therefore the method wouldn't throw an exception - * and therefore this test failed. - * - * The first attempt to fix this is to create a local variable and assigned the memory to that. Also this doesn't work as it still detects the allocation is - * local and optimizes away the memory call. - * - * Now, we assign the memory on some static global which fools the optimizer to believe that it isn't local and it stops optimizing the operator new call. - * - * We (Bas Vodde and Terry Yin) suspect that in a real product, you wouldn't be able to detect the optimization and it's breaking of Standard C++. Therefore, - * for now, we keep this hack in the test to fool the optimizer and hope nobody will ever notice this 'optimizer behavior' in a real product. - * - */ - -static char* some_memory; - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorThrowsAnExceptionWhenUsingStdCppNewWithoutOverride) -{ - CHECK_THROWS(std::bad_alloc, some_memory = new char); -} - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorThrowsAnExceptionWhenUsingStdCppNewWithoutOverride) -{ - CHECK_THROWS(std::bad_alloc, some_memory = new char[10]); -} - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorReturnsNullWithoutOverride) -{ - POINTERS_EQUAL(NULL, new (std::nothrow) char); -} - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorReturnsNullWithoutOverride) -{ - POINTERS_EQUAL(NULL, new (std::nothrow) char[10]); -} - -#else - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewOperatorReturnsNullWithoutOverride) -{ - POINTERS_EQUAL(NULL, new char); -} - -TEST(OutOfMemoryTestsForOperatorNew, FailingNewArrayOperatorReturnsNullWithoutOverride) -{ - POINTERS_EQUAL(NULL, new char[10]); -} - -#endif - -#endif diff -Nru cpputest-3.8/tests/PluginTest.cpp cpputest-4.0/tests/PluginTest.cpp --- cpputest-3.8/tests/PluginTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/PluginTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestRegistry.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/TestTestingFixture.h" - -#define GENERIC_PLUGIN "GenericPlugin" -#define GENERIC_PLUGIN2 "GenericPlugin2" -#define GENERIC_PLUGIN3 "GenericPlugin3" - -static int sequenceNumber; - -class DummyPlugin: public TestPlugin -{ -public: - DummyPlugin(const SimpleString& name) : - TestPlugin(name), preAction(0), preActionSequence(0), postAction(0), postActionSequence(0) - { - } - - virtual void preTestAction(UtestShell&, TestResult&) - { - preAction++; - preActionSequence = sequenceNumber++; - } - - virtual void postTestAction(UtestShell&, TestResult&) - { - postAction++; - postActionSequence = sequenceNumber++; - } - - int preAction; - int preActionSequence; - int postAction; - int postActionSequence; -}; - -class DummyPluginWhichAcceptsParameters: public DummyPlugin -{ -public: - DummyPluginWhichAcceptsParameters(const SimpleString& name) : - DummyPlugin(name) - { - } - - virtual bool parseArguments(int ac, const char** av, int index) - { - SimpleString argument (av[index]); - if (argument == "-paccept") - return true; - return TestPlugin::parseArguments(ac, av, index); - } - -}; - -TEST_GROUP(PluginTest) -{ - DummyPlugin* firstPlugin; - DummyPluginWhichAcceptsParameters* secondPlugin; - DummyPlugin* thirdPlugin; - TestTestingFixture *genFixture; - TestRegistry *registry; - void setup() - { - firstPlugin = new DummyPlugin(GENERIC_PLUGIN); - secondPlugin = new DummyPluginWhichAcceptsParameters(GENERIC_PLUGIN2); - thirdPlugin = new DummyPlugin(GENERIC_PLUGIN3); - genFixture = new TestTestingFixture; - registry = genFixture->registry_; - registry->installPlugin(firstPlugin); - sequenceNumber = 1; - } - - void teardown() - { - delete firstPlugin; - delete secondPlugin; - delete thirdPlugin; - delete genFixture; - } -}; - -#define GENERIC_PLUGIN "GenericPlugin" - -TEST(PluginTest, PluginHasName) -{ - STRCMP_EQUAL(GENERIC_PLUGIN, firstPlugin->getName().asCharString()); -} - -TEST(PluginTest, InstallPlugin) -{ - CHECK_EQUAL(firstPlugin, registry->getFirstPlugin()); - CHECK_EQUAL(firstPlugin, registry->getPluginByName(GENERIC_PLUGIN)); - LONGS_EQUAL(1, registry->countPlugins()); -} - -TEST(PluginTest, InstallMultiplePlugins) -{ - registry->installPlugin(thirdPlugin); - CHECK_EQUAL(firstPlugin, registry->getPluginByName(GENERIC_PLUGIN)); - CHECK_EQUAL(thirdPlugin, registry->getPluginByName(GENERIC_PLUGIN3)); - CHECK_EQUAL(0, registry->getPluginByName("I do not exist")); -} - -TEST(PluginTest, ActionsAllRun) -{ - genFixture->runAllTests(); - genFixture->runAllTests(); - CHECK_EQUAL(2, firstPlugin->preAction); - CHECK_EQUAL(2, firstPlugin->postAction); -} - -TEST(PluginTest, Sequence) -{ - registry->installPlugin(thirdPlugin); - genFixture->runAllTests(); - CHECK_EQUAL(1, thirdPlugin->preActionSequence); - CHECK_EQUAL(2, firstPlugin->preActionSequence); - CHECK_EQUAL(3, firstPlugin->postActionSequence); - CHECK_EQUAL(4, thirdPlugin->postActionSequence); - LONGS_EQUAL(2, registry->countPlugins()); -} - -TEST(PluginTest, RemovePluginByName) -{ - registry->installPlugin(secondPlugin); - registry->installPlugin(thirdPlugin); - LONGS_EQUAL(3, registry->countPlugins()); - registry->removePluginByName(GENERIC_PLUGIN2); - LONGS_EQUAL(2, registry->countPlugins()); -} - -struct DefaultPlugin : public TestPlugin -{ - DefaultPlugin() : TestPlugin("default") {} -}; - -TEST(PluginTest, DefaultPostTestActionDoesntDoAnything) -{ - DefaultPlugin defaultPlugin; - registry->installPlugin(&defaultPlugin); - genFixture->runAllTests(); -} - -TEST(PluginTest, DisablesPluginsDontRun) -{ - registry->installPlugin(thirdPlugin); - thirdPlugin->disable(); - genFixture->runAllTests(); - CHECK(!thirdPlugin->isEnabled()); - thirdPlugin->enable(); - genFixture->runAllTests(); - CHECK_EQUAL(2, firstPlugin->preAction); - CHECK_EQUAL(1, thirdPlugin->preAction); - CHECK(thirdPlugin->isEnabled()); -} - -TEST(PluginTest, ParseArgumentsForUnknownArgumentsFails) -{ - registry->installPlugin(secondPlugin); - const char *cmd_line[] = {"nonsense", "andmorenonsense"}; - CHECK(registry->getFirstPlugin()->parseAllArguments(2, const_cast(cmd_line), 0) == false); /* cover non-const wrapper, too */ -} - -TEST(PluginTest, ParseArgumentsContinuesAndSucceedsWhenAPluginCanParse) -{ - registry->installPlugin(secondPlugin); - const char *cmd_line[] = {"-paccept", "andmorenonsense"}; - CHECK(registry->getFirstPlugin()->parseAllArguments(2, const_cast(cmd_line), 0)); /* cover non-const wrapper, too */ -} diff -Nru cpputest-3.8/tests/PreprocessorTest.cpp cpputest-4.0/tests/PreprocessorTest.cpp --- cpputest-3.8/tests/PreprocessorTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/PreprocessorTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" - -TEST_GROUP(PreprocessorTest) -{ -}; - diff -Nru cpputest-3.8/tests/RunAllTests.sh cpputest-4.0/tests/RunAllTests.sh --- cpputest-3.8/tests/RunAllTests.sh 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/RunAllTests.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -#/bin/bash -#put any pre-test execution commands here. -echo Running all tests -./AllTests $1 diff -Nru cpputest-3.8/tests/SetPluginTest.cpp cpputest-4.0/tests/SetPluginTest.cpp --- cpputest-3.8/tests/SetPluginTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/SetPluginTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestRegistry.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/TestPlugin.h" - -static void orig_func1() -{ -} - -static void stub_func1() -{ -} - -static void orig_func2() -{ -} - -static void stub_func2() -{ -} - -static void (*fp1)(); -static void (*fp2)(); - -TEST_GROUP(SetPointerPluginTest) -{ - SetPointerPlugin* plugin_; - TestRegistry* myRegistry_; - StringBufferTestOutput* output_; - TestResult* result_; - - void setup() - { - myRegistry_ = new TestRegistry(); - plugin_ = new SetPointerPlugin("TestSetPlugin"); - myRegistry_->setCurrentRegistry(myRegistry_); - myRegistry_->installPlugin(plugin_); - output_ = new StringBufferTestOutput(); - result_ = new TestResult(*output_); - } - - void teardown() - { - myRegistry_->setCurrentRegistry(0); - delete myRegistry_; - delete plugin_; - delete output_; - delete result_; - } -}; - -class FunctionPointerUtest : public Utest -{ -public: - void setup() _override - { - UT_PTR_SET(fp1, stub_func1); - UT_PTR_SET(fp2, stub_func2); - UT_PTR_SET(fp2, stub_func2); - } - void testBody() _override - { - CHECK(fp1 == stub_func1); - CHECK(fp2 == stub_func2); - } -}; - -class FunctionPointerUtestShell: public UtestShell -{ -public: - virtual Utest* createTest() - { - return new FunctionPointerUtest(); - } -}; - -TEST(SetPointerPluginTest, installTwoFunctionPointer) -{ - FunctionPointerUtestShell *tst = new FunctionPointerUtestShell(); - ; - - fp1 = orig_func1; - fp2 = orig_func2; - myRegistry_->addTest(tst); - myRegistry_->runAllTests(*result_); - CHECK(fp1 == orig_func1); - CHECK(fp2 == orig_func2); - LONGS_EQUAL(0, result_->getFailureCount()); - LONGS_EQUAL(2, result_->getCheckCount()); - delete tst; -} - -class MaxFunctionPointerUtest : public Utest -{ -public: - int numOfFpSets; - MaxFunctionPointerUtest(int num) : - numOfFpSets(num) - { - } - - void setup() - { - for (int i = 0; i < numOfFpSets; ++i) - { - UT_PTR_SET(fp1, stub_func1); - } - } -}; - -class MaxFunctionPointerUtestShell: public UtestShell -{ -public: - int numOfFpSets; - MaxFunctionPointerUtestShell(int num) : - numOfFpSets(num) - { - } - - virtual Utest* createTest() - { - return new MaxFunctionPointerUtest(numOfFpSets); - } -}; - -TEST(SetPointerPluginTest, installTooMuchFunctionPointer) -{ - MaxFunctionPointerUtestShell *tst = new MaxFunctionPointerUtestShell(SetPointerPlugin::MAX_SET + 1); - myRegistry_->addTest(tst); - - myRegistry_->runAllTests(*result_); - - LONGS_EQUAL(1, result_->getFailureCount()); - delete tst; -} - -static double orig_double = 3.0; -static double* orig_double_ptr = &orig_double; -static double stub_double = 4.0; - -class SetDoublePointerUtest : public Utest -{ -public: - void setup() - { - UT_PTR_SET(orig_double_ptr, &stub_double); - } - void testBody() - { - CHECK(orig_double_ptr == &stub_double); - } -}; - -class SetDoublePointerUtestShell: public UtestShell -{ -public: - Utest * createTest() - { - return new SetDoublePointerUtest(); - } -}; - -TEST(SetPointerPluginTest, doublePointer) -{ - SetDoublePointerUtestShell *doubletst = new SetDoublePointerUtestShell(); - myRegistry_->addTest(doubletst); - myRegistry_->runAllTests(*result_); - - CHECK(orig_double_ptr == &orig_double); - LONGS_EQUAL(1, result_->getCheckCount()); - delete doubletst; -} diff -Nru cpputest-3.8/tests/SimpleMutexTest.cpp cpputest-4.0/tests/SimpleMutexTest.cpp --- cpputest-3.8/tests/SimpleMutexTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/SimpleMutexTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2014, Michael Feathers, James Grenning, Bas Vodde and Chen YewMing - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/SimpleMutex.h" -#include "CppUTest/PlatformSpecificFunctions.h" - -static int mutexCreateCount = 0; -static int mutexLockCount = 0; -static int mutexUnlockCount = 0; -static int mutexDestroyCount = 0; - -static PlatformSpecificMutex StubMutexCreate(void) -{ - mutexCreateCount++; - return 0; -} - -static void StubMutexLock(PlatformSpecificMutex) -{ - mutexLockCount++; -} - -static void StubMutexUnlock(PlatformSpecificMutex) -{ - mutexUnlockCount++; -} - -static void StubMutexDestroy(PlatformSpecificMutex) -{ - mutexDestroyCount++; -} - - - -TEST_GROUP(SimpleMutexTest) -{ - void setup() - { - UT_PTR_SET(PlatformSpecificMutexCreate, StubMutexCreate); - UT_PTR_SET(PlatformSpecificMutexLock, StubMutexLock); - UT_PTR_SET(PlatformSpecificMutexUnlock, StubMutexUnlock); - UT_PTR_SET(PlatformSpecificMutexDestroy, StubMutexDestroy); - - mutexCreateCount = 0; - mutexDestroyCount = 0; - mutexLockCount = 0; - mutexUnlockCount = 0; - } - - void teardown() - { - } -}; - -TEST(SimpleMutexTest, CreateAndDestroy) -{ - { - SimpleMutex mtx; - } - - CHECK_EQUAL(1, mutexCreateCount); - CHECK_EQUAL(1, mutexDestroyCount); - CHECK_EQUAL(0, mutexLockCount); - CHECK_EQUAL(0, mutexUnlockCount); -} - -TEST(SimpleMutexTest, LockUnlockTest) -{ - { - SimpleMutex mtx; - mtx.Lock(); - mtx.Unlock(); - } - - CHECK_EQUAL(1, mutexCreateCount); - CHECK_EQUAL(1, mutexLockCount); - CHECK_EQUAL(1, mutexUnlockCount); - CHECK_EQUAL(1, mutexDestroyCount); -} diff -Nru cpputest-3.8/tests/SimpleStringTest.cpp cpputest-4.0/tests/SimpleStringTest.cpp --- cpputest-3.8/tests/SimpleStringTest.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/tests/SimpleStringTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1030 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/SimpleString.h" -#include "CppUTest/PlatformSpecificFunctions.h" -#include "CppUTest/TestMemoryAllocator.h" -#include "CppUTest/MemoryLeakDetector.h" - -class JustUseNewStringAllocator : public TestMemoryAllocator -{ -public: - virtual ~JustUseNewStringAllocator() {} - - char* alloc_memory(size_t size, const char* file, int line) - { - return MemoryLeakWarningPlugin::getGlobalDetector()->allocMemory(getCurrentNewArrayAllocator(), size, (char*) file, line); - } - void free_memory(char* str, const char* file, int line) - { - MemoryLeakWarningPlugin::getGlobalDetector()->deallocMemory(getCurrentNewArrayAllocator(), str, (char*) file, line); - } -}; - - -TEST_GROUP(SimpleString) -{ - JustUseNewStringAllocator justNewForSimpleStringTestAllocator; - void setup() - { - SimpleString::setStringAllocator(&justNewForSimpleStringTestAllocator); - } - void teardown() - { - SimpleString::setStringAllocator(NULL); - } -}; - -TEST(SimpleString, defaultAllocatorIsNewArrayAllocator) -{ - SimpleString::setStringAllocator(NULL); - POINTERS_EQUAL(getCurrentNewArrayAllocator(), SimpleString::getStringAllocator()); -} - -class MyOwnStringAllocator : public TestMemoryAllocator -{ -public: - MyOwnStringAllocator() : memoryWasAllocated(false) {} - virtual ~MyOwnStringAllocator() {} - - bool memoryWasAllocated; - char* alloc_memory(size_t size, const char* file, int line) - { - memoryWasAllocated = true; - return TestMemoryAllocator::alloc_memory(size, file, line); - } -}; - -TEST(SimpleString, allocatorForSimpleStringCanBeReplaced) -{ - MyOwnStringAllocator myOwnAllocator; - SimpleString::setStringAllocator(&myOwnAllocator); - SimpleString simpleString; - CHECK(myOwnAllocator.memoryWasAllocated); - SimpleString::setStringAllocator(NULL); -} - -TEST(SimpleString, CreateSequence) -{ - SimpleString expected("hellohello"); - SimpleString actual("hello", 2); - - CHECK_EQUAL(expected, actual); -} - -TEST(SimpleString, CreateSequenceOfZero) -{ - SimpleString expected(""); - SimpleString actual("hello", 0); - - CHECK_EQUAL(expected, actual); -} - -TEST(SimpleString, Copy) -{ - SimpleString s1("hello"); - SimpleString s2(s1); - - CHECK_EQUAL(s1, s2); -} - -TEST(SimpleString, Assignment) -{ - SimpleString s1("hello"); - SimpleString s2("goodbye"); - - s2 = s1; - - CHECK_EQUAL(s1, s2); -} - -TEST(SimpleString, Equality) -{ - SimpleString s1("hello"); - SimpleString s2("hello"); - - CHECK(s1 == s2); -} - -TEST(SimpleString, InEquality) -{ - SimpleString s1("hello"); - SimpleString s2("goodbye"); - - CHECK(s1 != s2); -} - -TEST(SimpleString, CompareNoCaseWithoutCase) -{ - SimpleString s1("hello"); - SimpleString s2("hello"); - - CHECK(s1.equalsNoCase(s2)); -} - -TEST(SimpleString, CompareNoCaseWithCase) -{ - SimpleString s1("hello"); - SimpleString s2("HELLO"); - - CHECK(s1.equalsNoCase(s2)); -} - -TEST(SimpleString, CompareNoCaseWithCaseNotEqual) -{ - SimpleString s1("hello"); - SimpleString s2("WORLD"); - - CHECK(!s1.equalsNoCase(s2)); -} - - -TEST(SimpleString, asCharString) -{ - SimpleString s1("hello"); - - STRCMP_EQUAL("hello", s1.asCharString()); -} - -TEST(SimpleString, Size) -{ - SimpleString s1("hello!"); - - LONGS_EQUAL(6, s1.size()); -} - -TEST(SimpleString, lowerCase) -{ - SimpleString s1("AbCdEfG1234"); - SimpleString s2(s1.lowerCase()); - STRCMP_EQUAL("abcdefg1234", s2.asCharString()); - STRCMP_EQUAL("AbCdEfG1234", s1.asCharString()); -} - -TEST(SimpleString, Addition) -{ - SimpleString s1("hello!"); - SimpleString s2("goodbye!"); - SimpleString s3("hello!goodbye!"); - SimpleString s4; - s4 = s1 + s2; - - CHECK_EQUAL(s3, s4); -} - -TEST(SimpleString, Concatenation) -{ - SimpleString s1("hello!"); - SimpleString s2("goodbye!"); - SimpleString s3("hello!goodbye!"); - SimpleString s4; - s4 += s1; - s4 += s2; - - CHECK_EQUAL(s3, s4); - - SimpleString s5("hello!goodbye!hello!goodbye!"); - s4 += s4; - - CHECK_EQUAL(s5, s4); -} - -TEST(SimpleString, Contains) -{ - SimpleString s("hello!"); - SimpleString empty(""); - SimpleString beginning("hello"); - SimpleString end("lo!"); - SimpleString mid("l"); - SimpleString notPartOfString("xxxx"); - - CHECK(s.contains(empty)); - CHECK(s.contains(beginning)); - CHECK(s.contains(end)); - CHECK(s.contains(mid)); - CHECK(!s.contains(notPartOfString)); - - CHECK(empty.contains(empty)); - CHECK(!empty.contains(s)); -} - -TEST(SimpleString, startsWith) -{ - SimpleString hi("Hi you!"); - SimpleString part("Hi"); - SimpleString diff("Hrrm Hi you! ffdsfd"); - CHECK(hi.startsWith(part)); - CHECK(!part.startsWith(hi)); - CHECK(!diff.startsWith(hi)); -} - -TEST(SimpleString, split) -{ - SimpleString hi("hello\nworld\nhow\ndo\nyou\ndo\n\n"); - - SimpleStringCollection collection; - hi.split("\n", collection); - - LONGS_EQUAL(7, collection.size()); - STRCMP_EQUAL("hello\n", collection[0].asCharString()); - STRCMP_EQUAL("world\n", collection[1].asCharString()); - STRCMP_EQUAL("how\n", collection[2].asCharString()); - STRCMP_EQUAL("do\n", collection[3].asCharString()); - STRCMP_EQUAL("you\n", collection[4].asCharString()); - STRCMP_EQUAL("do\n", collection[5].asCharString()); - STRCMP_EQUAL("\n", collection[6].asCharString()); -} - -TEST(SimpleString, splitNoTokenOnTheEnd) -{ - SimpleString string("Bah Yah oops"); - SimpleStringCollection collection; - - string.split(" ", collection); - LONGS_EQUAL(3, collection.size()); - STRCMP_EQUAL("Bah ", collection[0].asCharString()); - STRCMP_EQUAL("Yah ", collection[1].asCharString()); - STRCMP_EQUAL("oops", collection[2].asCharString()); -} - -TEST(SimpleString, count) -{ - SimpleString str("ha ha ha ha"); - LONGS_EQUAL(4, str.count("ha")); -} - -TEST(SimpleString, countTogether) -{ - SimpleString str("hahahaha"); - LONGS_EQUAL(4, str.count("ha")); -} - -TEST(SimpleString, countEmptyString) -{ - SimpleString str("hahahaha"); - LONGS_EQUAL(8, str.count("")); -} - -TEST(SimpleString, countEmptyStringInEmptyString) -{ - SimpleString str; - LONGS_EQUAL(0, str.count("")); -} - -TEST(SimpleString, endsWith) -{ - SimpleString str("Hello World"); - CHECK(str.endsWith("World")); - CHECK(!str.endsWith("Worl")); - CHECK(!str.endsWith("Hello")); - SimpleString str2("ah"); - CHECK(str2.endsWith("ah")); - CHECK(!str2.endsWith("baah")); - SimpleString str3(""); - CHECK(!str3.endsWith("baah")); - - SimpleString str4("ha ha ha ha"); - CHECK(str4.endsWith("ha")); -} - -TEST(SimpleString, replaceCharWithChar) -{ - SimpleString str("abcabcabca"); - str.replace('a', 'b'); - STRCMP_EQUAL("bbcbbcbbcb", str.asCharString()); -} - -TEST(SimpleString, replaceEmptyStringWithEmptyString) -{ - SimpleString str; - str.replace("", ""); - STRCMP_EQUAL("", str.asCharString()); -} - -TEST(SimpleString, replaceWholeString) -{ - SimpleString str("boo"); - str.replace("boo", ""); - STRCMP_EQUAL("", str.asCharString()); -} - -TEST(SimpleString, replaceStringWithString) -{ - SimpleString str("boo baa boo baa boo"); - str.replace("boo", "boohoo"); - STRCMP_EQUAL("boohoo baa boohoo baa boohoo", str.asCharString()); -} - -TEST(SimpleString, subStringFromEmptyString) -{ - SimpleString str(""); - STRCMP_EQUAL("", str.subString(0, 1).asCharString()); -} - -TEST(SimpleString, subStringFromSmallString) -{ - SimpleString str("H"); - STRCMP_EQUAL("H", str.subString(0, 1).asCharString()); -} - -TEST(SimpleString, subStringFromPos0) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("Hello", str.subString(0, 5).asCharString()); -} - -TEST(SimpleString, subStringFromPos1) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("ello ", str.subString(1, 5).asCharString()); -} - -TEST(SimpleString, subStringFromPos5WithAmountLargerThanString) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("World", str.subString(6, 10).asCharString()); -} - -TEST(SimpleString, subStringFromPos6ToEndOfString) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("World", str.subString(6).asCharString()); -} - -TEST(SimpleString, subStringBeginPosOutOfBounds) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("", str.subString(13, 5).asCharString()); -} - -TEST(SimpleString, subStringFromTillNormal) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("Hello", str.subStringFromTill('H', ' ').asCharString()); -} - -TEST(SimpleString, subStringFromTillOutOfBounds) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("World", str.subStringFromTill('W', '!').asCharString()); -} - -TEST(SimpleString, subStringFromTillStartDoesntExist) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("", str.subStringFromTill('!', ' ').asCharString()); -} - -TEST(SimpleString, subStringFromTillWhenTheEndAppearsBeforeTheStart) -{ - SimpleString str("Hello World"); - STRCMP_EQUAL("World", str.subStringFromTill('W', 'H').asCharString()); -} - -TEST(SimpleString, findNormal) -{ - SimpleString str("Hello World"); - LONGS_EQUAL(0, str.find('H')); - LONGS_EQUAL(1, str.find('e')); - LONGS_EQUAL(SimpleString::npos, str.find('!')); -} - -TEST(SimpleString, at) -{ - SimpleString str("Hello World"); - BYTES_EQUAL('H', str.at(0)); -} - -TEST(SimpleString, copyInBufferNormal) -{ - SimpleString str("Hello World"); - size_t bufferSize = str.size()+1; - char* buffer = (char*) malloc(bufferSize); - str.copyToBuffer(buffer, bufferSize); - STRCMP_EQUAL(str.asCharString(), buffer); - free(buffer); -} - -TEST(SimpleString, copyInBufferWithEmptyBuffer) -{ - SimpleString str("Hello World"); - char* buffer= NULL; - str.copyToBuffer(buffer, 0); - POINTERS_EQUAL(NULL, buffer); -} - -TEST(SimpleString, copyInBufferWithBiggerBufferThanNeeded) -{ - SimpleString str("Hello"); - size_t bufferSize = 20; - char* buffer= (char*) malloc(bufferSize); - str.copyToBuffer(buffer, bufferSize); - STRCMP_EQUAL(str.asCharString(), buffer); - free(buffer); -} - -TEST(SimpleString, ContainsNull) -{ - SimpleString s(0); - STRCMP_EQUAL("", s.asCharString()); -} - -TEST(SimpleString, NULLReportsNullString) -{ - STRCMP_EQUAL("(null)", StringFromOrNull((char*) NULL).asCharString()); -} - -TEST(SimpleString, Booleans) -{ - SimpleString s1(StringFrom(true)); - SimpleString s2(StringFrom(false)); - CHECK(s1 == "true"); - CHECK(s2 == "false"); -} - -TEST(SimpleString, Pointers) -{ - SimpleString s(StringFrom((void *)0x1234)); - STRCMP_EQUAL("0x1234", s.asCharString()); -} - -TEST(SimpleString, FunctionPointers) -{ - SimpleString s(StringFrom((void (*)())0x1234)); - STRCMP_EQUAL("0x1234", s.asCharString()); -} - -TEST(SimpleString, Characters) -{ - SimpleString s(StringFrom('a')); - STRCMP_EQUAL("a", s.asCharString()); -} - -TEST(SimpleString, NegativeSignedBytes) -{ - STRCMP_EQUAL("-15", StringFrom((signed char)-15).asCharString()); -} - -TEST(SimpleString, PositiveSignedBytes) -{ - STRCMP_EQUAL("4", StringFrom(4).asCharString()); -} - -TEST(SimpleString, LongInts) -{ - SimpleString s(StringFrom((long)1)); - CHECK(s == "1"); -} - -TEST(SimpleString, UnsignedLongInts) -{ - SimpleString s(StringFrom((unsigned long)1)); - SimpleString s2(StringFrom((unsigned long)1)); - CHECK(s == s2); -} - -#ifdef CPPUTEST_USE_LONG_LONG - -TEST(SimpleString, LongLongInts) -{ - SimpleString s(StringFrom((long long)1)); - CHECK(s == "1"); -} - -TEST(SimpleString, UnsignedLongLongInts) -{ - SimpleString s(StringFrom((unsigned long long)1)); - SimpleString s2(StringFrom((unsigned long long)1)); - CHECK(s == s2); -} - -#endif /* CPPUTEST_USE_LONG_LONG */ - -TEST(SimpleString, Doubles) -{ - SimpleString s(StringFrom(1.2)); - STRCMP_EQUAL("1.2", s.asCharString()); -} - -extern "C" { - static int alwaysTrue(double) { return true; } -} - -TEST(SimpleString, NaN) -{ - UT_PTR_SET(PlatformSpecificIsNan, alwaysTrue); - SimpleString s(StringFrom(0.0)); - STRCMP_EQUAL("Nan - Not a number", s.asCharString()); -} - -TEST(SimpleString, Inf) -{ - UT_PTR_SET(PlatformSpecificIsInf, alwaysTrue); - SimpleString s(StringFrom(0.0)); - STRCMP_EQUAL("Inf - Infinity", s.asCharString()); -} - -TEST(SimpleString, SmallDoubles) -{ - SimpleString s(StringFrom(1.2e-10)); - STRCMP_CONTAINS("1.2e", s.asCharString()); -} - -TEST(SimpleString, Sizes) -{ - size_t size = 10; - STRCMP_EQUAL("10", StringFrom((int) size).asCharString()); -} - -TEST(SimpleString, HexStrings) -{ - STRCMP_EQUAL("f3", HexStringFrom((signed char)-13).asCharString()); - - SimpleString h1 = HexStringFrom(0xffffL); - STRCMP_EQUAL("ffff", h1.asCharString()); - -#ifdef CPPUTEST_USE_LONG_LONG - SimpleString h15 = HexStringFrom(0xffffLL); - STRCMP_EQUAL("ffff", h15.asCharString()); -#endif - - SimpleString h2 = HexStringFrom((void *)0xfffeL); - STRCMP_EQUAL("fffe", h2.asCharString()); - - SimpleString h3 = HexStringFrom((void (*)())0xfffdL); - STRCMP_EQUAL("fffd", h3.asCharString()); -} - -TEST(SimpleString, StringFromFormat) -{ - SimpleString h1 = StringFromFormat("%s %s! %d", "Hello", "World", 2009); - STRCMP_EQUAL("Hello World! 2009", h1.asCharString()); -} - -TEST(SimpleString, StringFromFormatpointer) -{ - //this is not a great test. but %p is odd on mingw and even more odd on Solaris. - SimpleString h1 = StringFromFormat("%p", (void*) 1); - if (h1.size() == 3) - STRCMP_EQUAL("0x1", h1.asCharString()) - else if (h1.size() == 8) - STRCMP_EQUAL("00000001", h1.asCharString()) - else if (h1.size() == 9) - STRCMP_EQUAL("0000:0001", h1.asCharString()) - else if (h1.size() == 16) - STRCMP_EQUAL("0000000000000001", h1.asCharString()) - else if (h1.size() == 1) - STRCMP_EQUAL("1", h1.asCharString()) - else - FAIL("Off %p behavior") -} - -TEST(SimpleString, StringFromFormatLarge) -{ - const char* s = "ThisIsAPrettyLargeStringAndIfWeAddThisManyTimesToABufferItWillbeFull"; - SimpleString h1 = StringFromFormat("%s%s%s%s%s%s%s%s%s%s", s, s, s, s, s, s, s, s, s, s); - LONGS_EQUAL(10, h1.count(s)); -} - -TEST(SimpleString, StringFromConstSimpleString) -{ - STRCMP_EQUAL("bla", StringFrom(SimpleString("bla")).asCharString()); -} - -static int WrappedUpVSNPrintf(char* buf, size_t n, const char* format, ...) -{ - va_list arguments; - va_start(arguments, format); - - int result = PlatformSpecificVSNprintf(buf, n, format, arguments); - va_end(arguments); - return result; -} - -TEST(SimpleString, PlatformSpecificSprintf_fits) -{ - char buf[10]; - - int count = WrappedUpVSNPrintf(buf, sizeof(buf), "%s", "12345"); - STRCMP_EQUAL("12345", buf); - LONGS_EQUAL(5, count); -} - -TEST(SimpleString, PlatformSpecificSprintf_doesNotFit) -{ - char buf[10]; - - int count = WrappedUpVSNPrintf(buf, sizeof(buf), "%s", "12345678901"); - STRCMP_EQUAL("123456789", buf); - LONGS_EQUAL(11, count); -} - -TEST(SimpleString, PadStringsToSameLengthString1Larger) -{ - SimpleString str1("1"); - SimpleString str2("222"); - - SimpleString::padStringsToSameLength(str1, str2, '4'); - STRCMP_EQUAL("441", str1.asCharString()); - STRCMP_EQUAL("222", str2.asCharString()); -} - -TEST(SimpleString, PadStringsToSameLengthString2Larger) -{ - SimpleString str1(" "); - SimpleString str2(""); - - SimpleString::padStringsToSameLength(str1, str2, ' '); - STRCMP_EQUAL(" ", str1.asCharString()); - STRCMP_EQUAL(" ", str2.asCharString()); -} - -TEST(SimpleString, PadStringsToSameLengthWithSameLengthStrings) -{ - SimpleString str1("123"); - SimpleString str2("123"); - - SimpleString::padStringsToSameLength(str1, str2, ' '); - STRCMP_EQUAL("123", str1.asCharString()); - STRCMP_EQUAL("123", str2.asCharString()); -} - -TEST(SimpleString, NullParameters2) -{ - SimpleString* arr = new SimpleString[100]; - delete[] arr; -} - -TEST(SimpleString, CollectionMultipleAllocateNoLeaksMemory) -{ - SimpleStringCollection col; - col.allocate(5); - col.allocate(5); - // CHECK no memory leak -} - -TEST(SimpleString, CollectionReadOutOfBoundsReturnsEmptyString) -{ - SimpleStringCollection col; - col.allocate(3); - STRCMP_EQUAL("", col[3].asCharString()); -} - -TEST(SimpleString, CollectionWritingToEmptyString) -{ - SimpleStringCollection col; - col.allocate(3); - col[3] = SimpleString("HAH"); - STRCMP_EQUAL("", col[3].asCharString()); -} - -#ifdef CPPUTEST_64BIT -#ifndef CPPUTEST_64BIT_32BIT_LONGS - -TEST(SimpleString, _64BitAddressPrintsCorrectly) -{ - char* p = (char*) 0x0012345678901234; - SimpleString expected("0x12345678901234"); - SimpleString actual = StringFrom((void*)p); - STRCMP_EQUAL(expected.asCharString(), actual.asCharString()); -} - -#else -/* - * This test case should pass on 64 bit systems with 32 bit longs, - * but actually fails due to an implementation problem: Right now, - * the 64 bit pointers are casted to 32bit as the %p is causing - * different formats on different platforms. However, this will - * need to be fixed in the future. - */ - -IGNORE_TEST(SimpleString, _64BitAddressPrintsCorrectly) -{ - char* p = (char*) 0xffffffff; - SimpleString expected("0x123456789"); - SimpleString actual = StringFrom((void*)&p[0x2345678A]); - STRCMP_EQUAL(expected.asCharString(), actual.asCharString()); -} - -#endif -#else -/* - * This test case cannot pass on 32 bit systems. - */ -IGNORE_TEST(SimpleString, _64BitAddressPrintsCorrectly) -{ -} - -#endif - -TEST(SimpleString, BuildStringFromUnsignedInteger) -{ - unsigned long int i = 0xffffffff; - - SimpleString result = StringFrom(i); - const char* expected_string = "4294967295 (0xffffffff)"; - CHECK_EQUAL(expected_string, result); -} - -#if CPPUTEST_USE_STD_CPP_LIB - -TEST(SimpleString, fromStdString) -{ - std::string s("hello"); - SimpleString s1(StringFrom(s)); - - STRCMP_EQUAL("hello", s1.asCharString()); -} - -TEST(SimpleString, CHECK_EQUAL_unsigned_long) -{ - unsigned long i = 0xffffffffUL; - CHECK_EQUAL(i, i); -} - -TEST(SimpleString, unsigned_long) -{ - unsigned long i = 0xffffffffUL; - - SimpleString result = StringFrom(i); - const char* expected_string = "4294967295 (0xffffffff)"; - CHECK_EQUAL(expected_string, result); -} - -#endif - -TEST(SimpleString, StrCmp) -{ - char empty[] = ""; - char blabla[] = "blabla"; - char bla[] = "bla"; - CHECK(SimpleString::StrCmp(empty, empty) == 0); - CHECK(SimpleString::StrCmp(bla, blabla) == -(int)'b'); - CHECK(SimpleString::StrCmp(blabla, bla) == 'b'); - CHECK(SimpleString::StrCmp(bla, empty) == 'b'); - CHECK(SimpleString::StrCmp(empty, bla) == -(int)'b'); - CHECK(SimpleString::StrCmp(bla, bla) == 0); -} - -TEST(SimpleString, StrNCpy_no_zero_termination) -{ - char str[] = "XXXXXXXXXX"; - STRCMP_EQUAL("womanXXXXX", SimpleString::StrNCpy(str, "woman", 5)); -} - -TEST(SimpleString, StrNCpy_zero_termination) -{ - char str[] = "XXXXXXXXXX"; - STRCMP_EQUAL("woman", SimpleString::StrNCpy(str, "woman", 6)); -} - -TEST(SimpleString, StrNCpy_null_proof) -{ - POINTERS_EQUAL(NULL, SimpleString::StrNCpy(NULL, "woman", 6)); -} - -TEST(SimpleString, StrNCpy_stops_at_end_of_string) -{ - char str[] = "XXXXXXXXXX"; - STRCMP_EQUAL("woman", SimpleString::StrNCpy(str, "woman", 8)); -} - -TEST(SimpleString, StrNCpy_nothing_to_do) -{ - char str[] = "XXXXXXXXXX"; - STRCMP_EQUAL("XXXXXXXXXX", SimpleString::StrNCpy(str, "woman", 0)); -} - -TEST(SimpleString, StrNCpy_write_into_the_middle) -{ - char str[] = "womanXXXXX"; - SimpleString::StrNCpy(str+3, "e", 1); - STRCMP_EQUAL("womenXXXXX", str); -} - -TEST(SimpleString, StrNCmp_equal) -{ - int result = SimpleString::StrNCmp("teststring", "tests", 5); - LONGS_EQUAL(0, result); -} - -TEST(SimpleString, StrNCmp_should_always_return_0_when_n_is_0) -{ - int result = SimpleString::StrNCmp("a", "b", 0); - LONGS_EQUAL(0, result); -} - -TEST(SimpleString, StrNCmp_s1_smaller) -{ - int result = SimpleString::StrNCmp("testing", "tests", 7); - LONGS_EQUAL('i' - 's', result); -} - -TEST(SimpleString, StrNCmp_s1_larger) -{ - int result = SimpleString::StrNCmp("teststring", "tester", 7); - LONGS_EQUAL('s' - 'e', result); -} - -TEST(SimpleString, StrNCmp_n_too_large) -{ - int result = SimpleString::StrNCmp("teststring", "teststring", 20); - LONGS_EQUAL(0, result); -} - -TEST(SimpleString, StrNCmp_s1_empty) -{ - int result = SimpleString::StrNCmp("", "foo", 2); - LONGS_EQUAL(0 - 'f', result); -} - -TEST(SimpleString, StrNCmp_s2_empty) -{ - int result = SimpleString::StrNCmp("foo", "", 2); - LONGS_EQUAL('f', result); -} - -TEST(SimpleString, StrNCmp_s1_and_s2_empty) -{ - int result = SimpleString::StrNCmp("", "", 2); - LONGS_EQUAL(0, result); -} - -TEST(SimpleString, StrStr) -{ - char foo[] = "foo"; - char empty[] = ""; - char foobarfoo[] = "foobarfoo"; - char barf[] = "barf"; - CHECK(SimpleString::StrStr(foo, empty) == foo); - CHECK(SimpleString::StrStr(empty, foo) == 0); - CHECK(SimpleString::StrStr(foobarfoo, barf) == foobarfoo+3); - CHECK(SimpleString::StrStr(barf, foobarfoo) == 0); - CHECK(SimpleString::StrStr(foo, foo) == foo); -} - -TEST(SimpleString, AtoI) -{ - char max_short_str[] = "32767"; - char min_short_str[] = "-32768"; - - CHECK(12345 == SimpleString::AtoI("012345")); - CHECK(6789 == SimpleString::AtoI("6789")); - CHECK(12345 == SimpleString::AtoI("12345/")); - CHECK(12345 == SimpleString::AtoI("12345:")); - CHECK(-12345 == SimpleString::AtoI("-12345")); - CHECK(123 == SimpleString::AtoI("\t \r\n123")); - CHECK(123 == SimpleString::AtoI("123-foo")); - CHECK(0 == SimpleString::AtoI("-foo")); - CHECK(-32768 == SimpleString::AtoI(min_short_str)); - CHECK(32767 == SimpleString::AtoI(max_short_str)); -} - -TEST(SimpleString, Binary) -{ - const unsigned char value[] = { 0x00, 0x01, 0x2A, 0xFF }; - const char expectedString[] = "00 01 2A FF"; - - STRCMP_EQUAL(expectedString, StringFromBinary(value, sizeof(value)).asCharString()); - STRCMP_EQUAL(expectedString, StringFromBinaryOrNull(value, sizeof(value)).asCharString()); - STRCMP_EQUAL("", StringFromBinary(value, 0).asCharString()); - STRCMP_EQUAL("(null)", StringFromBinaryOrNull(NULL, 0).asCharString()); -} - -TEST(SimpleString, BinaryWithSize) -{ - const unsigned char value[] = { 0x12, 0xFE, 0xA1 }; - const char expectedString[] = "Size = 3 | HexContents = 12 FE A1"; - - STRCMP_EQUAL(expectedString, StringFromBinaryWithSize(value, sizeof(value)).asCharString()); - STRCMP_EQUAL(expectedString, StringFromBinaryWithSizeOrNull(value, sizeof(value)).asCharString()); - STRCMP_EQUAL("Size = 0 | HexContents = ", StringFromBinaryWithSize(value, 0).asCharString()); - STRCMP_EQUAL("(null)", StringFromBinaryWithSizeOrNull(NULL, 0).asCharString()); -} - -TEST(SimpleString, BinaryWithSizeLargerThan128) -{ - unsigned char value[129]; - value[127] = 0x00; - value[128] = 0xff; - - STRCMP_CONTAINS("00 ...", StringFromBinaryWithSize(value, sizeof(value)).asCharString()); -} - -TEST(SimpleString, MemCmp) -{ - unsigned char smaller[] = { 0x00, 0x01, 0x2A, 0xFF }; - unsigned char greater[] = { 0x00, 0x01, 0xFF, 0xFF }; - - LONGS_EQUAL(0, SimpleString::MemCmp(smaller, smaller, sizeof(smaller))); - CHECK(SimpleString::MemCmp(smaller, greater, sizeof(smaller)) < 0); - CHECK(SimpleString::MemCmp(greater, smaller, sizeof(smaller)) > 0); - LONGS_EQUAL(0, SimpleString::MemCmp(NULL, NULL, 0)); -} - -TEST(SimpleString, MemCmpFirstLastNotMatching) -{ - unsigned char base[] = { 0x00, 0x01, 0x2A, 0xFF }; - unsigned char firstNotMatching[] = { 0x01, 0x01, 0x2A, 0xFF }; - unsigned char lastNotMatching[] = { 0x00, 0x01, 0x2A, 0x00 }; - CHECK(0 != SimpleString::MemCmp(base, firstNotMatching, sizeof(base))); - CHECK(0 != SimpleString::MemCmp(base, lastNotMatching, sizeof(base))); -} - -#if (CPPUTEST_CHAR_BIT == 16) -TEST(SimpleString, MaskedBitsChar) -{ - STRCMP_EQUAL("xxxxxxxx xxxxxxxx", StringFromMaskedBits(0x00, 0x00, 1).asCharString()); - STRCMP_EQUAL("xxxxxxxx 00000000", StringFromMaskedBits(0x00, 0xFF, 1).asCharString()); - STRCMP_EQUAL("xxxxxxxx 11111111", StringFromMaskedBits(0xFF, 0xFF, 1).asCharString()); - STRCMP_EQUAL("xxxxxxxx 1xxxxxxx", StringFromMaskedBits(0x80, 0x80, 1).asCharString()); - STRCMP_EQUAL("xxxxxxxx xxxxxxx1", StringFromMaskedBits(0x01, 0x01, 1).asCharString()); - STRCMP_EQUAL("xxxxxxxx 11xx11xx", StringFromMaskedBits(0xFF, 0xCC, 1).asCharString()); -} -#else -TEST(SimpleString, MaskedBitsChar) -{ - STRCMP_EQUAL("xxxxxxxx", StringFromMaskedBits(0x00, 0x00, 1).asCharString()); - STRCMP_EQUAL("00000000", StringFromMaskedBits(0x00, 0xFF, 1).asCharString()); - STRCMP_EQUAL("11111111", StringFromMaskedBits(0xFF, 0xFF, 1).asCharString()); - STRCMP_EQUAL("1xxxxxxx", StringFromMaskedBits(0x80, 0x80, 1).asCharString()); - STRCMP_EQUAL("xxxxxxx1", StringFromMaskedBits(0x01, 0x01, 1).asCharString()); - STRCMP_EQUAL("11xx11xx", StringFromMaskedBits(0xFF, 0xCC, 1).asCharString()); -} -#endif - -TEST(SimpleString, MaskedBits16Bit) -{ - STRCMP_EQUAL("xxxxxxxx xxxxxxxx", StringFromMaskedBits(0x0000, 0x0000, 2*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("00000000 00000000", StringFromMaskedBits(0x0000, 0xFFFF, 2*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("11111111 11111111", StringFromMaskedBits(0xFFFF, 0xFFFF, 2*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("1xxxxxxx xxxxxxxx", StringFromMaskedBits(0x8000, 0x8000, 2*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("xxxxxxxx xxxxxxx1", StringFromMaskedBits(0x0001, 0x0001, 2*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("11xx11xx 11xx11xx", StringFromMaskedBits(0xFFFF, 0xCCCC, 2*8/CPPUTEST_CHAR_BIT).asCharString()); -} - -TEST(SimpleString, MaskedBits32Bit) -{ - STRCMP_EQUAL("xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx", StringFromMaskedBits(0x00000000, 0x00000000, 4*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("00000000 00000000 00000000 00000000", StringFromMaskedBits(0x00000000, 0xFFFFFFFF, 4*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("11111111 11111111 11111111 11111111", StringFromMaskedBits(0xFFFFFFFF, 0xFFFFFFFF, 4*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("1xxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx", StringFromMaskedBits(0x80000000, 0x80000000, 4*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxx1", StringFromMaskedBits(0x00000001, 0x00000001, 4*8/CPPUTEST_CHAR_BIT).asCharString()); - STRCMP_EQUAL("11xx11xx 11xx11xx 11xx11xx 11xx11xx", StringFromMaskedBits(0xFFFFFFFF, 0xCCCCCCCC, 4*8/CPPUTEST_CHAR_BIT).asCharString()); -} - -TEST(SimpleString, StringFromOrdinalNumberOnes) -{ - STRCMP_EQUAL("2nd", StringFromOrdinalNumber(2).asCharString()); - STRCMP_EQUAL("3rd", StringFromOrdinalNumber(3).asCharString()); - STRCMP_EQUAL("4th", StringFromOrdinalNumber(4).asCharString()); - STRCMP_EQUAL("5th", StringFromOrdinalNumber(5).asCharString()); - STRCMP_EQUAL("6th", StringFromOrdinalNumber(6).asCharString()); - STRCMP_EQUAL("7th", StringFromOrdinalNumber(7).asCharString()); -} - -TEST(SimpleString, StringFromOrdinalNumberTens) -{ - STRCMP_EQUAL("10th", StringFromOrdinalNumber(10).asCharString()); - STRCMP_EQUAL("11th", StringFromOrdinalNumber(11).asCharString()); - STRCMP_EQUAL("12th", StringFromOrdinalNumber(12).asCharString()); - STRCMP_EQUAL("13th", StringFromOrdinalNumber(13).asCharString()); - STRCMP_EQUAL("14th", StringFromOrdinalNumber(14).asCharString()); - STRCMP_EQUAL("18th", StringFromOrdinalNumber(18).asCharString()); -} - -TEST(SimpleString, StringFromOrdinalNumberOthers) -{ - STRCMP_EQUAL("21st", StringFromOrdinalNumber(21).asCharString()); - STRCMP_EQUAL("22nd", StringFromOrdinalNumber(22).asCharString()); - STRCMP_EQUAL("23rd", StringFromOrdinalNumber(23).asCharString()); - STRCMP_EQUAL("24th", StringFromOrdinalNumber(24).asCharString()); - STRCMP_EQUAL("32nd", StringFromOrdinalNumber(32).asCharString()); - STRCMP_EQUAL("100th", StringFromOrdinalNumber(100).asCharString()); - STRCMP_EQUAL("101st", StringFromOrdinalNumber(101).asCharString()); -} diff -Nru cpputest-3.8/tests/TeamCityOutputTest.cpp cpputest-4.0/tests/TeamCityOutputTest.cpp --- cpputest-3.8/tests/TeamCityOutputTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TeamCityOutputTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -#include "CppUTest/TestHarness.h" -#include "CppUTest/TeamCityTestOutput.h" -#include "CppUTest/PlatformSpecificFunctions.h" - -class TeamCityOutputToBuffer : public TeamCityTestOutput -{ -public: - explicit TeamCityOutputToBuffer() - { - } - - virtual ~TeamCityOutputToBuffer() - { - } - - void printBuffer(const char* s) _override - { - output += s; - } - - void flush() _override - { - output = ""; - } - - const SimpleString& getOutput() - { - return output; - } - -private: - SimpleString output; -}; - -static long millisTime; - -extern "C" { - - static long MockGetPlatformSpecificTimeInMillis() - { - return millisTime; - } - -} - -TEST_GROUP(TeamCityOutputTest) -{ - TeamCityTestOutput* tcout; - TeamCityOutputToBuffer* mock; - UtestShell* tst; - TestFailure *f, *f2, *f3; - TestResult* result; - - void setup() - { - mock = new TeamCityOutputToBuffer(); - tcout = mock; - tst = new UtestShell("group", "test", "file", 10); - f = new TestFailure(tst, "failfile", 20, "failure message"); - f2 = new TestFailure(tst, "file", 20, "message"); - f3 = new TestFailure(tst, "file", 30, "apos' pipe| [brackets]\r\nCRLF"); - result = new TestResult(*mock); - result->setTotalExecutionTime(10); - millisTime = 0; - UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); - } - void teardown() - { - delete tcout; - delete tst; - delete f; - delete f2; - delete f3; - delete result; - } -}; - -TEST(TeamCityOutputTest, PrintGroupStarted) -{ - result->currentGroupStarted(tst); - STRCMP_EQUAL("##teamcity[testSuiteStarted name='group']\n", mock->getOutput().asCharString()); -} - -TEST(TeamCityOutputTest, PrintGroupStartedAndEnded) -{ - const char* expected = "##teamcity[testSuiteStarted name='group']\n" - "##teamcity[testSuiteFinished name='group']\n"; - result->currentGroupStarted(tst); - result->currentGroupEnded(tst); - STRCMP_EQUAL(expected, mock->getOutput().asCharString()); -} - -TEST(TeamCityOutputTest, PrintGroupEndedButNotStarted) -{ - result->currentGroupEnded(tst); - STRCMP_EQUAL("", mock->getOutput().asCharString()); -} - -TEST(TeamCityOutputTest, PrintTestStarted) -{ - tcout->printCurrentTestStarted(*tst); - STRCMP_EQUAL("##teamcity[testStarted name='test']\n", mock->getOutput().asCharString()); -} - -TEST(TeamCityOutputTest, PrintTestStartedAndEnded) -{ - result->currentTestStarted(tst); - millisTime = 42; - result->currentTestEnded(tst); - STRCMP_EQUAL("##teamcity[testStarted name='test']\n##teamcity[testFinished name='test' duration='42']\n", - mock->getOutput().asCharString()); -} - -TEST(TeamCityOutputTest, PrintTestEndedButNotStarted) -{ - result->currentTestEnded(tst); - STRCMP_EQUAL("", mock->getOutput().asCharString()); -} - -TEST(TeamCityOutputTest, PrintTestIgnored) -{ - const char* expected = - "##teamcity[testStarted name='test']\n" - "##teamcity[testIgnored name='test']\n" - "##teamcity[testFinished name='test' duration='41']\n"; - - IgnoredUtestShell* itst = new IgnoredUtestShell("group", "test", "file", 10); - result->currentTestStarted(itst); - millisTime = 41; - result->currentTestEnded(itst); - STRCMP_EQUAL(expected, mock->getOutput().asCharString()); - delete itst; -} - -TEST(TeamCityOutputTest, PrintWithFailureInSameFile) -{ - tcout->printFailure(*f2); - const char* expected = - "##teamcity[testFailed name='test' message='file:20' " - "details='message']\n"; - STRCMP_EQUAL(expected, mock->getOutput().asCharString()); -} - -TEST(TeamCityOutputTest, PrintWithEscapedCharacters) -{ - tcout->printFailure(*f3); - const char* expected = - "##teamcity[testFailed name='test' message='file:30' " - "details='apos|' pipe|| |[brackets|]" - "|r|nCRLF']\n"; - STRCMP_EQUAL(expected, mock->getOutput().asCharString()); -} - -TEST(TeamCityOutputTest, PrintFailureWithFailInDifferentFile) -{ - tcout->printFailure(*f); - const char* expected = - "##teamcity[testFailed name='test' message='TEST failed (file:10): failfile:20' " - "details='failure message']\n"; - STRCMP_EQUAL(expected, mock->getOutput().asCharString()); -} - -/* Todo: - * -Detect when running in TeamCity and switch output to -o teamcity automatically - */ diff -Nru cpputest-3.8/tests/TestFailureNaNTest.cpp cpputest-4.0/tests/TestFailureNaNTest.cpp --- cpputest-3.8/tests/TestFailureNaNTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestFailureNaNTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/PlatformSpecificFunctions.h" - -namespace -{ -const int failLineNumber = 2; -const char* failFileName = "fail.cpp"; -} - -static double zero = 0.0; -static double one = 1.0; -static double not_a_number = zero / zero; -static double infinity = one / zero; - -extern "C" { - static int IsNanForSystemsWithoutNan(double d) { return ((long)not_a_number == (long)d); } - static int IsInfForSystemsWithoutInf(double d) { return ((long)infinity == (long)d); } -} - -TEST_GROUP(TestFailureNanAndInf) -{ - UtestShell* test; - - void setup() _override - { - test = new UtestShell("groupname", "testname", failFileName, failLineNumber-1); - if(PlatformSpecificIsNan(not_a_number) == false) - { - not_a_number = -1.0; - UT_PTR_SET(PlatformSpecificIsNan, IsNanForSystemsWithoutNan); - } - if(PlatformSpecificIsInf(infinity) == false) - { - infinity = -2.0; - UT_PTR_SET(PlatformSpecificIsInf, IsInfForSystemsWithoutInf); - } - } - void teardown() _override - { - delete test; - } -}; -#define FAILURE_EQUAL(a, b) STRCMP_EQUAL_LOCATION(a, b.getMessage().asCharString(), "", __FILE__, __LINE__) - -TEST(TestFailureNanAndInf, DoublesEqualExpectedIsNaN) -{ - DoublesEqualFailure f(test, failFileName, failLineNumber, not_a_number, 2.0, 3.0, ""); - FAILURE_EQUAL("expected \n" - "\tbut was <2> threshold used was <3>\n" - "\tCannot make comparisons with Nan", f); -} - -TEST(TestFailureNanAndInf, DoublesEqualActualIsNaN) -{ - DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, not_a_number, 3.0, ""); - FAILURE_EQUAL("expected <1>\n" - "\tbut was threshold used was <3>\n" - "\tCannot make comparisons with Nan", f); -} - -TEST(TestFailureNanAndInf, DoublesEqualThresholdIsNaN) -{ - DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, 2.0, not_a_number, ""); - FAILURE_EQUAL("expected <1>\n" - "\tbut was <2> threshold used was \n" - "\tCannot make comparisons with Nan", f); -} - -TEST(TestFailureNanAndInf, DoublesEqualExpectedIsInf) -{ - DoublesEqualFailure f(test, failFileName, failLineNumber, infinity, 2.0, 3.0, ""); - FAILURE_EQUAL("expected \n" - "\tbut was <2> threshold used was <3>", f); -} - -TEST(TestFailureNanAndInf, DoublesEqualActualIsInf) -{ - DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, infinity, 3.0, ""); - FAILURE_EQUAL("expected <1>\n" - "\tbut was threshold used was <3>", f); -} - -TEST(TestFailureNanAndInf, DoublesEqualThresholdIsInf) -{ - DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, not_a_number, infinity, ""); - FAILURE_EQUAL("expected <1>\n" - "\tbut was threshold used was \n" - "\tCannot make comparisons with Nan", f); -} diff -Nru cpputest-3.8/tests/TestFailureTest.cpp cpputest-4.0/tests/TestFailureTest.cpp --- cpputest-3.8/tests/TestFailureTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestFailureTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,422 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestOutput.h" - -namespace -{ -const int failLineNumber = 2; -const char* failFileName = "fail.cpp"; -} - -TEST_GROUP(TestFailure) -{ - UtestShell* test; - - void setup() - { - test = new UtestShell("groupname", "testname", failFileName, failLineNumber-1); - } - void teardown() - { - delete test; - } -}; -#define FAILURE_EQUAL(a, b) STRCMP_EQUAL_LOCATION(a, b.getMessage().asCharString(), "", __FILE__, __LINE__) - -TEST(TestFailure, CreateFailure) -{ - TestFailure f1(test, failFileName, failLineNumber, "the failure message"); - TestFailure f2(test, "the failure message"); - TestFailure f3(test, failFileName, failLineNumber); -} - -TEST(TestFailure, GetTestFileAndLineFromFailure) -{ - TestFailure f1(test, failFileName, failLineNumber, "the failure message"); - STRCMP_EQUAL(failFileName, f1.getTestFileName().asCharString()); - LONGS_EQUAL(1, f1.getTestLineNumber()); -} - -TEST(TestFailure, EqualsFailureWithText) -{ - EqualsFailure f(test, failFileName, failLineNumber, "expected", "actual", "text"); - FAILURE_EQUAL("Message: text\n" - "\texpected \n\tbut was ", f); -} - -TEST(TestFailure, EqualsFailure) -{ - EqualsFailure f(test, failFileName, failLineNumber, "expected", "actual", ""); - FAILURE_EQUAL("expected \n\tbut was ", f); -} - -TEST(TestFailure, EqualsFailureWithNullAsActual) -{ - EqualsFailure f(test, failFileName, failLineNumber, "expected", NULL, ""); - FAILURE_EQUAL("expected \n\tbut was <(null)>", f); -} - -TEST(TestFailure, EqualsFailureWithNullAsExpected) -{ - EqualsFailure f(test, failFileName, failLineNumber, NULL, "actual", ""); - FAILURE_EQUAL("expected <(null)>\n\tbut was ", f); -} - -TEST(TestFailure, CheckEqualFailureWithText) -{ - CheckEqualFailure f(test, failFileName, failLineNumber, "expected", "actual", "text"); - FAILURE_EQUAL("Message: text\n" - "\texpected \n" - "\tbut was \n" - "\tdifference starts at position 0 at: < actual >\n" - "\t ^", f); -} - -TEST(TestFailure, CheckEqualFailure) -{ - CheckEqualFailure f(test, failFileName, failLineNumber, "expected", "actual", ""); - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 0 at: < actual >\n" - "\t ^", f); -} - -TEST(TestFailure, CheckFailure) -{ - CheckFailure f(test, failFileName, failLineNumber, "CHECK", "chk"); - FAILURE_EQUAL("CHECK(chk) failed", f); -} - -TEST(TestFailure, CheckFailureWithText) -{ - CheckFailure f(test, failFileName, failLineNumber, "CHECK", "chk", "text"); - FAILURE_EQUAL("Message: text\n" - "\tCHECK(chk) failed", f); -} - -TEST(TestFailure, FailFailure) -{ - FailFailure f(test, failFileName, failLineNumber, "chk"); - FAILURE_EQUAL("chk", f); -} - -TEST(TestFailure, LongsEqualFailureWithText) -{ - LongsEqualFailure f(test, failFileName, failLineNumber, 1, 2, "text"); - FAILURE_EQUAL("Message: text\n" - "\texpected <1 0x1>\n\tbut was <2 0x2>", f); -} - -TEST(TestFailure, LongsEqualFailure) -{ - LongsEqualFailure f(test, failFileName, failLineNumber, 1, 2, ""); - FAILURE_EQUAL("expected <1 0x1>\n\tbut was <2 0x2>", f); -} - -TEST(TestFailure, LongLongsEqualFailure) -{ -#ifdef CPPUTEST_USE_LONG_LONG - LongLongsEqualFailure f(test, failFileName, failLineNumber, 1, 2, ""); - FAILURE_EQUAL("expected <1 0x1>\n\tbut was <2 0x2>", f); -#else - cpputest_longlong dummy_longlong; - LongLongsEqualFailure f(test, failFileName, failLineNumber, dummy_longlong, dummy_longlong, ""); - FAILURE_EQUAL("expected < 0x>\n\tbut was < 0x>", f); -#endif -} - -TEST(TestFailure, UnsignedLongLongsEqualFailure) -{ -#ifdef CPPUTEST_USE_LONG_LONG - UnsignedLongLongsEqualFailure f(test, failFileName, failLineNumber, 1, 2, ""); - FAILURE_EQUAL("expected <1 (0x1) 0x1>\n\tbut was <2 (0x2) 0x2>", f); -#else - cpputest_ulonglong dummy_ulonglong; - UnsignedLongLongsEqualFailure f(test, failFileName, failLineNumber, dummy_ulonglong, dummy_ulonglong, ""); - FAILURE_EQUAL("expected < 0x>\n\tbut was < 0x>", f); -#endif -} - -TEST(TestFailure, StringsEqualFailureWithText) -{ - StringEqualFailure f(test, failFileName, failLineNumber, "abc", "abd", "text"); - FAILURE_EQUAL("Message: text\n" - "\texpected \n" - "\tbut was \n" - "\tdifference starts at position 2 at: < abd >\n" - "\t ^", f); -} - -TEST(TestFailure, StringsEqualFailure) -{ - StringEqualFailure f(test, failFileName, failLineNumber, "abc", "abd", ""); - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 2 at: < abd >\n" - "\t ^", f); -} - -TEST(TestFailure, StringsEqualFailureAtTheEnd) -{ - StringEqualFailure f(test, failFileName, failLineNumber, "abc", "ab", ""); - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 2 at: < ab >\n" - "\t ^", f); -} - -TEST(TestFailure, StringsEqualFailureNewVariantAtTheEnd) -{ - StringEqualFailure f(test, failFileName, failLineNumber, "EndOfALongerString", "EndOfALongerStrinG", ""); - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 17 at: \n" - "\t ^", f); -} - -TEST(TestFailure, StringsEqualFailureWithNewLinesAndTabs) -{ - StringEqualFailure f(test, failFileName, failLineNumber, - "StringWith\t\nDifferentString", - "StringWith\t\ndifferentString", ""); - - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 12 at: \n" - "\t \t\n^", f); -} - -TEST(TestFailure, StringsEqualFailureInTheMiddle) -{ - StringEqualFailure f(test, failFileName, failLineNumber, "aa", "ab", ""); - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 1 at: < ab >\n" - "\t ^", f); -} - -TEST(TestFailure, StringsEqualFailureAtTheBeginning) -{ - StringEqualFailure f(test, failFileName, failLineNumber, "aaa", "bbb", ""); - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 0 at: < bbb >\n" - "\t ^", f); -} - -TEST(TestFailure, StringsEqualFailureWithNullAsActual) -{ - StringEqualFailure f(test, failFileName, failLineNumber, "abc", NULL, ""); - FAILURE_EQUAL("expected \n" - "\tbut was <(null)>", f); -} - -TEST(TestFailure, StringsEqualFailureWithNullAsExpected) -{ - StringEqualFailure f(test, failFileName, failLineNumber, NULL, "abd", ""); - FAILURE_EQUAL("expected <(null)>\n" - "\tbut was ", f); -} - -TEST(TestFailure, StringsEqualNoCaseFailureWithText) -{ - StringEqualNoCaseFailure f(test, failFileName, failLineNumber, "ABC", "abd", "text"); - FAILURE_EQUAL("Message: text\n" - "\texpected \n" - "\tbut was \n" - "\tdifference starts at position 2 at: < abd >\n" - "\t ^", f); -} - -TEST(TestFailure, StringsEqualNoCaseFailure) -{ - StringEqualNoCaseFailure f(test, failFileName, failLineNumber, "ABC", "abd", ""); - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 2 at: < abd >\n" - "\t ^", f); -} - -TEST(TestFailure, StringsEqualNoCaseFailureWithActualAsNull) -{ - StringEqualNoCaseFailure f(test, failFileName, failLineNumber, "ABC", NULL, ""); - FAILURE_EQUAL("expected \n" - "\tbut was <(null)>", f); -} - -TEST(TestFailure, StringsEqualNoCaseFailureWithExpectedAsNull) -{ - StringEqualNoCaseFailure f(test, failFileName, failLineNumber, NULL, "abd", ""); - FAILURE_EQUAL("expected <(null)>\n" - "\tbut was ", f); -} - -TEST(TestFailure, StringsEqualNoCaseFailure2) -{ - StringEqualNoCaseFailure f(test, failFileName, failLineNumber, "ac", "AB", ""); - FAILURE_EQUAL("expected \n" - "\tbut was \n" - "\tdifference starts at position 1 at: < AB >\n" - "\t ^", f); -} - -TEST(TestFailure, DoublesEqualNormalWithText) -{ - DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, 2.0, 3.0, "text"); - FAILURE_EQUAL("Message: text\n" - "\texpected <1>\n" - "\tbut was <2> threshold used was <3>", f); -} - -TEST(TestFailure, DoublesEqualNormal) -{ - DoublesEqualFailure f(test, failFileName, failLineNumber, 1.0, 2.0, 3.0, ""); - FAILURE_EQUAL("expected <1>\n" - "\tbut was <2> threshold used was <3>", f); -} - -TEST(TestFailure, BinaryEqualWithText) -{ - const unsigned char expectedData[] = { 0x00 }; - const unsigned char actualData[] = { 0x01 }; - BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), "text"); - FAILURE_EQUAL("Message: text\n" - "\texpected <00>\n" - "\tbut was <01>\n" - "\tdifference starts at position 0 at: < 01 >\n" - "\t ^", f); -} - -TEST(TestFailure, BinaryEqualOneByte) -{ - const unsigned char expectedData[] = { 0x00 }; - const unsigned char actualData[] = { 0x01 }; - BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); - FAILURE_EQUAL("expected <00>\n" - "\tbut was <01>\n" - "\tdifference starts at position 0 at: < 01 >\n" - "\t ^", f); -} - -TEST(TestFailure, BinaryEqualTwoBytes) -{ - const unsigned char expectedData[] = {0x00, 0x01}; - const unsigned char actualData[] = {0x00, 0x02}; - BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); - FAILURE_EQUAL("expected <00 01>\n" - "\tbut was <00 02>\n" - "\tdifference starts at position 1 at: < 00 02 >\n" - "\t ^", f); -} - -TEST(TestFailure, BinaryEqualThreeBytes) -{ - const unsigned char expectedData[] = {0x00, 0x01, 0x00}; - const unsigned char actualData[] = {0x00, 0x02, 0x00}; - BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); - FAILURE_EQUAL("expected <00 01 00>\n" - "\tbut was <00 02 00>\n" - "\tdifference starts at position 1 at: < 00 02 00 >\n" - "\t ^", f); -} - -TEST(TestFailure, BinaryEqualFullWidth) -{ - const unsigned char expectedData[] = {0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00}; - const unsigned char actualData[] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00}; - BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); - FAILURE_EQUAL("expected <00 00 00 01 00 00 00>\n" - "\tbut was <00 00 00 02 00 00 00>\n" - "\tdifference starts at position 3 at: <00 00 00 02 00 00 00>\n" - "\t ^", f); -} - -TEST(TestFailure, BinaryEqualLast) -{ - const unsigned char expectedData[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - const unsigned char actualData[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; - BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, actualData, sizeof(expectedData), ""); - FAILURE_EQUAL("expected <00 00 00 00 00 00 00>\n" - "\tbut was <00 00 00 00 00 00 01>\n" - "\tdifference starts at position 6 at: <00 00 00 01 >\n" - "\t ^", f); -} - -TEST(TestFailure, BinaryEqualActualNull) -{ - const unsigned char expectedData[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - BinaryEqualFailure f(test, failFileName, failLineNumber, expectedData, NULL, sizeof(expectedData), ""); - FAILURE_EQUAL("expected <00 00 00 00 00 00 00>\n\tbut was <(null)>", f); -} - -TEST(TestFailure, BinaryEqualExpectedNull) -{ - const unsigned char actualData[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; - BinaryEqualFailure f(test, failFileName, failLineNumber, NULL, actualData, sizeof(actualData), ""); - FAILURE_EQUAL("expected <(null)>\n\tbut was <00 00 00 00 00 00 01>", f); -} - -TEST(TestFailure, BitsEqualWithText) -{ - BitsEqualFailure f(test, failFileName, failLineNumber, 0x0001, 0x0003, 0x00FF, 2*8/CPPUTEST_CHAR_BIT, "text"); - FAILURE_EQUAL("Message: text\n" - "\texpected \n\tbut was ", f); -} - -#if (CPPUTEST_CHAR_BIT == 16) -TEST(TestFailure, BitsEqualChar) -{ - BitsEqualFailure f(test, failFileName, failLineNumber, 0x01, 0x03, 0xFF, sizeof(char), ""); - FAILURE_EQUAL("expected \n\tbut was ", f); -} -#else -TEST(TestFailure, BitsEqualChar) -{ - BitsEqualFailure f(test, failFileName, failLineNumber, 0x01, 0x03, 0xFF, sizeof(char), ""); - FAILURE_EQUAL("expected <00000001>\n\tbut was <00000011>", f); -} -#endif - -TEST(TestFailure, BitsEqual16Bit) -{ - BitsEqualFailure f(test, failFileName, failLineNumber, 0x0001, 0x0003, 0xFFFF, 2*8/CPPUTEST_CHAR_BIT, ""); - FAILURE_EQUAL("expected <00000000 00000001>\n\tbut was <00000000 00000011>", f); -} - -TEST(TestFailure, BitsEqual32Bit) -{ - BitsEqualFailure f(test, failFileName, failLineNumber, 0x00000001, 0x00000003, 0xFFFFFFFF, 4*8/CPPUTEST_CHAR_BIT, ""); - FAILURE_EQUAL("expected <00000000 00000000 00000000 00000001>\n\tbut was <00000000 00000000 00000000 00000011>", f); -} - -TEST(TestFailure, FeatureUnsupported) -{ - FeatureUnsupportedFailure f(test, failFileName, failLineNumber, "SOME_FEATURE", ""); - FAILURE_EQUAL("The feature \"SOME_FEATURE\" is not supported in this environment or with the feature set selected when building the library.", f); -} diff -Nru cpputest-3.8/tests/TestFilterTest.cpp cpputest-4.0/tests/TestFilterTest.cpp --- cpputest-3.8/tests/TestFilterTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestFilterTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestFilter.h" - -TEST_GROUP(TestFilter) -{ -}; - -TEST(TestFilter, emptyFilterMatchesEverything) -{ - TestFilter filter; - CHECK(filter.match("random_name")); - CHECK(filter.match("")); - CHECK(filter.match("*&%#^&%$(*&^@#(&*@#^(&*$^@#")); -} - -TEST(TestFilter, defaultAbsoluteMismatches) -{ - TestFilter filter("filtername"); - CHECK(!filter.match("notevenclose")); - CHECK(!filter.match("filterrname")); - CHECK(!filter.match("")); -} - -TEST(TestFilter, strictMatching) -{ - TestFilter filter("filter"); - filter.strictMatching(); - CHECK(filter.match("filter")); - CHECK(!filter.match("filterr")); - CHECK(!filter.match(" filter")); -} - -TEST(TestFilter, invertMatching) -{ - TestFilter filter("filter"); - filter.invertMatching(); - CHECK(!filter.match("filter")); - CHECK(!filter.match("filterr")); - CHECK(filter.match("notevenclose")); - CHECK(filter.match("")); -} - -TEST(TestFilter, invertStrictMatching) -{ - TestFilter filter("filter"); - filter.invertMatching(); - filter.strictMatching(); - CHECK(!filter.match("filter")); - CHECK(filter.match("filterr")); - CHECK(filter.match(" filter")); -} - -TEST(TestFilter, equality) -{ - TestFilter filter1("filter"); - TestFilter filter2("filter"); - TestFilter filter3("filter3"); - CHECK(filter1 == filter2); - CHECK(! (filter1 == filter3)); -} - -TEST(TestFilter, equalityWithStrictness) -{ - TestFilter filter1("filter"); - TestFilter filter2("filter"); - filter2.strictMatching(); - CHECK(! (filter1 == filter2)); -} - -TEST(TestFilter, equalityWithInvertion) -{ - TestFilter filter1("filter"); - TestFilter filter2("filter"); - filter2.invertMatching(); - CHECK(! (filter1 == filter2)); -} - -TEST(TestFilter, notEqual) -{ - TestFilter filter1("filter"); - TestFilter filter2("filter"); - TestFilter filter3("filter3"); - CHECK(filter1 != filter3); - CHECK(! (filter1 != filter2)); -} - -TEST(TestFilter, stringFrom) -{ - TestFilter filter("filter"); - STRCMP_EQUAL("TestFilter: \"filter\"", StringFrom(filter).asCharString()); -} - -TEST(TestFilter, stringFromWithStrictMatching) -{ - TestFilter filter("filter"); - filter.strictMatching(); - STRCMP_EQUAL("TestFilter: \"filter\" with strict matching", StringFrom(filter).asCharString()); -} - -TEST(TestFilter, stringFromWithInvertMatching) -{ - TestFilter filter("filter"); - filter.invertMatching(); - STRCMP_EQUAL("TestFilter: \"filter\" with invert matching", StringFrom(filter).asCharString()); -} - -TEST(TestFilter, stringFromWithStrictInvertMatching) -{ - TestFilter filter("filter"); - filter.strictMatching(); - filter.invertMatching(); - STRCMP_EQUAL("TestFilter: \"filter\" with strict, invert matching", StringFrom(filter).asCharString()); -} - -TEST(TestFilter, listOfFilters) -{ - TestFilter *listOfFilters = NULL; - TestFilter first("foo"); - TestFilter secnd("bar"); - listOfFilters = first.add(listOfFilters); - listOfFilters = secnd.add(listOfFilters); - TestFilter *current = listOfFilters; - STRCMP_EQUAL("TestFilter: \"bar\"", StringFrom(*current).asCharString()); - current = current->getNext(); - STRCMP_EQUAL("TestFilter: \"foo\"", StringFrom(*current).asCharString()); - POINTERS_EQUAL(NULL, current->getNext()); -} - -TEST(TestFilter, constructors) -{ - TestFilter filter1; - TestFilter filter2(SimpleString("a")); - TestFilter filter3("a"); - CHECK(filter1.getNext() == NULL); - CHECK(filter2.getNext() == NULL); - CHECK(filter3.getNext() == NULL); - CHECK(filter2.match("ab")); - CHECK(filter3.match("ab")); -} diff -Nru cpputest-3.8/tests/TestHarness_cTestCFile.c cpputest-4.0/tests/TestHarness_cTestCFile.c --- cpputest-3.8/tests/TestHarness_cTestCFile.c 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestHarness_cTestCFile.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - -#include "CppUTest/TestHarness_c.h" -#include "CppUTest/PlatformSpecificFunctions_c.h" - -extern void functionWithUnusedParameter(void* PUNUSED(unlessParamater)); - -void functionWithUnusedParameter(void* PUNUSED(unlessParamater)) -{ - -} - -/* Declared in the cpp file */ -extern int setup_teardown_was_called_in_test_group_in_C; -extern int test_was_called_in_test_group_in_C; - -TEST_GROUP_C_SETUP(TestGroupInC) -{ - setup_teardown_was_called_in_test_group_in_C++; -} - -TEST_GROUP_C_TEARDOWN(TestGroupInC) -{ - setup_teardown_was_called_in_test_group_in_C--; - CHECK_C(test_was_called_in_test_group_in_C == 1); - test_was_called_in_test_group_in_C--; -} - -TEST_C(TestGroupInC, checkThatTheTestHasRun) -{ - test_was_called_in_test_group_in_C++; -} diff -Nru cpputest-3.8/tests/TestHarness_cTest.cpp cpputest-4.0/tests/TestHarness_cTest.cpp --- cpputest-3.8/tests/TestHarness_cTest.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/tests/TestHarness_cTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness_c.h" - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestRegistry.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/TestTestingFixture.h" -#include "CppUTest/PlatformSpecificFunctions.h" - - -extern "C" int setup_teardown_was_called_in_test_group_in_C; -extern "C" int test_was_called_in_test_group_in_C; -int setup_teardown_was_called_in_test_group_in_C = 0; -int test_was_called_in_test_group_in_C = 0; - -TEST_GROUP_C_WRAPPER(TestGroupInC) -{ - TEST_GROUP_C_SETUP_WRAPPER(TestGroupInC) - TEST_GROUP_C_TEARDOWN_WRAPPER(TestGroupInC) -}; - -TEST_C_WRAPPER(TestGroupInC, checkThatTheTestHasRun) - -/* - * This test is a bit strange. They use the fact that you can do -r2 for repeating the same run. - * When you do so, the same statics will be shared and therefore we can test whether the setup/teardown is run - * correctly. - */ - -TEST(TestGroupInC, setupHasBeenCalled) -{ - test_was_called_in_test_group_in_C++; - /* Increased in setup, decreased in teardown. So at this point it must be 1 also on a multiple run */ - LONGS_EQUAL(1, setup_teardown_was_called_in_test_group_in_C); -} - -static bool hasDestructorOfTheDestructorCheckedBeenCalled; - -class HasTheDestructorBeenCalledChecker -{ -public: - HasTheDestructorBeenCalledChecker(){} - ~HasTheDestructorBeenCalledChecker() { hasDestructorOfTheDestructorCheckedBeenCalled = true; } -}; - -TEST_GROUP(TestHarness_c) -{ - TestTestingFixture* fixture; - TEST_SETUP() - { - hasDestructorOfTheDestructorCheckedBeenCalled = false; - fixture = new TestTestingFixture(); - } - TEST_TEARDOWN() - { - delete fixture; - } -}; - -static void _failIntMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_EQUAL_C_INT(1, 2); -} // LCOV_EXCL_LINE - -TEST(TestHarness_c, checkInt) -{ - CHECK_EQUAL_C_INT(2, 2); - fixture->setTestFunction(_failIntMethod); - fixture->runAllTests(); - fixture->assertPrintContains("expected <1 0x1>\n but was <2 0x2>"); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failRealMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_EQUAL_C_REAL(1.0, 2.0, 0.5); -} // LCOV_EXCL_LINE - -TEST(TestHarness_c, checkReal) -{ - CHECK_EQUAL_C_REAL(1.0, 1.1, 0.5); - fixture->setTestFunction(_failRealMethod); - fixture->runAllTests(); - fixture->assertPrintContains("expected <1>\n but was <2>"); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failCharMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_EQUAL_C_CHAR('a', 'c'); -} - -TEST(TestHarness_c, checkChar) -{ - CHECK_EQUAL_C_CHAR('a', 'a'); - fixture->setTestFunction(_failCharMethod); - fixture->runAllTests(); - fixture->assertPrintContains("expected \n but was "); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failUnsignedByteMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_EQUAL_C_UBYTE(254, 253); -} - -TEST(TestHarness_c, checkUnsignedByte) -{ - CHECK_EQUAL_C_UBYTE(254, 254); - fixture->setTestFunction(_failUnsignedByteMethod); - fixture->runAllTests(); - fixture->assertPrintContains("expected <254>\n but was <253>"); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failSignedByteMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_EQUAL_C_SBYTE(-3, -5); -} - -TEST(TestHarness_c, checkSignedByte) -{ - CHECK_EQUAL_C_SBYTE(-3, -3); - fixture->setTestFunction(_failSignedByteMethod); - fixture->runAllTests(); - fixture->assertPrintContains("expected <-3>\n but was <-5>"); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failStringMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_EQUAL_C_STRING("Hello", "Hello World"); -} // LCOV_EXCL_LINE - -TEST(TestHarness_c, checkString) -{ - CHECK_EQUAL_C_STRING("Hello", "Hello"); - fixture->setTestFunction(_failStringMethod); - fixture->runAllTests(); - - StringEqualFailure failure(UtestShell::getCurrent(), "file", 1, "Hello", "Hello World", ""); - fixture->assertPrintContains(failure.getMessage()); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failPointerMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_EQUAL_C_POINTER(NULL, (void *)0x1); -} - -TEST(TestHarness_c, checkPointer) -{ - CHECK_EQUAL_C_POINTER(NULL, NULL); - fixture->setTestFunction(_failPointerMethod); - fixture->runAllTests(); - fixture->assertPrintContains("expected <0x0>\n but was <0x1>"); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failBitsMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_EQUAL_C_BITS(0x0001, (unsigned short)0x0003, 0xFFFF); -} - -TEST(TestHarness_c, checkBits) -{ - CHECK_EQUAL_C_POINTER(NULL, NULL); - fixture->setTestFunction(_failBitsMethod); - fixture->runAllTests(); - fixture->assertPrintContains("expected <00000000 00000001>\n\tbut was <00000000 00000011>"); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failTextMethod() -{ - HasTheDestructorBeenCalledChecker checker; - FAIL_TEXT_C("Booo"); -} // LCOV_EXCL_LINE - -TEST(TestHarness_c, checkFailText) -{ - fixture->setTestFunction(_failTextMethod); - fixture->runAllTests(); - fixture->assertPrintContains("Booo"); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _failMethod() -{ - HasTheDestructorBeenCalledChecker checker; - FAIL_C(); -} // LCOV_EXCL_LINE - -TEST(TestHarness_c, checkFail) -{ - fixture->setTestFunction(_failMethod); - fixture->runAllTests(); - LONGS_EQUAL(1, fixture->getFailureCount()); - fixture->assertPrintContains("arness_c"); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -static void _CheckMethod() -{ - HasTheDestructorBeenCalledChecker checker; - CHECK_C(false); -} // LCOV_EXCL_LINE - -TEST(TestHarness_c, checkCheck) -{ - CHECK_C(true); - fixture->setTestFunction(_CheckMethod); - fixture->runAllTests(); - LONGS_EQUAL(1, fixture->getFailureCount()); - CHECK(!hasDestructorOfTheDestructorCheckedBeenCalled) -} - -#if CPPUTEST_USE_MEM_LEAK_DETECTION - -TEST(TestHarness_c, cpputest_malloc_out_of_memory) -{ - cpputest_malloc_set_out_of_memory(); - CHECK(0 == cpputest_malloc(100)); - - cpputest_malloc_set_not_out_of_memory(); - void * mem = cpputest_malloc(100); - CHECK(0 != mem); - cpputest_free(mem); -} - -TEST(TestHarness_c, cpputest_malloc_out_of_memory_after_n_mallocs) -{ - cpputest_malloc_set_out_of_memory_countdown(3); - void * m1 = cpputest_malloc(10); - void * m2 = cpputest_malloc(11); - void * m3 = cpputest_malloc(12); - CHECK(m1); - CHECK(m2); - POINTERS_EQUAL(0, m3); - cpputest_malloc_set_not_out_of_memory(); - cpputest_free(m1); - cpputest_free(m2); -} - -TEST(TestHarness_c, cpputest_malloc_out_of_memory_after_0_mallocs) -{ - cpputest_malloc_set_out_of_memory_countdown(0); - void * m1 = cpputest_malloc(10); - CHECK(m1 == 0); - cpputest_malloc_set_not_out_of_memory(); -} - -TEST(TestHarness_c, count_mallocs) -{ - cpputest_malloc_count_reset(); - void * m1 = cpputest_malloc(10); - void * m2 = cpputest_malloc(11); - void * m3 = cpputest_malloc(12); - cpputest_free(m1); - cpputest_free(m2); - cpputest_free(m3); - LONGS_EQUAL(3, cpputest_malloc_get_count()); -} - -TEST(TestHarness_c, cpputest_calloc) -{ - void * mem = cpputest_calloc(10, 10); - CHECK(0 != mem); - cpputest_free(mem); -} - -TEST(TestHarness_c, cpputest_realloc_larger) -{ - const char* number_string = "123456789"; - - char* mem1 = (char*) cpputest_malloc(10); - - SimpleString::StrNCpy(mem1, number_string, 10); - - CHECK(mem1 != 0); - - char* mem2 = (char*) cpputest_realloc(mem1, 1000); - - CHECK(mem2 != 0); - STRCMP_EQUAL(number_string, mem2); - - cpputest_free(mem2); -} - -#include "CppUTest/MemoryLeakDetector.h" - -TEST(TestHarness_c, macros) -{ -#if CPPUTEST_USE_MALLOC_MACROS - MemoryLeakDetector* memLeakDetector = MemoryLeakWarningPlugin::getGlobalDetector(); - int memLeaks = memLeakDetector->totalMemoryLeaks(mem_leak_period_checking); -#endif - void* mem1 = malloc(10); - void* mem2 = calloc(10, 20); - void* mem3 = realloc(mem2, 100); -#if CPPUTEST_USE_MALLOC_MACROS - LONGS_EQUAL(memLeaks + 2, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); -#endif - free(mem1); - free(mem3); -#if CPPUTEST_USE_MALLOC_MACROS - LONGS_EQUAL(memLeaks, memLeakDetector->totalMemoryLeaks(mem_leak_period_checking)); -#endif - -} - -TEST(TestHarness_c, callocInitializedToZero) -{ - char* mem = (char*) calloc(20, sizeof(char)); - for (int i = 0; i < 20; i++) - CHECK(mem[i] == 0); - free(mem); -} - -TEST(TestHarness_c, callocShouldReturnNULLWhenOutOfMeory) -{ - cpputest_malloc_set_out_of_memory_countdown(0); - void * m = cpputest_calloc(1, 1); - CHECK(m == 0); - cpputest_malloc_set_not_out_of_memory(); -} -#endif - diff -Nru cpputest-3.8/tests/TestInstallerTest.cpp cpputest-4.0/tests/TestInstallerTest.cpp --- cpputest-3.8/tests/TestInstallerTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestInstallerTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestRegistry.h" - -class TestInstallerTestUtestShell : public UtestShell -{ -}; - - -// this is file scope because the test is installed -// with all other tests, which also happen to be -// created as static instances at file scope - -TEST_GROUP(TestInstaller) -{ - TestInstaller* testInstaller; - TestRegistry* myRegistry; - TestInstallerTestUtestShell shell; - void setup() - { - myRegistry = new TestRegistry(); - myRegistry->setCurrentRegistry(myRegistry); - testInstaller = new TestInstaller(shell, "TestInstaller", "test", __FILE__, __LINE__); - } - void teardown() - { - myRegistry->setCurrentRegistry(0); - testInstaller->unDo(); - delete testInstaller; - delete myRegistry; - } -}; - -TEST(TestInstaller, Create) -{ -} - diff -Nru cpputest-3.8/tests/TestMemoryAllocatorTest.cpp cpputest-4.0/tests/TestMemoryAllocatorTest.cpp --- cpputest-3.8/tests/TestMemoryAllocatorTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestMemoryAllocatorTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,253 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestMemoryAllocator.h" -#include "CppUTest/PlatformSpecificFunctions.h" - -TEST_GROUP(TestMemoryAllocatorTest) -{ - TestMemoryAllocator* allocator; - - void setup() - { - allocator = NULL; - } - - void teardown() - { - delete allocator; - } -}; - -TEST(TestMemoryAllocatorTest, SetCurrentNewAllocator) -{ - allocator = new TestMemoryAllocator("new allocator for test"); - setCurrentNewAllocator(allocator); - POINTERS_EQUAL(allocator, getCurrentNewAllocator()); - setCurrentNewAllocatorToDefault(); - POINTERS_EQUAL(defaultNewAllocator(), getCurrentNewAllocator()); -} - -TEST(TestMemoryAllocatorTest, SetCurrentNewArrayAllocator) -{ - allocator = new TestMemoryAllocator("new array allocator for test"); - setCurrentNewArrayAllocator(allocator); - POINTERS_EQUAL(allocator, getCurrentNewArrayAllocator()); - setCurrentNewArrayAllocatorToDefault(); - POINTERS_EQUAL(defaultNewArrayAllocator(), getCurrentNewArrayAllocator()); -} - -TEST(TestMemoryAllocatorTest, SetCurrentMallocAllocator) -{ - allocator = new TestMemoryAllocator("malloc_allocator"); - setCurrentMallocAllocator(allocator); - POINTERS_EQUAL(allocator, getCurrentMallocAllocator()); - setCurrentMallocAllocatorToDefault(); - POINTERS_EQUAL(defaultMallocAllocator(), getCurrentMallocAllocator()); -} - -TEST(TestMemoryAllocatorTest, MemoryAllocation) -{ - allocator = new TestMemoryAllocator(); - allocator->free_memory(allocator->alloc_memory(100, "file", 1), "file", 1); -} - -TEST(TestMemoryAllocatorTest, MallocNames) -{ - STRCMP_EQUAL("Standard Malloc Allocator", defaultMallocAllocator()->name()); - STRCMP_EQUAL("malloc", defaultMallocAllocator()->alloc_name()); - STRCMP_EQUAL("free", defaultMallocAllocator()->free_name()); -} - -TEST(TestMemoryAllocatorTest, NewNames) -{ - STRCMP_EQUAL("Standard New Allocator", defaultNewAllocator()->name()); - STRCMP_EQUAL("new", defaultNewAllocator()->alloc_name()); - STRCMP_EQUAL("delete", defaultNewAllocator()->free_name()); -} - -TEST(TestMemoryAllocatorTest, NewArrayNames) -{ - STRCMP_EQUAL("Standard New [] Allocator", defaultNewArrayAllocator()->name()); - STRCMP_EQUAL("new []", defaultNewArrayAllocator()->alloc_name()); - STRCMP_EQUAL("delete []", defaultNewArrayAllocator()->free_name()); -} - -TEST(TestMemoryAllocatorTest, NullUnknownAllocation) -{ - allocator = new NullUnknownAllocator; - allocator->free_memory(allocator->alloc_memory(100, "file", 1), "file", 1); -} - -TEST(TestMemoryAllocatorTest, NullUnknownNames) -{ - allocator = new NullUnknownAllocator; - STRCMP_EQUAL("Null Allocator", allocator->name()); - STRCMP_EQUAL("unknown", allocator->alloc_name()); - STRCMP_EQUAL("unknown", allocator->free_name()); -} - -#define MAX_SIZE_FOR_ALLOC ((size_t) -1 > (unsigned short)-1) ? (size_t) -97 : (size_t) -1 - -static void failTryingToAllocateTooMuchMemory(void) -{ - TestMemoryAllocator allocator; - allocator.alloc_memory(MAX_SIZE_FOR_ALLOC, "file", 1); -} // LCOV_EXCL_LINE - -#include "CppUTest/TestTestingFixture.h" - -TEST(TestMemoryAllocatorTest, TryingToAllocateTooMuchFailsTest) -{ - TestTestingFixture fixture; - fixture.setTestFunction(&failTryingToAllocateTooMuchMemory); - fixture.runAllTests(); - fixture.assertPrintContains("malloc returned null pointer"); -} - -#if CPPUTEST_USE_MEM_LEAK_DETECTION -#if CPPUTEST_USE_MALLOC_MACROS - -// FailableMemoryAllocator must be global. Otherwise, it does not exist when memory leak detector -// reports memory leaks. -static FailableMemoryAllocator failableMallocAllocator("Failable Malloc Allocator", "malloc", "free"); - - -TEST_GROUP(FailableMemoryAllocator) -{ - TestTestingFixture *fixture; - void setup() - { - fixture = new TestTestingFixture; - failableMallocAllocator.clearFailedAllocs(); - setCurrentMallocAllocator(&failableMallocAllocator); - } - void teardown() - { - failableMallocAllocator.checkAllFailedAllocsWereDone(); - setCurrentMallocAllocatorToDefault(); - delete fixture; - } -}; - -TEST(FailableMemoryAllocator, MallocWorksNormallyIfNotAskedToFail) -{ - int *memory = (int*)malloc(sizeof(int)); - CHECK(memory != NULL); - free(memory); -} - -TEST(FailableMemoryAllocator, FailFirstMalloc) -{ - failableMallocAllocator.failAllocNumber(1); - POINTERS_EQUAL(NULL, (int*)malloc(sizeof(int))); -} - -TEST(FailableMemoryAllocator, FailSecondAndFourthMalloc) -{ - failableMallocAllocator.failAllocNumber(2); - failableMallocAllocator.failAllocNumber(4); - int *memory1 = (int*)malloc(sizeof(int)); - int *memory2 = (int*)malloc(sizeof(int)); - int *memory3 = (int*)malloc(sizeof(int)); - int *memory4 = (int*)malloc(sizeof(int)); - - CHECK(NULL != memory1); - POINTERS_EQUAL(NULL, memory2); - CHECK(NULL != memory3); - POINTERS_EQUAL(NULL, memory4); - - free(memory1); - free(memory3); -} - -static void _failingAllocIsNeverDone() -{ - failableMallocAllocator.failAllocNumber(1); - failableMallocAllocator.failAllocNumber(2); - failableMallocAllocator.failAllocNumber(3); - malloc(sizeof(int)); - malloc(sizeof(int)); - failableMallocAllocator.checkAllFailedAllocsWereDone(); -} - -TEST(FailableMemoryAllocator, CheckAllFailingAllocsWereDone) -{ - fixture->setTestFunction(_failingAllocIsNeverDone); - - fixture->runAllTests(); - - LONGS_EQUAL(1, fixture->getFailureCount()); - fixture->assertPrintContains("Expected allocation number 3 was never done"); - failableMallocAllocator.clearFailedAllocs(); -} - -TEST(FailableMemoryAllocator, FailFirstAllocationAtGivenLine) -{ - failableMallocAllocator.failNthAllocAt(1, __FILE__, __LINE__ + 2); - - POINTERS_EQUAL(NULL, malloc(sizeof(int))); -} - -TEST(FailableMemoryAllocator, FailThirdAllocationAtGivenLine) -{ - int *memory[10]; - int allocation; - failableMallocAllocator.failNthAllocAt(3, __FILE__, __LINE__ + 4); - - for (allocation = 1; allocation <= 10; allocation++) - { - memory[allocation - 1] = (int *)malloc(sizeof(int)); - if (memory[allocation - 1] == NULL) - break; - } - - LONGS_EQUAL(3, allocation); - free(memory[0]); free(memory[1]); -} - -static void _failingLocationAllocIsNeverDone() -{ - failableMallocAllocator.failNthAllocAt(1, "TestMemoryAllocatorTest.cpp", __LINE__); - failableMallocAllocator.checkAllFailedAllocsWereDone(); -} - -TEST(FailableMemoryAllocator, CheckAllFailingLocationAllocsWereDone) -{ - fixture->setTestFunction(_failingLocationAllocIsNeverDone); - - fixture->runAllTests(); - - LONGS_EQUAL(1, fixture->getFailureCount()); - fixture->assertPrintContains("Expected failing alloc at TestMemoryAllocatorTest.cpp:"); - fixture->assertPrintContains("was never done"); - failableMallocAllocator.clearFailedAllocs(); -} - -#endif -#endif diff -Nru cpputest-3.8/tests/TestOutputTest.cpp cpputest-4.0/tests/TestOutputTest.cpp --- cpputest-3.8/tests/TestOutputTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestOutputTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,416 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/TestResult.h" -#include "CppUTest/PlatformSpecificFunctions.h" - -static long millisTime; - -extern "C" { - - static long MockGetPlatformSpecificTimeInMillis() - { - return millisTime; - } - -} - -TEST_GROUP(TestOutput) -{ - TestOutput* printer; - StringBufferTestOutput* mock; - UtestShell* tst; - TestFailure *f; - TestFailure *f2; - TestFailure *f3; - TestResult* result; - - void setup() - { - mock = new StringBufferTestOutput(); - printer = mock; - tst = new UtestShell("group", "test", "file", 10); - f = new TestFailure(tst, "failfile", 20, "message"); - f2 = new TestFailure(tst, "file", 20, "message"); - f3 = new TestFailure(tst, "file", 2, "message"); - result = new TestResult(*mock); - result->setTotalExecutionTime(10); - millisTime = 0; - UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); - TestOutput::setWorkingEnvironment(TestOutput::eclipse); - - } - void teardown() - { - TestOutput::setWorkingEnvironment(TestOutput::detectEnvironment); - delete printer; - delete tst; - delete f; - delete f2; - delete f3; - delete result; - } -}; - -TEST(TestOutput, PrintConstCharStar) -{ - printer->print("hello"); - printer->print("hello\n"); - STRCMP_EQUAL("hellohello\n", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintLong) -{ - printer->print(1234); - STRCMP_EQUAL("1234", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintDouble) -{ - printer->printDouble(12.34); - STRCMP_EQUAL("12.34", mock->getOutput().asCharString()); -} - -TEST(TestOutput, StreamOperators) -{ - *printer << "n=" << 1234; - STRCMP_EQUAL("n=1234", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintTestEnded) -{ - printer->printCurrentTestEnded(*result); - STRCMP_EQUAL(".", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintTestALot) -{ - for (int i = 0; i < 60; ++i) { - printer->printCurrentTestEnded(*result); - } - STRCMP_EQUAL("..................................................\n..........", mock->getOutput().asCharString()); -} - -TEST(TestOutput, SetProgressIndicator) -{ - printer->setProgressIndicator("."); - printer->printCurrentTestEnded(*result); - printer->setProgressIndicator("!"); - printer->printCurrentTestEnded(*result); - printer->setProgressIndicator("."); - printer->printCurrentTestEnded(*result); - - STRCMP_EQUAL(".!.", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintTestVerboseStarted) -{ - mock->verbose(); - printer->printCurrentTestStarted(*tst); - STRCMP_EQUAL("TEST(group, test)", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintTestVerboseEnded) -{ - mock->verbose(); - result->currentTestStarted(tst); - millisTime = 5; - result->currentTestEnded(tst); - STRCMP_EQUAL("TEST(group, test) - 5 ms\n", mock->getOutput().asCharString()); -} - -TEST(TestOutput, printColorWithSuccess) -{ - mock->color(); - printer->printTestsEnded(*result); - STRCMP_EQUAL("\n\033[32;1mOK (0 tests, 0 ran, 0 checks, 0 ignored, 0 filtered out, 10 ms)\033[m\n\n", mock->getOutput().asCharString()); -} - -TEST(TestOutput, printColorWithFailures) -{ - mock->color(); - result->addFailure(*f); - printer->flush(); - printer->printTestsEnded(*result); - STRCMP_EQUAL("\n\033[31;1mErrors (1 failures, 0 tests, 0 ran, 0 checks, 0 ignored, 0 filtered out, 10 ms)\033[m\n\n", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintTestRun) -{ - printer->printTestRun(2, 3); - STRCMP_EQUAL("Test run 2 of 3\n", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintTestRunOnlyOne) -{ - printer->printTestRun(1, 1); - STRCMP_EQUAL("", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintWithFailureInSameFile) -{ - printer->printFailure(*f2); - STRCMP_EQUAL("\nfile:20: error: Failure in TEST(group, test)\n\tmessage\n\n", mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintFailureWithFailInDifferentFile) -{ - printer->printFailure(*f); - const char* expected = - "\nfile:10: error: Failure in TEST(group, test)" - "\nfailfile:20: error:\n\tmessage\n\n"; - STRCMP_EQUAL(expected, mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintFailureWithFailInHelper) -{ - printer->printFailure(*f3); - const char* expected = - "\nfile:10: error: Failure in TEST(group, test)" - "\nfile:2: error:\n\tmessage\n\n"; - STRCMP_EQUAL(expected, mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintInVisualStudioFormat) -{ - TestOutput::setWorkingEnvironment(TestOutput::visualStudio); - printer->printFailure(*f3); - const char* expected = - "\nfile(10): error: Failure in TEST(group, test)" - "\nfile(2): error:\n\tmessage\n\n"; - STRCMP_EQUAL(expected, mock->getOutput().asCharString()); -} - -TEST(TestOutput, PrintTestStarts) -{ - printer->printTestsStarted(); - STRCMP_EQUAL("", mock->getOutput().asCharString()); -} - -TEST(TestOutput, printTestsEnded) -{ - result->countTest(); - result->countCheck(); - result->countIgnored(); - result->countIgnored(); - result->countRun(); - result->countRun(); - result->countRun(); - printer->printTestsEnded(*result); - STRCMP_EQUAL("\nOK (1 tests, 3 ran, 1 checks, 2 ignored, 0 filtered out, 10 ms)\n\n", mock->getOutput().asCharString()); -} - -TEST(TestOutput, printTestsEndedWithFailures) -{ - result->addFailure(*f); - printer->flush(); - printer->printTestsEnded(*result); - STRCMP_EQUAL("\nErrors (1 failures, 0 tests, 0 ran, 0 checks, 0 ignored, 0 filtered out, 10 ms)\n\n", mock->getOutput().asCharString()); -} - -class CompositeTestOutputTestStringBufferTestOutput : public StringBufferTestOutput -{ - public: - virtual void printTestsStarted() - { - output += "Test Start\n"; - } - - virtual void printTestsEnded(const TestResult& result) - { - output += StringFromFormat("Test End %d\n", result.getTestCount()); - } - - void printCurrentGroupStarted(const UtestShell& test) - { - output += StringFromFormat("Group %s Start\n", test.getGroup().asCharString()); - } - - void printCurrentGroupEnded(const TestResult& res) - { - output += StringFromFormat("Group End %d\n", res.getTestCount()); - } - - virtual void printCurrentTestStarted(const UtestShell&) - { - output += "s"; - } - - void flush() - { - output += "flush"; - } - - virtual bool isVerbose() - { - return verbose_; - } - - virtual bool isColor() - { - return color_; - } - - virtual const char* getProgressIndicator() - { - return progressIndication_; - } -}; - -TEST_GROUP(CompositeTestOutput) -{ - CompositeTestOutputTestStringBufferTestOutput* output1; - CompositeTestOutputTestStringBufferTestOutput* output2; - CompositeTestOutput compositeOutput; - TestResult* result; - UtestShell* test; - - void setup() - { - output1 = new CompositeTestOutputTestStringBufferTestOutput; - output2 = new CompositeTestOutputTestStringBufferTestOutput; - compositeOutput.setOutputOne(output1); - compositeOutput.setOutputTwo(output2); - result = new TestResult(compositeOutput); - test = new UtestShell("Group", "Name", "file", 10); - } - - void teardown() - { - delete test; - delete result; - } -}; - -TEST(CompositeTestOutput, TestStartedAndEnded) -{ - compositeOutput.printTestsStarted(); - compositeOutput.printTestsEnded(*result); - STRCMP_EQUAL("Test Start\nTest End 0\n", output1->getOutput().asCharString()); - STRCMP_EQUAL("Test Start\nTest End 0\n", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, CurrentTestStartedAndEnded) -{ - compositeOutput.printCurrentTestStarted(*test); - compositeOutput.printCurrentTestEnded(*result); - STRCMP_EQUAL("s.", output1->getOutput().asCharString()); - STRCMP_EQUAL("s.", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, CurrentGroupStartedAndEnded) -{ - compositeOutput.printCurrentGroupStarted(*test); - compositeOutput.printCurrentGroupEnded(*result); - STRCMP_EQUAL("Group Group Start\nGroup End 0\n", output1->getOutput().asCharString()); - STRCMP_EQUAL("Group Group Start\nGroup End 0\n", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, PrintBuffer) -{ - compositeOutput.printBuffer("Boo"); - STRCMP_EQUAL("Boo", output1->getOutput().asCharString()); - STRCMP_EQUAL("Boo", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, printChar) -{ - compositeOutput.print("Boo"); - STRCMP_EQUAL("Boo", output1->getOutput().asCharString()); - STRCMP_EQUAL("Boo", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, printLong) -{ - compositeOutput.print(10); - STRCMP_EQUAL("10", output1->getOutput().asCharString()); - STRCMP_EQUAL("10", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, printDouble) -{ - compositeOutput.printDouble(1.01); - STRCMP_EQUAL("1.01", output1->getOutput().asCharString()); - STRCMP_EQUAL("1.01", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, verbose) -{ - compositeOutput.verbose(); - CHECK(output1->isVerbose()); - CHECK(output2->isVerbose()); -} - -TEST(CompositeTestOutput, color) -{ - compositeOutput.color(); - CHECK(output1->isColor()); - CHECK(output2->isColor()); -} - -TEST(CompositeTestOutput, PrintTestFailure) -{ - TestOutput::WorkingEnvironment previousEnvironment = TestOutput::getWorkingEnvironment(); - TestOutput::setWorkingEnvironment(TestOutput::eclipse); - TestFailure failure(test, "file", 10, "failed"); - compositeOutput.printFailure(failure); - STRCMP_EQUAL("\nfile:10: error: Failure in TEST(Group, Name)\n\tfailed\n\n", output1->getOutput().asCharString()); - STRCMP_EQUAL("\nfile:10: error: Failure in TEST(Group, Name)\n\tfailed\n\n", output2->getOutput().asCharString()); - TestOutput::setWorkingEnvironment(previousEnvironment); -} - -TEST(CompositeTestOutput, PrintTestRun) -{ - compositeOutput.printTestRun(1, 2); - STRCMP_EQUAL("Test run 1 of 2\n", output1->getOutput().asCharString()); - STRCMP_EQUAL("Test run 1 of 2\n", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, setProgressIndicator) -{ - compositeOutput.setProgressIndicator("?"); - STRCMP_EQUAL("?", output1->getProgressIndicator()); - STRCMP_EQUAL("?", output2->getProgressIndicator()); -} - -TEST(CompositeTestOutput, flush) -{ - compositeOutput.flush(); - STRCMP_EQUAL("flush", output1->getOutput().asCharString()); - STRCMP_EQUAL("flush", output2->getOutput().asCharString()); -} - -TEST(CompositeTestOutput, deletePreviousInstanceWhenSettingNew) -{ - compositeOutput.setOutputOne(new CompositeTestOutput); - compositeOutput.setOutputTwo(new CompositeTestOutput); - - // CHECK NO MEMORY LEAKS -} - diff -Nru cpputest-3.8/tests/TestRegistryTest.cpp cpputest-4.0/tests/TestRegistryTest.cpp --- cpputest-3.8/tests/TestRegistryTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestRegistryTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,361 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestRegistry.h" -#include "CppUTest/TestOutput.h" - -namespace -{ -const int testLineNumber = 1; -} - -class MockTest: public UtestShell -{ -public: - MockTest(const char* group = "Group") : - UtestShell(group, "Name", "File", testLineNumber), hasRun_(false) - { - } - virtual void runOneTest(TestPlugin*, TestResult&) - { - hasRun_ = true; - } - - bool hasRun_; -}; - -class MockTestResult: public TestResult -{ -public: - - int countTestsStarted; - int countTestsEnded; - int countCurrentTestStarted; - int countCurrentTestEnded; - int countCurrentGroupStarted; - int countCurrentGroupEnded; - - MockTestResult(TestOutput& p) : - TestResult(p) - { - resetCount(); - } - - virtual ~MockTestResult() - { - } - - void resetCount() - { - countTestsStarted = 0; - countTestsEnded = 0; - countCurrentTestStarted = 0; - countCurrentTestEnded = 0; - countCurrentGroupStarted = 0; - countCurrentGroupEnded = 0; - } - - virtual void testsStarted() - { - countTestsStarted++; - } - virtual void testsEnded() - { - countTestsEnded++; - } - virtual void currentTestStarted(UtestShell* /*test*/) - { - countCurrentTestStarted++; - } - virtual void currentTestEnded(UtestShell* /*test*/) - { - countCurrentTestEnded++; - } - virtual void currentGroupStarted(UtestShell* /*test*/) - { - countCurrentGroupStarted++; - } - virtual void currentGroupEnded(UtestShell* /*test*/) - { - countCurrentGroupEnded++; - } - -}; - -TEST_GROUP(TestRegistry) -{ - TestRegistry* myRegistry; - StringBufferTestOutput* output; - MockTest* test1; - MockTest* test2; - MockTest* test3; - MockTest* test4; - TestResult *result; - MockTestResult *mockResult; - void setup() - { - output = new StringBufferTestOutput(); - mockResult = new MockTestResult(*output); - result = mockResult; - test1 = new MockTest(); - test2 = new MockTest(); - test3 = new MockTest("group2"); - test4 = new MockTest(); - myRegistry = new TestRegistry(); - myRegistry->setCurrentRegistry(myRegistry); - } - - void teardown() - { - myRegistry->setCurrentRegistry(0); - delete myRegistry; - delete test1; - delete test2; - delete test3; - delete test4; - delete result; - delete output; - } - - void addAndRunAllTests() - { - myRegistry->addTest(test1); - myRegistry->addTest(test2); - myRegistry->addTest(test3); - myRegistry->runAllTests(*result); - } -}; - -TEST(TestRegistry, registryMyRegistryAndReset) -{ - CHECK(myRegistry->getCurrentRegistry() == myRegistry); -} - -TEST(TestRegistry, emptyRegistryIsEmpty) -{ - CHECK(myRegistry->countTests() == 0); -} - -TEST(TestRegistry, addOneTestIsNotEmpty) -{ - myRegistry->addTest(test1); - CHECK(myRegistry->countTests() == 1); -} - -TEST(TestRegistry, addOneTwoTests) -{ - myRegistry->addTest(test1); - myRegistry->addTest(test2); - CHECK(myRegistry->countTests() == 2); -} - -TEST(TestRegistry, runTwoTests) -{ - myRegistry->addTest(test1); - myRegistry->addTest(test2); - CHECK(!test1->hasRun_); - CHECK(!test2->hasRun_); - myRegistry->runAllTests(*result); - CHECK(test1->hasRun_); - CHECK(test2->hasRun_); -} - -TEST(TestRegistry, runTwoTestsCheckResultFunctionsCalled) -{ - myRegistry->addTest(test1); - myRegistry->addTest(test2); - myRegistry->runAllTests(*result); - LONGS_EQUAL(1, mockResult->countTestsStarted); - LONGS_EQUAL(1, mockResult->countTestsEnded); - LONGS_EQUAL(1, mockResult->countCurrentGroupStarted); - LONGS_EQUAL(1, mockResult->countCurrentGroupEnded); - LONGS_EQUAL(2, mockResult->countCurrentTestStarted); - LONGS_EQUAL(2, mockResult->countCurrentTestEnded); -} - -TEST(TestRegistry, runThreeTestsandTwoGroupsCheckResultFunctionsCalled) -{ - addAndRunAllTests(); - LONGS_EQUAL(2, mockResult->countCurrentGroupStarted); - LONGS_EQUAL(2, mockResult->countCurrentGroupEnded); - LONGS_EQUAL(3, mockResult->countCurrentTestStarted); - LONGS_EQUAL(3, mockResult->countCurrentTestEnded); -} - -TEST(TestRegistry, unDoTest) -{ - myRegistry->addTest(test1); - CHECK(myRegistry->countTests() == 1); - myRegistry->unDoLastAddTest(); - CHECK(myRegistry->countTests() == 0); -} - -TEST(TestRegistry, unDoButNoTest) -{ - CHECK(myRegistry->countTests() == 0); - myRegistry->unDoLastAddTest(); - CHECK(myRegistry->countTests() == 0); -} - -TEST(TestRegistry, reallyUndoLastTest) -{ - myRegistry->addTest(test1); - myRegistry->addTest(test2); - CHECK(myRegistry->countTests() == 2); - myRegistry->unDoLastAddTest(); - CHECK(myRegistry->countTests() == 1); - myRegistry->runAllTests(*result); - CHECK(test1->hasRun_); - CHECK(!test2->hasRun_); -} - -TEST(TestRegistry, findTestWithNameDoesntExist) -{ - CHECK(myRegistry->findTestWithName("ThisTestDoesntExists") == NULL); -} - -TEST(TestRegistry, findTestWithName) -{ - test1->setTestName("NameOfATestThatDoesExist"); - test2->setTestName("SomeOtherTest"); - myRegistry->addTest(test1); - myRegistry->addTest(test2); - CHECK(myRegistry->findTestWithName("NameOfATestThatDoesExist")); -} - -TEST(TestRegistry, findTestWithGroupDoesntExist) -{ - CHECK(myRegistry->findTestWithGroup("ThisTestGroupDoesntExists") == NULL); -} - -TEST(TestRegistry, findTestWithGroup) -{ - test1->setGroupName("GroupOfATestThatDoesExist"); - test2->setGroupName("SomeOtherGroup"); - myRegistry->addTest(test1); - myRegistry->addTest(test2); - CHECK(myRegistry->findTestWithGroup("GroupOfATestThatDoesExist")); -} - -TEST(TestRegistry, nameFilterWorks) -{ - test1->setTestName("testname"); - test2->setTestName("noname"); - TestFilter nameFilter("testname"); - myRegistry->setNameFilters(&nameFilter); - addAndRunAllTests(); - CHECK(test1->hasRun_); - CHECK(!test2->hasRun_); -} - -TEST(TestRegistry, groupFilterWorks) -{ - test1->setGroupName("groupname"); - test2->setGroupName("noname"); - TestFilter groupFilter("groupname"); - myRegistry->setGroupFilters(&groupFilter); - addAndRunAllTests(); - CHECK(test1->hasRun_); - CHECK(!test2->hasRun_); -} - -TEST(TestRegistry, runTestInSeperateProcess) -{ - myRegistry->setRunTestsInSeperateProcess(); - myRegistry->addTest(test1); - myRegistry->runAllTests(*result); - CHECK(test1->isRunInSeperateProcess()); -} - -TEST(TestRegistry, CurrentRepetitionIsCorrectNone) -{ - CHECK(0 == myRegistry->getCurrentRepetition()); - myRegistry->runAllTests(*result); - LONGS_EQUAL(1, myRegistry->getCurrentRepetition()); -} - -TEST(TestRegistry, CurrentRepetitionIsCorrectTwo) -{ - CHECK(0 == myRegistry->getCurrentRepetition()); - myRegistry->runAllTests(*result); - myRegistry->runAllTests(*result); - LONGS_EQUAL(2, myRegistry->getCurrentRepetition()); -} - -class MyTestPluginDummy: public TestPlugin -{ -public: - MyTestPluginDummy(const SimpleString& name) : TestPlugin(name) {} - virtual ~MyTestPluginDummy() {} - virtual void runAllPreTestAction(UtestShell&, TestResult&) _override {} - virtual void runAllPostTestAction(UtestShell&, TestResult&) _override {} -}; - -TEST(TestRegistry, ResetPluginsWorks) -{ - MyTestPluginDummy plugin1("Plugin-1"); - MyTestPluginDummy plugin2("Plugin-2"); - myRegistry->installPlugin(&plugin1); - myRegistry->installPlugin(&plugin2); - LONGS_EQUAL(2, myRegistry->countPlugins()); - myRegistry->resetPlugins(); - LONGS_EQUAL(0, myRegistry->countPlugins()); -} - -TEST(TestRegistry, listTestGroupNames_shouldListBackwardsGroup1AfterGroup11AndGroup2OnlyOnce) -{ - test1->setGroupName("GROUP_1"); - myRegistry->addTest(test1); - test2->setGroupName("GROUP_2"); - myRegistry->addTest(test2); - test3->setGroupName("GROUP_11"); - myRegistry->addTest(test3); - test4->setGroupName("GROUP_2"); - myRegistry->addTest(test4); - - myRegistry->listTestGroupNames(*result); - SimpleString s = output->getOutput(); - STRCMP_EQUAL("GROUP_2 GROUP_11 GROUP_1", s.asCharString()); -} - -TEST(TestRegistry, listTestGroupAndCaseNames_shouldListBackwardsGroupATestaAfterGroupAtestaa) -{ - test1->setGroupName("GROUP_A"); - test1->setTestName("test_a"); - myRegistry->addTest(test1); - test2->setGroupName("GROUP_B"); - test2->setTestName("test_b"); - myRegistry->addTest(test2); - test3->setGroupName("GROUP_A"); - test3->setTestName("test_aa"); - myRegistry->addTest(test3); - - myRegistry->listTestGroupAndCaseNames(*result); - SimpleString s = output->getOutput(); - STRCMP_EQUAL("GROUP_A.test_aa GROUP_B.test_b GROUP_A.test_a", s.asCharString()); -} diff -Nru cpputest-3.8/tests/TestResultTest.cpp cpputest-4.0/tests/TestResultTest.cpp --- cpputest-3.8/tests/TestResultTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/TestResultTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/PlatformSpecificFunctions.h" -#include "CppUTest/TestOutput.h" - -extern "C" { - - static long MockGetPlatformSpecificTimeInMillis() - { - return 10; - } - -} - -TEST_GROUP(TestResult) -{ - TestOutput* printer; - StringBufferTestOutput* mock; - - TestResult* res; - - void setup() - { - mock = new StringBufferTestOutput(); - printer = mock; - res = new TestResult(*printer); - UT_PTR_SET(GetPlatformSpecificTimeInMillis, MockGetPlatformSpecificTimeInMillis); - } - void teardown() - { - delete printer; - delete res; - } -}; - -TEST(TestResult, TestEndedWillPrintResultsAndExecutionTime) -{ - res->testsEnded(); - CHECK(mock->getOutput().contains("10 ms")); -} diff -Nru cpputest-3.8/tests/TestUTestMacro.cpp cpputest-4.0/tests/TestUTestMacro.cpp --- cpputest-3.8/tests/TestUTestMacro.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/tests/TestUTestMacro.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1065 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/TestTestingFixture.h" - -#define CHECK_TEST_FAILS_PROPER_WITH_TEXT(text) fixture.checkTestFailsWithProperTestLocation(text, __FILE__, __LINE__) - -TEST_GROUP(UnitTestMacros) -{ - TestTestingFixture fixture; -}; - -static void _failingTestMethodWithFAIL() -{ - FAIL("This test fails"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FAILMakesTheTestFailPrintsTheRightResultAndStopsExecuting) -{ - fixture.runTestWithMethod(_failingTestMethodWithFAIL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("This test fails"); -} - -TEST(UnitTestMacros, FAILWillPrintTheFileThatItFailed) -{ - fixture.runTestWithMethod(_failingTestMethodWithFAIL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT(__FILE__); -} - -TEST(UnitTestMacros, FAILBehavesAsAProperMacro) -{ - if (false) FAIL("") - else CHECK(true) - - if (true) CHECK(true) - else FAIL("") -} - -IGNORE_TEST(UnitTestMacros, FAILworksInAnIgnoredTest) -{ - FAIL("die!"); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _UNSIGNED_LONGS_EQUALTestMethod() -{ - UNSIGNED_LONGS_EQUAL(1, 1); - UNSIGNED_LONGS_EQUAL(1, 0); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, TestUNSIGNED_LONGS_EQUAL) -{ - fixture.runTestWithMethod(_UNSIGNED_LONGS_EQUALTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1) 0x1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0) 0x0>"); -} - -TEST(UnitTestMacros, UNSIGNED_LONGS_EQUALBehavesAsProperMacro) -{ - if (false) UNSIGNED_LONGS_EQUAL(1, 0) - else UNSIGNED_LONGS_EQUAL(1, 1) -} - -IGNORE_TEST(UnitTestMacros, UNSIGNED_LONGS_EQUALWorksInAnIgnoredTest) -{ - UNSIGNED_LONGS_EQUAL(1, 0); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _UNSIGNED_LONGS_EQUAL_TEXTTestMethod() -{ - UNSIGNED_LONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, TestUNSIGNED_LONGS_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_UNSIGNED_LONGS_EQUAL_TEXTTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1) 0x1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0) 0x0>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, UNSIGNED_LONGS_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) UNSIGNED_LONGS_EQUAL_TEXT(1, 0, "Failed because it failed") - else UNSIGNED_LONGS_EQUAL_TEXT(1, 1, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, UNSIGNED_LONGS_EQUAL_TEXTWorksInAnIgnoredTest) -{ - UNSIGNED_LONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -#ifdef CPPUTEST_USE_LONG_LONG - -static void _LONGLONGS_EQUALTestMethod() -{ - LONGLONGS_EQUAL(1, 1); - LONGLONGS_EQUAL(1, 0); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, TestLONGLONGS_EQUAL) -{ - fixture.runTestWithMethod(_LONGLONGS_EQUALTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 0x1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 0x0>"); -} - -TEST(UnitTestMacros, LONGLONGS_EQUALBehavesAsProperMacro) -{ - if (false) LONGLONGS_EQUAL(1, 0) - else LONGLONGS_EQUAL(1, 1) -} - -IGNORE_TEST(UnitTestMacros, LONGLONGS_EQUALWorksInAnIgnoredTest) -{ - LONGLONGS_EQUAL(1, 0); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _LONGLONGS_EQUAL_TEXTTestMethod() -{ - LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, TestLONGLONGS_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_LONGLONGS_EQUAL_TEXTTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 0x1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 0x0>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, LONGLONGS_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed") - else LONGLONGS_EQUAL_TEXT(1, 1, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, LONGLONGS_EQUAL_TEXTWorksInAnIgnoredTest) -{ - LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _UNSIGNED_LONGLONGS_EQUALTestMethod() -{ - UNSIGNED_LONGLONGS_EQUAL(1, 1); - UNSIGNED_LONGLONGS_EQUAL(1, 0); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, TestUNSIGNED_LONGLONGS_EQUAL) -{ - fixture.runTestWithMethod(_UNSIGNED_LONGLONGS_EQUALTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1) 0x1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0) 0x0>"); -} - -TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUALBehavesAsProperMacro) -{ - if (false) UNSIGNED_LONGLONGS_EQUAL(1, 0) - else UNSIGNED_LONGLONGS_EQUAL(1, 1) -} - -IGNORE_TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUALWorksInAnIgnoredTest) -{ - UNSIGNED_LONGLONGS_EQUAL(1, 0); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _UNSIGNED_LONGLONGS_EQUAL_TEXTTestMethod() -{ - UNSIGNED_LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, TestUNSIGNED_LONGLONGS_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_UNSIGNED_LONGLONGS_EQUAL_TEXTTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1 (0x1) 0x1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0 (0x0) 0x0>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) UNSIGNED_LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed") - else UNSIGNED_LONGLONGS_EQUAL_TEXT(1, 1, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUAL_TEXTWorksInAnIgnoredTest) -{ - UNSIGNED_LONGLONGS_EQUAL_TEXT(1, 0, "Failed because it failed"); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -#else - -static void _LONGLONGS_EQUALFailsWithUnsupportedFeatureTestMethod() -{ - LONGLONGS_EQUAL(1, 1); -} // LCOV_EXCL_LINE - -static void _UNSIGNED_LONGLONGS_EQUALFailsWithUnsupportedFeatureTestMethod() -{ - UNSIGNED_LONGLONGS_EQUAL(1, 1); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, LONGLONGS_EQUALFailsWithUnsupportedFeature) -{ - fixture.runTestWithMethod(_LONGLONGS_EQUALFailsWithUnsupportedFeatureTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("\"CPPUTEST_USE_LONG_LONG\" is not supported"); -} - -TEST(UnitTestMacros, UNSIGNED_LONGLONGS_EQUALFailsWithUnsupportedFeature) -{ - fixture.runTestWithMethod(_UNSIGNED_LONGLONGS_EQUALFailsWithUnsupportedFeatureTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("\"CPPUTEST_USE_LONG_LONG\" is not supported"); -} - -#endif /* CPPUTEST_USE_LONG_LONG */ - -static void _failingTestMethodWithCHECK() -{ - CHECK(false); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK(false) failed"); -} - -TEST(UnitTestMacros, CHECKBehavesAsProperMacro) -{ - if (false) CHECK(false) - else CHECK(true) -} - -IGNORE_TEST(UnitTestMacros, CHECKWorksInAnIgnoredTest) -{ - CHECK(false); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithCHECK_TEXT() -{ - CHECK_TEXT(false, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK(false) failed"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, CHECK_TEXTBehavesAsProperMacro) -{ - if (false) CHECK_TEXT(false, "false") - else CHECK_TEXT(true, "true") -} - -IGNORE_TEST(UnitTestMacros, CHECK_TEXTWorksInAnIgnoredTest) -{ - CHECK_TEXT(false, "false"); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithCHECK_TRUE() -{ - CHECK_TRUE(false); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_TRUE) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK_TRUE); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_TRUE(false) failed"); -} - -TEST(UnitTestMacros, CHECK_TRUEBehavesAsProperMacro) -{ - if (false) CHECK_TRUE(false) - else CHECK_TRUE(true) -} - -IGNORE_TEST(UnitTestMacros, CHECK_TRUEWorksInAnIgnoredTest) -{ - CHECK_TRUE(false) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithCHECK_TRUE_TEXT() -{ - CHECK_TRUE_TEXT(false, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_TRUE_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK_TRUE_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_TRUE(false) failed"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, CHECK_TRUE_TEXTBehavesAsProperMacro) -{ - if (false) CHECK_TRUE_TEXT(false, "Failed because it failed") - else CHECK_TRUE_TEXT(true, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, CHECK_TRUE_TEXTWorksInAnIgnoredTest) -{ - CHECK_TRUE_TEXT(false, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithCHECK_FALSE() -{ - CHECK_FALSE(true); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_FALSE) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK_FALSE); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_FALSE(true) failed"); -} - -TEST(UnitTestMacros, CHECK_FALSEBehavesAsProperMacro) -{ - if (false) CHECK_FALSE(true) - else CHECK_FALSE(false) -} - -IGNORE_TEST(UnitTestMacros, CHECK_FALSEWorksInAnIgnoredTest) -{ - CHECK_FALSE(true) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithCHECK_FALSE_TEXT() -{ - CHECK_FALSE_TEXT(true, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_FALSE_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK_FALSE_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("CHECK_FALSE(true)"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, CHECK_FALSE_TEXTBehavesAsProperMacro) -{ - if (false) CHECK_FALSE_TEXT(true, "Failed because it failed") - else CHECK_FALSE_TEXT(false, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, CHECK_FALSE_TEXTWorksInAnIgnoredTest) -{ - CHECK_FALSE_TEXT(true, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithCHECK_EQUAL() -{ - CHECK_EQUAL(1, 2); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <2>"); -} - -static int countInCountingMethod; -static int _countingMethod() -{ - return countInCountingMethod++; -} - -TEST(UnitTestMacros, LONGS_EQUAL_macroExpressionSafety) -{ - LONGS_EQUAL(1, 0.4 + 0.7); - LONGS_EQUAL(0.4 + 0.7, 1); - LONGS_EQUAL_TEXT(1, 0.4 + 0.7, "-Wconversion=great"); - LONGS_EQUAL_TEXT(0.4 + 0.7, 1, "-Wconversion=great"); -} - -TEST(UnitTestMacros, UNSIGNED_LONGS_EQUAL_macroExpressionSafety) -{ - UNSIGNED_LONGS_EQUAL(1, 0.4 + 0.7); - UNSIGNED_LONGS_EQUAL(0.4 + 0.7, 1); - UNSIGNED_LONGS_EQUAL_TEXT(1, 0.4 + 0.7, "-Wconversion=great"); - UNSIGNED_LONGS_EQUAL_TEXT(0.4 + 0.7, 1, "-Wconversion=great"); -} - -TEST(UnitTestMacros, passingCheckEqualWillNotBeEvaluatedMultipleTimesWithCHECK_EQUAL) -{ - countInCountingMethod = 0; - CHECK_EQUAL(0, _countingMethod()); - - LONGS_EQUAL(1, countInCountingMethod); -} - -static void _failing_CHECK_EQUAL_WithActualBeingEvaluatesMultipleTimesWillGiveAWarning() -{ - CHECK_EQUAL(12345, _countingMethod()); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, failing_CHECK_EQUAL_WithActualBeingEvaluatesMultipleTimesWillGiveAWarning) -{ - fixture.runTestWithMethod(_failing_CHECK_EQUAL_WithActualBeingEvaluatesMultipleTimesWillGiveAWarning); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("WARNING:\n\tThe \"Actual Parameter\" parameter is evaluated multiple times resulting in different values.\n\tThus the value in the error message is probably incorrect."); -} - -static void _failing_CHECK_EQUAL_WithExpectedBeingEvaluatesMultipleTimesWillGiveAWarning() -{ - CHECK_EQUAL(_countingMethod(), 12345); -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, failing_CHECK_EQUAL_WithExpectedBeingEvaluatesMultipleTimesWillGiveAWarning) -{ - fixture.runTestWithMethod(_failing_CHECK_EQUAL_WithExpectedBeingEvaluatesMultipleTimesWillGiveAWarning); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("WARNING:\n\tThe \"Expected Parameter\" parameter is evaluated multiple times resulting in different values.\n\tThus the value in the error message is probably incorrect."); -} - -TEST(UnitTestMacros, failing_CHECK_EQUAL_withParamatersThatDontChangeWillNotGiveAnyWarning) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK_EQUAL); - CHECK( ! fixture.output_->getOutput().contains("WARNING")); -} - -TEST(UnitTestMacros, CHECK_EQUALBehavesAsProperMacro) -{ - if (false) CHECK_EQUAL(1, 2) - else CHECK_EQUAL(1, 1) -} - -IGNORE_TEST(UnitTestMacros, CHECK_EQUALWorksInAnIgnoredTest) -{ - CHECK_EQUAL(1, 2) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithCHECK_EQUAL_TEXT() -{ - CHECK_EQUAL_TEXT(1, 2, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithCHECK_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <2>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, CHECK_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) CHECK_EQUAL_TEXT(1, 2, "Failed because it failed") - else CHECK_EQUAL_TEXT(1, 1, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, CHECK_EQUAL_TEXTWorksInAnIgnoredTest) -{ - CHECK_EQUAL_TEXT(1, 2, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithLONGS_EQUAL() -{ - LONGS_EQUAL(1, 0xff); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithLONGS_EQUALS) -{ - fixture.runTestWithMethod(_failingTestMethodWithLONGS_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected < 1 0x01>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <255 0xff>"); -} - -TEST(UnitTestMacros, LONGS_EQUALBehavesAsProperMacro) -{ - if (false) LONGS_EQUAL(1, 2) - else LONGS_EQUAL(10, 10) -} - -IGNORE_TEST(UnitTestMacros, LONGS_EQUALWorksInAnIgnoredTest) -{ - LONGS_EQUAL(11, 22) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithLONGS_EQUAL_TEXT() -{ - LONGS_EQUAL_TEXT(1, 0xff, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithLONGS_EQUALS_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithLONGS_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected < 1 0x01>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <255 0xff>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, LONGS_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) LONGS_EQUAL_TEXT(1, 2, "Failed because it failed") - else LONGS_EQUAL_TEXT(10, 10, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, LONGS_EQUAL_TEXTWorksInAnIgnoredTest) -{ - LONGS_EQUAL_TEXT(11, 22, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithBYTES_EQUAL() -{ - BYTES_EQUAL('a', 'b'); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} - -TEST(UnitTestMacros, FailureWithBYTES_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithBYTES_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <97 0x61>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <98 0x62>"); -} - -TEST(UnitTestMacros, BYTES_EQUALBehavesAsProperMacro) -{ - if (false) BYTES_EQUAL('a', 'b') - else BYTES_EQUAL('c', 'c') -} - -IGNORE_TEST(UnitTestMacros, BYTES_EQUALWorksInAnIgnoredTest) -{ - BYTES_EQUAL('q', 'w') // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithBYTES_EQUAL_TEXT() -{ - BYTES_EQUAL_TEXT('a', 'b', "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} - -TEST(UnitTestMacros, FailureWithBYTES_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithBYTES_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <97 0x61>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <98 0x62>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, BYTES_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) BYTES_EQUAL_TEXT('a', 'b', "Failed because it failed") - else BYTES_EQUAL_TEXT('c', 'c', "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, BYTES_EQUAL_TEXTWorksInAnIgnoredTest) -{ - BYTES_EQUAL_TEXT('q', 'w', "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSIGNED_BYTES_EQUAL() -{ - SIGNED_BYTES_EQUAL(-1, -2); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} - -TEST(UnitTestMacros, FailureWithSIGNED_BYTES_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithSIGNED_BYTES_EQUAL); -#if CPPUTEST_CHAR_BIT == 16 - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <-1 0xffff>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <-2 0xfffe>"); -#else - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <-1 0xff>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <-2 0xfe>"); -#endif -} - -TEST(UnitTestMacros, CHARS_EQUALBehavesAsProperMacro) -{ - if (false) SIGNED_BYTES_EQUAL(-1, -2) - else SIGNED_BYTES_EQUAL(-3, -3) -} - -IGNORE_TEST(UnitTestMacros, CHARS_EQUALWorksInAnIgnoredTest) -{ - SIGNED_BYTES_EQUAL(-7, 19) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSIGNED_BYTES_EQUAL_TEXT() -{ - SIGNED_BYTES_EQUAL_TEXT(-127, -126, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} - -TEST(UnitTestMacros, FailureWithSIGNED_BYTES_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithSIGNED_BYTES_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <-127 0x81>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <-126 0x82>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, CHARS_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) SIGNED_BYTES_EQUAL_TEXT(-1, -2, "Failed because it failed") - else SIGNED_BYTES_EQUAL_TEXT(-3, -3, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, SIGNED_BYTES_EQUAL_TEXTWorksInAnIgnoredTest) -{ - SIGNED_BYTES_EQUAL_TEXT(-7, 19, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithPOINTERS_EQUAL() -{ - POINTERS_EQUAL((void*)0xa5a5, (void*)0xf0f0); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithPOINTERS_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithPOINTERS_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0xa5a5>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0xf0f0>"); -} - -TEST(UnitTestMacros, POINTERS_EQUALBehavesAsProperMacro) -{ - if (false) POINTERS_EQUAL(0, (void*) 0xbeefbeef) - else POINTERS_EQUAL((void*)0xdeadbeef, (void*)0xdeadbeef) -} - -IGNORE_TEST(UnitTestMacros, POINTERS_EQUALWorksInAnIgnoredTest) -{ - POINTERS_EQUAL((void*) 0xbeef, (void*) 0xdead) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithPOINTERS_EQUAL_TEXT() -{ - POINTERS_EQUAL_TEXT((void*)0xa5a5, (void*)0xf0f0, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithPOINTERS_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithPOINTERS_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0xa5a5>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0xf0f0>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, POINTERS_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) POINTERS_EQUAL_TEXT(0, (void*) 0xbeefbeef, "Failed because it failed") - else POINTERS_EQUAL_TEXT((void*)0xdeadbeef, (void*)0xdeadbeef, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, POINTERS_EQUAL_TEXTWorksInAnIgnoredTest) -{ - POINTERS_EQUAL_TEXT((void*) 0xbeef, (void*) 0xdead, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - - -static void _failingTestMethodWithFUNCTIONPOINTERS_EQUAL() -{ - FUNCTIONPOINTERS_EQUAL((void (*)())0xa5a5, (void (*)())0xf0f0); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithFUNCTIONPOINTERS_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithFUNCTIONPOINTERS_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0xa5a5>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0xf0f0>"); -} - -TEST(UnitTestMacros, FUNCTIONPOINTERS_EQUALBehavesAsProperMacro) -{ - if (false) FUNCTIONPOINTERS_EQUAL(0, (void (*)())0xbeefbeef) - else FUNCTIONPOINTERS_EQUAL((void (*)())0xdeadbeef, (void (*)())0xdeadbeef) -} - -IGNORE_TEST(UnitTestMacros, FUNCTIONPOINTERS_EQUALWorksInAnIgnoredTest) -{ - FUNCTIONPOINTERS_EQUAL((void (*)())0xbeef, (void (*)())0xdead) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithFUNCTIONPOINTERS_EQUAL_TEXT() -{ - FUNCTIONPOINTERS_EQUAL_TEXT((void (*)())0xa5a5, (void (*)())0xf0f0, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithFUNCTIONPOINTERS_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithFUNCTIONPOINTERS_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0xa5a5>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <0xf0f0>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, FUNCTIONPOINTERS_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) FUNCTIONPOINTERS_EQUAL_TEXT(0, (void (*)())0xbeefbeef, "Failed because it failed") - else FUNCTIONPOINTERS_EQUAL_TEXT((void (*)())0xdeadbeef, (void (*)())0xdeadbeef, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, FUNCTIONPOINTERS_EQUAL_TEXTWorksInAnIgnoredTest) -{ - FUNCTIONPOINTERS_EQUAL_TEXT((void (*)())0xbeef, (void (*)())0xdead, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - - - - -static void _failingTestMethodWithDOUBLES_EQUAL() -{ - DOUBLES_EQUAL(0.12, 44.1, 0.3); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithDOUBLES_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithDOUBLES_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0.12>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <44.1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("threshold used was <0.3>"); -} - -TEST(UnitTestMacros, DOUBLES_EQUALBehavesAsProperMacro) -{ - if (false) DOUBLES_EQUAL(0.0, 1.1, 0.0005) - else DOUBLES_EQUAL(0.1, 0.2, 0.2) -} - -IGNORE_TEST(UnitTestMacros, DOUBLES_EQUALWorksInAnIgnoredTest) -{ - DOUBLES_EQUAL(100.0, 0.0, 0.2) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithDOUBLES_EQUAL_TEXT() -{ - DOUBLES_EQUAL_TEXT(0.12, 44.1, 0.3, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithDOUBLES_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithDOUBLES_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <0.12>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <44.1>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("threshold used was <0.3>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, DOUBLES_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) DOUBLES_EQUAL_TEXT(0.0, 1.1, 0.0005, "Failed because it failed") - else DOUBLES_EQUAL_TEXT(0.1, 0.2, 0.2, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, DOUBLES_EQUAL_TEXTWorksInAnIgnoredTest) -{ - DOUBLES_EQUAL_TEXT(100.0, 0.0, 0.2, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static bool lineOfCodeExecutedAfterCheck = false; - -static void _passingTestMethod() -{ - CHECK(true); - lineOfCodeExecutedAfterCheck = true; -} - -TEST(UnitTestMacros, SuccessPrintsNothing) -{ - fixture.runTestWithMethod(_passingTestMethod); - - LONGS_EQUAL(0, fixture.getFailureCount()); - fixture.assertPrintContains(".\nOK (1 tests"); - CHECK(lineOfCodeExecutedAfterCheck); -} - -static void _methodThatOnlyPrints() -{ - UT_PRINT("Hello World!"); -} - -TEST(UnitTestMacros, PrintPrintsWhateverPrintPrints) -{ - fixture.runTestWithMethod(_methodThatOnlyPrints); - - LONGS_EQUAL(0, fixture.getFailureCount()); - fixture.assertPrintContains("Hello World!"); - fixture.assertPrintContains(__FILE__); -} - -static void _methodThatOnlyPrintsUsingSimpleStringFromFormat() -{ - UT_PRINT(StringFromFormat("Hello %s %d", "World!", 2009)); -} - -TEST(UnitTestMacros, PrintPrintsSimpleStringsForExampleThoseReturnedByFromString) -{ - fixture.runTestWithMethod(_methodThatOnlyPrintsUsingSimpleStringFromFormat); - fixture.assertPrintContains("Hello World! 2009"); -} - -static int functionThatReturnsAValue() -{ - CHECK(0 == 0); - CHECK_TEXT(0 == 0, "Shouldn't fail"); - CHECK_TRUE(0 == 0); - CHECK_TRUE_TEXT(0 == 0, "Shouldn't fail"); - CHECK_FALSE(0 != 0); - CHECK_FALSE_TEXT(0 != 0, "Shouldn't fail"); - LONGS_EQUAL(1,1); - LONGS_EQUAL_TEXT(1, 1, "Shouldn't fail"); - BYTES_EQUAL(0xab,0xab); - BYTES_EQUAL_TEXT(0xab, 0xab, "Shouldn't fail"); - CHECK_EQUAL(100,100); - CHECK_EQUAL_TEXT(100, 100, "Shouldn't fail"); - STRCMP_EQUAL("THIS", "THIS"); - STRCMP_EQUAL_TEXT("THIS", "THIS", "Shouldn't fail"); - DOUBLES_EQUAL(1.0, 1.0, .01); - DOUBLES_EQUAL_TEXT(1.0, 1.0, .01, "Shouldn't fail"); - POINTERS_EQUAL(0, 0); - POINTERS_EQUAL_TEXT(0, 0, "Shouldn't fail"); - MEMCMP_EQUAL("THIS", "THIS", 5); - MEMCMP_EQUAL_TEXT("THIS", "THIS", 5, "Shouldn't fail"); - BITS_EQUAL(0x01, (unsigned char )0x01, 0xFF); - BITS_EQUAL(0x0001, (unsigned short )0x0001, 0xFFFF); - BITS_EQUAL(0x00000001, (unsigned long )0x00000001, 0xFFFFFFFF); - BITS_EQUAL_TEXT(0x01, (unsigned char )0x01, 0xFF, "Shouldn't fail"); - return 0; -} - -TEST(UnitTestMacros, allMacrosFromFunctionThatReturnsAValue) -{ - functionThatReturnsAValue(); -} - -TEST(UnitTestMacros, MEMCMP_EQUALBehavesAsAProperMacro) -{ - if (false) MEMCMP_EQUAL("TEST", "test", 5) - else MEMCMP_EQUAL("TEST", "TEST", 5) -} - -IGNORE_TEST(UnitTestMacros, MEMCMP_EQUALWorksInAnIgnoredTest) -{ - MEMCMP_EQUAL("TEST", "test", 5); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _MEMCMP_EQUALFailingTestMethodWithUnequalInput() -{ - unsigned char expectedData[] = { 0x00, 0x01, 0x02, 0x03 }; - unsigned char actualData[] = { 0x00, 0x01, 0x03, 0x03 }; - - MEMCMP_EQUAL(expectedData, actualData, sizeof(expectedData)); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, MEMCMP_EQUALFailureWithUnequalInput) -{ - fixture.runTestWithMethod(_MEMCMP_EQUALFailingTestMethodWithUnequalInput); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <00 01 02 03>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <00 01 03 03>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 2"); -} - -static void _MEMCMP_EQUALFailingTestMethodWithNullExpected() -{ - unsigned char actualData[] = { 0x00, 0x01, 0x02, 0x03 }; - - MEMCMP_EQUAL(NULL, actualData, sizeof(actualData)); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, MEMCMP_EQUALFailureWithNullExpected) -{ - fixture.runTestWithMethod(_MEMCMP_EQUALFailingTestMethodWithNullExpected); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <(null)>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <00 01 02 03>"); -} - -static void _MEMCMP_EQUALFailingTestMethodWithNullActual() -{ - unsigned char expectedData[] = { 0x00, 0x01, 0x02, 0x03 }; - - MEMCMP_EQUAL(expectedData, NULL, sizeof(expectedData)); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, MEMCMP_EQUALFailureWithNullActual) -{ - fixture.runTestWithMethod(_MEMCMP_EQUALFailingTestMethodWithNullActual); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <00 01 02 03>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <(null)>"); -} - -TEST(UnitTestMacros, MEMCMP_EQUALNullExpectedNullActual) -{ - MEMCMP_EQUAL(NULL, NULL, 0); - MEMCMP_EQUAL(NULL, NULL, 1024); -} - -static void _failingTestMethodWithMEMCMP_EQUAL_TEXT() -{ - unsigned char expectedData[] = { 0x00, 0x01, 0x02, 0x03 }; - unsigned char actualData[] = { 0x00, 0x01, 0x03, 0x03 }; - - MEMCMP_EQUAL_TEXT(expectedData, actualData, sizeof(expectedData), "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithMEMCMP_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithMEMCMP_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <00 01 02 03>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <00 01 03 03>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 2"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, MEMCMP_EQUAL_TEXTBehavesAsAProperMacro) -{ - if (false) MEMCMP_EQUAL_TEXT("TEST", "test", 5, "Failed because it failed") - else MEMCMP_EQUAL_TEXT("TEST", "TEST", 5, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, MEMCMP_EQUAL_TEXTWorksInAnIgnoredTest) -{ - MEMCMP_EQUAL_TEXT("TEST", "test", 5, "Failed because it failed"); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, BITS_EQUALBehavesAsAProperMacro) -{ - if (false) BITS_EQUAL(0x00, 0xFF, 0xFF) - else BITS_EQUAL(0x00, 0x00, 0xFF) -} - -IGNORE_TEST(UnitTestMacros, BITS_EQUALWorksInAnIgnoredTest) -{ - BITS_EQUAL(0x00, 0xFF, 0xFF); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _BITS_EQUALFailingTestMethodWithUnequalInput() -{ - BITS_EQUAL(0x00, 0xFF, 0xFF); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, BITS_EQUALFailureWithUnequalInput) -{ - fixture.runTestWithMethod(_BITS_EQUALFailingTestMethodWithUnequalInput); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("00000000>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("11111111>"); -} - -TEST(UnitTestMacros, BITS_EQUALZeroMaskEqual) -{ - BITS_EQUAL(0x00, 0xFF, 0x00); -} - -static void _failingTestMethodWithBITS_EQUAL_TEXT() -{ - BITS_EQUAL_TEXT(0x00, 0xFFFFFFFF, 0xFF, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithBITS_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithBITS_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestMacros, BITS_EQUAL_TEXTBehavesAsAProperMacro) -{ - if (false) BITS_EQUAL_TEXT(0x00, 0xFF, 0xFF, "Failed because it failed") - else BITS_EQUAL_TEXT(0x00, 0x00, 0xFF, "Failed because it failed") -} - -IGNORE_TEST(UnitTestMacros, BITS_EQUAL_TEXTWorksInAnIgnoredTest) -{ - BITS_EQUAL_TEXT(0x00, 0xFF, 0xFF, "Failed because it failed"); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -#if CPPUTEST_USE_STD_CPP_LIB -static void _failingTestMethod_NoThrowWithCHECK_THROWS() -{ - CHECK_THROWS(int, (void) (1+2)); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_THROWS_whenDoesntThrow) -{ - fixture.runTestWithMethod(_failingTestMethod_NoThrowWithCHECK_THROWS); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected to throw int"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but threw nothing"); - LONGS_EQUAL(1, fixture.getCheckCount()); -} - -static void _succeedingTestMethod_CorrectThrowWithCHECK_THROWS() -{ - CHECK_THROWS(int, throw 4); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} - -TEST(UnitTestMacros, SuccessWithCHECK_THROWS) -{ - fixture.runTestWithMethod(_succeedingTestMethod_CorrectThrowWithCHECK_THROWS); - LONGS_EQUAL(1, fixture.getCheckCount()); -} - -static void _failingTestMethod_WrongThrowWithCHECK_THROWS() -{ - CHECK_THROWS(int, throw 4.3); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestMacros, FailureWithCHECK_THROWS_whenWrongThrow) -{ - fixture.runTestWithMethod(_failingTestMethod_WrongThrowWithCHECK_THROWS); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected to throw int"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but threw a different type"); - LONGS_EQUAL(1, fixture.getCheckCount()); -} - -TEST(UnitTestMacros, MultipleCHECK_THROWS_inOneScope) -{ - CHECK_THROWS(int, throw 4); - CHECK_THROWS(int, throw 4); -} -#endif diff -Nru cpputest-3.8/tests/TestUTestStringMacro.cpp cpputest-4.0/tests/TestUTestStringMacro.cpp --- cpputest-3.8/tests/TestUTestStringMacro.cpp 2016-05-25 03:32:27.000000000 +0000 +++ cpputest-4.0/tests/TestUTestStringMacro.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,468 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/TestTestingFixture.h" - -#define CHECK_TEST_FAILS_PROPER_WITH_TEXT(text) fixture.checkTestFailsWithProperTestLocation(text, __FILE__, __LINE__) - -TEST_GROUP(UnitTestStringMacros) -{ - TestTestingFixture fixture; -}; - -static void _STRCMP_EQUALWithActualIsNULLTestMethod() -{ - STRCMP_EQUAL("ok", NULL); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_EQUALAndActualIsNULL) -{ - fixture.runTestWithMethod(_STRCMP_EQUALWithActualIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <(null)>"); -} - -static void _STRCMP_EQUALWithExpectedIsNULLTestMethod() -{ - STRCMP_EQUAL(NULL, "ok"); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_EQUALAndExpectedIsNULL) -{ - fixture.runTestWithMethod(_STRCMP_EQUALWithExpectedIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <(null)>"); -} - -static void _STRCMP_CONTAINSWithActualIsNULLTestMethod() -{ - STRCMP_CONTAINS("ok", NULL); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_CONTAINSAndActualIsNULL) -{ - fixture.runTestWithMethod(_STRCMP_CONTAINSWithActualIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); -} - -static void _STRCMP_CONTAINSWithExpectedIsNULLTestMethod() -{ - STRCMP_CONTAINS(NULL, "ok"); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_CONTAINSAndExpectedIsNULL) -{ - fixture.runTestWithMethod(_STRCMP_CONTAINSWithExpectedIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain <>"); -} - -static void _STRNCMP_EQUALWithActualIsNULLTestMethod() -{ - STRNCMP_EQUAL("ok", NULL, 2); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRNCMP_EQUALAndActualIsNULL) -{ - fixture.runTestWithMethod(_STRNCMP_EQUALWithActualIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <(null)>"); -} - -static void _STRNCMP_EQUALWithExpectedIsNULLTestMethod() -{ - STRNCMP_EQUAL(NULL, "ok", 2); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRNCMP_EQUALAndExpectedIsNULL) -{ - fixture.runTestWithMethod(_STRNCMP_EQUALWithExpectedIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <(null)>"); -} - -static void _STRCMP_NOCASE_EQUALWithActualIsNULLTestMethod() -{ - STRCMP_NOCASE_EQUAL("ok", NULL); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUALAndActualIsNULL) -{ - fixture.runTestWithMethod(_STRCMP_NOCASE_EQUALWithActualIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was <(null)>"); -} - -static void _STRCMP_NOCASE_EQUALWithExpectedIsNULLTestMethod() -{ - STRCMP_NOCASE_EQUAL(NULL, "ok"); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUALAndExpectedIsNULL) -{ - fixture.runTestWithMethod(_STRCMP_NOCASE_EQUALWithExpectedIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <(null)>"); -} - -static void _STRCMP_NOCASE_EQUALWithUnequalInputTestMethod() -{ - STRCMP_NOCASE_EQUAL("no", "ok"); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUALAndUnequalInput) -{ - fixture.runTestWithMethod(_STRCMP_NOCASE_EQUALWithUnequalInputTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); -} - -static void _STRCMP_NOCASE_CONTAINSWithActualIsNULLTestMethod() -{ - STRCMP_NOCASE_CONTAINS("ok", NULL); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_CONTAINSAndActualIsNULL) -{ - fixture.runTestWithMethod(_STRCMP_NOCASE_CONTAINSWithActualIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); -} - -static void _STRCMP_NOCASE_CONTAINSWithExpectedIsNULLTestMethod() -{ - STRCMP_NOCASE_CONTAINS(NULL, "ok"); -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_CONTAINSAndExpectedIsNULL) -{ - fixture.runTestWithMethod(_STRCMP_NOCASE_CONTAINSWithExpectedIsNULLTestMethod); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain <>"); -} - -static void _failingTestMethodWithSTRCMP_EQUAL() -{ - STRCMP_EQUAL("hello", "hell"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); -} - -TEST(UnitTestStringMacros, STRCMP_EQUALBehavesAsProperMacro) -{ - if (false) STRCMP_EQUAL("1", "2") - else STRCMP_EQUAL("1", "1") -} - -IGNORE_TEST(UnitTestStringMacros, STRCMP_EQUALWorksInAnIgnoredTest) -{ - STRCMP_EQUAL("Hello", "World") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRCMP_EQUAL_TEXT() -{ - STRCMP_EQUAL_TEXT("hello", "hell", "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestStringMacros, STRCMP_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) STRCMP_EQUAL_TEXT("1", "2", "Failed because it failed") - else STRCMP_EQUAL_TEXT("1", "1", "Failed because it failed") -} - -IGNORE_TEST(UnitTestStringMacros, STRCMP_EQUAL_TEXTWorksInAnIgnoredTest) -{ - STRCMP_EQUAL_TEXT("Hello", "World", "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRNCMP_EQUAL() -{ - STRNCMP_EQUAL("hello", "hallo", 5); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRNCMP_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRNCMP_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); -} - -TEST(UnitTestStringMacros, STRNCMP_EQUALBehavesAsProperMacro) -{ - if (false) STRNCMP_EQUAL("1", "2", 1) - else STRNCMP_EQUAL("1", "1", 1) -} - -IGNORE_TEST(UnitTestStringMacros, STRNCMP_EQUALWorksInAnIgnoredTest) -{ - STRNCMP_EQUAL("Hello", "World", 3) // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRNCMP_EQUAL_TEXT() -{ - STRNCMP_EQUAL_TEXT("hello", "hallo", 5, "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRNCMP_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRNCMP_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestStringMacros, STRNCMP_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) STRNCMP_EQUAL_TEXT("1", "2", 1, "Failed because it failed") - else STRNCMP_EQUAL_TEXT("1", "1", 1, "Failed because it failed") -} - -IGNORE_TEST(UnitTestStringMacros, STRNCMP_EQUAL_TEXTWorksInAnIgnoredTest) -{ - STRNCMP_EQUAL_TEXT("Hello", "World", 3, "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRCMP_NOCASE_EQUAL() -{ - STRCMP_NOCASE_EQUAL("hello", "Hell"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUAL) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_NOCASE_EQUAL); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); -} - -TEST(UnitTestStringMacros, STRCMP_NOCASE_EQUALBehavesAsProperMacro) -{ - if (false) STRCMP_NOCASE_EQUAL("1", "2") - else STRCMP_NOCASE_EQUAL("1", "1") -} - -IGNORE_TEST(UnitTestStringMacros, STRCMP_NOCASE_EQUALWorksInAnIgnoredTest) -{ - STRCMP_NOCASE_EQUAL("Hello", "World") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRCMP_NOCASE_EQUAL_TEXT() -{ - STRCMP_NOCASE_EQUAL_TEXT("hello", "hell", "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_EQUAL_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_NOCASE_EQUAL_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestStringMacros, STRCMP_NOCASE_EQUAL_TEXTBehavesAsProperMacro) -{ - if (false) STRCMP_NOCASE_EQUAL_TEXT("1", "2", "Failed because it failed") - else STRCMP_NOCASE_EQUAL_TEXT("1", "1", "Failed because it failed") -} - -IGNORE_TEST(UnitTestStringMacros, STRCMP_NOCASE_EQUAL_TEXTWorksInAnIgnoredTest) -{ - STRCMP_NOCASE_EQUAL_TEXT("Hello", "World", "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRCMP_CONTAINS() -{ - STRCMP_CONTAINS("hello", "world"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_CONTAINS) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_CONTAINS); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("actual "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); -} - -TEST(UnitTestStringMacros, STRCMP_CONTAINSBehavesAsProperMacro) -{ - if (false) STRCMP_CONTAINS("1", "2") - else STRCMP_CONTAINS("1", "1") -} - -IGNORE_TEST(UnitTestStringMacros, STRCMP_CONTAINSWorksInAnIgnoredTest) -{ - STRCMP_CONTAINS("Hello", "World") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRCMP_CONTAINS_TEXT() -{ - STRCMP_CONTAINS_TEXT("hello", "world", "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, FailureWithSTRCMP_CONTAINS_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_CONTAINS_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("actual "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestStringMacros, STRCMP_CONTAINS_TEXTBehavesAsProperMacro) -{ - if (false) STRCMP_CONTAINS_TEXT("1", "2", "Failed because it failed") - else STRCMP_CONTAINS_TEXT("1", "1", "Failed because it failed") -} - -IGNORE_TEST(UnitTestStringMacros, STRCMP_CONTAINS_TEXTWorksInAnIgnoredTest) -{ - STRCMP_CONTAINS_TEXT("Hello", "World", "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRCMP_NOCASE_CONTAINS() -{ - STRCMP_NOCASE_CONTAINS("hello", "WORLD"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_CONTAINS) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_NOCASE_CONTAINS); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("actual "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); -} - -TEST(UnitTestStringMacros, STRCMP_NOCASE_CONTAINSBehavesAsProperMacro) -{ - if (false) STRCMP_NOCASE_CONTAINS("never", "executed") - else STRCMP_NOCASE_CONTAINS("hello", "HELLO WORLD") -} - -IGNORE_TEST(UnitTestStringMacros, STRCMP_NO_CASE_CONTAINSWorksInAnIgnoredTest) -{ - STRCMP_NOCASE_CONTAINS("Hello", "World") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -static void _failingTestMethodWithSTRCMP_NOCASE_CONTAINS_TEXT() -{ - STRCMP_NOCASE_CONTAINS_TEXT("hello", "WORLD", "Failed because it failed"); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} - -TEST(UnitTestStringMacros, FailureWithSTRCMP_NOCASE_CONTAINS_TEXT) -{ - fixture.runTestWithMethod(_failingTestMethodWithSTRCMP_NOCASE_CONTAINS_TEXT); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("actual "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("did not contain "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("Failed because it failed"); -} - -TEST(UnitTestStringMacros, STRCMP_NOCASE_CONTAINS_TEXTBehavesAsProperMacro) -{ - if (false) STRCMP_NOCASE_CONTAINS_TEXT("never", "executed", "Failed because it failed") - else STRCMP_NOCASE_CONTAINS_TEXT("hello", "HELLO WORLD", "Failed because it failed") -} - -IGNORE_TEST(UnitTestStringMacros, STRCMP_NO_CASE_CONTAINS_TEXTWorksInAnIgnoredTest) -{ - STRCMP_NOCASE_CONTAINS_TEXT("Hello", "World", "Failed because it failed") // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, NFirstCharsComparison) -{ - STRNCMP_EQUAL("Hello World!", "Hello Peter!", 0); - STRNCMP_EQUAL("Hello World!", "Hello Peter!", 1); - STRNCMP_EQUAL("Hello World!", "Hello Peter!", 6); - STRNCMP_EQUAL("Hello World!", "Hello", 5); -} - -static void _compareNFirstCharsWithUpperAndLowercase() -{ - STRNCMP_EQUAL("hello world!", "HELLO WORLD!", 12); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, CompareNFirstCharsWithUpperAndLowercase) -{ - fixture.runTestWithMethod(_compareNFirstCharsWithUpperAndLowercase); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 0"); -} - -static void _compareNFirstCharsWithDifferenceInTheMiddle() -{ - STRNCMP_EQUAL("Hello World!", "Hello Peter!", 12); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, CompareNFirstCharsWithDifferenceInTheMiddle) -{ - fixture.runTestWithMethod(_compareNFirstCharsWithDifferenceInTheMiddle); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 6"); -} - -static void _compareNFirstCharsWithEmptyString() -{ - STRNCMP_EQUAL("", "Not empty string", 5); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, CompareNFirstCharsWithEmptyString) -{ - fixture.runTestWithMethod(_compareNFirstCharsWithEmptyString); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected <>"); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 0"); -} - -static void _compareNFirstCharsWithLastCharDifferent() -{ - STRNCMP_EQUAL("Not empty string?", "Not empty string!", 17); - TestTestingFixture::lineExecutedAfterCheck(); // LCOV_EXCL_LINE -} // LCOV_EXCL_LINE - -TEST(UnitTestStringMacros, CompareNFirstCharsWithLastCharDifferent) -{ - fixture.runTestWithMethod(_compareNFirstCharsWithLastCharDifferent); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("expected "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("but was "); - CHECK_TEST_FAILS_PROPER_WITH_TEXT("difference starts at position 16"); -} - diff -Nru cpputest-3.8/tests/UtestPlatformTest.cpp cpputest-4.0/tests/UtestPlatformTest.cpp --- cpputest-3.8/tests/UtestPlatformTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/UtestPlatformTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/CommandLineTestRunner.h" -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestTestingFixture.h" -#include "CppUTest/PlatformSpecificFunctions.h" - -// This will cause a crash in VS2010 due to PlatformSpecificFree being uninitialized -static const SimpleString str1("abc"); -static const SimpleString str2("def"); -static const SimpleString str3(str1 + str2); - -TEST_GROUP(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess) -{ - TestTestingFixture fixture; -}; - -#ifndef CPPUTEST_HAVE_FORK - -TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, DummyFailsWithMessage) -{ - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.runAllTests(); - fixture.assertPrintContains("-p doesn't work on this platform, as it is lacking fork.\b"); -} - -#else - -static void _failFunction() -{ - FAIL("This test fails"); -} - -#include - -extern "C" { - - static int (*original_waitpid)(int, int*, int) = NULL; - - static int fork_failed_stub(void) { return -1; } - - static int waitpid_while_debugging_stub(int pid, int* status, int options) - { - static int number_called = 0; - static int saved_status; - - if (number_called++ < 10) { - saved_status = *status; - errno=EINTR; - return -1; - } - else { - *status = saved_status; - return original_waitpid(pid, status, options); - } - } - - static int waitpid_failed_stub(int, int*, int) { return -1; } -} - -static int _accessViolationTestFunction() -{ - return *(volatile int*) 0; -} - -#include -#include - -static void _stoppedTestFunction() -{ - kill(getpid(), SIGSTOP); -} - -TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, FailureInSeparateProcessWorks) -{ - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.setTestFunction(_failFunction); - fixture.runAllTests(); - fixture.assertPrintContains("Failed in separate process"); -} - -TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, AccessViolationInSeparateProcessWorks) -{ - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.setTestFunction((void(*)())_accessViolationTestFunction); - fixture.runAllTests(); - fixture.assertPrintContains("Failed in separate process - killed by signal 11"); -} - -TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, StoppedInSeparateProcessWorks) -{ - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.setTestFunction(_stoppedTestFunction); - fixture.runAllTests(); - fixture.assertPrintContains("Stopped in separate process - continuing"); -} - -TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, CallToForkFailedInSeparateProcessWorks) -{ - UT_PTR_SET(PlatformSpecificFork, fork_failed_stub); - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.runAllTests(); - fixture.assertPrintContains("Call to fork() failed"); -} - -TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, CallToWaitPidWhileDebuggingInSeparateProcessWorks) -{ - UT_PTR_SET(original_waitpid, PlatformSpecificWaitPid); - UT_PTR_SET(PlatformSpecificWaitPid, waitpid_while_debugging_stub); - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.runAllTests(); - fixture.assertPrintContains("OK (1 tests, 0 ran, 0 checks, 0 ignored, 0 filtered out"); -} - -TEST(UTestPlatformsTest_PlatformSpecificRunTestInASeperateProcess, CallToWaitPidFailedInSeparateProcessWorks) -{ - UT_PTR_SET(PlatformSpecificWaitPid, waitpid_failed_stub); - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.runAllTests(); - fixture.assertPrintContains("Call to waitpid() failed"); -} - -#endif diff -Nru cpputest-3.8/tests/UtestTest.cpp cpputest-4.0/tests/UtestTest.cpp --- cpputest-3.8/tests/UtestTest.cpp 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/tests/UtestTest.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,383 +0,0 @@ -/* - * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "CppUTest/TestHarness.h" -#include "CppUTest/TestOutput.h" -#include "CppUTest/TestTestingFixture.h" -#include "CppUTest/PlatformSpecificFunctions.h" - -TEST_GROUP(UtestShell) -{ - TestTestingFixture fixture; -}; - -static void _failMethod() -{ - FAIL("This test fails"); -} - -static void _passingTestMethod() -{ - CHECK(true); -} - -static void _passingCheckEqualTestMethod() -{ - CHECK_EQUAL(1, 1); -} - -static void _exitTestMethod() -{ - TEST_EXIT; - FAIL("Should not get here"); -} - -TEST(UtestShell, compareDoubles) -{ - double zero = 0.0; - double not_a_number = zero / zero; - double infinity = 1 / zero; - CHECK(doubles_equal(1.0, 1.001, 0.01)); - CHECK(!doubles_equal(not_a_number, 1.001, 0.01)); - CHECK(!doubles_equal(1.0, not_a_number, 0.01)); - CHECK(!doubles_equal(1.0, 1.001, not_a_number)); - CHECK(!doubles_equal(1.0, 1.1, 0.05)); - CHECK(!doubles_equal(infinity, 1.0, 0.01)); - CHECK(!doubles_equal(1.0, infinity, 0.01)); - CHECK(doubles_equal(1.0, -1.0, infinity)); - CHECK(doubles_equal(infinity, infinity, 0.01)); - CHECK(doubles_equal(infinity, infinity, infinity)); - double a = 1.2345678; - CHECK(doubles_equal(a, a, 0.000000001)); -} - -TEST(UtestShell, FailWillIncreaseTheAmountOfChecks) -{ - fixture.setTestFunction(_failMethod); - fixture.runAllTests(); - LONGS_EQUAL(1, fixture.getCheckCount()); -} - -TEST(UtestShell, PassedCheckEqualWillIncreaseTheAmountOfChecks) -{ - fixture.setTestFunction(_passingCheckEqualTestMethod); - fixture.runAllTests(); - LONGS_EQUAL(1, fixture.getCheckCount()); -} - -IGNORE_TEST(UtestShell, IgnoreTestAccessingFixture) -{ - CHECK(&fixture != NULL); -} - -TEST(UtestShell, MacrosUsedInSetup) -{ - IGNORE_ALL_LEAKS_IN_TEST(); - fixture.setSetup(_failMethod); - fixture.setTestFunction(_passingTestMethod); - fixture.runAllTests(); - LONGS_EQUAL(1, fixture.getFailureCount()); -} - -TEST(UtestShell, MacrosUsedInTearDown) -{ - IGNORE_ALL_LEAKS_IN_TEST(); - fixture.setTeardown(_failMethod); - fixture.setTestFunction(_passingTestMethod); - fixture.runAllTests(); - LONGS_EQUAL(1, fixture.getFailureCount()); -} - -TEST(UtestShell, ExitLeavesQuietly) -{ - fixture.setTestFunction(_exitTestMethod); - fixture.runAllTests(); - LONGS_EQUAL(0, fixture.getFailureCount()); -} - - - -static int teardownCalled = 0; - -static void _teardownMethod() -{ - teardownCalled++; -} - -TEST(UtestShell, TeardownCalledAfterTestFailure) -{ - teardownCalled = 0; - IGNORE_ALL_LEAKS_IN_TEST(); - fixture.setTeardown(_teardownMethod); - fixture.setTestFunction(_failMethod); - fixture.runAllTests(); - LONGS_EQUAL(1, fixture.getFailureCount()); - LONGS_EQUAL(1, teardownCalled); -} - -static int stopAfterFailure = 0; -static void _stopAfterFailureMethod() -{ - FAIL("fail"); - stopAfterFailure++; -} - -TEST(UtestShell, TestStopsAfterTestFailure) -{ - IGNORE_ALL_LEAKS_IN_TEST(); - stopAfterFailure = 0; - fixture.setTestFunction(_stopAfterFailureMethod); - fixture.runAllTests(); - CHECK(fixture.hasTestFailed()); - LONGS_EQUAL(1, fixture.getFailureCount()); - LONGS_EQUAL(0, stopAfterFailure); -} - -TEST(UtestShell, TestStopsAfterSetupFailure) -{ - stopAfterFailure = 0; - fixture.setSetup(_stopAfterFailureMethod); - fixture.setTeardown(_stopAfterFailureMethod); - fixture.setTestFunction(_failMethod); - fixture.runAllTests(); - LONGS_EQUAL(2, fixture.getFailureCount()); - LONGS_EQUAL(0, stopAfterFailure); -} - -class defaultUtestShell: public UtestShell -{ -}; - -TEST(UtestShell, this_test_covers_the_UtestShell_createTest_and_Utest_testBody_methods) -{ - defaultUtestShell shell; - fixture.addTest(&shell); - fixture.runAllTests(); - LONGS_EQUAL(2, fixture.result_->getTestCount()); -} - -static void StubPlatformSpecificRunTestInASeperateProcess(UtestShell* shell, TestPlugin*, TestResult* result) -{ - result->addFailure(TestFailure(shell, "Failed in separate process")); -} - -TEST(UtestShell, RunInSeparateProcessTest) -{ - UT_PTR_SET(PlatformSpecificRunTestInASeperateProcess, StubPlatformSpecificRunTestInASeperateProcess); - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.runAllTests(); - fixture.assertPrintContains("Failed in separate process"); -} - -#ifndef CPPUTEST_HAVE_FORK - -IGNORE_TEST(UtestShell, TestDefaultCrashMethodInSeparateProcessTest) {} - -#else - -TEST(UtestShell, TestDefaultCrashMethodInSeparateProcessTest) -{ - fixture.setTestFunction(UtestShell::crash); - fixture.registry_->setRunTestsInSeperateProcess(); - fixture.runAllTests(); - fixture.assertPrintContains("Failed in separate process - killed by signal"); - - /* Signal 11 usually happens, but with clang3.7 on Linux, it produced signal 4 */ - CHECK(fixture.getOutput().contains("signal 11") || fixture.getOutput().contains("signal 4")); -} - -#endif - -#if CPPUTEST_USE_STD_CPP_LIB - -static bool destructorWasCalledOnFailedTest = false; - -static void _destructorCalledForLocalObjects() -{ - SetBooleanOnDestructorCall pleaseCallTheDestructor(destructorWasCalledOnFailedTest); - destructorWasCalledOnFailedTest = false; - FAIL("fail"); -} - -TEST(UtestShell, DestructorIsCalledForLocalObjectsWhenTheTestFails) -{ - fixture.setTestFunction(_destructorCalledForLocalObjects); - fixture.runAllTests(); - CHECK(destructorWasCalledOnFailedTest); -} - -#endif - -TEST_GROUP(IgnoredUtestShell) -{ - TestTestingFixture fixture; - IgnoredUtestShell ignoredTest; - ExecFunctionTestShell normalUtestShell; - - void setup() _override - { - fixture.addTest(&ignoredTest); - fixture.addTest(&normalUtestShell); - } -}; - -TEST(IgnoredUtestShell, doesIgnoreCount) -{ - fixture.runAllTests(); - LONGS_EQUAL(1, fixture.getIgnoreCount()); -} - -TEST(IgnoredUtestShell, printsIGNORE_TESTwhenVerbose) -{ - fixture.output_->verbose(); - fixture.runAllTests(); - fixture.assertPrintContains("IGNORE_TEST"); -} - -TEST(IgnoredUtestShell, runIgnoredOptionSpecifiedThenIncreaseRunCount) -{ - ignoredTest.setRunIgnored(); - fixture.runAllTests(); - LONGS_EQUAL(3, fixture.getRunCount()); - LONGS_EQUAL(0, fixture.getIgnoreCount()); -} - -TEST(IgnoredUtestShell, runIgnoredOptionNotSpecifiedThenIncreaseIgnoredCount) -{ - fixture.runAllTests(); - LONGS_EQUAL(2, fixture.getRunCount()); - LONGS_EQUAL(1, fixture.getIgnoreCount()); -} - -TEST(IgnoredUtestShell, runIgnoredOptionSpecifiedWillNotInfluenceNormalTestCount) -{ - normalUtestShell.setRunIgnored(); - fixture.runAllTests(); - LONGS_EQUAL(2, fixture.getRunCount()); - LONGS_EQUAL(1, fixture.getIgnoreCount()); -} - -TEST(IgnoredUtestShell, runIgnoredOptionSpecifiedThenReturnTESTInFormattedName) -{ - ignoredTest.setGroupName("TestGroup"); - ignoredTest.setTestName("TestName"); - ignoredTest.setRunIgnored(); - fixture.runAllTests(); - STRCMP_EQUAL("TEST(TestGroup, TestName)", ignoredTest.getFormattedName().asCharString()); -} - -TEST(IgnoredUtestShell, runIgnoredOptionNotSpecifiedThenReturnIGNORETESTInFormattedName) -{ - ignoredTest.setGroupName("TestGroup"); - ignoredTest.setTestName("TestName"); - fixture.runAllTests(); - STRCMP_EQUAL("IGNORE_TEST(TestGroup, TestName)", ignoredTest.getFormattedName().asCharString()); -} - -TEST(IgnoredUtestShell, runIgnoredOptionNotSpecifiedThenWillRunReturnFalse) -{ - CHECK_FALSE(ignoredTest.willRun()); -} - -TEST(IgnoredUtestShell, runIgnoredOptionSpecifiedThenWillRunReturnTrue) -{ - ignoredTest.setRunIgnored(); - CHECK_TRUE(ignoredTest.willRun()); -} - -TEST_BASE(MyOwnTest) -{ - MyOwnTest() : - inTest(false) - { - } - bool inTest; - - void setup() - { - CHECK(!inTest); - inTest = true; - } - void teardown() - { - CHECK(inTest); - inTest = false; - } -}; - -TEST_GROUP_BASE(UtestMyOwn, MyOwnTest) -{ -}; - -TEST(UtestMyOwn, test) -{ - CHECK(inTest); -} - -class NullParameterTest: public UtestShell -{ -}; - -TEST(UtestMyOwn, NullParameters) -{ - NullParameterTest nullTest; /* Bug fix tests for creating a test without a name, fix in SimpleString */ - TestFilter emptyFilter; - CHECK(nullTest.shouldRun(&emptyFilter, &emptyFilter)); -} - -class AllocateAndDeallocateInConstructorAndDestructor -{ - char* memory_; - char* morememory_; -public: - AllocateAndDeallocateInConstructorAndDestructor() - { - memory_ = new char[100]; - morememory_ = NULL; - } - void allocateMoreMemory() - { - morememory_ = new char[123]; - } - - ~AllocateAndDeallocateInConstructorAndDestructor() - { - delete [] memory_; - delete [] morememory_; - } -}; - -TEST_GROUP(CanHaveMemberVariablesInTestGroupThatAllocateMemoryWithoutCausingMemoryLeaks) -{ - AllocateAndDeallocateInConstructorAndDestructor dummy; -}; - -TEST(CanHaveMemberVariablesInTestGroupThatAllocateMemoryWithoutCausingMemoryLeaks, testInTestGroupName) -{ - dummy.allocateMoreMemory(); -} - diff -Nru cpputest-3.8/.travis_github_deployer.yml cpputest-4.0/.travis_github_deployer.yml --- cpputest-3.8/.travis_github_deployer.yml 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/.travis_github_deployer.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -destination_repository: https://github.com/cpputest/cpputest.github.io.git - -files_to_deploy: - cpputest_build/unit_test_report/*: unit_test_report - cpputest_build/cpputest-3.7dev.tar.gz: - destination: releases - purge: yes - cpputest_build/cpputest-3.7dev.zip: - destination: releases - purge: yes diff -Nru cpputest-3.8/.travis.yml cpputest-4.0/.travis.yml --- cpputest-3.8/.travis.yml 2016-05-02 05:35:11.000000000 +0000 +++ cpputest-4.0/.travis.yml 2020-05-26 11:24:07.000000000 +0000 @@ -1,54 +1,196 @@ + +# Global environment language: cpp -sudo: false -matrix: - include: +os: linux +dist: bionic + +# Avoid double build because of the tagging in the build. +branches: + except: + - latest-passing-build + +# Build stages and the conditionals for the stages +stages: + - name: extensive daily tests + if: type = cron + - name: basic build & test + if: type != cron + - name: extended build & test + if: type != cron + - name: deploy latest + if: "(NOT type IN (pull_request)) AND (branch = master) AND (type != cron)" + +jobs: + include: + +# Basic builds + +# Mac OSX + - stage: basic build & test + compiler: gcc + os: osx + env: BUILD=autotools - compiler: clang env: BUILD=autotools - addons: - apt: - packages: - - valgrind + os: osx + +# Windows + - compiler: msbuild + os: windows + env: BUILD=vc_windows CPP_STD=17 + - MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" + - VCTargetsPath="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets" + +# Linux + - compiler: gcc + env: BUILD=cmake CPP_STD=17 + - compiler: gcc + env: BUILD=autotools - compiler: clang - env: BUILD=cmake + env: BUILD=autotools + +# Extended builds, different C++ version and build tools + - stage: extended build & test + +# Mac OSX + compiler: clang + os: osx + env: BUILD=cmake CPP_STD=17 + - compiler: gcc + os: osx + env: BUILD=cmake CPP_STD=14 + +# Linux +# CMake different C++ versions with clang - compiler: clang - env: BUILD=autotools_gtest + env: BUILD=cmake CPP_STD=98 - compiler: clang - env: BUILD=cmake_gtest + env: BUILD=cmake CPP_STD=11 + - compiler: clang + env: BUILD=cmake CPP_STD=14 + - compiler: clang + env: BUILD=cmake CPP_STD=17 + +# CMake different C++ versions with gcc - compiler: gcc - env: BUILD=autotools + env: BUILD=cmake CPP_STD=98 + - compiler: gcc + env: BUILD=cmake CPP_STD=11 + - compiler: gcc + env: BUILD=cmake CPP_STD=14 + - compiler: gcc + env: BUILD=cmake CPP_STD=17 + +# New compilers can be added here. Need to be cleared when compiler becomes standard + - compiler: gcc + env: BUILD=cmake CPP_STD=17 + - CC=gcc-10 + - CXX=g++-10 addons: apt: - packages: - - valgrind + packages: ['g++-10'] + sources: + - sourceline: 'ppa:ubuntu-toolchain-r/test' + - compiler: clang + env: BUILD=cmake CPP_STD=17 + - CC=clang-10 + - CXX=clang++-10 + addons: + apt: + sources: + - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + packages: ['clang-10', 'libc++-10-dev', 'libc++abi-10-dev'] + +# Specific other tests - compiler: gcc - env: BUILD=cmake + env: BUILD=test_report + addons: + apt: + packages: + - ant-optional - compiler: gcc - env: BUILD=autotools_gtest + env: BUILD=cmake_coverage - compiler: gcc env: BUILD=cmake_gtest + - compiler: clang + env: BUILD=autotools_gtest - compiler: gcc - env: BUILD=cmake_coverage - - compiler: gcc - env: BUILD=test_report - - compiler: wcl - env: BUILD=make_dos + env: BUILD=autotools_cmake_install_test + +# MS DOS Build + - env: BUILD=make_dos addons: apt: packages: - dosbox -global: -- os: linux -- rvm: '1.9.3' -- secure: |- - P05xUfJVw5YM4hF7hzQLjyMzDD4Q1/fyWP9Uk5aK5VrSWNY99EuxldXI5QK/ - vA1NkcW49tQW1wQvBlRtdlLNOmUfDP/oiJFXPwNn4dqwOIOEet2P7JO/5hnH - MNHlZmGu2WpoZREhOFBfsIhK0IP8mloqLDq2XemBdga/LWygrLU= -- secure: |- - Y/8iNkf6uEbE3qltnM+7mGlCvFWzyttwwRGgVGw1m9xOiUJcobvOImQRU8XZ - 91dgO+Fz0A3mljqs1sK1OPjpXmFGE1jP/NlotMw0WlDOuSIDjQ4ubwdTNGAw - NY53R9ygbIjEmqxHAJm9mOZqxW2hNaoI7TcX6oX248/hLibyx8M= + +# Docker images. Need to be cleared at times + - env: BUILD=docker_ubuntu_autotools + - env: BUILD=docker_ubuntu_dos + - env: BUILD=autotools_dist + + - stage: extensive daily tests + compiler: gcc + env: BUILD=extensive_check + - compiler: clang + env: BUILD=extensive_check + - arch: ppc64le + compiler: gcc + env: BUILD=autotools + - arch: s390x + compiler: gcc + env: BUILD=autotools + - arch: arm64 + compiler: gcc + env: BUILD=autotools + - compiler: gcc + env: BUILD=makefileworker + - compiler: clang + env: BUILD=autotools_install_and_test_examples + +# Deploy to github releases + - stage: deploy latest + env: BUILD=autotools_dist + script: + - export DATE=`date` + - git tag -f latest-passing-build -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER at $DATE" + - git push -f https://cpputest-travis:$GH_TOKEN@github.com/cpputest/cpputest.git --tags + - ../scripts/travis_ci_build.sh + - pwd + - ls + deploy: + provider: releases + #: + edge: true + token: $GH_TOKEN + tag_name: latest-passing-build + name: Latest passing build + release_notes: "This is the automatic release from Travis CI.\n\nWhenever a build passes, it gets released as Latest Passing Build.\n\nBuild number: $TRAVIS_BUILD_NUMBER\nDate: $DATE\nLog: $TRAVIS_BUILD_WEB_URL" + file: + - cpputest-latest.tar.gz + - cpputest-latest.zip + overwrite: true + on: + tags: false + before_script: - export CPPUTEST_BUILD_DIR=$TRAVIS_BUILD_DIR/cpputest_build - mkdir -p $CPPUTEST_BUILD_DIR && cd $CPPUTEST_BUILD_DIR + script: - "../scripts/travis_ci_build.sh" + +after_failure: +- "../scripts/travis_ci_after.sh" + +after_success: +- "../scripts/travis_ci_after.sh" + +notifications: + slack: + secure: oOx4AGIiJB+j1pkIxlLeQh5qp7TF89Sj+3RzJRQuo6z0HocTz9yJgXPlDh1H9rLj5SxK/UKsk+WFafVuPdWakQ40LeYO49C/+e+mCDcS0ujLka6dvIE8v0SEb1PuaAGjJWdhiviAhSqu9YOKPYZs37lD3oqepuEpxeiXwsur9QU= + +env: + global: + secure: H6djbn5YP1P62n//ergaRZ4lIkneCzWp1Ok4F71kvvNiwlRzYDGll4kJT6MhVq6bBHeR81W/lwUd+RdjyqsJpVhj7DHXC/0k0h0xpAAm7LUhOl+6mIII1uhcMFqbeHvilwvDCzTQ6qv8Mzd1g0QfUECrmti9/U+/TTFJG0r0Zuc=