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