mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-13 07:08:23 +01:00
Updated for phreeqc changes
Introduce end-of-line normalization for CMakeLists.txt
This commit is contained in:
parent
a13fbe0134
commit
90a6449de8
10
.pre-commit-config.yaml
Normal file
10
.pre-commit-config.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: c8bad492e1b1d65d9126dba3fe3bd49a5a52b9d6 # v2.1.0
|
||||
hooks:
|
||||
- id: end-of-file-fixer
|
||||
files: CMakeLists.txt
|
||||
- id: trailing-whitespace
|
||||
files: CMakeLists.txt
|
||||
- id: no-commit-to-branch
|
||||
args: [--branch, main, --branch, master, --branch, develop]
|
||||
926
CMakeLists.txt
926
CMakeLists.txt
@ -1,463 +1,463 @@
|
||||
# CMAKE_MSVC_RUNTIME_LIBRARY requires 3.15
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project (
|
||||
IPhreeqc
|
||||
VERSION 3.6.3
|
||||
LANGUAGES CXX C
|
||||
)
|
||||
|
||||
# check if this is the root project
|
||||
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set(STANDALONE_BUILD 1)
|
||||
else()
|
||||
set(STANDALONE_BUILD 0)
|
||||
endif()
|
||||
|
||||
if (STANDALONE_BUILD)
|
||||
# Set a default build type if none was specified
|
||||
set(default_build_type "Release")
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
||||
STRING "Choose the type of build." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# overide docdir on windows
|
||||
if (WIN32 AND NOT CMAKE_INSTALL_DOCDIR)
|
||||
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (doc)")
|
||||
set(CMAKE_INSTALL_DOCDIR "doc")
|
||||
endif()
|
||||
|
||||
# set standard directory locations
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if (STANDALONE_BUILD AND MSVC)
|
||||
option (IPHREEQC_STATIC_RUNTIME "Build with a static runtime" OFF)
|
||||
if (IPHREEQC_STATIC_RUNTIME)
|
||||
# compile with static runtime
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Fortran
|
||||
option (IPHREEQC_ENABLE_MODULE "Enable Fortran module" ON)
|
||||
if (STANDALONE_BUILD)
|
||||
if (IPHREEQC_FORTRAN_TESTING)
|
||||
enable_language(Fortran)
|
||||
else()
|
||||
if (CMAKE_Fortran_COMPILER)
|
||||
option (IPHREEQC_FORTRAN_TESTING "Build Fortran test" ON)
|
||||
else()
|
||||
option (IPHREEQC_FORTRAN_TESTING "Build Fortran test" OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# compile Var.c as c++
|
||||
set_source_files_properties(src/Var.c PROPERTIES LANGUAGE CXX)
|
||||
|
||||
if (STANDALONE_BUILD)
|
||||
option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
|
||||
set(LIB_TYPE STATIC)
|
||||
endif()
|
||||
|
||||
if (STANDALONE_BUILD)
|
||||
if (MSVC)
|
||||
option(BUILD_CLR_LIBS "Build CLR Libraries" OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(LIB_TYPE SHARED)
|
||||
endif()
|
||||
|
||||
add_library(IPhreeqc ${LIB_TYPE} src/IPhreeqc.cpp)
|
||||
|
||||
target_sources(IPhreeqc
|
||||
PRIVATE
|
||||
src/CSelectedOutput.cpp
|
||||
src/CSelectedOutput.hxx
|
||||
src/CVar.hxx
|
||||
src/Debug.h
|
||||
src/ErrorReporter.hxx
|
||||
src/IPhreeqc.h
|
||||
src/IPhreeqc.hpp
|
||||
src/IPhreeqc_interface_F.cpp
|
||||
src/IPhreeqcCallbacks.h
|
||||
src/IPhreeqcLib.cpp
|
||||
src/phreeqcpp/advection.cpp
|
||||
src/phreeqcpp/basicsubs.cpp
|
||||
src/phreeqcpp/cl1.cpp
|
||||
src/phreeqcpp/common/Parser.cxx
|
||||
src/phreeqcpp/common/Parser.h
|
||||
src/phreeqcpp/common/PHRQ_base.cxx
|
||||
src/phreeqcpp/common/PHRQ_base.h
|
||||
src/phreeqcpp/common/PHRQ_exports.h
|
||||
src/phreeqcpp/common/PHRQ_io.cpp
|
||||
src/phreeqcpp/common/PHRQ_io.h
|
||||
src/phreeqcpp/common/phrqtype.h
|
||||
src/phreeqcpp/common/Utils.cxx
|
||||
src/phreeqcpp/common/Utils.h
|
||||
src/phreeqcpp/cvdense.cpp
|
||||
src/phreeqcpp/cvdense.h
|
||||
src/phreeqcpp/cvode.cpp
|
||||
src/phreeqcpp/cvode.h
|
||||
src/phreeqcpp/cxxKinetics.cxx
|
||||
src/phreeqcpp/cxxKinetics.h
|
||||
src/phreeqcpp/cxxMix.cxx
|
||||
src/phreeqcpp/cxxMix.h
|
||||
src/phreeqcpp/dense.cpp
|
||||
src/phreeqcpp/dense.h
|
||||
src/phreeqcpp/Dictionary.cpp
|
||||
src/phreeqcpp/Dictionary.h
|
||||
src/phreeqcpp/dumper.cpp
|
||||
src/phreeqcpp/dumper.h
|
||||
src/phreeqcpp/Exchange.cxx
|
||||
src/phreeqcpp/Exchange.h
|
||||
src/phreeqcpp/ExchComp.cxx
|
||||
src/phreeqcpp/ExchComp.h
|
||||
src/phreeqcpp/GasComp.cxx
|
||||
src/phreeqcpp/GasComp.h
|
||||
src/phreeqcpp/gases.cpp
|
||||
src/phreeqcpp/GasPhase.cxx
|
||||
src/phreeqcpp/GasPhase.h
|
||||
src/phreeqcpp/global_structures.h
|
||||
src/phreeqcpp/input.cpp
|
||||
src/phreeqcpp/integrate.cpp
|
||||
src/phreeqcpp/inverse.cpp
|
||||
src/phreeqcpp/ISolution.cxx
|
||||
src/phreeqcpp/ISolution.h
|
||||
src/phreeqcpp/ISolutionComp.cxx
|
||||
src/phreeqcpp/ISolutionComp.h
|
||||
src/phreeqcpp/isotopes.cpp
|
||||
src/phreeqcpp/kinetics.cpp
|
||||
src/phreeqcpp/KineticsComp.cxx
|
||||
src/phreeqcpp/KineticsComp.h
|
||||
src/phreeqcpp/mainsubs.cpp
|
||||
src/phreeqcpp/model.cpp
|
||||
src/phreeqcpp/NA.h
|
||||
src/phreeqcpp/NameDouble.cxx
|
||||
src/phreeqcpp/NameDouble.h
|
||||
src/phreeqcpp/NumKeyword.cxx
|
||||
src/phreeqcpp/NumKeyword.h
|
||||
src/phreeqcpp/nvector.cpp
|
||||
src/phreeqcpp/nvector.h
|
||||
src/phreeqcpp/nvector_serial.cpp
|
||||
src/phreeqcpp/nvector_serial.h
|
||||
src/phreeqcpp/parse.cpp
|
||||
src/phreeqcpp/PBasic.cpp
|
||||
src/phreeqcpp/PBasic.h
|
||||
src/phreeqcpp/phqalloc.cpp
|
||||
src/phreeqcpp/phqalloc.h
|
||||
src/phreeqcpp/Phreeqc.cpp
|
||||
src/phreeqcpp/Phreeqc.h
|
||||
src/phreeqcpp/PhreeqcKeywords/Keywords.cpp
|
||||
src/phreeqcpp/PhreeqcKeywords/Keywords.h
|
||||
src/phreeqcpp/PHRQ_io_output.cpp
|
||||
src/phreeqcpp/pitzer.cpp
|
||||
src/phreeqcpp/pitzer_structures.cpp
|
||||
src/phreeqcpp/PPassemblage.cxx
|
||||
src/phreeqcpp/PPassemblage.h
|
||||
src/phreeqcpp/PPassemblageComp.cxx
|
||||
src/phreeqcpp/PPassemblageComp.h
|
||||
src/phreeqcpp/prep.cpp
|
||||
src/phreeqcpp/Pressure.cxx
|
||||
src/phreeqcpp/Pressure.h
|
||||
src/phreeqcpp/print.cpp
|
||||
src/phreeqcpp/Reaction.cxx
|
||||
src/phreeqcpp/Reaction.h
|
||||
src/phreeqcpp/read.cpp
|
||||
src/phreeqcpp/ReadClass.cxx
|
||||
src/phreeqcpp/readtr.cpp
|
||||
src/phreeqcpp/runner.cpp
|
||||
src/phreeqcpp/runner.h
|
||||
src/phreeqcpp/SelectedOutput.cpp
|
||||
src/phreeqcpp/SelectedOutput.h
|
||||
src/phreeqcpp/Serializer.cxx
|
||||
src/phreeqcpp/Serializer.h
|
||||
src/phreeqcpp/sit.cpp
|
||||
src/phreeqcpp/smalldense.cpp
|
||||
src/phreeqcpp/smalldense.h
|
||||
src/phreeqcpp/Solution.cxx
|
||||
src/phreeqcpp/Solution.h
|
||||
src/phreeqcpp/SolutionIsotope.cxx
|
||||
src/phreeqcpp/SolutionIsotope.h
|
||||
src/phreeqcpp/spread.cpp
|
||||
src/phreeqcpp/SS.cxx
|
||||
src/phreeqcpp/SS.h
|
||||
src/phreeqcpp/SSassemblage.cxx
|
||||
src/phreeqcpp/SSassemblage.h
|
||||
src/phreeqcpp/SScomp.cxx
|
||||
src/phreeqcpp/SScomp.h
|
||||
src/phreeqcpp/step.cpp
|
||||
src/phreeqcpp/StorageBin.cxx
|
||||
src/phreeqcpp/StorageBin.h
|
||||
src/phreeqcpp/StorageBinList.cpp
|
||||
src/phreeqcpp/StorageBinList.h
|
||||
src/phreeqcpp/structures.cpp
|
||||
src/phreeqcpp/sundialsmath.cpp
|
||||
src/phreeqcpp/sundialsmath.h
|
||||
src/phreeqcpp/sundialstypes.h
|
||||
src/phreeqcpp/Surface.cxx
|
||||
src/phreeqcpp/Surface.h
|
||||
src/phreeqcpp/SurfaceCharge.cxx
|
||||
src/phreeqcpp/SurfaceCharge.h
|
||||
src/phreeqcpp/SurfaceComp.cxx
|
||||
src/phreeqcpp/SurfaceComp.h
|
||||
src/phreeqcpp/System.cxx
|
||||
src/phreeqcpp/System.h
|
||||
src/phreeqcpp/tally.cpp
|
||||
src/phreeqcpp/Temperature.cxx
|
||||
src/phreeqcpp/Temperature.h
|
||||
src/phreeqcpp/tidy.cpp
|
||||
src/phreeqcpp/transport.cpp
|
||||
src/phreeqcpp/Use.cpp
|
||||
src/phreeqcpp/Use.h
|
||||
src/phreeqcpp/UserPunch.cpp
|
||||
src/phreeqcpp/UserPunch.h
|
||||
src/phreeqcpp/utilities.cpp
|
||||
src/thread.h
|
||||
src/Var.c
|
||||
src/Var.h
|
||||
src/Version.h
|
||||
)
|
||||
|
||||
target_include_directories(IPhreeqc
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${IPhreeqc_SOURCE_DIR}/src>
|
||||
$<BUILD_INTERFACE:${IPhreeqc_SOURCE_DIR}/src/phreeqcpp>
|
||||
$<BUILD_INTERFACE:${IPhreeqc_SOURCE_DIR}/src/phreeqcpp/common>
|
||||
$<BUILD_INTERFACE:${IPhreeqc_SOURCE_DIR}/src/phreeqcpp/PhreeqcKeywords>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
target_compile_definitions(IPhreeqc PRIVATE SWIG_SHARED_OBJ)
|
||||
target_compile_definitions(IPhreeqc PRIVATE USE_PHRQ_ALLOC)
|
||||
|
||||
if (NOT IPHREEQC_ENABLE_MODULE)
|
||||
target_compile_definitions(IPhreeqc
|
||||
PUBLIC
|
||||
IPHREEQC_NO_FORTRAN_MODULE
|
||||
)
|
||||
|
||||
target_sources(IPhreeqc
|
||||
PRIVATE
|
||||
src/fimpl.h
|
||||
src/fwrap.cpp
|
||||
src/fwrap1.cpp
|
||||
src/fwrap2.cpp
|
||||
src/fwrap3.cpp
|
||||
src/fwrap4.cpp
|
||||
src/fwrap5.cpp
|
||||
src/fwrap6.cpp
|
||||
src/fwrap7.cpp
|
||||
src/fwrap8.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
||||
target_compile_options(IPhreeqc PRIVATE /wd4251 /wd4275 /wd4793)
|
||||
endif()
|
||||
|
||||
# Disable deprecation warnings for standard C and STL functions in VS2005
|
||||
# and later
|
||||
if (MSVC_VERSION EQUAL 1400 OR MSVC_VERSION GREATER 1400)
|
||||
target_compile_definitions(IPhreeqc PUBLIC _CRT_SECURE_NO_DEPRECATE)
|
||||
target_compile_definitions(IPhreeqc PUBLIC _SCL_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# Allow user to override POSTFIX properties (but mandate them so that
|
||||
# all builds can be installed to the same directory)
|
||||
if (NOT CMAKE_DEBUG_POSTFIX)
|
||||
set_target_properties(IPhreeqc PROPERTIES DEBUG_POSTFIX "d")
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_MINSIZEREL_POSTFIX)
|
||||
set_target_properties(IPhreeqc PROPERTIES MINSIZEREL_POSTFIX "msr")
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_RELWITHDEBINFO_POSTFIX)
|
||||
set_target_properties(IPhreeqc PROPERTIES RELWITHDEBINFO_POSTFIX "rwd")
|
||||
endif()
|
||||
|
||||
set(IPhreeqc_Headers
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc.h
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqcCallbacks.h
|
||||
${PROJECT_SOURCE_DIR}/src/phreeqcpp/PhreeqcKeywords/Keywords.h
|
||||
${PROJECT_SOURCE_DIR}/src/phreeqcpp/common/PHRQ_exports.h
|
||||
${PROJECT_SOURCE_DIR}/src/phreeqcpp/common/PHRQ_io.h
|
||||
${PROJECT_SOURCE_DIR}/src/Var.h
|
||||
)
|
||||
|
||||
if (IPHREEQC_ENABLE_MODULE)
|
||||
set(IPhreeqc_SRC
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc_interface.F90
|
||||
${PROJECT_SOURCE_DIR}/src/README.Fortran
|
||||
)
|
||||
else()
|
||||
# always install README.Fortran
|
||||
set(IPhreeqc_SRC
|
||||
${PROJECT_SOURCE_DIR}/src/README.Fortran
|
||||
)
|
||||
# install old fortran include files
|
||||
set(IPhreeqc_Headers
|
||||
${IPhreeqc_Headers}
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc.f.inc
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc.f90.inc
|
||||
)
|
||||
endif()
|
||||
|
||||
# Setup references for /CLR
|
||||
if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS)
|
||||
if (MSVC_VERSION LESS 1600)
|
||||
message(FATAL_ERROR "CLR options must be set manually for versions prior to Visual Studio 2010")
|
||||
endif()
|
||||
set_target_properties(IPhreeqc PROPERTIES VS_DOTNET_REFERENCES "System;System.Drawing;System.Windows.Forms;${CMAKE_CURRENT_SOURCE_DIR}/src/phreeqcpp/ZedGraph.dll")
|
||||
set_target_properties(IPhreeqc PROPERTIES COMMON_LANGUAGE_RUNTIME "")
|
||||
target_compile_definitions(IPhreeqc PRIVATE "MULTICHART")
|
||||
endif()
|
||||
|
||||
set_target_properties(IPhreeqc PROPERTIES
|
||||
VERSION "${IPhreeqc_VERSION}"
|
||||
SOVERSION "${IPhreeqc_VERSION_MAJOR}"
|
||||
)
|
||||
|
||||
# install
|
||||
if (STANDALONE_BUILD)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
configure_package_config_file(IPhreeqcConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/IPhreeqcConfig.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/IPhreeqc
|
||||
)
|
||||
|
||||
write_basic_package_version_file("IPhreeqcConfigVersion.cmake"
|
||||
VERSION ${IPhreeqc_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/IPhreeqcConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/IPhreeqcConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/IPhreeqc
|
||||
)
|
||||
|
||||
install(TARGETS IPhreeqc
|
||||
EXPORT IPhreeqcTargets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
install(EXPORT IPhreeqcTargets
|
||||
FILE IPhreeqcTargets.cmake
|
||||
NAMESPACE IPhreeqc::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/IPhreeqc
|
||||
)
|
||||
|
||||
install(FILES ${IPhreeqc_Headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
if (WIN32)
|
||||
install(FILES ${IPhreeqc_SRC} DESTINATION src)
|
||||
else()
|
||||
install(FILES ${IPhreeqc_SRC} DESTINATION ${CMAKE_INSTALL_DOCDIR}/src)
|
||||
endif()
|
||||
if (BUILD_CLR_LIBS)
|
||||
install(FILES "${PROJECT_SOURCE_DIR}/src/phreeqcpp/ZedGraph.dll" DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_CLR_LIBS)
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
message(FATAL_ERROR "BUILD_CLR_LIBS requires that BUILD_SHARED_LIBS be set")
|
||||
endif()
|
||||
|
||||
if (IPHREEQC_STATIC_RUNTIME)
|
||||
message(FATAL_ERROR "BUILD_CLR_LIBS and IPHREEQC_STATIC_RUNTIME are mutually exclusive")
|
||||
endif()
|
||||
|
||||
# CLR files
|
||||
target_sources(IPhreeqc
|
||||
PRIVATE
|
||||
src/phreeqcpp/ChartHandler.cpp
|
||||
src/phreeqcpp/ChartHandler.h
|
||||
src/phreeqcpp/ChartObject.cpp
|
||||
src/phreeqcpp/ChartObject.h
|
||||
src/phreeqcpp/CurveObject.cpp
|
||||
src/phreeqcpp/CurveObject.h
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
include (CTest)
|
||||
|
||||
if (STANDALONE_BUILD)
|
||||
|
||||
add_subdirectory(database)
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(examples)
|
||||
|
||||
if (BUILD_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
|
||||
if (BUILD_TESTING) # may need to add MSVC version check
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # release-1.12.1
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
FETCHCONTENT_BASE_DIR
|
||||
FETCHCONTENT_FULLY_DISCONNECTED
|
||||
FETCHCONTENT_QUIET
|
||||
FETCHCONTENT_SOURCE_DIR_GOOGLETEST
|
||||
FETCHCONTENT_UPDATES_DISCONNECTED
|
||||
FETCHCONTENT_UPDATES_DISCONNECTED_GOOGLETEST
|
||||
)
|
||||
|
||||
# Prevent GoogleTest from overriding our compiler/linker options
|
||||
# when building with Visual Studio
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(BUILD_GTEST ON CACHE BOOL "" FORCE)
|
||||
set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
|
||||
|
||||
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
|
||||
set(INSTALL_GMOCK OFF CACHE BOOL "" FORCE)
|
||||
|
||||
mark_as_advanced(
|
||||
BUILD_GTEST
|
||||
BUILD_GMOCK
|
||||
INSTALL_GTEST
|
||||
INSTALL_GMOCK
|
||||
gmock_build_tests
|
||||
gtest_build_tests
|
||||
gtest_build_samples
|
||||
gtest_disable_pthreads
|
||||
gtest_force_shared_crt
|
||||
gtest_hide_internal_symbols
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(googletest)
|
||||
if (NOT googletest_POPULATED)
|
||||
FetchContent_Populate(googletest)
|
||||
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
add_subdirectory(gtest)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# get_cmake_property(_variableNames VARIABLES)
|
||||
# list (SORT _variableNames)
|
||||
# foreach (_variableName ${_variableNames})
|
||||
# message(STATUS "${_variableName}=${${_variableName}}")
|
||||
# endforeach()
|
||||
# CMAKE_MSVC_RUNTIME_LIBRARY requires 3.15
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project (
|
||||
IPhreeqc
|
||||
VERSION 3.6.3
|
||||
LANGUAGES CXX C
|
||||
)
|
||||
|
||||
# check if this is the root project
|
||||
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set(STANDALONE_BUILD 1)
|
||||
else()
|
||||
set(STANDALONE_BUILD 0)
|
||||
endif()
|
||||
|
||||
if (STANDALONE_BUILD)
|
||||
# Set a default build type if none was specified
|
||||
set(default_build_type "Release")
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
||||
STRING "Choose the type of build." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# overide docdir on windows
|
||||
if (WIN32 AND NOT CMAKE_INSTALL_DOCDIR)
|
||||
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (doc)")
|
||||
set(CMAKE_INSTALL_DOCDIR "doc")
|
||||
endif()
|
||||
|
||||
# set standard directory locations
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if (STANDALONE_BUILD AND MSVC)
|
||||
option (IPHREEQC_STATIC_RUNTIME "Build with a static runtime" OFF)
|
||||
if (IPHREEQC_STATIC_RUNTIME)
|
||||
# compile with static runtime
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Fortran
|
||||
option (IPHREEQC_ENABLE_MODULE "Enable Fortran module" ON)
|
||||
if (STANDALONE_BUILD)
|
||||
if (IPHREEQC_FORTRAN_TESTING)
|
||||
enable_language(Fortran)
|
||||
else()
|
||||
if (CMAKE_Fortran_COMPILER)
|
||||
option (IPHREEQC_FORTRAN_TESTING "Build Fortran test" ON)
|
||||
else()
|
||||
option (IPHREEQC_FORTRAN_TESTING "Build Fortran test" OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# compile Var.c as c++
|
||||
set_source_files_properties(src/Var.c PROPERTIES LANGUAGE CXX)
|
||||
|
||||
if (STANDALONE_BUILD)
|
||||
option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
|
||||
set(LIB_TYPE STATIC)
|
||||
endif()
|
||||
|
||||
if (STANDALONE_BUILD)
|
||||
if (MSVC)
|
||||
option(BUILD_CLR_LIBS "Build CLR Libraries" OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(LIB_TYPE SHARED)
|
||||
endif()
|
||||
|
||||
add_library(IPhreeqc ${LIB_TYPE} src/IPhreeqc.cpp)
|
||||
|
||||
target_sources(IPhreeqc
|
||||
PRIVATE
|
||||
src/CSelectedOutput.cpp
|
||||
src/CSelectedOutput.hxx
|
||||
src/CVar.hxx
|
||||
src/Debug.h
|
||||
src/ErrorReporter.hxx
|
||||
src/IPhreeqc.h
|
||||
src/IPhreeqc.hpp
|
||||
src/IPhreeqc_interface_F.cpp
|
||||
src/IPhreeqcCallbacks.h
|
||||
src/IPhreeqcLib.cpp
|
||||
src/phreeqcpp/advection.cpp
|
||||
src/phreeqcpp/basicsubs.cpp
|
||||
src/phreeqcpp/cl1.cpp
|
||||
src/phreeqcpp/common/Parser.cxx
|
||||
src/phreeqcpp/common/Parser.h
|
||||
src/phreeqcpp/common/PHRQ_base.cxx
|
||||
src/phreeqcpp/common/PHRQ_base.h
|
||||
src/phreeqcpp/common/PHRQ_exports.h
|
||||
src/phreeqcpp/common/PHRQ_io.cpp
|
||||
src/phreeqcpp/common/PHRQ_io.h
|
||||
src/phreeqcpp/common/phrqtype.h
|
||||
src/phreeqcpp/common/Utils.cxx
|
||||
src/phreeqcpp/common/Utils.h
|
||||
src/phreeqcpp/cvdense.cpp
|
||||
src/phreeqcpp/cvdense.h
|
||||
src/phreeqcpp/cvode.cpp
|
||||
src/phreeqcpp/cvode.h
|
||||
src/phreeqcpp/cxxKinetics.cxx
|
||||
src/phreeqcpp/cxxKinetics.h
|
||||
src/phreeqcpp/cxxMix.cxx
|
||||
src/phreeqcpp/cxxMix.h
|
||||
src/phreeqcpp/dense.cpp
|
||||
src/phreeqcpp/dense.h
|
||||
src/phreeqcpp/Dictionary.cpp
|
||||
src/phreeqcpp/Dictionary.h
|
||||
src/phreeqcpp/dumper.cpp
|
||||
src/phreeqcpp/dumper.h
|
||||
src/phreeqcpp/Exchange.cxx
|
||||
src/phreeqcpp/Exchange.h
|
||||
src/phreeqcpp/ExchComp.cxx
|
||||
src/phreeqcpp/ExchComp.h
|
||||
src/phreeqcpp/GasComp.cxx
|
||||
src/phreeqcpp/GasComp.h
|
||||
src/phreeqcpp/gases.cpp
|
||||
src/phreeqcpp/GasPhase.cxx
|
||||
src/phreeqcpp/GasPhase.h
|
||||
src/phreeqcpp/global_structures.h
|
||||
src/phreeqcpp/input.cpp
|
||||
src/phreeqcpp/integrate.cpp
|
||||
src/phreeqcpp/inverse.cpp
|
||||
src/phreeqcpp/ISolution.cxx
|
||||
src/phreeqcpp/ISolution.h
|
||||
src/phreeqcpp/ISolutionComp.cxx
|
||||
src/phreeqcpp/ISolutionComp.h
|
||||
src/phreeqcpp/isotopes.cpp
|
||||
src/phreeqcpp/kinetics.cpp
|
||||
src/phreeqcpp/KineticsComp.cxx
|
||||
src/phreeqcpp/KineticsComp.h
|
||||
src/phreeqcpp/mainsubs.cpp
|
||||
src/phreeqcpp/model.cpp
|
||||
src/phreeqcpp/NA.h
|
||||
src/phreeqcpp/NameDouble.cxx
|
||||
src/phreeqcpp/NameDouble.h
|
||||
src/phreeqcpp/NumKeyword.cxx
|
||||
src/phreeqcpp/NumKeyword.h
|
||||
src/phreeqcpp/nvector.cpp
|
||||
src/phreeqcpp/nvector.h
|
||||
src/phreeqcpp/nvector_serial.cpp
|
||||
src/phreeqcpp/nvector_serial.h
|
||||
src/phreeqcpp/parse.cpp
|
||||
src/phreeqcpp/PBasic.cpp
|
||||
src/phreeqcpp/PBasic.h
|
||||
src/phreeqcpp/phqalloc.cpp
|
||||
src/phreeqcpp/phqalloc.h
|
||||
src/phreeqcpp/Phreeqc.cpp
|
||||
src/phreeqcpp/Phreeqc.h
|
||||
src/phreeqcpp/PhreeqcKeywords/Keywords.cpp
|
||||
src/phreeqcpp/PhreeqcKeywords/Keywords.h
|
||||
src/phreeqcpp/PHRQ_io_output.cpp
|
||||
src/phreeqcpp/pitzer.cpp
|
||||
src/phreeqcpp/pitzer_structures.cpp
|
||||
src/phreeqcpp/PPassemblage.cxx
|
||||
src/phreeqcpp/PPassemblage.h
|
||||
src/phreeqcpp/PPassemblageComp.cxx
|
||||
src/phreeqcpp/PPassemblageComp.h
|
||||
src/phreeqcpp/prep.cpp
|
||||
src/phreeqcpp/Pressure.cxx
|
||||
src/phreeqcpp/Pressure.h
|
||||
src/phreeqcpp/print.cpp
|
||||
src/phreeqcpp/Reaction.cxx
|
||||
src/phreeqcpp/Reaction.h
|
||||
src/phreeqcpp/read.cpp
|
||||
src/phreeqcpp/ReadClass.cxx
|
||||
src/phreeqcpp/readtr.cpp
|
||||
src/phreeqcpp/runner.cpp
|
||||
src/phreeqcpp/runner.h
|
||||
src/phreeqcpp/SelectedOutput.cpp
|
||||
src/phreeqcpp/SelectedOutput.h
|
||||
src/phreeqcpp/Serializer.cxx
|
||||
src/phreeqcpp/Serializer.h
|
||||
src/phreeqcpp/sit.cpp
|
||||
src/phreeqcpp/smalldense.cpp
|
||||
src/phreeqcpp/smalldense.h
|
||||
src/phreeqcpp/Solution.cxx
|
||||
src/phreeqcpp/Solution.h
|
||||
src/phreeqcpp/SolutionIsotope.cxx
|
||||
src/phreeqcpp/SolutionIsotope.h
|
||||
src/phreeqcpp/spread.cpp
|
||||
src/phreeqcpp/SS.cxx
|
||||
src/phreeqcpp/SS.h
|
||||
src/phreeqcpp/SSassemblage.cxx
|
||||
src/phreeqcpp/SSassemblage.h
|
||||
src/phreeqcpp/SScomp.cxx
|
||||
src/phreeqcpp/SScomp.h
|
||||
src/phreeqcpp/step.cpp
|
||||
src/phreeqcpp/StorageBin.cxx
|
||||
src/phreeqcpp/StorageBin.h
|
||||
src/phreeqcpp/StorageBinList.cpp
|
||||
src/phreeqcpp/StorageBinList.h
|
||||
src/phreeqcpp/structures.cpp
|
||||
src/phreeqcpp/sundialsmath.cpp
|
||||
src/phreeqcpp/sundialsmath.h
|
||||
src/phreeqcpp/sundialstypes.h
|
||||
src/phreeqcpp/Surface.cxx
|
||||
src/phreeqcpp/Surface.h
|
||||
src/phreeqcpp/SurfaceCharge.cxx
|
||||
src/phreeqcpp/SurfaceCharge.h
|
||||
src/phreeqcpp/SurfaceComp.cxx
|
||||
src/phreeqcpp/SurfaceComp.h
|
||||
src/phreeqcpp/System.cxx
|
||||
src/phreeqcpp/System.h
|
||||
src/phreeqcpp/tally.cpp
|
||||
src/phreeqcpp/Temperature.cxx
|
||||
src/phreeqcpp/Temperature.h
|
||||
src/phreeqcpp/tidy.cpp
|
||||
src/phreeqcpp/transport.cpp
|
||||
src/phreeqcpp/Use.cpp
|
||||
src/phreeqcpp/Use.h
|
||||
src/phreeqcpp/UserPunch.cpp
|
||||
src/phreeqcpp/UserPunch.h
|
||||
src/phreeqcpp/utilities.cpp
|
||||
src/thread.h
|
||||
src/Var.c
|
||||
src/Var.h
|
||||
src/Version.h
|
||||
)
|
||||
|
||||
target_include_directories(IPhreeqc
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${IPhreeqc_SOURCE_DIR}/src>
|
||||
$<BUILD_INTERFACE:${IPhreeqc_SOURCE_DIR}/src/phreeqcpp>
|
||||
$<BUILD_INTERFACE:${IPhreeqc_SOURCE_DIR}/src/phreeqcpp/common>
|
||||
$<BUILD_INTERFACE:${IPhreeqc_SOURCE_DIR}/src/phreeqcpp/PhreeqcKeywords>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
target_compile_definitions(IPhreeqc PRIVATE SWIG_SHARED_OBJ)
|
||||
target_compile_definitions(IPhreeqc PRIVATE USE_PHRQ_ALLOC)
|
||||
|
||||
if (NOT IPHREEQC_ENABLE_MODULE)
|
||||
target_compile_definitions(IPhreeqc
|
||||
PUBLIC
|
||||
IPHREEQC_NO_FORTRAN_MODULE
|
||||
)
|
||||
|
||||
target_sources(IPhreeqc
|
||||
PRIVATE
|
||||
src/fimpl.h
|
||||
src/fwrap.cpp
|
||||
src/fwrap1.cpp
|
||||
src/fwrap2.cpp
|
||||
src/fwrap3.cpp
|
||||
src/fwrap4.cpp
|
||||
src/fwrap5.cpp
|
||||
src/fwrap6.cpp
|
||||
src/fwrap7.cpp
|
||||
src/fwrap8.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
||||
target_compile_options(IPhreeqc PRIVATE /wd4251 /wd4275 /wd4793)
|
||||
endif()
|
||||
|
||||
# Disable deprecation warnings for standard C and STL functions in VS2005
|
||||
# and later
|
||||
if (MSVC_VERSION EQUAL 1400 OR MSVC_VERSION GREATER 1400)
|
||||
target_compile_definitions(IPhreeqc PUBLIC _CRT_SECURE_NO_DEPRECATE)
|
||||
target_compile_definitions(IPhreeqc PUBLIC _SCL_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# Allow user to override POSTFIX properties (but mandate them so that
|
||||
# all builds can be installed to the same directory)
|
||||
if (NOT CMAKE_DEBUG_POSTFIX)
|
||||
set_target_properties(IPhreeqc PROPERTIES DEBUG_POSTFIX "d")
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_MINSIZEREL_POSTFIX)
|
||||
set_target_properties(IPhreeqc PROPERTIES MINSIZEREL_POSTFIX "msr")
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_RELWITHDEBINFO_POSTFIX)
|
||||
set_target_properties(IPhreeqc PROPERTIES RELWITHDEBINFO_POSTFIX "rwd")
|
||||
endif()
|
||||
|
||||
set(IPhreeqc_Headers
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc.h
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc.hpp
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqcCallbacks.h
|
||||
${PROJECT_SOURCE_DIR}/src/phreeqcpp/PhreeqcKeywords/Keywords.h
|
||||
${PROJECT_SOURCE_DIR}/src/phreeqcpp/common/PHRQ_exports.h
|
||||
${PROJECT_SOURCE_DIR}/src/phreeqcpp/common/PHRQ_io.h
|
||||
${PROJECT_SOURCE_DIR}/src/Var.h
|
||||
)
|
||||
|
||||
if (IPHREEQC_ENABLE_MODULE)
|
||||
set(IPhreeqc_SRC
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc_interface.F90
|
||||
${PROJECT_SOURCE_DIR}/src/README.Fortran
|
||||
)
|
||||
else()
|
||||
# always install README.Fortran
|
||||
set(IPhreeqc_SRC
|
||||
${PROJECT_SOURCE_DIR}/src/README.Fortran
|
||||
)
|
||||
# install old fortran include files
|
||||
set(IPhreeqc_Headers
|
||||
${IPhreeqc_Headers}
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc.f.inc
|
||||
${PROJECT_SOURCE_DIR}/src/IPhreeqc.f90.inc
|
||||
)
|
||||
endif()
|
||||
|
||||
# Setup references for /CLR
|
||||
if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS)
|
||||
if (MSVC_VERSION LESS 1600)
|
||||
message(FATAL_ERROR "CLR options must be set manually for versions prior to Visual Studio 2010")
|
||||
endif()
|
||||
set_target_properties(IPhreeqc PROPERTIES VS_DOTNET_REFERENCES "System;System.Drawing;System.Windows.Forms;${CMAKE_CURRENT_SOURCE_DIR}/src/phreeqcpp/ZedGraph.dll")
|
||||
set_target_properties(IPhreeqc PROPERTIES COMMON_LANGUAGE_RUNTIME "")
|
||||
target_compile_definitions(IPhreeqc PRIVATE "MULTICHART")
|
||||
endif()
|
||||
|
||||
set_target_properties(IPhreeqc PROPERTIES
|
||||
VERSION "${IPhreeqc_VERSION}"
|
||||
SOVERSION "${IPhreeqc_VERSION_MAJOR}"
|
||||
)
|
||||
|
||||
# install
|
||||
if (STANDALONE_BUILD)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
configure_package_config_file(IPhreeqcConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/IPhreeqcConfig.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/IPhreeqc
|
||||
)
|
||||
|
||||
write_basic_package_version_file("IPhreeqcConfigVersion.cmake"
|
||||
VERSION ${IPhreeqc_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/IPhreeqcConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/IPhreeqcConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/IPhreeqc
|
||||
)
|
||||
|
||||
install(TARGETS IPhreeqc
|
||||
EXPORT IPhreeqcTargets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
install(EXPORT IPhreeqcTargets
|
||||
FILE IPhreeqcTargets.cmake
|
||||
NAMESPACE IPhreeqc::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/IPhreeqc
|
||||
)
|
||||
|
||||
install(FILES ${IPhreeqc_Headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
if (WIN32)
|
||||
install(FILES ${IPhreeqc_SRC} DESTINATION src)
|
||||
else()
|
||||
install(FILES ${IPhreeqc_SRC} DESTINATION ${CMAKE_INSTALL_DOCDIR}/src)
|
||||
endif()
|
||||
if (BUILD_CLR_LIBS)
|
||||
install(FILES "${PROJECT_SOURCE_DIR}/src/phreeqcpp/ZedGraph.dll" DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_CLR_LIBS)
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
message(FATAL_ERROR "BUILD_CLR_LIBS requires that BUILD_SHARED_LIBS be set")
|
||||
endif()
|
||||
|
||||
if (IPHREEQC_STATIC_RUNTIME)
|
||||
message(FATAL_ERROR "BUILD_CLR_LIBS and IPHREEQC_STATIC_RUNTIME are mutually exclusive")
|
||||
endif()
|
||||
|
||||
# CLR files
|
||||
target_sources(IPhreeqc
|
||||
PRIVATE
|
||||
src/phreeqcpp/ChartHandler.cpp
|
||||
src/phreeqcpp/ChartHandler.h
|
||||
src/phreeqcpp/ChartObject.cpp
|
||||
src/phreeqcpp/ChartObject.h
|
||||
src/phreeqcpp/CurveObject.cpp
|
||||
src/phreeqcpp/CurveObject.h
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
include (CTest)
|
||||
|
||||
if (STANDALONE_BUILD)
|
||||
|
||||
add_subdirectory(database)
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(examples)
|
||||
|
||||
if (BUILD_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
|
||||
if (BUILD_TESTING) # may need to add MSVC version check
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # release-1.12.1
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
FETCHCONTENT_BASE_DIR
|
||||
FETCHCONTENT_FULLY_DISCONNECTED
|
||||
FETCHCONTENT_QUIET
|
||||
FETCHCONTENT_SOURCE_DIR_GOOGLETEST
|
||||
FETCHCONTENT_UPDATES_DISCONNECTED
|
||||
FETCHCONTENT_UPDATES_DISCONNECTED_GOOGLETEST
|
||||
)
|
||||
|
||||
# Prevent GoogleTest from overriding our compiler/linker options
|
||||
# when building with Visual Studio
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(BUILD_GTEST ON CACHE BOOL "" FORCE)
|
||||
set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
|
||||
set(INSTALL_GMOCK OFF CACHE BOOL "" FORCE)
|
||||
|
||||
mark_as_advanced(
|
||||
BUILD_GTEST
|
||||
BUILD_GMOCK
|
||||
INSTALL_GTEST
|
||||
INSTALL_GMOCK
|
||||
gmock_build_tests
|
||||
gtest_build_tests
|
||||
gtest_build_samples
|
||||
gtest_disable_pthreads
|
||||
gtest_force_shared_crt
|
||||
gtest_hide_internal_symbols
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(googletest)
|
||||
if (NOT googletest_POPULATED)
|
||||
FetchContent_Populate(googletest)
|
||||
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
add_subdirectory(gtest)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# get_cmake_property(_variableNames VARIABLES)
|
||||
# list (SORT _variableNames)
|
||||
# foreach (_variableName ${_variableNames})
|
||||
# message(STATUS "${_variableName}=${${_variableName}}")
|
||||
# endforeach()
|
||||
|
||||
@ -1,35 +1,35 @@
|
||||
if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/html)
|
||||
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/doc/html)
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/NOTICE)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/phreeqc3-doc/NOTICE.TXT
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/doc)
|
||||
file(RENAME ${CMAKE_SOURCE_DIR}/doc/NOTICE.TXT ${CMAKE_SOURCE_DIR}/doc/NOTICE)
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/README)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/phreeqc3-doc/README.IPhreeqc.TXT
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/doc)
|
||||
file(RENAME ${CMAKE_SOURCE_DIR}/doc/README.IPhreeqc.TXT ${CMAKE_SOURCE_DIR}/doc/README)
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/RELEASE)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/phreeqc3-doc/RELEASE.TXT
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/doc)
|
||||
file(RENAME ${CMAKE_SOURCE_DIR}/doc/RELEASE.TXT ${CMAKE_SOURCE_DIR}/doc/RELEASE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
SET(IPhreeqc_Docs
|
||||
IPhreeqc.pdf
|
||||
NOTICE
|
||||
Phreeqc_2_1999_manual.pdf
|
||||
Phreeqc_3_2013_manual.pdf
|
||||
README
|
||||
RELEASE
|
||||
)
|
||||
|
||||
install(FILES ${IPhreeqc_Docs} DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
install(DIRECTORY html/ DESTINATION ${CMAKE_INSTALL_DOCDIR}/html)
|
||||
if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/html)
|
||||
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/doc/html)
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/NOTICE)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/phreeqc3-doc/NOTICE.TXT
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/doc)
|
||||
file(RENAME ${CMAKE_SOURCE_DIR}/doc/NOTICE.TXT ${CMAKE_SOURCE_DIR}/doc/NOTICE)
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/README)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/phreeqc3-doc/README.IPhreeqc.TXT
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/doc)
|
||||
file(RENAME ${CMAKE_SOURCE_DIR}/doc/README.IPhreeqc.TXT ${CMAKE_SOURCE_DIR}/doc/README)
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/doc/RELEASE)
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/phreeqc3-doc/RELEASE.TXT
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/doc)
|
||||
file(RENAME ${CMAKE_SOURCE_DIR}/doc/RELEASE.TXT ${CMAKE_SOURCE_DIR}/doc/RELEASE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
SET(IPhreeqc_Docs
|
||||
IPhreeqc.pdf
|
||||
NOTICE
|
||||
Phreeqc_2_1999_manual.pdf
|
||||
Phreeqc_3_2013_manual.pdf
|
||||
README
|
||||
RELEASE
|
||||
)
|
||||
|
||||
install(FILES ${IPhreeqc_Docs} DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
install(DIRECTORY html/ DESTINATION ${CMAKE_INSTALL_DOCDIR}/html)
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
if (WIN32)
|
||||
SET(EXAMPLES_DIR examples)
|
||||
else()
|
||||
SET(EXAMPLES_DIR ${CMAKE_INSTALL_DOCDIR}/examples)
|
||||
endif()
|
||||
|
||||
add_subdirectory(c)
|
||||
add_subdirectory(com)
|
||||
add_subdirectory(cpp)
|
||||
add_subdirectory(fortran)
|
||||
add_subdirectory(using-cmake)
|
||||
if (WIN32)
|
||||
SET(EXAMPLES_DIR examples)
|
||||
else()
|
||||
SET(EXAMPLES_DIR ${CMAKE_INSTALL_DOCDIR}/examples)
|
||||
endif()
|
||||
|
||||
add_subdirectory(c)
|
||||
add_subdirectory(com)
|
||||
add_subdirectory(cpp)
|
||||
add_subdirectory(fortran)
|
||||
add_subdirectory(using-cmake)
|
||||
|
||||
@ -1 +1 @@
|
||||
add_subdirectory(advect)
|
||||
add_subdirectory(advect)
|
||||
|
||||
@ -1,35 +1,35 @@
|
||||
# project
|
||||
project(example_advect_c C)
|
||||
|
||||
configure_file(phreeqc.dat phreeqc.dat COPYONLY)
|
||||
configure_file(ic ic COPYONLY)
|
||||
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
|
||||
|
||||
# files
|
||||
SET(C_Advect_Files
|
||||
${IPhreeqc_BINARY_DIR}/examples/c/advect/CMakeLists.txt
|
||||
advect.c
|
||||
ic
|
||||
phreeqc.dat
|
||||
README.txt
|
||||
)
|
||||
|
||||
# src
|
||||
SET(C_Advect_SRC
|
||||
advect.c
|
||||
)
|
||||
|
||||
# executable
|
||||
add_executable(example_advect_c ${C_Advect_SRC})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(example_advect_c ${EXTRA_LIBS})
|
||||
|
||||
# install directory
|
||||
SET(C_Advect_Dir ${EXAMPLES_DIR}/c/advect)
|
||||
|
||||
# install
|
||||
install(FILES ${C_Advect_Files} DESTINATION ${C_Advect_Dir})
|
||||
# project
|
||||
project(example_advect_c C)
|
||||
|
||||
configure_file(phreeqc.dat phreeqc.dat COPYONLY)
|
||||
configure_file(ic ic COPYONLY)
|
||||
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
|
||||
|
||||
# files
|
||||
SET(C_Advect_Files
|
||||
${IPhreeqc_BINARY_DIR}/examples/c/advect/CMakeLists.txt
|
||||
advect.c
|
||||
ic
|
||||
phreeqc.dat
|
||||
README.txt
|
||||
)
|
||||
|
||||
# src
|
||||
SET(C_Advect_SRC
|
||||
advect.c
|
||||
)
|
||||
|
||||
# executable
|
||||
add_executable(example_advect_c ${C_Advect_SRC})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(example_advect_c ${EXTRA_LIBS})
|
||||
|
||||
# install directory
|
||||
SET(C_Advect_Dir ${EXAMPLES_DIR}/c/advect)
|
||||
|
||||
# install
|
||||
install(FILES ${C_Advect_Files} DESTINATION ${C_Advect_Dir})
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
add_subdirectory(excel)
|
||||
add_subdirectory(python)
|
||||
|
||||
SET(COM_Files
|
||||
README.txt
|
||||
)
|
||||
|
||||
SET(COM_Dir ${EXAMPLES_DIR}/com)
|
||||
|
||||
install(FILES ${COM_Files} DESTINATION ${COM_Dir})
|
||||
add_subdirectory(excel)
|
||||
add_subdirectory(python)
|
||||
|
||||
SET(COM_Files
|
||||
README.txt
|
||||
)
|
||||
|
||||
SET(COM_Dir ${EXAMPLES_DIR}/com)
|
||||
|
||||
install(FILES ${COM_Files} DESTINATION ${COM_Dir})
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
SET(Excel_Files
|
||||
phreeqc.dat
|
||||
runphreeqc.xls
|
||||
withcallback.xls
|
||||
)
|
||||
|
||||
SET(Excel_Dir ${EXAMPLES_DIR}/com/excel)
|
||||
|
||||
install(FILES ${Excel_Files} DESTINATION ${Excel_Dir})
|
||||
|
||||
|
||||
|
||||
SET(Excel_Files
|
||||
phreeqc.dat
|
||||
runphreeqc.xls
|
||||
withcallback.xls
|
||||
)
|
||||
|
||||
SET(Excel_Dir ${EXAMPLES_DIR}/com/excel)
|
||||
|
||||
install(FILES ${Excel_Files} DESTINATION ${Excel_Dir})
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
SET(Python_Files
|
||||
Gypsum.py
|
||||
parallel_advect.py
|
||||
phreeqc.dat
|
||||
pitzer.dat
|
||||
wateq4f.dat
|
||||
)
|
||||
|
||||
SET(Python_Dir ${EXAMPLES_DIR}/com/python)
|
||||
|
||||
install(FILES ${Python_Files} DESTINATION ${Python_Dir})
|
||||
|
||||
|
||||
|
||||
SET(Python_Files
|
||||
Gypsum.py
|
||||
parallel_advect.py
|
||||
phreeqc.dat
|
||||
pitzer.dat
|
||||
wateq4f.dat
|
||||
)
|
||||
|
||||
SET(Python_Dir ${EXAMPLES_DIR}/com/python)
|
||||
|
||||
install(FILES ${Python_Files} DESTINATION ${Python_Dir})
|
||||
|
||||
@ -1 +1 @@
|
||||
add_subdirectory(advect)
|
||||
add_subdirectory(advect)
|
||||
|
||||
@ -1,35 +1,35 @@
|
||||
# project
|
||||
project(example_advect_cpp CXX)
|
||||
|
||||
configure_file(phreeqc.dat phreeqc.dat COPYONLY)
|
||||
configure_file(ic ic COPYONLY)
|
||||
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
|
||||
|
||||
# files
|
||||
SET(CPP_Advect_Files
|
||||
${IPhreeqc_BINARY_DIR}/examples/cpp/advect/CMakeLists.txt
|
||||
advect.cpp
|
||||
ic
|
||||
phreeqc.dat
|
||||
README.txt
|
||||
)
|
||||
|
||||
# src
|
||||
SET(CPP_Advect_SRC
|
||||
advect.cpp
|
||||
)
|
||||
|
||||
# executable
|
||||
add_executable(example_advect_cpp ${CPP_Advect_SRC})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(example_advect_cpp ${EXTRA_LIBS})
|
||||
|
||||
# install directory
|
||||
SET(CPP_Advect_Dir ${EXAMPLES_DIR}/cpp/advect)
|
||||
|
||||
# install
|
||||
install(FILES ${CPP_Advect_Files} DESTINATION ${CPP_Advect_Dir})
|
||||
# project
|
||||
project(example_advect_cpp CXX)
|
||||
|
||||
configure_file(phreeqc.dat phreeqc.dat COPYONLY)
|
||||
configure_file(ic ic COPYONLY)
|
||||
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
|
||||
|
||||
# files
|
||||
SET(CPP_Advect_Files
|
||||
${IPhreeqc_BINARY_DIR}/examples/cpp/advect/CMakeLists.txt
|
||||
advect.cpp
|
||||
ic
|
||||
phreeqc.dat
|
||||
README.txt
|
||||
)
|
||||
|
||||
# src
|
||||
SET(CPP_Advect_SRC
|
||||
advect.cpp
|
||||
)
|
||||
|
||||
# executable
|
||||
add_executable(example_advect_cpp ${CPP_Advect_SRC})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(example_advect_cpp ${EXTRA_LIBS})
|
||||
|
||||
# install directory
|
||||
SET(CPP_Advect_Dir ${EXAMPLES_DIR}/cpp/advect)
|
||||
|
||||
# install
|
||||
install(FILES ${CPP_Advect_Files} DESTINATION ${CPP_Advect_Dir})
|
||||
|
||||
@ -1 +1 @@
|
||||
add_subdirectory(advect)
|
||||
add_subdirectory(advect)
|
||||
|
||||
@ -1,44 +1,44 @@
|
||||
# project
|
||||
if (IPHREEQC_FORTRAN_TESTING AND IPHREEQC_ENABLE_MODULE)
|
||||
project(example_advect_f90 Fortran)
|
||||
|
||||
configure_file(phreeqc.dat phreeqc.dat COPYONLY)
|
||||
configure_file(ic ic COPYONLY)
|
||||
endif()
|
||||
|
||||
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
|
||||
|
||||
# files
|
||||
SET(FORTRAN_Advect_Files
|
||||
${IPhreeqc_BINARY_DIR}/examples/fortran/advect/CMakeLists.txt
|
||||
advect.F90
|
||||
ic
|
||||
phreeqc.dat
|
||||
README.txt
|
||||
)
|
||||
|
||||
if (IPHREEQC_FORTRAN_TESTING AND IPHREEQC_ENABLE_MODULE)
|
||||
# src
|
||||
SET(FORTRAN_Advect_SRC
|
||||
advect.F90
|
||||
../../../src/IPhreeqc_interface.F90
|
||||
)
|
||||
|
||||
# place [*.F90] files into "Source Files"
|
||||
source_group("Source Files" FILES ${FORTRAN_Advect_SRC})
|
||||
|
||||
# executable
|
||||
add_executable(example_advect_f90 ${FORTRAN_Advect_SRC})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(example_advect_f90 ${EXTRA_LIBS})
|
||||
endif()
|
||||
|
||||
# install directory
|
||||
SET(FORTRAN_Advect_Dir ${EXAMPLES_DIR}/fortran/advect)
|
||||
|
||||
# install
|
||||
install(FILES ${FORTRAN_Advect_Files} DESTINATION ${FORTRAN_Advect_Dir})
|
||||
# project
|
||||
if (IPHREEQC_FORTRAN_TESTING AND IPHREEQC_ENABLE_MODULE)
|
||||
project(example_advect_f90 Fortran)
|
||||
|
||||
configure_file(phreeqc.dat phreeqc.dat COPYONLY)
|
||||
configure_file(ic ic COPYONLY)
|
||||
endif()
|
||||
|
||||
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
|
||||
|
||||
# files
|
||||
SET(FORTRAN_Advect_Files
|
||||
${IPhreeqc_BINARY_DIR}/examples/fortran/advect/CMakeLists.txt
|
||||
advect.F90
|
||||
ic
|
||||
phreeqc.dat
|
||||
README.txt
|
||||
)
|
||||
|
||||
if (IPHREEQC_FORTRAN_TESTING AND IPHREEQC_ENABLE_MODULE)
|
||||
# src
|
||||
SET(FORTRAN_Advect_SRC
|
||||
advect.F90
|
||||
../../../src/IPhreeqc_interface.F90
|
||||
)
|
||||
|
||||
# place [*.F90] files into "Source Files"
|
||||
source_group("Source Files" FILES ${FORTRAN_Advect_SRC})
|
||||
|
||||
# executable
|
||||
add_executable(example_advect_f90 ${FORTRAN_Advect_SRC})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(example_advect_f90 ${EXTRA_LIBS})
|
||||
endif()
|
||||
|
||||
# install directory
|
||||
SET(FORTRAN_Advect_Dir ${EXAMPLES_DIR}/fortran/advect)
|
||||
|
||||
# install
|
||||
install(FILES ${FORTRAN_Advect_Files} DESTINATION ${FORTRAN_Advect_Dir})
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
|
||||
|
||||
set(example_FILES
|
||||
${IPhreeqc_BINARY_DIR}/examples/using-cmake/CMakeLists.txt
|
||||
ex2
|
||||
main.cpp
|
||||
phreeqc.dat
|
||||
README.txt
|
||||
)
|
||||
|
||||
# install directory
|
||||
set(example_DIR ${EXAMPLES_DIR}/using-cmake)
|
||||
|
||||
if (IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
||||
set(FULL_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
else()
|
||||
# this assumes that relative install prefixes are always relative to the build directory
|
||||
get_filename_component(FULL_INSTALL_PREFIX "${IPhreeqc_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
|
||||
endif()
|
||||
configure_file(post-install.cmake.in ${IPhreeqc_BINARY_DIR}/post-install.cmake @ONLY)
|
||||
|
||||
# install
|
||||
install(FILES ${example_FILES} DESTINATION ${example_DIR})
|
||||
|
||||
# configure
|
||||
install(CODE "execute_process(COMMAND ${CMAKE_CTEST_COMMAND} -S post-install.cmake)")
|
||||
configure_file(CMakeLists.txt.in CMakeLists.txt COPYONLY)
|
||||
|
||||
set(example_FILES
|
||||
${IPhreeqc_BINARY_DIR}/examples/using-cmake/CMakeLists.txt
|
||||
ex2
|
||||
main.cpp
|
||||
phreeqc.dat
|
||||
README.txt
|
||||
)
|
||||
|
||||
# install directory
|
||||
set(example_DIR ${EXAMPLES_DIR}/using-cmake)
|
||||
|
||||
if (IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
||||
set(FULL_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
else()
|
||||
# this assumes that relative install prefixes are always relative to the build directory
|
||||
get_filename_component(FULL_INSTALL_PREFIX "${IPhreeqc_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
|
||||
endif()
|
||||
configure_file(post-install.cmake.in ${IPhreeqc_BINARY_DIR}/post-install.cmake @ONLY)
|
||||
|
||||
# install
|
||||
install(FILES ${example_FILES} DESTINATION ${example_DIR})
|
||||
|
||||
# configure
|
||||
install(CODE "execute_process(COMMAND ${CMAKE_CTEST_COMMAND} -S post-install.cmake)")
|
||||
|
||||
@ -3,19 +3,19 @@ project(unit)
|
||||
include(GoogleTest)
|
||||
|
||||
add_executable(TestCVar TestCVar.cpp)
|
||||
target_link_libraries(TestCVar IPhreeqc gtest gtest_main)
|
||||
target_link_libraries(TestCVar IPhreeqc gtest gtest_main gmock)
|
||||
gtest_discover_tests(TestCVar)
|
||||
|
||||
add_executable(TestVar TestVar.cpp)
|
||||
target_link_libraries(TestVar IPhreeqc gtest gtest_main)
|
||||
target_link_libraries(TestVar IPhreeqc gtest gtest_main gmock)
|
||||
gtest_discover_tests(TestVar)
|
||||
|
||||
add_executable(TestIPhreeqcLib TestIPhreeqcLib.cpp FileTest.cpp)
|
||||
target_link_libraries(TestIPhreeqcLib IPhreeqc gtest gtest_main)
|
||||
target_link_libraries(TestIPhreeqcLib IPhreeqc gtest gtest_main gmock)
|
||||
gtest_discover_tests(TestIPhreeqcLib)
|
||||
|
||||
add_executable(TestIPhreeqc TestIPhreeqc.cpp FileTest.cpp)
|
||||
target_link_libraries(TestIPhreeqc IPhreeqc gtest gtest_main)
|
||||
target_link_libraries(TestIPhreeqc IPhreeqc gtest gtest_main gmock)
|
||||
if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS)
|
||||
# Setup references for /CLR
|
||||
set_target_properties(TestIPhreeqc PROPERTIES VS_DOTNET_REFERENCES "${CMAKE_CURRENT_SOURCE_DIR}/../src/phreeqcpp/ZedGraph.dll")
|
||||
@ -24,7 +24,7 @@ endif()
|
||||
gtest_discover_tests(TestIPhreeqc)
|
||||
|
||||
add_executable(TestSelectedOutput TestSelectedOutput.cpp)
|
||||
target_link_libraries(TestSelectedOutput IPhreeqc gtest gtest_main)
|
||||
target_link_libraries(TestSelectedOutput IPhreeqc gtest gtest_main gmock)
|
||||
gtest_discover_tests(TestSelectedOutput)
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
@ -176,7 +176,7 @@ configure_file(
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
# misc files
|
||||
# misc files
|
||||
|
||||
configure_file(
|
||||
conv_fail.in
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// -*- coding: windows-1252 -*-
|
||||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <cfloat>
|
||||
@ -11,6 +11,8 @@
|
||||
#undef false
|
||||
#include "CVar.hxx"
|
||||
|
||||
using ::testing::HasSubstr;
|
||||
|
||||
VRESULT SOLUTION(IPhreeqc& obj, double C, double Ca, double Na);
|
||||
VRESULT EQUILIBRIUM_PHASES(IPhreeqc& obj, const char* phase, double si, double amount);
|
||||
VRESULT USER_PUNCH(IPhreeqc& obj, const char* element, int max);
|
||||
@ -1927,7 +1929,7 @@ TEST(TestIPhreeqc, TestGetDumpStringLineCount)
|
||||
obj.SetDumpStringOn(true);
|
||||
ASSERT_EQ(true, obj.GetDumpStringOn());
|
||||
ASSERT_EQ(0, obj.RunAccumulated());
|
||||
ASSERT_EQ(33, obj.GetDumpStringLineCount());
|
||||
ASSERT_EQ(34, obj.GetDumpStringLineCount());
|
||||
}
|
||||
|
||||
TEST(TestIPhreeqc, TestGetDumpStringLine)
|
||||
@ -1953,43 +1955,44 @@ TEST(TestIPhreeqc, TestGetDumpStringLine)
|
||||
obj.SetDumpStringOn(true);
|
||||
ASSERT_EQ(true, obj.GetDumpStringOn());
|
||||
ASSERT_EQ(0, obj.RunAccumulated());
|
||||
ASSERT_EQ(33, obj.GetDumpStringLineCount());
|
||||
ASSERT_EQ(34, obj.GetDumpStringLineCount());
|
||||
|
||||
int line = 0;
|
||||
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "SOLUTION_RAW") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-temp") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-pressure") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-potential") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-total_h") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-total_o") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-cb") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-density") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-totals") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-pH") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-pe") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-mu") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-ah2o") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-mass_water") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-soln_vol") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-total_alkalinity") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-activities") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " C(-4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " E ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), " O(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "-gammas") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "USE mix none") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "USE reaction none") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "USE reaction_temperature none") != NULL);
|
||||
ASSERT_TRUE(::strstr(obj.GetDumpStringLine(line++), "USE reaction_pressure none") != NULL);
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("SOLUTION_RAW"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-temp"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-pressure"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-potential"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-total_h"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-total_o"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-cb"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-density"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-viscosity"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-totals"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" Ca "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" Na "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-pH"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-pe"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-mu"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-ah2o"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-mass_water"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-soln_vol"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-total_alkalinity"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-activities"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" C(-4) "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" Ca "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" E "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" Na "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr(" O(0) "));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("-gammas"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("USE mix none"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("USE reaction none"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("USE reaction_temperature none"));
|
||||
EXPECT_THAT(obj.GetDumpStringLine(line++), HasSubstr("USE reaction_pressure none"));
|
||||
|
||||
// remaining lines should be empty
|
||||
ASSERT_EQ(std::string(""), std::string(obj.GetDumpStringLine(line++)));
|
||||
@ -2114,7 +2117,7 @@ TEST(TestIPhreeqc, TestSetDumpFileName)
|
||||
|
||||
ASSERT_EQ(true, ::FileExists(DUMP_FILENAME));
|
||||
|
||||
std::string lines[33];
|
||||
std::string lines[35];
|
||||
std::ifstream ifs(DUMP_FILENAME);
|
||||
|
||||
size_t i = 0;
|
||||
@ -2124,39 +2127,40 @@ TEST(TestIPhreeqc, TestSetDumpFileName)
|
||||
}
|
||||
|
||||
int line = 0;
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "SOLUTION_RAW") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-temp") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-pressure") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-potential") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-total_h") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-total_o") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-cb") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-density") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-totals") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-pH") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-pe") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-mu") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-ah2o") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-mass_water") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-soln_vol") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-total_alkalinity") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-activities") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C(-4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " E ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " O(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-gammas") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "USE mix none") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "USE reaction none") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "USE reaction_temperature none") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "USE reaction_pressure none") != NULL);
|
||||
EXPECT_THAT(lines[line++], HasSubstr("SOLUTION_RAW"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-temp"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-pressure"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-potential"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-total_h"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-total_o"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-cb"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-density"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-viscosity"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-totals"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-pH"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-pe"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-mu"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-ah2o"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-mass_water"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-soln_vol"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-total_alkalinity"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-activities"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C(-4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" E "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" O(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-gammas"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("USE mix none"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("USE reaction none"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("USE reaction_temperature none"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("USE reaction_pressure none"));
|
||||
|
||||
if (::FileExists(DUMP_FILENAME))
|
||||
{
|
||||
@ -2218,111 +2222,111 @@ TEST(TestIPhreeqc, TestSetOutputFileName)
|
||||
// but seems to not work when BUILD_SHARED_LIBS is set gtest 1.8.1
|
||||
// see aa178fd6fac2d1c0a867385538071031e2ddedde of gtest branch
|
||||
//
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Reading input data for simulation 1.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " SOLUTION 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " DUMP") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " -solution 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-------------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Beginning of initial solution calculations.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-------------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Initial solution 1. ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-----------------------------Solution composition--------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Elements Molality Moles") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "----------------------------Description of solution------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " pH = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " pe = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Activity of water = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ionic strength (mol/kgw) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Mass of water (kg) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Total alkalinity (eq/kg) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Total CO2 (mol/kg) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Temperature (°C) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Electrical balance (eq) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Percent error, 100*(Cat-|An|)/(Cat+|An|) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Iterations = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Total H = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Total O = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "----------------------------Distribution of species----------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Log Log Log mole V") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Species Molality Activity Molality Activity Gamma cm³/mol") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " OH- ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H2O ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "C(-4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CH4 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " HCO3- ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CO2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaHCO3+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaCO3 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CO3-2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaHCO3 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaCO3- ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca+2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaHCO3+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaCO3 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaOH+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaHCO3 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaCO3- ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaOH ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "O(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " O2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------Saturation indices-------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Phase SI** log IAP log K(298 K, 1 atm)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Aragonite") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Calcite") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CH4(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CO2(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H2(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H2O(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " O2(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "**For a gas, SI = log10(fugacity). Fugacity = pressure * phi / 1 atm.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " For ideal gases, phi = 1.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "End of simulation.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Reading input data for simulation 2.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Reading input data for simulation 1."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" SOLUTION 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" DUMP"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" -solution 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-------------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Beginning of initial solution calculations."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-------------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Initial solution 1. "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-----------------------------Solution composition--------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Elements Molality Moles"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("----------------------------Description of solution------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" pH = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" pe = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Activity of water = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ionic strength (mol/kgw) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Mass of water (kg) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Total alkalinity (eq/kg) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Total CO2 (mol/kg) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Temperature (°C) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Electrical balance (eq) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Percent error, 100*(Cat-|An|)/(Cat+|An|) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Iterations = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Total H = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Total O = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("----------------------------Distribution of species----------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Log Log Log mole V"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Species Molality Activity Molality Activity Gamma cm³/mol"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" OH- "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H2O "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("C(-4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CH4 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("C(4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" HCO3- "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CO2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaHCO3+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaCO3 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CO3-2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaHCO3 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaCO3- "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Ca "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca+2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaHCO3+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaCO3 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaOH+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("H(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Na "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaHCO3 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaCO3- "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaOH "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("O(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" O2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------Saturation indices-------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Phase SI** log IAP log K(298 K, 1 atm)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Aragonite"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Calcite"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CH4(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CO2(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H2(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H2O(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" O2(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("**For a gas, SI = log10(fugacity). Fugacity = pressure * phi / 1 atm."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" For ideal gases, phi = 1."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("End of simulation."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Reading input data for simulation 2."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
#ifndef TESTING
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "----------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "End of Run after ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "----------------") != NULL);
|
||||
EXPECT_THAT(lines[line++], HasSubstr("----------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("End of Run after "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("----------------"));
|
||||
#endif
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
|
||||
|
||||
if (::FileExists(OUTPUT_FILENAME))
|
||||
@ -3160,66 +3164,66 @@ TEST(TestIPhreeqc, TestGetSelectedOutputString)
|
||||
|
||||
std::string sline(obj.GetSelectedOutputString());
|
||||
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "sim\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "state\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "soln\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "dist_x\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "time\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "step\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "pH\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "pe\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "C\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "Ca\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "Na\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "m_CO3-2\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "m_CaOH+\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "m_NaCO3-\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "la_CO3-2\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "la_CaOH+\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "la_NaCO3-\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "Calcite\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "d_Calcite\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "si_CO2(g)\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "si_Siderite\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "pressure\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "total mol\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "volume\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "g_CO2(g)\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "g_N2(g)\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "k_Albite\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "dk_Albite\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "k_Pyrite\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "dk_Pyrite\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "s_CaSO4\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "s_SrSO4\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "1.name\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "1.type\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "1.moles\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "2.name\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "2.type\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "2.moles\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "3.name\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "3.type\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "3.moles\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "4.name\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "4.type\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "4.moles\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "5.name\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "5.type\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "5.moles\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "6.name\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "6.type\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "6.moles\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "\n") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "i_soln\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "react\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "Ca+2\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "aq\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "CaHCO3+\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "CaCO3\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "CaOH+\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "Calcite\t") != NULL);
|
||||
ASSERT_TRUE(::strstr(sline.c_str(), "equi\t") != NULL);
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("sim\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("state\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("soln\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("dist_x\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("time\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("step\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("pH\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("pe\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("C\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("Ca\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("Na\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("m_CO3-2\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("m_CaOH+\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("m_NaCO3-\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("la_CO3-2\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("la_CaOH+\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("la_NaCO3-\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("Calcite\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("d_Calcite\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("si_CO2(g)\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("si_Siderite\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("pressure\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("total mol\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("volume\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("g_CO2(g)\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("g_N2(g)\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("k_Albite\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("dk_Albite\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("k_Pyrite\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("dk_Pyrite\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("s_CaSO4\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("s_SrSO4\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("1.name\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("1.type\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("1.moles\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("2.name\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("2.type\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("2.moles\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("3.name\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("3.type\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("3.moles\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("4.name\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("4.type\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("4.moles\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("5.name\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("5.type\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("5.moles\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("6.name\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("6.type\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("6.moles\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("\n"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("i_soln\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("react\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("Ca+2\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("aq\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("CaHCO3+\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("CaCO3\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("CaOH+\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("Calcite\t"));
|
||||
EXPECT_THAT(sline.c_str(), HasSubstr("equi\t"));
|
||||
}
|
||||
|
||||
TEST(TestIPhreeqc, TestGetSelectedOutputStringLineCount)
|
||||
@ -4100,12 +4104,12 @@ TEST(TestIPhreeqc, TestMultiPunchCSelectedOutput)
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(6, 0, &var)); ASSERT_NEAR(-7.60411, var.dVal, ::pow(10., -2));
|
||||
|
||||
// si_Calcite
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(1, 1, &var)); ASSERT_NEAR(0.692077, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(2, 1, &var)); ASSERT_NEAR(0.678847, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(3, 1, &var)); ASSERT_NEAR(0.678847, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(1, 1, &var)); ASSERT_NEAR(0.702316, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(2, 1, &var)); ASSERT_NEAR(0.695856, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(3, 1, &var)); ASSERT_NEAR(0.689518, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(4, 1, &var)); ASSERT_NEAR(-999.999, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(5, 1, &var)); ASSERT_NEAR(-999.999, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(6, 1, &var)); ASSERT_NEAR(0.672429, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(6, 1, &var)); ASSERT_NEAR(0.683300, var.dVal, ::pow(10., -2));
|
||||
|
||||
// DUMMY_1
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(1, 2, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
@ -4129,7 +4133,7 @@ TEST(TestIPhreeqc, TestMultiPunchCSelectedOutput)
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(3, 4, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(4, 4, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(5, 4, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(6, 4, &var)); ASSERT_NEAR(3.69E-13, var.dVal, ::pow(10., log10(3.69E-13) - 2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(6, 4, &var)); ASSERT_NEAR(4.12e-13, var.dVal, ::pow(10., log10(4.12e-13) - 2));
|
||||
|
||||
// Sum_Delta/U
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(1, 5, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
@ -4247,7 +4251,7 @@ TEST(TestIPhreeqc, TestMultiPunchCSelectedOutput)
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(0, ncol++, &var)); ASSERT_EQ(std::string("Halite_max"), std::string(var.sVal));
|
||||
|
||||
// Sum_resid
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(1, 0, &var)); ASSERT_NEAR(3.69E-13, var.dVal, ::pow(10., log10(3.69E-13) - 2));
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(1, 0, &var)); ASSERT_NEAR(4.12e-13, var.dVal, ::pow(10., log10(4.12e-13) - 2));
|
||||
|
||||
// Sum_Delta/U
|
||||
ASSERT_EQ(VR_OK, obj.GetSelectedOutputValue(1, 1, &var)); ASSERT_NEAR(0, var.dVal, ::pow(10., -3));
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
// -*- coding: windows-1252 -*-
|
||||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
#include "IPhreeqc.h"
|
||||
#include "Phreeqc.h" /* snprintf */
|
||||
#include "CVar.hxx"
|
||||
|
||||
using ::testing::HasSubstr;
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
@ -1756,35 +1758,39 @@ TEST(TestIPhreeqcLib, TestDumpString)
|
||||
|
||||
const char* dump_str = ::GetDumpString(n);
|
||||
|
||||
ASSERT_TRUE(::strstr(dump_str, "SOLUTION_RAW") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-temp") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-total_h") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-total_o") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-cb") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-totals") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-pH") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-pe") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-mu") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-ah2o") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-mass_water") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-total_alkalinity") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-activities") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " C(-4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " E ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, " O(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "-gammas") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "USE mix none") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "USE reaction none") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "USE reaction_temperature none") != NULL);
|
||||
ASSERT_TRUE(::strstr(dump_str, "USE reaction_pressure none") != NULL);
|
||||
EXPECT_THAT(dump_str, HasSubstr("SOLUTION_RAW"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-temp"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-pressure"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-potential"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-total_h"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-total_o"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-cb"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-density"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-viscosity"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-totals"));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" Ca "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" Na "));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-pH"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-pe"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-mu"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-ah2o"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-mass_water"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-total_alkalinity"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-activities"));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" C(-4) "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" Ca "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" E "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" Na "));
|
||||
EXPECT_THAT(dump_str, HasSubstr(" O(0) "));
|
||||
EXPECT_THAT(dump_str, HasSubstr("-gammas"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("USE mix none"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("USE reaction none"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("USE reaction_temperature none"));
|
||||
EXPECT_THAT(dump_str, HasSubstr("USE reaction_pressure none"));
|
||||
|
||||
if (n >= 0)
|
||||
{
|
||||
@ -1813,7 +1819,7 @@ TEST(TestIPhreeqcLib, TestGetDumpStringLineCount)
|
||||
ASSERT_EQ(IPQ_OK, ::SetDumpFileOn(n, 0));
|
||||
ASSERT_EQ(IPQ_OK, ::SetDumpStringOn(n, 1));
|
||||
ASSERT_EQ(0, ::RunAccumulated(n));
|
||||
ASSERT_EQ(33, ::GetDumpStringLineCount(n));
|
||||
ASSERT_EQ(34, ::GetDumpStringLineCount(n));
|
||||
|
||||
if (n >= 0)
|
||||
{
|
||||
@ -1842,43 +1848,44 @@ TEST(TestIPhreeqcLib, TestGetDumpStringLine)
|
||||
ASSERT_EQ(IPQ_OK, ::SetDumpFileOn(n, 0));
|
||||
ASSERT_EQ(IPQ_OK, ::SetDumpStringOn(n, 1));
|
||||
ASSERT_EQ(0, ::RunAccumulated(n));
|
||||
ASSERT_EQ(33, ::GetDumpStringLineCount(n));
|
||||
ASSERT_EQ(34, ::GetDumpStringLineCount(n));
|
||||
|
||||
int line = 0;
|
||||
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "SOLUTION_RAW") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-temp") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-pressure") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-potential") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-total_h") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-total_o") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-cb") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-density") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-totals") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-pH") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-pe") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-mu") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-ah2o") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-mass_water") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-soln_vol") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-total_alkalinity") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-activities") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " C(-4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " E ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), " O(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "-gammas") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "USE mix none") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "USE reaction none") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "USE reaction_temperature none") != NULL);
|
||||
ASSERT_TRUE(::strstr(::GetDumpStringLine(n, line++), "USE reaction_pressure none") != NULL);
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("SOLUTION_RAW"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-temp"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-pressure"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-potential"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-total_h"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-total_o"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-cb"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-density"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-viscosity"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-totals"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" Ca "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" Na "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-pH"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-pe"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-mu"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-ah2o"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-mass_water"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-soln_vol"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-total_alkalinity"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-activities"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" C(-4) "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" Ca "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" E "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" Na "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr(" O(0) "));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("-gammas"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("USE mix none"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("USE reaction none"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("USE reaction_temperature none"));
|
||||
EXPECT_THAT(::GetDumpStringLine(n, line++), HasSubstr("USE reaction_pressure none"));
|
||||
|
||||
// remaining lines should be empty
|
||||
ASSERT_EQ(std::string(""), std::string(::GetDumpStringLine(n, line++)));
|
||||
@ -2328,7 +2335,7 @@ TEST(TestIPhreeqcLib, TestSetDumpFileName)
|
||||
|
||||
ASSERT_EQ(true, ::FileExists(DUMP_FILENAME));
|
||||
|
||||
std::string lines[33];
|
||||
std::string lines[35];
|
||||
std::ifstream ifs(DUMP_FILENAME);
|
||||
|
||||
size_t i = 0;
|
||||
@ -2338,39 +2345,40 @@ TEST(TestIPhreeqcLib, TestSetDumpFileName)
|
||||
}
|
||||
|
||||
int line = 0;
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "SOLUTION_RAW") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-temp") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-pressure") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-potential") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-total_h") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-total_o") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-cb") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-density") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-totals") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-pH") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-pe") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-mu") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-ah2o") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-mass_water") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-soln_vol") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-total_alkalinity") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-activities") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C(-4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " E ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " O(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-gammas") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "USE mix none") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "USE reaction none") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "USE reaction_temperature none") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "USE reaction_pressure none") != NULL);
|
||||
EXPECT_THAT(lines[line++], HasSubstr("SOLUTION_RAW"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-temp"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-pressure"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-potential"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-total_h"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-total_o"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-cb"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-density"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-viscosity"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-totals"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-pH"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-pe"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-mu"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-ah2o"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-mass_water"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-soln_vol"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-total_alkalinity"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-activities"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C(-4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C(4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" E "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" O(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-gammas"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("USE mix none"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("USE reaction none"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("USE reaction_temperature none"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("USE reaction_pressure none"));
|
||||
|
||||
if (::FileExists(DUMP_FILENAME))
|
||||
{
|
||||
@ -2436,111 +2444,111 @@ TEST(TestIPhreeqcLib, TestSetOutputFileName)
|
||||
|
||||
int line = 0;
|
||||
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Reading input data for simulation 1.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " SOLUTION 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " DUMP") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " -solution 1") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-------------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Beginning of initial solution calculations.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-------------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Initial solution 1. ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "-----------------------------Solution composition--------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Elements Molality Moles") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " C ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "----------------------------Description of solution------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " pH = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " pe = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Activity of water = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ionic strength (mol/kgw) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Mass of water (kg) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Total alkalinity (eq/kg) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Total CO2 (mol/kg) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Temperature (°C) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Electrical balance (eq) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Percent error, 100*(Cat-|An|)/(Cat+|An|) = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Iterations = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Total H = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Total O = ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "----------------------------Distribution of species----------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Log Log Log mole V") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Species Molality Activity Molality Activity Gamma cm³/mol") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " OH- ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H2O ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "C(-4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CH4 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "C(4) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " HCO3- ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CO2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaHCO3+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaCO3 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CO3-2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaHCO3 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaCO3- ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Ca ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Ca+2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaHCO3+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaCO3 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CaOH+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "H(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Na ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Na+ ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaHCO3 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaCO3- ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " NaOH ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "O(0) ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " O2 ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------Saturation indices-------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Phase SI** log IAP log K(298 K, 1 atm)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Aragonite") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " Calcite") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CH4(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " CO2(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H2(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " H2O(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " O2(g)") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "**For a gas, SI = log10(fugacity). Fugacity = pressure * phi / 1 atm.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), " For ideal gases, phi = 1.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "End of simulation.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "Reading input data for simulation 2.") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "------------------------------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Reading input data for simulation 1."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" SOLUTION 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" DUMP"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" -solution 1"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-------------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Beginning of initial solution calculations."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-------------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Initial solution 1. "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("-----------------------------Solution composition--------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Elements Molality Moles"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" C "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("----------------------------Description of solution------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" pH = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" pe = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Activity of water = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ionic strength (mol/kgw) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Mass of water (kg) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Total alkalinity (eq/kg) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Total CO2 (mol/kg) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Temperature (°C) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Electrical balance (eq) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Percent error, 100*(Cat-|An|)/(Cat+|An|) = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Iterations = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Total H = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Total O = "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("----------------------------Distribution of species----------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Log Log Log mole V"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Species Molality Activity Molality Activity Gamma cm³/mol"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" OH- "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H2O "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("C(-4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CH4 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("C(4) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" HCO3- "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CO2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaHCO3+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaCO3 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CO3-2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaHCO3 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaCO3- "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Ca "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Ca+2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaHCO3+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaCO3 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CaOH+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("H(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Na "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Na+ "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaHCO3 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaCO3- "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" NaOH "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("O(0) "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" O2 "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------Saturation indices-------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Phase SI** log IAP log K(298 K, 1 atm)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Aragonite"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" Calcite"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CH4(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" CO2(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H2(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" H2O(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" O2(g)"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("**For a gas, SI = log10(fugacity). Fugacity = pressure * phi / 1 atm."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(" For ideal gases, phi = 1."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("End of simulation."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("Reading input data for simulation 2."));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("------------------------------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
#ifndef TESTING
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "----------------") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "End of Run after ") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "----------------") != NULL);
|
||||
EXPECT_THAT(lines[line++], HasSubstr("----------------"));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("End of Run after "));
|
||||
EXPECT_THAT(lines[line++], HasSubstr("----------------"));
|
||||
#endif
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
ASSERT_TRUE(::strstr(lines[line++].c_str(), "") != NULL);
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
EXPECT_THAT(lines[line++], HasSubstr(""));
|
||||
///#endif
|
||||
|
||||
if (n >= 0)
|
||||
@ -4175,12 +4183,12 @@ TEST(TestIPhreeqcLib, TestMultiPunchCSelectedOutput)
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 6, 0, &var)); ASSERT_NEAR(-7.60411, var.dVal, ::pow(10., -2));
|
||||
|
||||
// si_Calcite
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 1, 1, &var)); ASSERT_NEAR(0.692077, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 2, 1, &var)); ASSERT_NEAR(0.678847, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 3, 1, &var)); ASSERT_NEAR(0.678847, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 1, 1, &var)); ASSERT_NEAR(0.702316, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 2, 1, &var)); ASSERT_NEAR(0.695856, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 3, 1, &var)); ASSERT_NEAR(0.689518, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 4, 1, &var)); ASSERT_NEAR(-999.999, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 5, 1, &var)); ASSERT_NEAR(-999.999, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 6, 1, &var)); ASSERT_NEAR(0.672429, var.dVal, ::pow(10., -2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 6, 1, &var)); ASSERT_NEAR(0.683300, var.dVal, ::pow(10., -2));
|
||||
|
||||
// DUMMY_1
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 1, 2, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
@ -4204,7 +4212,7 @@ TEST(TestIPhreeqcLib, TestMultiPunchCSelectedOutput)
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 3, 4, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 4, 4, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 5, 4, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 6, 4, &var)); ASSERT_NEAR(3.69E-13, var.dVal, ::pow(10., log10(3.69E-13) - 2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 6, 4, &var)); ASSERT_NEAR(4.12e-13, var.dVal, ::pow(10., log10(4.12e-13) - 2));
|
||||
|
||||
// Sum_Delta/U
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 1, 5, &var)); ASSERT_EQ(TT_EMPTY, var.type);
|
||||
@ -4322,7 +4330,7 @@ TEST(TestIPhreeqcLib, TestMultiPunchCSelectedOutput)
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 0, ncol++, &var)); ASSERT_EQ(std::string("Halite_max"), std::string(var.sVal));
|
||||
|
||||
// Sum_resid
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 1, 0, &var)); ASSERT_NEAR(3.69E-13, var.dVal, ::pow(10., log10(3.69E-13) - 2));
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 1, 0, &var)); ASSERT_NEAR(4.12E-13, var.dVal, ::pow(10., log10(4.12E-13) - 2));
|
||||
|
||||
// Sum_Delta/U
|
||||
ASSERT_EQ(IPQ_OK, ::GetSelectedOutputValue(id, 1, 1, &var)); ASSERT_NEAR(0, var.dVal, ::pow(10., -3));
|
||||
|
||||
@ -1,325 +1,325 @@
|
||||
cmake_minimum_required (VERSION 3.9)
|
||||
|
||||
SET(phreeqc_EXAMPLES
|
||||
co2.tsv
|
||||
ex1
|
||||
ex2
|
||||
ex2b
|
||||
ex2b.tsv
|
||||
ex3
|
||||
ex4
|
||||
ex5
|
||||
ex6
|
||||
ex7
|
||||
ex8
|
||||
ex9
|
||||
ex10
|
||||
ex11
|
||||
ex12
|
||||
ex12a
|
||||
ex13a
|
||||
ex13ac
|
||||
ex13b
|
||||
ex13c
|
||||
ex14
|
||||
ex15
|
||||
ex15a
|
||||
ex15b
|
||||
ex15.dat
|
||||
ex16
|
||||
ex17
|
||||
ex17b
|
||||
ex18
|
||||
ex19
|
||||
ex19_meas.tsv
|
||||
ex19b
|
||||
ex20a
|
||||
ex20b
|
||||
ex20-c13.tsv
|
||||
ex20-c14.tsv
|
||||
ex21
|
||||
ex21_Cl_tr_rad.tsv
|
||||
ex21_Cs_rad.tsv
|
||||
ex21_HTO_rad.tsv
|
||||
ex21_Na_tr_rad.tsv
|
||||
ex22
|
||||
Zn1e_4
|
||||
Zn1e_7
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
install (FILES ${phreeqc_EXAMPLES} DESTINATION examples)
|
||||
else()
|
||||
install (FILES ${phreeqc_EXAMPLES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
|
||||
endif()
|
||||
|
||||
#
|
||||
# copy tsv files to build directories for testing
|
||||
#
|
||||
|
||||
# ex2b.tsv
|
||||
configure_file (
|
||||
"ex2b.tsv"
|
||||
"ex2b.tsv"
|
||||
)
|
||||
|
||||
# ex19_meas.tsv
|
||||
configure_file (
|
||||
"ex19_meas.tsv"
|
||||
"ex19_meas.tsv"
|
||||
)
|
||||
|
||||
# ex20-c13.tsv
|
||||
configure_file (
|
||||
"ex20-c13.tsv"
|
||||
"ex20-c13.tsv"
|
||||
)
|
||||
|
||||
# ex20-c14.tsv
|
||||
configure_file (
|
||||
"ex20-c14.tsv"
|
||||
"ex20-c14.tsv"
|
||||
)
|
||||
|
||||
# ex21_Cl_tr_rad.tsv
|
||||
configure_file (
|
||||
"ex21_Cl_tr_rad.tsv"
|
||||
"ex21_Cl_tr_rad.tsv"
|
||||
)
|
||||
|
||||
# ex21_Cs_rad.tsv
|
||||
configure_file (
|
||||
"ex21_Cs_rad.tsv"
|
||||
"ex21_Cs_rad.tsv"
|
||||
)
|
||||
|
||||
# ex21_HTO_rad.tsv
|
||||
configure_file (
|
||||
"ex21_HTO_rad.tsv"
|
||||
"ex21_HTO_rad.tsv"
|
||||
)
|
||||
|
||||
# ex21_Na_tr_rad.tsv
|
||||
configure_file (
|
||||
"ex21_Na_tr_rad.tsv"
|
||||
"ex21_Na_tr_rad.tsv"
|
||||
)
|
||||
|
||||
# co2.tsv
|
||||
configure_file (
|
||||
"co2.tsv"
|
||||
"co2.tsv"
|
||||
)
|
||||
|
||||
#
|
||||
# run examples for testing
|
||||
#
|
||||
|
||||
# ex1
|
||||
configure_file(ex1 ex1 COPYONLY)
|
||||
add_test(NAME examples.ex1
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex1 ex1.out ../database/phreeqc.dat ex1.log
|
||||
)
|
||||
|
||||
# ex2
|
||||
configure_file(ex2 ex2 COPYONLY)
|
||||
add_test(NAME examples.ex2
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex2 ex2.out ../database/phreeqc.dat ex2.log
|
||||
)
|
||||
|
||||
# ex2b
|
||||
configure_file(ex2b ex2b COPYONLY)
|
||||
add_test(NAME examples.ex2b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex2b ex2b.out ../database/phreeqc.dat ex2b.log
|
||||
)
|
||||
|
||||
# ex3
|
||||
configure_file(ex3 ex3 COPYONLY)
|
||||
add_test(NAME examples.ex3
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex3 ex3.out ../database/phreeqc.dat ex3.log
|
||||
)
|
||||
|
||||
# ex4
|
||||
configure_file(ex4 ex4 COPYONLY)
|
||||
add_test(NAME examples.ex4
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex4 ex4.out ../database/phreeqc.dat ex4.log
|
||||
)
|
||||
|
||||
# ex5
|
||||
configure_file(ex5 ex5 COPYONLY)
|
||||
add_test(NAME examples.ex5
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex5 ex5.out ../database/phreeqc.dat ex5.log
|
||||
)
|
||||
|
||||
# ex6
|
||||
configure_file(ex6 ex6 COPYONLY)
|
||||
add_test(NAME examples.ex6
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex6 ex6.out ../database/phreeqc.dat ex6.log
|
||||
)
|
||||
|
||||
# ex7
|
||||
configure_file(ex7 ex7 COPYONLY)
|
||||
add_test(NAME examples.ex7
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex7 ex7.out ../database/phreeqc.dat ex7.log
|
||||
)
|
||||
|
||||
# ex8
|
||||
configure_file(ex8 ex8 COPYONLY)
|
||||
add_test(NAME examples.ex8
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex8 ex8.out ../database/phreeqc.dat ex8.log
|
||||
)
|
||||
|
||||
# ex9
|
||||
configure_file(ex9 ex9 COPYONLY)
|
||||
add_test(NAME examples.ex9
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex9 ex9.out ../database/phreeqc.dat ex9.log
|
||||
)
|
||||
|
||||
# ex10
|
||||
configure_file(ex10 ex10 COPYONLY)
|
||||
add_test(NAME examples.ex10
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex10 ex10.out ../database/phreeqc.dat ex10.log
|
||||
)
|
||||
|
||||
# ex11
|
||||
configure_file(ex11 ex11 COPYONLY)
|
||||
add_test(NAME examples.ex11
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex11 ex11.out ../database/phreeqc.dat ex11.log
|
||||
)
|
||||
|
||||
# ex12
|
||||
configure_file(ex12 ex12 COPYONLY)
|
||||
add_test(NAME examples.ex12
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex12 ex12.out ../database/phreeqc.dat ex12.log
|
||||
)
|
||||
|
||||
# ex12a
|
||||
configure_file(ex12a ex12a COPYONLY)
|
||||
add_test(NAME examples.ex12a
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex12a ex12a.out ../database/phreeqc.dat ex12a.log
|
||||
)
|
||||
|
||||
# ex13a
|
||||
configure_file(ex13a ex13a COPYONLY)
|
||||
add_test(NAME examples.ex13a
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex13a ex13a.out ../database/phreeqc.dat ex13a.log
|
||||
)
|
||||
|
||||
# ex13b
|
||||
configure_file(ex13b ex13b COPYONLY)
|
||||
add_test(NAME examples.ex13b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex13b ex13b.out ../database/phreeqc.dat ex13b.log
|
||||
)
|
||||
|
||||
# ex13c
|
||||
configure_file(ex13c ex13c COPYONLY)
|
||||
add_test(NAME examples.ex13c
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex13c ex13c.out ../database/phreeqc.dat ex13c.log
|
||||
)
|
||||
|
||||
# ex13ac
|
||||
configure_file(ex13ac ex13ac COPYONLY)
|
||||
add_test(NAME examples.ex13ac
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex13ac ex13ac.out ../database/phreeqc.dat ex13ac.log
|
||||
)
|
||||
|
||||
# ex14
|
||||
configure_file(ex14 ex14 COPYONLY)
|
||||
add_test(NAME examples.ex14
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex14 ex14.out ../database/phreeqc.dat ex14.log
|
||||
)
|
||||
|
||||
# ex15
|
||||
configure_file(ex15 ex15 COPYONLY)
|
||||
configure_file(ex15.dat ex15.dat COPYONLY)
|
||||
add_test(NAME examples.ex15
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex15 ex15.out ../examples/ex15.dat ex15.log
|
||||
)
|
||||
|
||||
# ex15a
|
||||
configure_file(ex15a ex15a COPYONLY)
|
||||
add_test(NAME examples.ex15a
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex15a ex15a.out ../examples/ex15.dat ex15a.log
|
||||
)
|
||||
|
||||
# ex15b
|
||||
configure_file(ex15b ex15b COPYONLY)
|
||||
add_test(NAME examples.ex15b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex15b ex15b.out ../examples/ex15.dat ex15b.log
|
||||
)
|
||||
|
||||
# ex16
|
||||
configure_file(ex16 ex16 COPYONLY)
|
||||
add_test(NAME examples.ex16
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex16 ex16.out ../database/phreeqc.dat ex16.log
|
||||
)
|
||||
|
||||
# ex17
|
||||
configure_file(ex17 ex17 COPYONLY)
|
||||
add_test(NAME examples.ex17
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex17 ex17.out ../database/pitzer.dat ex17.log
|
||||
)
|
||||
|
||||
# ex17b
|
||||
configure_file(ex17b ex17b COPYONLY)
|
||||
add_test(NAME examples.ex17b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex17b ex17b.out ../database/pitzer.dat ex17b.log
|
||||
)
|
||||
|
||||
# ex18
|
||||
configure_file(ex18 ex18 COPYONLY)
|
||||
add_test(NAME examples.ex18
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex18 ex18.out ../database/phreeqc.dat ex18.log
|
||||
)
|
||||
|
||||
# ex19
|
||||
configure_file(ex19 ex19 COPYONLY)
|
||||
add_test(NAME examples.ex19
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex19 ex19.out ../database/phreeqc.dat ex19.log
|
||||
)
|
||||
|
||||
# ex19b
|
||||
configure_file(ex19b ex19b COPYONLY)
|
||||
add_test(NAME examples.ex19b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex19b ex19b.out ../database/phreeqc.dat ex19b.log
|
||||
)
|
||||
|
||||
# ex20a
|
||||
configure_file(ex20a ex20a COPYONLY)
|
||||
add_test(NAME examples.ex20a
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex20a ex20a.out ../database/iso.dat ex20a.log
|
||||
)
|
||||
|
||||
# ex20b
|
||||
configure_file(ex20b ex20b COPYONLY)
|
||||
add_test(NAME examples.ex20b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex20b ex20b.out ../database/iso.dat ex20b.log
|
||||
)
|
||||
|
||||
# ex21
|
||||
configure_file(ex21 ex21 COPYONLY)
|
||||
add_test(NAME examples.ex21
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex21 ex21.out ../database/phreeqc.dat ex21.log
|
||||
)
|
||||
|
||||
# ex22
|
||||
configure_file(ex22 ex22 COPYONLY)
|
||||
add_test(NAME examples.ex22
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex22 ex22.out ../database/phreeqc.dat ex22.log
|
||||
)
|
||||
|
||||
# Note when setting labels we can't use the following:
|
||||
# set_tests_properties(${test} PROPERTIES LABELS "pitzer")
|
||||
# since it will overwrite any existing labels already set
|
||||
|
||||
# long_debug
|
||||
# > 600 seconds Debug
|
||||
set(LONG_DEBUG
|
||||
examples.ex21
|
||||
)
|
||||
|
||||
# label tests that take too long
|
||||
foreach(test ${LONG_DEBUG})
|
||||
set_property(TEST ${test} APPEND PROPERTY LABELS "long_debug")
|
||||
set_property(TEST ${test} APPEND PROPERTY LABELS "long_memcheck")
|
||||
endforeach()
|
||||
cmake_minimum_required (VERSION 3.9)
|
||||
|
||||
SET(phreeqc_EXAMPLES
|
||||
co2.tsv
|
||||
ex1
|
||||
ex2
|
||||
ex2b
|
||||
ex2b.tsv
|
||||
ex3
|
||||
ex4
|
||||
ex5
|
||||
ex6
|
||||
ex7
|
||||
ex8
|
||||
ex9
|
||||
ex10
|
||||
ex11
|
||||
ex12
|
||||
ex12a
|
||||
ex13a
|
||||
ex13ac
|
||||
ex13b
|
||||
ex13c
|
||||
ex14
|
||||
ex15
|
||||
ex15a
|
||||
ex15b
|
||||
ex15.dat
|
||||
ex16
|
||||
ex17
|
||||
ex17b
|
||||
ex18
|
||||
ex19
|
||||
ex19_meas.tsv
|
||||
ex19b
|
||||
ex20a
|
||||
ex20b
|
||||
ex20-c13.tsv
|
||||
ex20-c14.tsv
|
||||
ex21
|
||||
ex21_Cl_tr_rad.tsv
|
||||
ex21_Cs_rad.tsv
|
||||
ex21_HTO_rad.tsv
|
||||
ex21_Na_tr_rad.tsv
|
||||
ex22
|
||||
Zn1e_4
|
||||
Zn1e_7
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
install (FILES ${phreeqc_EXAMPLES} DESTINATION examples)
|
||||
else()
|
||||
install (FILES ${phreeqc_EXAMPLES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
|
||||
endif()
|
||||
|
||||
#
|
||||
# copy tsv files to build directories for testing
|
||||
#
|
||||
|
||||
# ex2b.tsv
|
||||
configure_file (
|
||||
"ex2b.tsv"
|
||||
"ex2b.tsv"
|
||||
)
|
||||
|
||||
# ex19_meas.tsv
|
||||
configure_file (
|
||||
"ex19_meas.tsv"
|
||||
"ex19_meas.tsv"
|
||||
)
|
||||
|
||||
# ex20-c13.tsv
|
||||
configure_file (
|
||||
"ex20-c13.tsv"
|
||||
"ex20-c13.tsv"
|
||||
)
|
||||
|
||||
# ex20-c14.tsv
|
||||
configure_file (
|
||||
"ex20-c14.tsv"
|
||||
"ex20-c14.tsv"
|
||||
)
|
||||
|
||||
# ex21_Cl_tr_rad.tsv
|
||||
configure_file (
|
||||
"ex21_Cl_tr_rad.tsv"
|
||||
"ex21_Cl_tr_rad.tsv"
|
||||
)
|
||||
|
||||
# ex21_Cs_rad.tsv
|
||||
configure_file (
|
||||
"ex21_Cs_rad.tsv"
|
||||
"ex21_Cs_rad.tsv"
|
||||
)
|
||||
|
||||
# ex21_HTO_rad.tsv
|
||||
configure_file (
|
||||
"ex21_HTO_rad.tsv"
|
||||
"ex21_HTO_rad.tsv"
|
||||
)
|
||||
|
||||
# ex21_Na_tr_rad.tsv
|
||||
configure_file (
|
||||
"ex21_Na_tr_rad.tsv"
|
||||
"ex21_Na_tr_rad.tsv"
|
||||
)
|
||||
|
||||
# co2.tsv
|
||||
configure_file (
|
||||
"co2.tsv"
|
||||
"co2.tsv"
|
||||
)
|
||||
|
||||
#
|
||||
# run examples for testing
|
||||
#
|
||||
|
||||
# ex1
|
||||
configure_file(ex1 ex1 COPYONLY)
|
||||
add_test(NAME examples.ex1
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex1 ex1.out ../database/phreeqc.dat ex1.log
|
||||
)
|
||||
|
||||
# ex2
|
||||
configure_file(ex2 ex2 COPYONLY)
|
||||
add_test(NAME examples.ex2
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex2 ex2.out ../database/phreeqc.dat ex2.log
|
||||
)
|
||||
|
||||
# ex2b
|
||||
configure_file(ex2b ex2b COPYONLY)
|
||||
add_test(NAME examples.ex2b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex2b ex2b.out ../database/phreeqc.dat ex2b.log
|
||||
)
|
||||
|
||||
# ex3
|
||||
configure_file(ex3 ex3 COPYONLY)
|
||||
add_test(NAME examples.ex3
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex3 ex3.out ../database/phreeqc.dat ex3.log
|
||||
)
|
||||
|
||||
# ex4
|
||||
configure_file(ex4 ex4 COPYONLY)
|
||||
add_test(NAME examples.ex4
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex4 ex4.out ../database/phreeqc.dat ex4.log
|
||||
)
|
||||
|
||||
# ex5
|
||||
configure_file(ex5 ex5 COPYONLY)
|
||||
add_test(NAME examples.ex5
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex5 ex5.out ../database/phreeqc.dat ex5.log
|
||||
)
|
||||
|
||||
# ex6
|
||||
configure_file(ex6 ex6 COPYONLY)
|
||||
add_test(NAME examples.ex6
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex6 ex6.out ../database/phreeqc.dat ex6.log
|
||||
)
|
||||
|
||||
# ex7
|
||||
configure_file(ex7 ex7 COPYONLY)
|
||||
add_test(NAME examples.ex7
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex7 ex7.out ../database/phreeqc.dat ex7.log
|
||||
)
|
||||
|
||||
# ex8
|
||||
configure_file(ex8 ex8 COPYONLY)
|
||||
add_test(NAME examples.ex8
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex8 ex8.out ../database/phreeqc.dat ex8.log
|
||||
)
|
||||
|
||||
# ex9
|
||||
configure_file(ex9 ex9 COPYONLY)
|
||||
add_test(NAME examples.ex9
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex9 ex9.out ../database/phreeqc.dat ex9.log
|
||||
)
|
||||
|
||||
# ex10
|
||||
configure_file(ex10 ex10 COPYONLY)
|
||||
add_test(NAME examples.ex10
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex10 ex10.out ../database/phreeqc.dat ex10.log
|
||||
)
|
||||
|
||||
# ex11
|
||||
configure_file(ex11 ex11 COPYONLY)
|
||||
add_test(NAME examples.ex11
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex11 ex11.out ../database/phreeqc.dat ex11.log
|
||||
)
|
||||
|
||||
# ex12
|
||||
configure_file(ex12 ex12 COPYONLY)
|
||||
add_test(NAME examples.ex12
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex12 ex12.out ../database/phreeqc.dat ex12.log
|
||||
)
|
||||
|
||||
# ex12a
|
||||
configure_file(ex12a ex12a COPYONLY)
|
||||
add_test(NAME examples.ex12a
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex12a ex12a.out ../database/phreeqc.dat ex12a.log
|
||||
)
|
||||
|
||||
# ex13a
|
||||
configure_file(ex13a ex13a COPYONLY)
|
||||
add_test(NAME examples.ex13a
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex13a ex13a.out ../database/phreeqc.dat ex13a.log
|
||||
)
|
||||
|
||||
# ex13b
|
||||
configure_file(ex13b ex13b COPYONLY)
|
||||
add_test(NAME examples.ex13b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex13b ex13b.out ../database/phreeqc.dat ex13b.log
|
||||
)
|
||||
|
||||
# ex13c
|
||||
configure_file(ex13c ex13c COPYONLY)
|
||||
add_test(NAME examples.ex13c
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex13c ex13c.out ../database/phreeqc.dat ex13c.log
|
||||
)
|
||||
|
||||
# ex13ac
|
||||
configure_file(ex13ac ex13ac COPYONLY)
|
||||
add_test(NAME examples.ex13ac
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex13ac ex13ac.out ../database/phreeqc.dat ex13ac.log
|
||||
)
|
||||
|
||||
# ex14
|
||||
configure_file(ex14 ex14 COPYONLY)
|
||||
add_test(NAME examples.ex14
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex14 ex14.out ../database/phreeqc.dat ex14.log
|
||||
)
|
||||
|
||||
# ex15
|
||||
configure_file(ex15 ex15 COPYONLY)
|
||||
configure_file(ex15.dat ex15.dat COPYONLY)
|
||||
add_test(NAME examples.ex15
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex15 ex15.out ../examples/ex15.dat ex15.log
|
||||
)
|
||||
|
||||
# ex15a
|
||||
configure_file(ex15a ex15a COPYONLY)
|
||||
add_test(NAME examples.ex15a
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex15a ex15a.out ../examples/ex15.dat ex15a.log
|
||||
)
|
||||
|
||||
# ex15b
|
||||
configure_file(ex15b ex15b COPYONLY)
|
||||
add_test(NAME examples.ex15b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex15b ex15b.out ../examples/ex15.dat ex15b.log
|
||||
)
|
||||
|
||||
# ex16
|
||||
configure_file(ex16 ex16 COPYONLY)
|
||||
add_test(NAME examples.ex16
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex16 ex16.out ../database/phreeqc.dat ex16.log
|
||||
)
|
||||
|
||||
# ex17
|
||||
configure_file(ex17 ex17 COPYONLY)
|
||||
add_test(NAME examples.ex17
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex17 ex17.out ../database/pitzer.dat ex17.log
|
||||
)
|
||||
|
||||
# ex17b
|
||||
configure_file(ex17b ex17b COPYONLY)
|
||||
add_test(NAME examples.ex17b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex17b ex17b.out ../database/pitzer.dat ex17b.log
|
||||
)
|
||||
|
||||
# ex18
|
||||
configure_file(ex18 ex18 COPYONLY)
|
||||
add_test(NAME examples.ex18
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex18 ex18.out ../database/phreeqc.dat ex18.log
|
||||
)
|
||||
|
||||
# ex19
|
||||
configure_file(ex19 ex19 COPYONLY)
|
||||
add_test(NAME examples.ex19
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex19 ex19.out ../database/phreeqc.dat ex19.log
|
||||
)
|
||||
|
||||
# ex19b
|
||||
configure_file(ex19b ex19b COPYONLY)
|
||||
add_test(NAME examples.ex19b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex19b ex19b.out ../database/phreeqc.dat ex19b.log
|
||||
)
|
||||
|
||||
# ex20a
|
||||
configure_file(ex20a ex20a COPYONLY)
|
||||
add_test(NAME examples.ex20a
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex20a ex20a.out ../database/iso.dat ex20a.log
|
||||
)
|
||||
|
||||
# ex20b
|
||||
configure_file(ex20b ex20b COPYONLY)
|
||||
add_test(NAME examples.ex20b
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex20b ex20b.out ../database/iso.dat ex20b.log
|
||||
)
|
||||
|
||||
# ex21
|
||||
configure_file(ex21 ex21 COPYONLY)
|
||||
add_test(NAME examples.ex21
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex21 ex21.out ../database/phreeqc.dat ex21.log
|
||||
)
|
||||
|
||||
# ex22
|
||||
configure_file(ex22 ex22 COPYONLY)
|
||||
add_test(NAME examples.ex22
|
||||
COMMAND $<TARGET_FILE:phreeqc> ../examples/ex22 ex22.out ../database/phreeqc.dat ex22.log
|
||||
)
|
||||
|
||||
# Note when setting labels we can't use the following:
|
||||
# set_tests_properties(${test} PROPERTIES LABELS "pitzer")
|
||||
# since it will overwrite any existing labels already set
|
||||
|
||||
# long_debug
|
||||
# > 600 seconds Debug
|
||||
set(LONG_DEBUG
|
||||
examples.ex21
|
||||
)
|
||||
|
||||
# label tests that take too long
|
||||
foreach(test ${LONG_DEBUG})
|
||||
set_property(TEST ${test} APPEND PROPERTY LABELS "long_debug")
|
||||
set_property(TEST ${test} APPEND PROPERTY LABELS "long_memcheck")
|
||||
endforeach()
|
||||
|
||||
@ -1,133 +1,133 @@
|
||||
##
|
||||
## Configure files
|
||||
##
|
||||
|
||||
# tests/ex2
|
||||
configure_file (
|
||||
"ex2.in"
|
||||
"ex2"
|
||||
)
|
||||
|
||||
# tests/phreeqc.dat
|
||||
configure_file (
|
||||
"phreeqc.dat.in"
|
||||
"phreeqc.dat"
|
||||
)
|
||||
|
||||
##
|
||||
## Test C
|
||||
##
|
||||
|
||||
project(test_c C)
|
||||
|
||||
# source
|
||||
SET(test_c_SOURCES
|
||||
test_c.c
|
||||
)
|
||||
|
||||
# test executable
|
||||
add_executable(test_c ${test_c_SOURCES})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(test_c ${EXTRA_LIBS})
|
||||
if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS)
|
||||
# Setup references for /CLR
|
||||
set_target_properties(test_c PROPERTIES VS_DOTNET_REFERENCES "${CMAKE_CURRENT_SOURCE_DIR}/../src/phreeqcpp/ZedGraph.dll")
|
||||
endif()
|
||||
|
||||
|
||||
# test compile and run
|
||||
add_test(TestCompileAndRunC test_c)
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
# copy dll
|
||||
add_custom_command(TARGET test_c POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:IPhreeqc> $<TARGET_FILE_DIR:test_c>
|
||||
)
|
||||
endif()
|
||||
|
||||
##
|
||||
## Test CXX
|
||||
##
|
||||
|
||||
project(test_cxx CXX)
|
||||
|
||||
# source
|
||||
SET(test_cxx_SOURCES
|
||||
test_cxx.cxx
|
||||
)
|
||||
|
||||
# test executable
|
||||
add_executable(test_cxx ${test_cxx_SOURCES})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(test_cxx ${EXTRA_LIBS})
|
||||
if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS)
|
||||
# Setup references for /CLR
|
||||
set_target_properties(test_cxx PROPERTIES VS_DOTNET_REFERENCES "${CMAKE_CURRENT_SOURCE_DIR}/../src/phreeqcpp/ZedGraph.dll")
|
||||
endif()
|
||||
|
||||
# test compile and run
|
||||
add_test(TestCompileAndRunCXX test_cxx)
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
# copy dll
|
||||
add_custom_command(TARGET test_cxx POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:IPhreeqc> $<TARGET_FILE_DIR:test_cxx>
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
##
|
||||
## Test Fortran
|
||||
##
|
||||
|
||||
if (IPHREEQC_FORTRAN_TESTING)
|
||||
|
||||
project(test_f90 Fortran)
|
||||
|
||||
# source
|
||||
SET(test_f90_SOURCES
|
||||
main.f90
|
||||
test_f90.F90
|
||||
)
|
||||
|
||||
if (IPHREEQC_ENABLE_MODULE)
|
||||
SET(test_f90_SOURCES
|
||||
${test_f90_SOURCES}
|
||||
../src/IPhreeqc_interface.F90
|
||||
)
|
||||
endif()
|
||||
|
||||
# place [*.F[90]] files into "Source Files"
|
||||
source_group("Source Files" FILES "test_f90.F90")
|
||||
if (IPHREEQC_ENABLE_MODULE)
|
||||
source_group("Source Files" FILES "../src/IPhreeqc_interface.F90")
|
||||
endif()
|
||||
|
||||
# test executable
|
||||
add_executable(test_f90 ${test_f90_SOURCES})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(test_f90 ${EXTRA_LIBS})
|
||||
|
||||
# test compile and run
|
||||
add_test(TestCompileAndRunFortran test_f90)
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
# copy dll
|
||||
add_custom_command(TARGET test_f90 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:IPhreeqc> $<TARGET_FILE_DIR:test_f90>
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
##
|
||||
## Configure files
|
||||
##
|
||||
|
||||
# tests/ex2
|
||||
configure_file (
|
||||
"ex2.in"
|
||||
"ex2"
|
||||
)
|
||||
|
||||
# tests/phreeqc.dat
|
||||
configure_file (
|
||||
"phreeqc.dat.in"
|
||||
"phreeqc.dat"
|
||||
)
|
||||
|
||||
##
|
||||
## Test C
|
||||
##
|
||||
|
||||
project(test_c C)
|
||||
|
||||
# source
|
||||
SET(test_c_SOURCES
|
||||
test_c.c
|
||||
)
|
||||
|
||||
# test executable
|
||||
add_executable(test_c ${test_c_SOURCES})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(test_c ${EXTRA_LIBS})
|
||||
if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS)
|
||||
# Setup references for /CLR
|
||||
set_target_properties(test_c PROPERTIES VS_DOTNET_REFERENCES "${CMAKE_CURRENT_SOURCE_DIR}/../src/phreeqcpp/ZedGraph.dll")
|
||||
endif()
|
||||
|
||||
|
||||
# test compile and run
|
||||
add_test(TestCompileAndRunC test_c)
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
# copy dll
|
||||
add_custom_command(TARGET test_c POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:IPhreeqc> $<TARGET_FILE_DIR:test_c>
|
||||
)
|
||||
endif()
|
||||
|
||||
##
|
||||
## Test CXX
|
||||
##
|
||||
|
||||
project(test_cxx CXX)
|
||||
|
||||
# source
|
||||
SET(test_cxx_SOURCES
|
||||
test_cxx.cxx
|
||||
)
|
||||
|
||||
# test executable
|
||||
add_executable(test_cxx ${test_cxx_SOURCES})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(test_cxx ${EXTRA_LIBS})
|
||||
if (MSVC AND BUILD_SHARED_LIBS AND BUILD_CLR_LIBS)
|
||||
# Setup references for /CLR
|
||||
set_target_properties(test_cxx PROPERTIES VS_DOTNET_REFERENCES "${CMAKE_CURRENT_SOURCE_DIR}/../src/phreeqcpp/ZedGraph.dll")
|
||||
endif()
|
||||
|
||||
# test compile and run
|
||||
add_test(TestCompileAndRunCXX test_cxx)
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
# copy dll
|
||||
add_custom_command(TARGET test_cxx POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:IPhreeqc> $<TARGET_FILE_DIR:test_cxx>
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
##
|
||||
## Test Fortran
|
||||
##
|
||||
|
||||
if (IPHREEQC_FORTRAN_TESTING)
|
||||
|
||||
project(test_f90 Fortran)
|
||||
|
||||
# source
|
||||
SET(test_f90_SOURCES
|
||||
main.f90
|
||||
test_f90.F90
|
||||
)
|
||||
|
||||
if (IPHREEQC_ENABLE_MODULE)
|
||||
SET(test_f90_SOURCES
|
||||
${test_f90_SOURCES}
|
||||
../src/IPhreeqc_interface.F90
|
||||
)
|
||||
endif()
|
||||
|
||||
# place [*.F[90]] files into "Source Files"
|
||||
source_group("Source Files" FILES "test_f90.F90")
|
||||
if (IPHREEQC_ENABLE_MODULE)
|
||||
source_group("Source Files" FILES "../src/IPhreeqc_interface.F90")
|
||||
endif()
|
||||
|
||||
# test executable
|
||||
add_executable(test_f90 ${test_f90_SOURCES})
|
||||
|
||||
# library dependencies
|
||||
SET(EXTRA_LIBS ${EXTRA_LIBS} IPhreeqc)
|
||||
|
||||
# link
|
||||
target_link_libraries(test_f90 ${EXTRA_LIBS})
|
||||
|
||||
# test compile and run
|
||||
add_test(TestCompileAndRunFortran test_f90)
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
# copy dll
|
||||
add_custom_command(TARGET test_f90 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:IPhreeqc> $<TARGET_FILE_DIR:test_f90>
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user