mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
Updated for IPhreeqc to use PHREEQC_CPP and PHREEQC_CLASS. Currently doesn't include gmp. MemDebug project still needs work. Needs to be tested on linux.
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/branches/class@4145 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
532aca62f3
commit
7b7edd5637
270
IPhreeqc.vcproj
270
IPhreeqc.vcproj
@ -44,7 +44,7 @@
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(DEV_GMP_INC);include;src;src/phreeqcpp;src/phreeqcpp/phreeqc"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;SWIG_SHARED_OBJ;_CRT_SECURE_NO_DEPRECATE"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;SWIG_SHARED_OBJ;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;PHREEQC_CPP;XX_INVERSE_CL1MP_XX;PHREEQC_CLASS;USE_PHRQ_ALLOC"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
@ -118,7 +118,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(DEV_GMP_INC);include;src;src/phreeqcpp;src/phreeqcpp/phreeqc"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;SWIG_SHARED_OBJ;_CRT_SECURE_NO_DEPRECATE"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;SWIG_SHARED_OBJ;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;PHREEQC_CPP;XX_INVERSE_CL1MP_XX;PHREEQC_CLASS;USE_PHRQ_ALLOC"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@ -193,7 +193,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(DEV_GMP_INC);include;src;src/phreeqcpp;src/phreeqcpp/phreeqc"
|
||||
PreprocessorDefinitions="WIN32_MEMORY_DEBUG;_DEBUG;WIN32;_LIB;SWIG_SHARED_OBJ;_CRT_SECURE_NO_DEPRECATE"
|
||||
PreprocessorDefinitions="WIN32_MEMORY_DEBUG;_DEBUG;WIN32;_LIB;SWIG_SHARED_OBJ;_CRT_SECURE_NO_DEPRECATE;XX_INVERSE_CL1MP_XX"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
@ -313,40 +313,6 @@
|
||||
RelativePath=".\src\fwrap3.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\global.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemDebug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\IPhreeqc.cpp"
|
||||
>
|
||||
@ -454,6 +420,214 @@
|
||||
<Filter
|
||||
Name="phreeqcpp"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\class_main.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\cxxKinetics.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\cxxMix.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Dictionary.cxx"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\dumper.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Exchange.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\ExchComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\GasPhase.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\ISolution.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\ISolutionComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\KineticsComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\NameDouble.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\NumKeyword.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Parser.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Phreeqc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\PPassemblage.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\PPassemblageComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Reaction.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\ReadClass.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\runner.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\SAXPhreeqc.cxx"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Solution.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\SolutionIsotope.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\SolutionIsotopeList.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\SSassemblage.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\SSassemblageSS.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\StorageBin.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\StorageBinList.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Surface.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\SurfaceCharge.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\SurfaceComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\System.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Temperature.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\phreeqcpp\Utils.cxx"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="phreeqc"
|
||||
>
|
||||
@ -1831,37 +2005,25 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\IPhreeqc.h"
|
||||
RelativePath=".\include\IPhreeqc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\IPhreeqc.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\module_files.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\Output.hxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\Phreeqc.hxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\phreeqcns.hxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\PhreeqcParser.hxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\SelectedOutput.hxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\Var.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
|
||||
93
IPhreeqc.vcproj.GS.charlton.user
Normal file
93
IPhreeqc.vcproj.GS.charlton.user
Normal file
@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioUserFile
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
ShowAllFiles="false"
|
||||
>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<DebugSettings
|
||||
Command=""
|
||||
WorkingDirectory=""
|
||||
CommandArguments=""
|
||||
Attach="false"
|
||||
DebuggerType="3"
|
||||
Remote="1"
|
||||
RemoteMachine="IGSKAHHWWSNY5H1"
|
||||
RemoteCommand=""
|
||||
HttpUrl=""
|
||||
PDBPath=""
|
||||
SQLDebugging=""
|
||||
Environment=""
|
||||
EnvironmentMerge="true"
|
||||
DebuggerFlavor=""
|
||||
MPIRunCommand=""
|
||||
MPIRunArguments=""
|
||||
MPIRunWorkingDirectory=""
|
||||
ApplicationCommand=""
|
||||
ApplicationArguments=""
|
||||
ShimCommand=""
|
||||
MPIAcceptMode=""
|
||||
MPIAcceptFilter=""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<DebugSettings
|
||||
Command=""
|
||||
WorkingDirectory=""
|
||||
CommandArguments=""
|
||||
Attach="false"
|
||||
DebuggerType="3"
|
||||
Remote="1"
|
||||
RemoteMachine="IGSKAHHWWSNY5H1"
|
||||
RemoteCommand=""
|
||||
HttpUrl=""
|
||||
PDBPath=""
|
||||
SQLDebugging=""
|
||||
Environment=""
|
||||
EnvironmentMerge="true"
|
||||
DebuggerFlavor=""
|
||||
MPIRunCommand=""
|
||||
MPIRunArguments=""
|
||||
MPIRunWorkingDirectory=""
|
||||
ApplicationCommand=""
|
||||
ApplicationArguments=""
|
||||
ShimCommand=""
|
||||
MPIAcceptMode=""
|
||||
MPIAcceptFilter=""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="MemDebug|Win32"
|
||||
>
|
||||
<DebugSettings
|
||||
Command=""
|
||||
WorkingDirectory=""
|
||||
CommandArguments=""
|
||||
Attach="false"
|
||||
DebuggerType="3"
|
||||
Remote="1"
|
||||
RemoteMachine="IGSKAHHWWSNY5H1"
|
||||
RemoteCommand=""
|
||||
HttpUrl=""
|
||||
PDBPath=""
|
||||
SQLDebugging=""
|
||||
Environment=""
|
||||
EnvironmentMerge="true"
|
||||
DebuggerFlavor=""
|
||||
MPIRunCommand=""
|
||||
MPIRunArguments=""
|
||||
MPIRunWorkingDirectory=""
|
||||
ApplicationCommand=""
|
||||
ApplicationArguments=""
|
||||
ShimCommand=""
|
||||
MPIAcceptMode=""
|
||||
MPIAcceptFilter=""
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
</VisualStudioUserFile>
|
||||
@ -1,11 +1,13 @@
|
||||
#ifndef __IPHREEQC_H
|
||||
#define __IPHREEQC_H
|
||||
#ifndef _INC_IPHREEQC_H
|
||||
#define _INC_IPHREEQC_H
|
||||
|
||||
#include "Var.h"
|
||||
#include "IPhreeqcCallbacks.h" /* PFN_PRERUN_CALLBACK, PFN_POSTRUN_CALLBACK, PFN_CATCH_CALLBACK */
|
||||
#include "CVar.hxx" /* VRESULT */
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Load the specified database file into phreeqc.
|
||||
* @param filename The name of the phreeqc database to load.
|
||||
@ -373,10 +375,6 @@ void ClearErrors(void);
|
||||
void OutputLines(void);
|
||||
|
||||
|
||||
typedef int (*PFN_PRERUN_CALLBACK)(void *cookie);
|
||||
typedef int (*PFN_POSTRUN_CALLBACK)(void *cookie);
|
||||
typedef int (*PFN_CATCH_CALLBACK)(void *cookie);
|
||||
|
||||
int RunWithCallback(PFN_PRERUN_CALLBACK pfn_pre, PFN_POSTRUN_CALLBACK pfn_post, void *cookie, int output_on, int error_on, int log_on, int selected_output_on);
|
||||
|
||||
int CatchErrors(PFN_CATCH_CALLBACK pfn, void *cookie);
|
||||
@ -387,8 +385,9 @@ const char* GetLastErrorString(void);
|
||||
void DebugOutputLines(void);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __IPHREEQC_H */
|
||||
#endif /* _INC_IPHREEQC_H */
|
||||
|
||||
19
include/IPhreeqcCallbacks.h
Normal file
19
include/IPhreeqcCallbacks.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef _INC_IPHREEQC_CALLBACKS_H
|
||||
#define _INC_IPHREEQC_CALLBACKS_H
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef int (*PFN_PRERUN_CALLBACK)(void *cookie);
|
||||
typedef int (*PFN_POSTRUN_CALLBACK)(void *cookie);
|
||||
typedef int (*PFN_CATCH_CALLBACK)(void *cookie);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _INC_IPHREEQC_CALLBACKS_H */
|
||||
@ -6,7 +6,8 @@
|
||||
#include <cstdio> // std::fprintf
|
||||
#include "phreeqcns.hxx"
|
||||
|
||||
class IErrorReporter {
|
||||
class IErrorReporter
|
||||
{
|
||||
public:
|
||||
virtual size_t AddError(const char* error_msg) = 0;
|
||||
virtual void Clear(void) = 0;
|
||||
|
||||
1869
src/IPhreeqc.cpp
1869
src/IPhreeqc.cpp
File diff suppressed because it is too large
Load Diff
87
src/IPhreeqc.hpp
Normal file
87
src/IPhreeqc.hpp
Normal file
@ -0,0 +1,87 @@
|
||||
#ifndef _INC_IPHREEQC_HPP
|
||||
#define _INC_IPHREEQC_HPP
|
||||
|
||||
#include "Phreeqc.h" /* Phreeqc */
|
||||
#include "IPhreeqcCallbacks.h" /* PFN_PRERUN_CALLBACK, PFN_POSTRUN_CALLBACK, PFN_CATCH_CALLBACK */
|
||||
#include "Var.h" /* VRESULT */
|
||||
#include "SelectedOutput.hxx"
|
||||
|
||||
|
||||
class IErrorReporter;
|
||||
|
||||
struct PhreeqcStop{};
|
||||
|
||||
class IPhreeqc : public Phreeqc
|
||||
{
|
||||
public:
|
||||
IPhreeqc(void);
|
||||
~IPhreeqc(void);
|
||||
|
||||
public:
|
||||
int LoadDatabase(const char* filename);
|
||||
int LoadDatabaseString(const char* input);
|
||||
|
||||
void UnLoadDatabase(void);
|
||||
|
||||
void OutputLastError(void);
|
||||
const char* GetLastErrorString(void);
|
||||
|
||||
VRESULT AccumulateLine(const char *line);
|
||||
|
||||
int Run(int output_on, int error_on, int log_on, int selected_output_on);
|
||||
int RunFile(const char* filename, int output_on, int error_on, int log_on, int selected_output_on);
|
||||
int RunString(const char* input, int output_on, int error_on, int log_on, int selected_output_on);
|
||||
|
||||
int GetSelectedOutputRowCount(void)const;
|
||||
int GetSelectedOutputColumnCount(void)const;
|
||||
VRESULT GetSelectedOutputValue(int row, int col, VAR* pVAR);
|
||||
|
||||
void OutputLines(void);
|
||||
|
||||
size_t AddError(const char* error_msg);
|
||||
|
||||
const std::string& GetAccumulatedLines(void);
|
||||
void ClearAccumulatedLines(void);
|
||||
|
||||
// Singleton for library
|
||||
static IPhreeqc* LibraryInstance();
|
||||
|
||||
// Callbacks
|
||||
//
|
||||
|
||||
// IPhreeqc.cpp
|
||||
static int handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args);
|
||||
int output_handler(const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args);
|
||||
int open_handler(const int type, const char *file_name/*, void *cookie*/);
|
||||
|
||||
// module_files.c
|
||||
static int module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args);
|
||||
int module_isopen_handler(const int type);
|
||||
int module_open_handler(const int type, const char *file_name);
|
||||
|
||||
// module_output.c
|
||||
int output_isopen(const int type);
|
||||
|
||||
virtual int EndRow(void);
|
||||
void AddSelectedOutput(const char* name, const char* format, va_list argptr);
|
||||
|
||||
void check_database(const char* sz_routine);
|
||||
void do_run(const char* sz_routine, std::istream* pis, FILE* fp, int output_on, int error_on, int log_on, int selected_output_on, PFN_PRERUN_CALLBACK pfn_pre, PFN_POSTRUN_CALLBACK pfn_post, void *cookie);
|
||||
|
||||
protected:
|
||||
void Init(void);
|
||||
|
||||
protected:
|
||||
// Data
|
||||
IErrorReporter *ErrorReporter;
|
||||
CSelectedOutput *SelectedOutput;
|
||||
std::string PunchFileName;
|
||||
bool DatabaseLoaded;
|
||||
bool SelectedOutputOn;
|
||||
std::string StringInput;
|
||||
|
||||
private:
|
||||
static IPhreeqc* Instance;
|
||||
};
|
||||
|
||||
#endif /* _INC_IPHREEQC_HPP */
|
||||
@ -1,35 +0,0 @@
|
||||
#if !defined(__PHREEQC_PARSER_HXX_INC)
|
||||
#define __PHREEQC_PARSER_HXX_INC
|
||||
|
||||
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}#include <string>
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}//#include <iosfwd>
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}struct PhreeqcStop{};
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}class CPhreeqcParser
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}{
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}public:
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} CPhreeqcParser(std::istream& input);
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} virtual ~CPhreeqcParser(void);
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} // const char* GetErrorMsg(void);
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} // overrides
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} int get_logical_line(int *l);
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} int get_line(void);
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} // int error_msg (const char *err_str, const int stop);
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}protected:
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} std::istream& m_input_stream;
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} //std::ostream& m_output_stream;
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} //std::ostream& m_error_stream;
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}
|
||||
// COMMENT: {11/10/2004 10:35:56 PM} //std::string m_errors;
|
||||
// COMMENT: {11/10/2004 10:35:56 PM}};
|
||||
|
||||
|
||||
#endif // __PHREEQC_PARSER_HXX_INC
|
||||
@ -5,236 +5,253 @@
|
||||
#pragma warning(disable : 4786) // disable truncation warning
|
||||
#include <sstream> // std::ostringstream
|
||||
#include <windows.h> // ::OutputDebugString
|
||||
#else
|
||||
#if defined(PHREEQC_CLASS)
|
||||
#include <windows.h> // ::OutputDebugString
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(PHREEQC_CLASS)
|
||||
#include "phrqtype.h"
|
||||
#include "p2c.h"
|
||||
#include "global_structures.h"
|
||||
#include "basic.h"
|
||||
#include "Phreeqc.h"
|
||||
|
||||
// COMMENT: {2/24/2010 6:01:56 PM}extern int user_punch_count_headings;
|
||||
// COMMENT: {2/24/2010 6:01:56 PM}extern char **user_punch_headings;
|
||||
#endif
|
||||
|
||||
#include "SelectedOutput.hxx"
|
||||
#include "phreeqcns.hxx"
|
||||
|
||||
const size_t RESERVE_ROWS = 80;
|
||||
const size_t RESERVE_COLS = 80;
|
||||
|
||||
|
||||
int EndRow(void);
|
||||
// COMMENT: {3/3/2010 5:31:34 PM}int EndRow(void);
|
||||
void AddSelectedOutput(const char* name, const char* format, va_list argptr);
|
||||
int warning_msg (const char *err_str);
|
||||
|
||||
int EndRow(void)
|
||||
{
|
||||
if (CSelectedOutput::Instance()->GetRowCount() <= 1) {
|
||||
// ensure all user_punch headings are included
|
||||
for (int i = n_user_punch_index; i < user_punch_count_headings; ++i) {
|
||||
CSelectedOutput::Instance()->PushBackEmpty(user_punch_headings[i]);
|
||||
}
|
||||
}
|
||||
return CSelectedOutput::Instance()->EndRow();
|
||||
}
|
||||
// COMMENT: {3/3/2010 8:55:29 PM}int Phreeqc::EndRow(void)
|
||||
// COMMENT: {3/3/2010 8:55:29 PM}{
|
||||
// COMMENT: {3/3/2010 8:55:29 PM}// COMMENT: {3/3/2010 7:29:42 PM} if (CSelectedOutput::Instance()->GetRowCount() <= 1)
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} if (this->SelectedOutput.GetRowCount() <= 1)
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} {
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} // ensure all user_punch headings are included
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} for (int i = n_user_punch_index; i < user_punch_count_headings; ++i)
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} {
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} CSelectedOutput::Instance()->PushBackEmpty(user_punch_headings[i]);
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} }
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} }
|
||||
// COMMENT: {3/3/2010 8:55:29 PM} return CSelectedOutput::Instance()->EndRow();
|
||||
// COMMENT: {3/3/2010 8:55:29 PM}}
|
||||
|
||||
int PushBackDouble(const char* key, double dVal)
|
||||
{
|
||||
return CSelectedOutput::Instance()->PushBackDouble(key, dVal);
|
||||
}
|
||||
|
||||
int PushBackLong(const char* key, long lVal)
|
||||
{
|
||||
return CSelectedOutput::Instance()->PushBackLong(key, lVal);
|
||||
}
|
||||
|
||||
int PushBackString(const char* key, const char* sVal)
|
||||
{
|
||||
return CSelectedOutput::Instance()->PushBackString(key, sVal);
|
||||
}
|
||||
|
||||
int PushBackEmpty(const char* key)
|
||||
{
|
||||
return CSelectedOutput::Instance()->PushBackEmpty(key);
|
||||
}
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}int PushBackDouble(const char* key, double dVal)
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}{
|
||||
// COMMENT: {3/3/2010 8:55:40 PM} return CSelectedOutput::Instance()->PushBackDouble(key, dVal);
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}}
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}int PushBackLong(const char* key, long lVal)
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}{
|
||||
// COMMENT: {3/3/2010 8:55:40 PM} return CSelectedOutput::Instance()->PushBackLong(key, lVal);
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}}
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}int PushBackString(const char* key, const char* sVal)
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}{
|
||||
// COMMENT: {3/3/2010 8:55:40 PM} return CSelectedOutput::Instance()->PushBackString(key, sVal);
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}}
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}int PushBackEmpty(const char* key)
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}{
|
||||
// COMMENT: {3/3/2010 8:55:40 PM} return CSelectedOutput::Instance()->PushBackEmpty(key);
|
||||
// COMMENT: {3/3/2010 8:55:40 PM}}
|
||||
|
||||
|
||||
void AddSelectedOutput(const char* name, const char* format, va_list argptr)
|
||||
{
|
||||
int bInt;
|
||||
int bDouble;
|
||||
int bString;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}void AddSelectedOutput(const char* name, const char* format, va_list argptr)
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}{
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} int bInt;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} int bDouble;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} int bString;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} int state;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} int bLongDouble;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} char ch;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} /* state values
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} 0 Haven't found start(%)
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} 1 Just read start(%)
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} 2 Just read Flags(-0+ #) (zero or more)
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} 3 Just read Width
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} 4 Just read Precision start (.)
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} 5 Just read Size modifier
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} 6 Just read Type
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} */
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} if (name == NULL) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} return;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} bDouble = 0;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} bInt = 0;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} bString = 0;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} bLongDouble = 0;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} state = 0;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} while (ch != '\0') {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} switch (state) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 0: /* looking for Start specification (%) */
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} switch (ch) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case '%':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} state = 1;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} default:
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 1: /* reading Flags (zero or more(-,+,0,# or space)) */
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} switch (ch) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case '-': case '0': case '+': case ' ': case '#':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} default:
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} state = 2;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 2: /* reading Minimum field width (decimal integer constant) */
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} switch (ch) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case '.':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} state = 3;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} default:
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} state = 4;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 3: /* reading Precision specification (period already read) */
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} switch (ch)
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} default:
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} state = 4;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 4: /* reading Size modifier */
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} switch (ch)
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'l':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'L':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} bLongDouble = 1;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'h':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = *format++;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} state = 5;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 5: /* reading Conversion letter */
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} switch (ch) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'c':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'd':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'i':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} bInt = 1;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'n':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'o':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'p':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 's':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} bString = 1;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'u':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'x':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'X':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case '%':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'f':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'e':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'E':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'g':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} case 'G':
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} bDouble = 1;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} default:
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ASSERT(false);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ch = '\0'; /* done */
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} break;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} if (bDouble) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} double valDouble;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} if (bLongDouble) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} valDouble = (double)va_arg(argptr, long double);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} else {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} valDouble = va_arg(argptr, double);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} CSelectedOutput::Instance()->PushBackDouble(name, valDouble);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} else if (bInt) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} int valInt;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} valInt = va_arg(argptr, int);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} CSelectedOutput::Instance()->PushBackLong(name, (long)valInt);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} else if (bString) {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} char* valString;
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} valString = (char *)va_arg(argptr, char *);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} CSelectedOutput::Instance()->PushBackString(name, valString);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} else {
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} ASSERT(false);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} CSelectedOutput::Instance()->PushBackEmpty(name);
|
||||
// COMMENT: {3/3/2010 8:58:25 PM} }
|
||||
// COMMENT: {3/3/2010 8:58:25 PM}}
|
||||
|
||||
int state;
|
||||
int bLongDouble;
|
||||
char ch;
|
||||
|
||||
|
||||
/* state values
|
||||
0 Haven't found start(%)
|
||||
1 Just read start(%)
|
||||
2 Just read Flags(-0+ #) (zero or more)
|
||||
3 Just read Width
|
||||
4 Just read Precision start (.)
|
||||
5 Just read Size modifier
|
||||
6 Just read Type
|
||||
*/
|
||||
|
||||
if (name == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
bDouble = 0;
|
||||
bInt = 0;
|
||||
bString = 0;
|
||||
|
||||
bLongDouble = 0;
|
||||
|
||||
state = 0;
|
||||
ch = *format++;
|
||||
while (ch != '\0') {
|
||||
switch (state) {
|
||||
case 0: /* looking for Start specification (%) */
|
||||
switch (ch) {
|
||||
case '%':
|
||||
state = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ch = *format++;
|
||||
break;
|
||||
case 1: /* reading Flags (zero or more(-,+,0,# or space)) */
|
||||
switch (ch) {
|
||||
case '-': case '0': case '+': case ' ': case '#':
|
||||
ch = *format++;
|
||||
break;
|
||||
default:
|
||||
state = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2: /* reading Minimum field width (decimal integer constant) */
|
||||
switch (ch) {
|
||||
case '.':
|
||||
state = 3;
|
||||
ch = *format++;
|
||||
break;
|
||||
case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
|
||||
ch = *format++;
|
||||
break;
|
||||
default:
|
||||
state = 4;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3: /* reading Precision specification (period already read) */
|
||||
switch (ch)
|
||||
{
|
||||
case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
|
||||
ch = *format++;
|
||||
break;
|
||||
default:
|
||||
state = 4;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4: /* reading Size modifier */
|
||||
switch (ch)
|
||||
{
|
||||
case 'l':
|
||||
ch = *format++;
|
||||
break;
|
||||
case 'L':
|
||||
bLongDouble = 1;
|
||||
ch = *format++;
|
||||
break;
|
||||
case 'h':
|
||||
ch = *format++;
|
||||
break;
|
||||
}
|
||||
state = 5;
|
||||
break;
|
||||
case 5: /* reading Conversion letter */
|
||||
switch (ch) {
|
||||
case 'c':
|
||||
break;
|
||||
case 'd':
|
||||
case 'i':
|
||||
bInt = 1;
|
||||
break;
|
||||
case 'n':
|
||||
case 'o':
|
||||
case 'p':
|
||||
break;
|
||||
case 's':
|
||||
bString = 1;
|
||||
break;
|
||||
case 'u':
|
||||
case 'x':
|
||||
case 'X':
|
||||
case '%':
|
||||
break;
|
||||
case 'f':
|
||||
case 'e':
|
||||
case 'E':
|
||||
case 'g':
|
||||
case 'G':
|
||||
bDouble = 1;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
break;
|
||||
}
|
||||
ch = '\0'; /* done */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bDouble) {
|
||||
double valDouble;
|
||||
|
||||
if (bLongDouble) {
|
||||
valDouble = (double)va_arg(argptr, long double);
|
||||
}
|
||||
else {
|
||||
valDouble = va_arg(argptr, double);
|
||||
}
|
||||
|
||||
CSelectedOutput::Instance()->PushBackDouble(name, valDouble);
|
||||
}
|
||||
else if (bInt) {
|
||||
int valInt;
|
||||
valInt = va_arg(argptr, int);
|
||||
|
||||
CSelectedOutput::Instance()->PushBackLong(name, (long)valInt);
|
||||
}
|
||||
else if (bString) {
|
||||
char* valString;
|
||||
valString = (char *)va_arg(argptr, char *);
|
||||
|
||||
CSelectedOutput::Instance()->PushBackString(name, valString);
|
||||
}
|
||||
else {
|
||||
ASSERT(false);
|
||||
CSelectedOutput::Instance()->PushBackEmpty(name);
|
||||
}
|
||||
}
|
||||
|
||||
// COMMENT: {11/16/2004 10:18:22 PM}CSelectedOutput CSelectedOutput::singleton;
|
||||
CSelectedOutput* CSelectedOutput::s_instance = 0;
|
||||
|
||||
CSelectedOutput* CSelectedOutput::Instance()
|
||||
{
|
||||
if (s_instance == 0)
|
||||
{
|
||||
s_instance = new CSelectedOutput;
|
||||
}
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
void CSelectedOutput::Release()
|
||||
{
|
||||
if (s_instance)
|
||||
{
|
||||
delete s_instance;
|
||||
s_instance = 0;
|
||||
}
|
||||
}
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}// COMMENT: {11/16/2004 10:18:22 PM}CSelectedOutput CSelectedOutput::singleton;
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}CSelectedOutput* CSelectedOutput::s_instance = 0;
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}CSelectedOutput* CSelectedOutput::Instance()
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}{
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} if (s_instance == 0)
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} {
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} s_instance = new CSelectedOutput;
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} }
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} return s_instance;
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}}
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}void CSelectedOutput::Release()
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}{
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} if (s_instance)
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} {
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} delete s_instance;
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} s_instance = 0;
|
||||
// COMMENT: {3/3/2010 8:56:03 PM} }
|
||||
// COMMENT: {3/3/2010 8:56:03 PM}}
|
||||
|
||||
CSelectedOutput::CSelectedOutput()
|
||||
: m_nRowCount(0)
|
||||
|
||||
@ -18,15 +18,10 @@
|
||||
// TODO: templatize
|
||||
class CSelectedOutput
|
||||
{
|
||||
protected:
|
||||
CSelectedOutput(void);
|
||||
public:
|
||||
static CSelectedOutput* Instance();
|
||||
static void Release();
|
||||
|
||||
CSelectedOutput(void);
|
||||
virtual ~CSelectedOutput(void);
|
||||
|
||||
|
||||
int EndRow(void);
|
||||
void Clear(void);
|
||||
|
||||
|
||||
@ -8,7 +8,9 @@
|
||||
//
|
||||
void VarInit(VAR* pvar)
|
||||
{
|
||||
pvar->type = TT_EMPTY;
|
||||
pvar->type = TT_EMPTY;
|
||||
pvar->sVal = 0;
|
||||
pvar->vresult = VR_OK;
|
||||
}
|
||||
|
||||
VRESULT VarClear(VAR* pvar)
|
||||
|
||||
@ -4,9 +4,7 @@
|
||||
#include <assert.h> /* assert */
|
||||
#include <stdio.h> /* printf */
|
||||
|
||||
#define EXTERNAL extern
|
||||
#include "phreeqcpp/phreeqc/global.h"
|
||||
#undef EXTERNAL
|
||||
#include "phrqtype.h"
|
||||
|
||||
struct buffer {
|
||||
char *name;
|
||||
@ -35,8 +33,7 @@ extern int store_tally_table(double *array, int row_dim, int col_dim);
|
||||
extern int warning_msg (const char *err_str);
|
||||
extern int zero_tally_table(void);
|
||||
|
||||
|
||||
#include "../include/IPhreeqc.h"
|
||||
#include "IPhreeqc.h"
|
||||
|
||||
/*******************************
|
||||
When using GNU gcc/g++/g77
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
#define EXTERNAL
|
||||
#define MAIN
|
||||
// TEST RMWEBB WRITE ACCESS
|
||||
#include "global.h"
|
||||
#include "phqalloc.h"
|
||||
@ -5,33 +5,35 @@
|
||||
#include "phreeqcpp/phreeqc/phreeqc_files.c"
|
||||
#endif
|
||||
|
||||
static int module_isopen_handler(const int type);
|
||||
static int module_open_handler(const int type, const char *file_name);
|
||||
// COMMENT: {3/2/2010 4:06:35 PM}static int module_isopen_handler(const int type);
|
||||
// COMMENT: {3/2/2010 4:06:35 PM}static int module_open_handler(const int type, const char *file_name);
|
||||
|
||||
int
|
||||
module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
||||
#include "IPhreeqc.hpp"
|
||||
|
||||
int IPhreeqc::module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
||||
{
|
||||
IPhreeqc* pThis = (IPhreeqc*) cookie;
|
||||
|
||||
switch (action) {
|
||||
case ACTION_OPEN:
|
||||
return module_open_handler(type, err_str);
|
||||
return pThis->module_open_handler(type, err_str);
|
||||
break;
|
||||
case ACTION_ISOPEN:
|
||||
return module_isopen_handler(type);
|
||||
return pThis->module_isopen_handler(type);
|
||||
break;
|
||||
default:
|
||||
return phreeqc_handler(action, type, err_str, stop, cookie, format, args);
|
||||
return pThis->phreeqc_handler(action, type, err_str, stop, cookie, format, args);
|
||||
break;
|
||||
}
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
static int
|
||||
module_isopen_handler(const int type)
|
||||
int IPhreeqc::module_isopen_handler(const int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case OUTPUT_PUNCH:
|
||||
if (punch_file) return 1;
|
||||
if (this->punch_file) return 1;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
@ -39,51 +41,52 @@ module_isopen_handler(const int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
module_open_handler(const int type, const char *file_name)
|
||||
int IPhreeqc::module_open_handler(const int type, const char *file_name)
|
||||
{
|
||||
assert(file_name && strlen(file_name));
|
||||
assert(file_name && ::strlen(file_name));
|
||||
switch (type)
|
||||
{
|
||||
case OUTPUT_MESSAGE:
|
||||
if (output != NULL)
|
||||
if (this->output != NULL)
|
||||
{
|
||||
fclose(output);
|
||||
output = NULL;
|
||||
::fclose(this->output);
|
||||
this->output = NULL;
|
||||
}
|
||||
if ( (output = fopen(file_name, "w")) == NULL)
|
||||
if ( (this->output = ::fopen(file_name, "w")) == NULL)
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case OUTPUT_ERROR:
|
||||
assert(error_file != stderr);
|
||||
if (error_file != NULL)
|
||||
assert(this->error_file != stderr);
|
||||
if (this->error_file != NULL)
|
||||
{
|
||||
fclose(error_file);
|
||||
error_file = NULL;
|
||||
::fclose(this->error_file);
|
||||
this->error_file = NULL;
|
||||
}
|
||||
if ( (error_file = fopen(file_name, "w")) == NULL)
|
||||
if ( (this->error_file = ::fopen(file_name, "w")) == NULL)
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case OUTPUT_LOG:
|
||||
if (log_file != NULL)
|
||||
if (this->log_file != NULL)
|
||||
{
|
||||
fclose(log_file);
|
||||
log_file = NULL;
|
||||
::fclose(this->log_file);
|
||||
this->log_file = NULL;
|
||||
}
|
||||
if ( (log_file = fopen(file_name, "w")) == NULL)
|
||||
if ( (this->log_file = ::fopen(file_name, "w")) == NULL)
|
||||
{
|
||||
return ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return open_handler(type, file_name);
|
||||
return this->Phreeqc::open_handler(type, file_name);
|
||||
break;
|
||||
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args);
|
||||
int output_isopen(const int type);
|
||||
// COMMENT: {3/2/2010 4:07:45 PM}int module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args);
|
||||
// COMMENT: {3/2/2010 4:07:45 PM}int output_isopen(const int type);
|
||||
|
||||
|
||||
typedef enum {
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
#include "module_files.h"
|
||||
|
||||
#include "IPhreeqc.hpp"
|
||||
|
||||
#if defined(R_SO)
|
||||
#include "output.inl"
|
||||
#else
|
||||
@ -7,14 +9,13 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int output_isopen(const int type)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
int IPhreeqc::output_isopen(const int type)
|
||||
{
|
||||
size_t i;
|
||||
int isopen;
|
||||
for (i = 0; i < count_output_callback; ++i) {
|
||||
isopen = (output_callbacks[i].callback)(ACTION_ISOPEN, type, NULL, CONTINUE, output_callbacks[i].cookie, NULL, NULL);
|
||||
for (i = 0; i < this->count_output_callback; ++i)
|
||||
{
|
||||
isopen = (this->output_callbacks[i].callback)(ACTION_ISOPEN, type, NULL, CONTINUE, this->output_callbacks[i].cookie, NULL, NULL);
|
||||
if (isopen) return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#if !defined(PHREEQC_CLASS)
|
||||
#define EXTERNAL extern
|
||||
|
||||
#include "global.h"
|
||||
@ -21,6 +22,7 @@
|
||||
EXTERNAL int n_user_punch_index;
|
||||
|
||||
#undef EXTERNAL
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _INC_GLOBALNS */
|
||||
|
||||
@ -40,12 +40,83 @@ void TestInterface::TestLoadDatabase()
|
||||
CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat"));
|
||||
}
|
||||
|
||||
void TestInterface::TestLoadDatabaseString()
|
||||
{
|
||||
const char ex15_dat[] =
|
||||
"SOLUTION_MASTER_SPECIES\n"
|
||||
"C CO2 2.0 61.0173 12.0111\n"
|
||||
"Cl Cl- 0.0 Cl 35.453\n"
|
||||
"Co Co+2 0.0 58.93 58.93 \n"
|
||||
"E e- 0.0 0.0 0.0\n"
|
||||
"H H+ -1. 1.008 1.008\n"
|
||||
"H(0) H2 0.0 1.008\n"
|
||||
"H(1) H+ -1. 1.008\n"
|
||||
"N NH4+ 0.0 14.0067 14.0067\n"
|
||||
"Na Na+ 0.0 Na 22.9898\n"
|
||||
"Nta Nta-3 3.0 1. 1.\n"
|
||||
"O H2O 0.0 16.00 16.00\n"
|
||||
"O(-2) H2O 0.0 18.016\n"
|
||||
"O(0) O2 0.0 16.00\n"
|
||||
"SOLUTION_SPECIES\n"
|
||||
"2H2O = O2 + 4H+ + 4e- \n"
|
||||
" log_k -86.08; -gamma 1e7 0.0\n"
|
||||
"2 H+ + 2 e- = H2\n"
|
||||
" log_k -3.15; -gamma 1e7 0.0\n"
|
||||
"H+ = H+\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"e- = e-\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"H2O = H2O\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"CO2 = CO2\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"Na+ = Na+\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"Cl- = Cl-\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"Co+2 = Co+2\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"NH4+ = NH4+\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"Nta-3 = Nta-3\n"
|
||||
" log_k 0.0; -gamma 1e7 0.0\n"
|
||||
"Nta-3 + 3H+ = H3Nta\n"
|
||||
" log_k 14.9; -gamma 1e7 0.0\n"
|
||||
"Nta-3 + 2H+ = H2Nta-\n"
|
||||
" log_k 13.3; -gamma 1e7 0.0\n"
|
||||
"Nta-3 + H+ = HNta-2\n"
|
||||
" log_k 10.3; -gamma 1e7 0.0\n"
|
||||
"Nta-3 + Co+2 = CoNta-\n"
|
||||
" log_k 11.7; -gamma 1e7 0.0\n"
|
||||
"2 Nta-3 + Co+2 = CoNta2-4\n"
|
||||
" log_k 14.5; -gamma 1e7 0.0\n"
|
||||
"Nta-3 + Co+2 + H2O = CoOHNta-2 + H+\n"
|
||||
" log_k 0.5; -gamma 1e7 0.0\n"
|
||||
"Co+2 + H2O = CoOH+ + H+\n"
|
||||
" log_k -9.7; -gamma 1e7 0.0\n"
|
||||
"Co+2 + 2H2O = Co(OH)2 + 2H+\n"
|
||||
" log_k -22.9; -gamma 1e7 0.0\n"
|
||||
"Co+2 + 3H2O = Co(OH)3- + 3H+\n"
|
||||
" log_k -31.5; -gamma 1e7 0.0\n"
|
||||
"CO2 + H2O = HCO3- + H+\n"
|
||||
" log_k -6.35; -gamma 1e7 0.0\n"
|
||||
"CO2 + H2O = CO3-2 + 2H+\n"
|
||||
" log_k -16.68; -gamma 1e7 0.0\n"
|
||||
"NH4+ = NH3 + H+\n"
|
||||
" log_k -9.3; -gamma 1e7 0.0\n"
|
||||
"H2O = OH- + H+\n"
|
||||
" log_k -14.0; -gamma 1e7 0.0\n"
|
||||
"END\n";
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabaseString(ex15_dat));
|
||||
}
|
||||
|
||||
void TestInterface::TestLoadDatabaseMissingFile()
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(false, ::FileExists("missing.file"));
|
||||
CPPUNIT_ASSERT_EQUAL(1, ::LoadDatabase("missing.file"));
|
||||
CPPUNIT_ASSERT_EQUAL(1, ::LoadDatabase("missing.file"));
|
||||
CPPUNIT_ASSERT_EQUAL(1, ::LoadDatabase("missing.file"));
|
||||
CPPUNIT_ASSERT_EQUAL((bool)false, ::FileExists("missing.file"));
|
||||
CPPUNIT_ASSERT_EQUAL(1, ::LoadDatabase("missing.file"));
|
||||
CPPUNIT_ASSERT_EQUAL(1, ::LoadDatabase("missing.file"));
|
||||
CPPUNIT_ASSERT_EQUAL(1, ::LoadDatabase("missing.file"));
|
||||
|
||||
const char expected[] =
|
||||
"ERROR: LoadDatabase: Unable to open:\"missing.file\".\n"
|
||||
@ -135,7 +206,7 @@ void TestInterface::TestRunWithErrors()
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( std::string(expected), std::string(err) );
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( true, ::FileExists(dump_file) );
|
||||
CPPUNIT_ASSERT_EQUAL((bool)true, ::FileExists(dump_file) );
|
||||
CPPUNIT_ASSERT(::DeleteFile(dump_file));
|
||||
}
|
||||
|
||||
@ -161,9 +232,9 @@ void TestInterface::TestRunFile()
|
||||
"Stopping.\n";
|
||||
const char* err = ::GetLastErrorString();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( std::string(expected), std::string(err) );
|
||||
CPPUNIT_ASSERT_EQUAL(std::string(expected), std::string(err));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( true, ::FileExists(dump_file) );
|
||||
CPPUNIT_ASSERT_EQUAL((bool)true, ::FileExists(dump_file));
|
||||
CPPUNIT_ASSERT(::DeleteFile(dump_file));
|
||||
}
|
||||
|
||||
@ -780,53 +851,53 @@ EXPECTED selected.out:
|
||||
|
||||
void TestInterface::TestGetSelectedOutputColumnCount()
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase("llnl.dat"));
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::GetSelectedOutputColumnCount() );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, EQUILIBRIUM_PHASES("calcite", 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) );
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 0) );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
// COMMENT: {3/3/2010 4:57:53 PM} CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase("llnl.dat"));
|
||||
// COMMENT: {3/3/2010 4:57:53 PM} CPPUNIT_ASSERT_EQUAL( 0, ::GetSelectedOutputColumnCount() );
|
||||
// COMMENT: {3/3/2010 4:57:53 PM} CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
// COMMENT: {3/3/2010 4:57:53 PM} CPPUNIT_ASSERT_EQUAL( VR_OK, EQUILIBRIUM_PHASES("calcite", 1.0, 1.0) );
|
||||
// COMMENT: {3/3/2010 4:57:53 PM} CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) );
|
||||
// COMMENT: {3/3/2010 4:57:53 PM} CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 0) );
|
||||
// COMMENT: {3/3/2010 4:57:53 PM} CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
}
|
||||
|
||||
void TestInterface::TestAddError()
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat"));
|
||||
|
||||
// make sure initialized to empty
|
||||
//
|
||||
const char* err = ::GetLastErrorString();
|
||||
CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(err) );
|
||||
|
||||
// make sure initialized to empty
|
||||
//
|
||||
const char *expected = "TESTING AddError\n";
|
||||
CPPUNIT_ASSERT_EQUAL(1u, ::AddError(expected));
|
||||
|
||||
// check 1
|
||||
//
|
||||
err = ::GetLastErrorString();
|
||||
CPPUNIT_ASSERT_EQUAL( std::string(expected), std::string(err) );
|
||||
|
||||
// check increment
|
||||
//
|
||||
const char *expected2 = "XXXXXX\n";
|
||||
CPPUNIT_ASSERT_EQUAL(2u, ::AddError(expected2));
|
||||
|
||||
// check concatenation
|
||||
//
|
||||
err = ::GetLastErrorString();
|
||||
CPPUNIT_ASSERT_EQUAL( std::string(expected) + std::string(expected2), std::string(err) );
|
||||
|
||||
|
||||
// clear errors
|
||||
//
|
||||
CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat"));
|
||||
|
||||
// make sure back to empty
|
||||
//
|
||||
err = ::GetLastErrorString();
|
||||
CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(err) );
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat"));
|
||||
// COMMENT: {3/3/2010 4:58:00 PM}
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} // make sure initialized to empty
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} //
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} const char* err = ::GetLastErrorString();
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(err) );
|
||||
// COMMENT: {3/3/2010 4:58:00 PM}
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} // make sure initialized to empty
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} //
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} const char *expected = "TESTING AddError\n";
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} CPPUNIT_ASSERT_EQUAL(1u, ::AddError(expected));
|
||||
// COMMENT: {3/3/2010 4:58:00 PM}
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} // check 1
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} //
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} err = ::GetLastErrorString();
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} CPPUNIT_ASSERT_EQUAL( std::string(expected), std::string(err) );
|
||||
// COMMENT: {3/3/2010 4:58:00 PM}
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} // check increment
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} //
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} const char *expected2 = "XXXXXX\n";
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} CPPUNIT_ASSERT_EQUAL(2u, ::AddError(expected2));
|
||||
// COMMENT: {3/3/2010 4:58:00 PM}
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} // check concatenation
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} //
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} err = ::GetLastErrorString();
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} CPPUNIT_ASSERT_EQUAL( std::string(expected) + std::string(expected2), std::string(err) );
|
||||
// COMMENT: {3/3/2010 4:58:00 PM}
|
||||
// COMMENT: {3/3/2010 4:58:00 PM}
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} // clear errors
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} //
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat"));
|
||||
// COMMENT: {3/3/2010 4:58:00 PM}
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} // make sure back to empty
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} //
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} err = ::GetLastErrorString();
|
||||
// COMMENT: {3/3/2010 4:58:00 PM} CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(err) );
|
||||
}
|
||||
|
||||
void TestInterface::TestAccumulateLine()
|
||||
@ -884,24 +955,24 @@ void TestInterface::TestCase1()
|
||||
{
|
||||
CPPUNIT_ASSERT(::DeleteFile("selected.out"));
|
||||
}
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("selected.out") );
|
||||
|
||||
|
||||
// clear all flags
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase("phreeqc.dat") );
|
||||
CPPUNIT_ASSERT_EQUAL( FALSE, punch.in);
|
||||
CPPUNIT_ASSERT_EQUAL( TRUE, pr.punch);
|
||||
// COMMENT: {3/4/2010 6:28:53 PM} CPPUNIT_ASSERT_EQUAL( FALSE, punch.in);
|
||||
// COMMENT: {3/4/2010 6:28:53 PM} CPPUNIT_ASSERT_EQUAL( TRUE, pr.punch);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) );
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 1) );
|
||||
CPPUNIT_ASSERT_EQUAL( true, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) );
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 1) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)true, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 1) );
|
||||
CPPUNIT_ASSERT_EQUAL( true, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 1) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)true, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
}
|
||||
|
||||
void TestInterface::TestCase2()
|
||||
@ -922,21 +993,21 @@ void TestInterface::TestCase2()
|
||||
{
|
||||
::DeleteFile("case2.punch");
|
||||
}
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("case2.punch") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("case2.punch") );
|
||||
|
||||
// clear all flags
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase("phreeqc.dat") );
|
||||
CPPUNIT_ASSERT_EQUAL( FALSE, punch.in);
|
||||
CPPUNIT_ASSERT_EQUAL( TRUE, pr.punch);
|
||||
// COMMENT: {3/4/2010 6:29:02 PM} CPPUNIT_ASSERT_EQUAL( FALSE, punch.in);
|
||||
// COMMENT: {3/4/2010 6:29:02 PM} CPPUNIT_ASSERT_EQUAL( TRUE, pr.punch);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, ::AccumulateLine("-file case2.punch") ); // force have_punch_name to TRUE (see read_selected_ouput)
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 1) );
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( true, ::FileExists("case2.punch") );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, ::AccumulateLine("-file case2.punch") ); // force have_punch_name to TRUE (see read_selected_ouput)
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 1) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)true, ::FileExists("case2.punch") );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
|
||||
|
||||
// remove punch files if they exists
|
||||
@ -949,21 +1020,21 @@ void TestInterface::TestCase2()
|
||||
{
|
||||
::DeleteFile("case2.punch");
|
||||
}
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("case2.punch") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("case2.punch") );
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) );
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 1) );
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( true, ::FileExists("case2.punch") );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) );
|
||||
CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) );
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 1) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)true, ::FileExists("case2.punch") );
|
||||
CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() );
|
||||
|
||||
if (::FileExists("case2.punch"))
|
||||
{
|
||||
::DeleteFile("case2.punch");
|
||||
}
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("case2.punch") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("case2.punch") );
|
||||
}
|
||||
|
||||
void TestInterface::TestPrintSelectedOutputFalse()
|
||||
@ -974,7 +1045,7 @@ void TestInterface::TestPrintSelectedOutputFalse()
|
||||
{
|
||||
::DeleteFile("selected.out");
|
||||
}
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists("selected.out") );
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase("phreeqc.dat") );
|
||||
|
||||
@ -1165,7 +1236,7 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in
|
||||
{
|
||||
::DeleteFile(FILENAME);
|
||||
}
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists(FILENAME) );
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase("phreeqc.dat") );
|
||||
|
||||
@ -1183,7 +1254,7 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in
|
||||
|
||||
// run all off
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 0) );
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists(FILENAME) );
|
||||
|
||||
|
||||
|
||||
@ -1203,7 +1274,7 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in
|
||||
|
||||
// run
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(output_on, error_on, log_on, selected_output_on) );
|
||||
CPPUNIT_ASSERT_EQUAL( true, ::FileExists(FILENAME) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)true, ::FileExists(FILENAME) );
|
||||
CPPUNIT_ASSERT( ::DeleteFile(FILENAME) );
|
||||
|
||||
|
||||
@ -1224,7 +1295,7 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in
|
||||
|
||||
// run
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(0, 0, 0, 0) );
|
||||
CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)false, ::FileExists(FILENAME) );
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase("phreeqc.dat") );
|
||||
|
||||
@ -1242,7 +1313,7 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in
|
||||
|
||||
// run
|
||||
CPPUNIT_ASSERT_EQUAL( 0, ::Run(output_on, error_on, log_on, selected_output_on) );
|
||||
CPPUNIT_ASSERT_EQUAL( true, ::FileExists(FILENAME) );
|
||||
CPPUNIT_ASSERT_EQUAL( (bool)true, ::FileExists(FILENAME) );
|
||||
CPPUNIT_ASSERT( ::DeleteFile(FILENAME) );
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ class TestInterface :
|
||||
{
|
||||
CPPUNIT_TEST_SUITE( TestInterface );
|
||||
CPPUNIT_TEST( TestLoadDatabase );
|
||||
CPPUNIT_TEST( TestLoadDatabaseString );
|
||||
CPPUNIT_TEST( TestLoadDatabaseMissingFile );
|
||||
CPPUNIT_TEST( TestLoadDatabaseWithErrors );
|
||||
CPPUNIT_TEST( TestRun );
|
||||
@ -41,6 +42,7 @@ public:
|
||||
|
||||
public:
|
||||
void TestLoadDatabase();
|
||||
void TestLoadDatabaseString();
|
||||
void TestLoadDatabaseMissingFile();
|
||||
void TestLoadDatabaseWithErrors();
|
||||
void TestRun();
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
#include "TestSelectedOutput.h"
|
||||
|
||||
|
||||
#include "../src/phreeqcns.hxx"
|
||||
#undef free
|
||||
// COMMENT: {3/3/2010 5:39:47 PM}#include "../src/phreeqcns.hxx"
|
||||
// COMMENT: {3/3/2010 5:39:47 PM}#undef free
|
||||
|
||||
// COMMENT: {3/4/2010 5:13:40 PM}#include "IPhreeqc.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define strdup _strdup
|
||||
#endif
|
||||
|
||||
int EndRow(void);
|
||||
// COMMENT: {3/4/2010 5:13:30 PM}int EndRow(void);
|
||||
|
||||
|
||||
TestSelectedOutput::TestSelectedOutput()
|
||||
@ -22,131 +24,148 @@ TestSelectedOutput::~TestSelectedOutput()
|
||||
void
|
||||
TestSelectedOutput::TestEmpty()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
}
|
||||
|
||||
void
|
||||
TestSelectedOutput::TestSinglePushBack()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CVar v(7.0);
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBack("pH", v));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBack("pH", v));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
// row count doesn't change until EndRow is called
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
#if defined(_DEBUG)
|
||||
CSelectedOutput::Instance()->Dump("TestSinglePushBack");
|
||||
co.Dump("TestSinglePushBack");
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
TestSelectedOutput::TestMultiplePushBack()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CVar v1(7.0);
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBack("pH", v1));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBack("pH", v1));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v2(8.0);
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBack("pH", v2));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBack("pH", v2));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, co.GetRowCount());
|
||||
#if defined(_DEBUG)
|
||||
CSelectedOutput::Instance()->Dump("TestMultiplePushBack");
|
||||
co.Dump("TestMultiplePushBack");
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
TestSelectedOutput::TestNewHeadingsPushBack()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CVar v1(7.0);
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBack("pH", v1));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBack("pH", v1));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v2(8.0);
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBack("pH", v2));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBack("pH", v2));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v3(9.0);
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBack("user_pH", v3));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBack("user_pH", v3));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, co.GetRowCount());
|
||||
#if defined(_DEBUG)
|
||||
CSelectedOutput::Instance()->Dump("TestNewHeadingsPushBack");
|
||||
co.Dump("TestNewHeadingsPushBack");
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
TestSelectedOutput::TestPushBackDouble()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 7.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 7.0));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount()); // heading
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount()); // heading
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("pH"), std::string(v.sVal));
|
||||
|
||||
CVar vval;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_DOUBLE, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(7.0, vval.dVal);
|
||||
}
|
||||
@ -154,28 +173,32 @@ TestSelectedOutput::TestPushBackDouble()
|
||||
void
|
||||
TestSelectedOutput::TestPushBackLong()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackLong("Sim", 2));
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount()); // heading plus first row
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackLong("Sim", 2));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount()); // heading plus first row
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("Sim"), std::string(v.sVal));
|
||||
|
||||
CVar vval;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_LONG, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(2l, vval.lVal);
|
||||
}
|
||||
@ -183,28 +206,32 @@ TestSelectedOutput::TestPushBackLong()
|
||||
void
|
||||
TestSelectedOutput::TestPushBackString()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackString("state", "i_soln"));
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount()); // heading
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackString("state", "i_soln"));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount()); // heading
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("state"), std::string(v.sVal));
|
||||
|
||||
CVar vval;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("i_soln"), std::string(vval.sVal));
|
||||
}
|
||||
@ -212,64 +239,72 @@ TestSelectedOutput::TestPushBackString()
|
||||
void
|
||||
TestSelectedOutput::TestPushBackEmpty()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackEmpty("Empty"));
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount()); // heading
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackEmpty("Empty"));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount()); // heading
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("Empty"), std::string(v.sVal));
|
||||
|
||||
CVar vval;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval.type);
|
||||
}
|
||||
|
||||
void
|
||||
TestSelectedOutput::TestDuplicateHeadings()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 7.0));
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount()); // heading
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 7.0));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount()); // heading
|
||||
|
||||
// overwrite pH with 8.0
|
||||
//
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 8.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 8.0));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount()); // heading
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount()); // heading
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("pH"), std::string(v.sVal));
|
||||
|
||||
|
||||
CVar vval;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_DOUBLE, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(8.0, vval.dVal);
|
||||
}
|
||||
@ -277,45 +312,49 @@ TestSelectedOutput::TestDuplicateHeadings()
|
||||
void
|
||||
TestSelectedOutput::TestEndRow()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 7.0));
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetRowCount()); // heading
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 7.0));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetRowCount()); // heading
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("pH"), std::string(v.sVal));
|
||||
|
||||
CVar vval;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_DOUBLE, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(7.0, vval.dVal);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 8.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 8.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, co.GetRowCount());
|
||||
|
||||
CVar vval3;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval3.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval3));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval3));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_DOUBLE, vval3.type);
|
||||
CPPUNIT_ASSERT_EQUAL(7.0, vval3.dVal);
|
||||
|
||||
CVar vval2;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval2.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(2, 0, &vval2));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(2, 0, &vval2));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_DOUBLE, vval2.type);
|
||||
CPPUNIT_ASSERT_EQUAL(8.0, vval2.dVal);
|
||||
}
|
||||
@ -323,45 +362,49 @@ TestSelectedOutput::TestEndRow()
|
||||
void
|
||||
TestSelectedOutput::TestEndRow2()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 6.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 7.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 8.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 9.0));
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 6.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 7.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 8.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 9.0));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("pH"), std::string(v.sVal));
|
||||
|
||||
CVar vval;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_DOUBLE, vval.type);
|
||||
CPPUNIT_ASSERT_EQUAL(9.0, vval.dVal); // dups get overwritten
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackDouble("pH", 8.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackDouble("pH", 8.0));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, co.GetRowCount());
|
||||
|
||||
CVar vval3;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval3.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &vval3));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &vval3));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_DOUBLE, vval3.type);
|
||||
CPPUNIT_ASSERT_EQUAL(9.0, vval3.dVal);
|
||||
|
||||
CVar vval2;
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, vval2.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(2, 0, &vval2));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(2, 0, &vval2));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_DOUBLE, vval2.type);
|
||||
CPPUNIT_ASSERT_EQUAL(8.0, vval2.dVal);
|
||||
}
|
||||
@ -370,138 +413,148 @@ TestSelectedOutput::TestEndRow2()
|
||||
void
|
||||
TestSelectedOutput::TestTooManyHeadings()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
|
||||
// USER_PUNCH
|
||||
// -headings 1.name 1.type 1.moles
|
||||
|
||||
n_user_punch_index = 0;
|
||||
user_punch_headings = NULL;
|
||||
user_punch_count_headings = 0;
|
||||
|
||||
user_punch_headings = (char**)::realloc(user_punch_headings, (size_t) (user_punch_count_headings + 1) * sizeof(char *));
|
||||
user_punch_headings[user_punch_count_headings] = ::strdup("1.name");
|
||||
user_punch_count_headings++;
|
||||
|
||||
user_punch_headings = (char**)::realloc(user_punch_headings, (size_t) (user_punch_count_headings + 1) * sizeof(char *));
|
||||
user_punch_headings[user_punch_count_headings] = ::strdup("1.type");
|
||||
user_punch_count_headings++;
|
||||
|
||||
user_punch_headings = (char**)::realloc(user_punch_headings, (size_t) (user_punch_count_headings + 1) * sizeof(char *));
|
||||
user_punch_headings[user_punch_count_headings] = ::strdup("1.moles");
|
||||
user_punch_count_headings++;
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, ::EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
#if defined(_DEBUG)
|
||||
CSelectedOutput::Instance()->Dump("TestTooManyHeadings");
|
||||
#endif
|
||||
|
||||
// clean up headings
|
||||
//
|
||||
for (int i = 0; i < user_punch_count_headings; ++i) {
|
||||
::free(user_punch_headings[i]);
|
||||
}
|
||||
::free(user_punch_headings);
|
||||
user_punch_headings = NULL;
|
||||
user_punch_count_headings = 0;
|
||||
|
||||
CVar head0, head1, head2;
|
||||
CVar val0, val1, val2;
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &head0));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 1, &head1));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 2, &head2));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &val0));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 1, &val1));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 2, &val2));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, head0.type);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, head1.type);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, head2.type);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, val0.type);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, val1.type);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, val2.type);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("1.name"), std::string(head0.sVal));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("1.type"), std::string(head1.sVal));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("1.moles"), std::string(head2.sVal));
|
||||
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackLong("sim", 1));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackString("state", "i_soln"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackLong("soln", 22));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(6u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, CSelectedOutput::Instance()->GetRowCount());
|
||||
#if defined(_DEBUG)
|
||||
CSelectedOutput::Instance()->Dump("TestTooManyHeadings");
|
||||
#endif
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CSelectedOutput co;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} co.Clear();
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} // USER_PUNCH
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} // -headings 1.name 1.type 1.moles
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} IPhreeqc p;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.do_initialize();
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.n_user_punch_index = 0;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_headings = 0;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_count_headings = 0;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_headings = (char**)::realloc(p.user_punch_headings, (size_t) (p.user_punch_count_headings + 1) * sizeof(char *));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_headings[p.user_punch_count_headings] = ::strdup("1.name");
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_count_headings++;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_headings = (char**)::realloc(p.user_punch_headings, (size_t) (p.user_punch_count_headings + 1) * sizeof(char *));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_headings[p.user_punch_count_headings] = ::strdup("1.type");
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_count_headings++;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_headings = (char**)::realloc(p.user_punch_headings, (size_t) (p.user_punch_count_headings + 1) * sizeof(char *));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_headings[p.user_punch_count_headings] = ::strdup("1.moles");
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_count_headings++;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0, p.EndRow());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(3u, co.GetColCount());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}#if defined(_DEBUG)
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} co.Dump("TestTooManyHeadings");
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}#endif
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} // clean up headings
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} //
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} for (int i = 0; i < p.user_punch_count_headings; ++i)
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} {
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} ::free(p.user_punch_headings[i]);
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} }
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} ::free(p.user_punch_headings);
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_headings = NULL;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} p.user_punch_count_headings = 0;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CVar head0, head1, head2;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CVar val0, val1, val2;
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &head0));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 1, &head1));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 2, &head2));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &val0));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 1, &val1));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 2, &val2));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(TT_STRING, head0.type);
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(TT_STRING, head1.type);
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(TT_STRING, head2.type);
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(TT_EMPTY, val0.type);
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(TT_EMPTY, val1.type);
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(TT_EMPTY, val2.type);
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(std::string("1.name"), std::string(head0.sVal));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(std::string("1.type"), std::string(head1.sVal));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(std::string("1.moles"), std::string(head2.sVal));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0, co.PushBackLong("sim", 1));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0, co.PushBackString("state", "i_soln"));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0, co.PushBackLong("soln", 22));
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(6u, co.GetColCount());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} CPPUNIT_ASSERT_EQUAL(3u, co.GetRowCount());
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}#if defined(_DEBUG)
|
||||
// COMMENT: {3/4/2010 5:12:41 PM} co.Dump("TestTooManyHeadings");
|
||||
// COMMENT: {3/4/2010 5:12:41 PM}#endif
|
||||
}
|
||||
|
||||
void
|
||||
TestSelectedOutput::TestNotEnoughHeadings()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
// USER_PUNCH
|
||||
// -headings 1.name 1.type 1.moles
|
||||
|
||||
n_user_punch_index = 0;
|
||||
user_punch_headings = NULL;
|
||||
user_punch_count_headings = 0;
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackLong("sim", 1));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackString("state", "i_soln"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackLong("soln", 22));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackLong("sim", 1));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackString("state", "i_soln"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackLong("soln", 22));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
#if defined(_DEBUG)
|
||||
CSelectedOutput::Instance()->Dump("TestNotEnoughHeadings");
|
||||
co.Dump("TestNotEnoughHeadings");
|
||||
#endif
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackLong("sim", 2));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackString("state", "react"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackLong("soln", 23));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackLong("sim", 2));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackString("state", "react"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackLong("soln", 23));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackEmpty("no_heading_1"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackEmpty("no_heading_2"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackEmpty("no_heading_3"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackEmpty("no_heading_1"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackEmpty("no_heading_2"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackEmpty("no_heading_3"));
|
||||
|
||||
#if defined(_DEBUG)
|
||||
CSelectedOutput::Instance()->Dump("TestNotEnoughHeadings");
|
||||
co.Dump("TestNotEnoughHeadings");
|
||||
#endif
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(6u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(6u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(3u, co.GetRowCount());
|
||||
|
||||
CVar head0, head1, head2, head3, head4, head5;
|
||||
CVar val0, val1, val2, val3, val4, val5;
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &head0));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 1, &head1));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 2, &head2));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 3, &head3));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 4, &head4));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 5, &head5));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &head0));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 1, &head1));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 2, &head2));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 3, &head3));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 4, &head4));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 5, &head5));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &val0));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 1, &val1));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 2, &val2));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 3, &val3));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 4, &val4));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 5, &val5));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &val0));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 1, &val1));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 2, &val2));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 3, &val3));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 4, &val4));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 5, &val5));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, head0.type);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, head1.type);
|
||||
@ -524,7 +577,6 @@ TestSelectedOutput::TestNotEnoughHeadings()
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("no_heading_2"), std::string(head4.sVal));
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("no_heading_3"), std::string(head5.sVal));
|
||||
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(1l, val0.lVal);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("i_soln"), std::string(val1.sVal));
|
||||
CPPUNIT_ASSERT_EQUAL(22l, val2.lVal);
|
||||
@ -533,34 +585,38 @@ TestSelectedOutput::TestNotEnoughHeadings()
|
||||
void
|
||||
TestSelectedOutput::TestInvalidRow()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, CSelectedOutput::Instance()->Get(0, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, co.Get(0, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_ERROR, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, v.vresult);
|
||||
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, CSelectedOutput::Instance()->Get(-1, -1, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, co.Get(-1, -1, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_ERROR, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, v.vresult);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackEmpty("heading"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackEmpty("heading"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("heading"), std::string(v.sVal));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, CSelectedOutput::Instance()->Get(2, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, co.Get(2, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_ERROR, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, v.vresult);
|
||||
}
|
||||
@ -568,38 +624,42 @@ TestSelectedOutput::TestInvalidRow()
|
||||
void
|
||||
TestSelectedOutput::TestInvalidCol()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CVar v;
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, CSelectedOutput::Instance()->Get(0, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, co.Get(0, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_ERROR, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, v.vresult);
|
||||
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, CSelectedOutput::Instance()->Get(-1, -1, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, co.Get(-1, -1, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_ERROR, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDROW, v.vresult);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackEmpty("heading"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackEmpty("heading"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(0, 0, &v) );
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("heading"), std::string(v.sVal));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, CSelectedOutput::Instance()->Get(1, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_OK, co.Get(1, 0, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v.type);
|
||||
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, CSelectedOutput::Instance()->Get(0, 1, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, co.Get(0, 1, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_ERROR, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, v.vresult);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, CSelectedOutput::Instance()->Get(0, -1, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, co.Get(0, -1, &v));
|
||||
CPPUNIT_ASSERT_EQUAL(TT_ERROR, v.type);
|
||||
CPPUNIT_ASSERT_EQUAL(VR_INVALIDCOL, v.vresult);
|
||||
}
|
||||
@ -607,40 +667,48 @@ TestSelectedOutput::TestInvalidCol()
|
||||
void
|
||||
TestSelectedOutput::TestGet()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackEmpty("heading"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackEmpty("heading"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
|
||||
CVar v0 = CSelectedOutput::Instance()->Get(0, 0);
|
||||
CVar v0 = co.Get(0, 0);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v0.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("heading"), std::string(v0.sVal));
|
||||
|
||||
CVar v1 = CSelectedOutput::Instance()->Get(1, 0);
|
||||
CVar v1 = co.Get(1, 0);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v1.type);
|
||||
}
|
||||
|
||||
void
|
||||
TestSelectedOutput::TestLongHeadings()
|
||||
{
|
||||
CSelectedOutput::Instance()->Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, CSelectedOutput::Instance()->GetRowCount());
|
||||
CSelectedOutput co;
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->PushBackEmpty("heading890123456789012345678901234567890123456789"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, CSelectedOutput::Instance()->EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, CSelectedOutput::Instance()->GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, CSelectedOutput::Instance()->GetRowCount());
|
||||
co.Clear();
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(0u, co.GetRowCount());
|
||||
|
||||
CVar v0 = CSelectedOutput::Instance()->Get(0, 0);
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.PushBackEmpty("heading890123456789012345678901234567890123456789"));
|
||||
CPPUNIT_ASSERT_EQUAL(0, co.EndRow());
|
||||
CPPUNIT_ASSERT_EQUAL(1u, co.GetColCount());
|
||||
CPPUNIT_ASSERT_EQUAL(2u, co.GetRowCount());
|
||||
|
||||
CVar v0 = co.Get(0, 0);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_STRING, v0.type);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("heading890123456789012345678901234567890123456789"), std::string(v0.sVal));
|
||||
|
||||
CVar v1 = CSelectedOutput::Instance()->Get(1, 0);
|
||||
CVar v1 = co.Get(1, 0);
|
||||
CPPUNIT_ASSERT_EQUAL(TT_EMPTY, v1.type);
|
||||
}
|
||||
|
||||
236
unit/unit.vcproj
236
unit/unit.vcproj
@ -45,7 +45,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(DEV_CPPUNIT_1.10)/include";../include;../src;../src/phreeqcpp;../src/phreeqcpp/phreeqc"
|
||||
PreprocessorDefinitions="SWIG_SHARED_OBJ;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
|
||||
PreprocessorDefinitions="SWIG_SHARED_OBJ;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;PHREEQC_CPP;PHREEQC_CLASS;USE_PHRQ_ALLOC"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@ -224,7 +224,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(DEV_CPPUNIT_1.10)/include";../include;../src;../src/phreeqcpp;../src/phreeqcpp/phreeqc"
|
||||
PreprocessorDefinitions="WIN32_MEMORY_DEBUG;SWIG_SHARED_OBJ;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
|
||||
PreprocessorDefinitions="WIN32_MEMORY_DEBUG;SWIG_SHARED_OBJ;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;PHREEQC_CPP;PHREEQC_CLASS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@ -453,6 +453,30 @@
|
||||
<File
|
||||
RelativePath="..\src\fwrap.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemDebug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\global.c"
|
||||
@ -601,6 +625,214 @@
|
||||
<Filter
|
||||
Name="phreeqcpp"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\class_main.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\cxxKinetics.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\cxxMix.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Dictionary.cxx"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\dumper.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Exchange.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\ExchComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\GasPhase.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\ISolution.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\ISolutionComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\KineticsComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\NameDouble.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\NumKeyword.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Parser.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Phreeqc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\PPassemblage.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\PPassemblageComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Reaction.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\ReadClass.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\runner.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\SAXPhreeqc.cxx"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Solution.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\SolutionIsotope.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\SolutionIsotopeList.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\SSassemblage.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\SSassemblageSS.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\StorageBin.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\StorageBinList.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Surface.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\SurfaceCharge.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\SurfaceComp.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\System.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Temperature.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\phreeqcpp\Utils.cxx"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="phreeqc"
|
||||
>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user