diff --git a/configure.ac b/configure.ac index 63ceeca0..601f8e60 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT([IPhreeqc], [2.17.1-4389], [charlton@usgs.gov]) +AC_INIT([IPhreeqc], [2.17.1-4411], [charlton@usgs.gov]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/examples/test_c.c.in b/examples/test_c.c.in index 9b5c4d6b..46d0f339 100644 --- a/examples/test_c.c.in +++ b/examples/test_c.c.in @@ -13,19 +13,19 @@ main(int argc, const char* argv[]) if (LoadDatabase(id, "phreeqc.dat") != 0) { - OutputError(id); + OutputErrorString(id); return 2; } if (RunFile(id, "ex1") != 0) { - OutputError(id); + OutputErrorString(id); return 3; } if (DestroyIPhreeqc(id) != IPQ_OK) { - OutputError(id); + OutputErrorString(id); return 4; } diff --git a/examples/test_f.f.in b/examples/test_f.f.in index 16e32ed5..d623ae38 100644 --- a/examples/test_f.f.in +++ b/examples/test_f.f.in @@ -10,17 +10,17 @@ ENDIF IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) STOP ENDIF IF (RunFile(id, "ex1").NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) STOP ENDIF IF (DestroyIPhreeqc(id).NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) STOP ENDIF diff --git a/examples/test_f90.f90.in b/examples/test_f90.f90.in index 241dc932..6b0fcaa6 100644 --- a/examples/test_f90.f90.in +++ b/examples/test_f90.f90.in @@ -10,17 +10,17 @@ SUBROUTINE F_MAIN ENDIF IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) STOP ENDIF IF (RunFile(id, "ex1").NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) STOP ENDIF IF (DestroyIPhreeqc(id).NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) STOP ENDIF diff --git a/include/IPhreeqc.f.inc b/include/IPhreeqc.f.inc index 01063379..dd22d9c4 100644 --- a/include/IPhreeqc.f.inc +++ b/include/IPhreeqc.f.inc @@ -46,33 +46,33 @@ C INTEGER(KIND=4) CreateIPhreeqc INTEGER(KIND=4) DestroyIPhreeqc INTEGER(KIND=4) GetComponentCount - INTEGER(KIND=4) GetDumpLine - INTEGER(KIND=4) GetDumpLineCount - LOGICAL(KIND=4) GetDumpOn + INTEGER(KIND=4) GetDumpStringLine + INTEGER(KIND=4) GetDumpStringLineCount + LOGICAL(KIND=4) GetDumpFileOn LOGICAL(KIND=4) GetDumpStringOn - INTEGER(KIND=4) GetErrorLine - INTEGER(KIND=4) GetErrorLineCount - LOGICAL(KIND=4) GetErrorOn - LOGICAL(KIND=4) GetLogOn - LOGICAL(KIND=4) GetOutputOn + INTEGER(KIND=4) GetErrorStringLine + INTEGER(KIND=4) GetErrorStringLineCount + LOGICAL(KIND=4) GetErrorFileOn + LOGICAL(KIND=4) GetLogFileOn + LOGICAL(KIND=4) GetOutputFileOn INTEGER(KIND=4) GetSelectedOutputColumnCount - LOGICAL(KIND=4) GetSelectedOutputOn + LOGICAL(KIND=4) GetSelectedOutputFileOn INTEGER(KIND=4) GetSelectedOutputRowCount INTEGER(KIND=4) GetSelectedOutputValue - INTEGER(KIND=4) GetWarningLine - INTEGER(KIND=4) GetWarningLineCount + INTEGER(KIND=4) GetWarningStringLine + INTEGER(KIND=4) GetWarningStringLineCount INTEGER(KIND=4) LoadDatabase INTEGER(KIND=4) LoadDatabaseString INTEGER(KIND=4) OutputLastError INTEGER(KIND=4) OutputLastWarning - INTEGER(KIND=4) OutputLines + INTEGER(KIND=4) OutputAccumulatedLines INTEGER(KIND=4) RunAccumulated INTEGER(KIND=4) RunFile INTEGER(KIND=4) RunString - INTEGER(KIND=4) SetDumpOn + INTEGER(KIND=4) SetDumpFileOn INTEGER(KIND=4) SetDumpStringOn - INTEGER(KIND=4) SetErrorOn - INTEGER(KIND=4) SetLogOn - INTEGER(KIND=4) SetOutputOn - INTEGER(KIND=4) SetSelectedOutputOn + INTEGER(KIND=4) SetErrorFileOn + INTEGER(KIND=4) SetLogFileOn + INTEGER(KIND=4) SetOutputFileOn + INTEGER(KIND=4) SetSelectedOutputFileOn INTEGER(KIND=4) UnLoadDatabase diff --git a/include/IPhreeqc.f90.inc b/include/IPhreeqc.f90.inc index 908f51d2..8358d693 100644 --- a/include/IPhreeqc.f90.inc +++ b/include/IPhreeqc.f90.inc @@ -57,7 +57,7 @@ INTERFACE - SUBROUTINE GetDumpLine(ID,N,LINE) + SUBROUTINE GetDumpStringLine(ID,N,LINE) INTEGER(KIND=4), INTENT(IN) :: ID INTEGER(KIND=4), INTENT(IN) :: N CHARACTER(LEN=*), INTENT(OUT) :: LINE @@ -66,18 +66,18 @@ INTERFACE - FUNCTION GetDumpLineCount(ID) + FUNCTION GetDumpStringLineCount(ID) INTEGER(KIND=4), INTENT(IN) :: ID - INTEGER(KIND=4) :: GetDumpLineCount - END FUNCTION GetDumpLineCount + INTEGER(KIND=4) :: GetDumpStringLineCount + END FUNCTION GetDumpStringLineCount END INTERFACE INTERFACE - FUNCTION GetDumpOn(ID) + FUNCTION GetDumpFileOn(ID) INTEGER(KIND=4), INTENT(IN) :: ID - LOGICAL(KIND=4) :: GetDumpOn - END FUNCTION GetDumpOn + LOGICAL(KIND=4) :: GetDumpFileOn + END FUNCTION GetDumpFileOn END INTERFACE @@ -90,7 +90,7 @@ INTERFACE - SUBROUTINE GetErrorLine(ID,N,LINE) + SUBROUTINE GetErrorStringLine(ID,N,LINE) INTEGER(KIND=4), INTENT(IN) :: ID INTEGER(KIND=4), INTENT(IN) :: N CHARACTER(LEN=*), INTENT(OUT) :: LINE @@ -99,34 +99,34 @@ INTERFACE - FUNCTION GetErrorLineCount(ID) + FUNCTION GetErrorStringLineCount(ID) INTEGER(KIND=4), INTENT(IN) :: ID - INTEGER(KIND=4) :: GetErrorLineCount - END FUNCTION GetErrorLineCount + INTEGER(KIND=4) :: GetErrorStringLineCount + END FUNCTION GetErrorStringLineCount END INTERFACE INTERFACE - FUNCTION GetErrorOn(ID) + FUNCTION GetErrorFileOn(ID) INTEGER(KIND=4), INTENT(IN) :: ID - LOGICAL(KIND=4) :: GetErrorOn - END FUNCTION GetErrorOn + LOGICAL(KIND=4) :: GetErrorFileOn + END FUNCTION GetErrorFileOn END INTERFACE INTERFACE - FUNCTION GetLogOn(ID) + FUNCTION GetLogFileOn(ID) INTEGER(KIND=4), INTENT(IN) :: ID - LOGICAL(KIND=4) :: GetLogOn - END FUNCTION GetLogOn + LOGICAL(KIND=4) :: GetLogFileOn + END FUNCTION GetLogFileOn END INTERFACE INTERFACE - FUNCTION GetOutputOn(ID) + FUNCTION GetOutputFileOn(ID) INTEGER(KIND=4), INTENT(IN) :: ID - LOGICAL(KIND=4) :: GetOutputOn - END FUNCTION GetOutputOn + LOGICAL(KIND=4) :: GetOutputFileOn + END FUNCTION GetOutputFileOn END INTERFACE @@ -139,10 +139,10 @@ INTERFACE - FUNCTION GetSelectedOutputOn(ID) + FUNCTION GetSelectedOutputFileOn(ID) INTEGER(KIND=4), INTENT(IN) :: ID - LOGICAL(KIND=4) :: GetSelectedOutputOn - END FUNCTION GetSelectedOutputOn + LOGICAL(KIND=4) :: GetSelectedOutputFileOn + END FUNCTION GetSelectedOutputFileOn END INTERFACE @@ -168,7 +168,7 @@ INTERFACE - SUBROUTINE GetWarningLine(ID,N,LINE) + SUBROUTINE GetWarningStringLine(ID,N,LINE) INTEGER(KIND=4), INTENT(IN) :: ID INTEGER(KIND=4), INTENT(IN) :: N CHARACTER(LEN=*), INTENT(OUT) :: LINE @@ -177,10 +177,10 @@ INTERFACE - FUNCTION GetWarningLineCount(ID) + FUNCTION GetWarningStringLineCount(ID) INTEGER(KIND=4), INTENT(IN) :: ID - INTEGER(KIND=4) :: GetWarningLineCount - END FUNCTION GetWarningLineCount + INTEGER(KIND=4) :: GetWarningStringLineCount + END FUNCTION GetWarningStringLineCount END INTERFACE @@ -203,19 +203,19 @@ INTERFACE - SUBROUTINE OutputError(ID) + SUBROUTINE OutputErrorString(ID) INTEGER(KIND=4), INTENT(IN) :: ID - END SUBROUTINE OutputError + END SUBROUTINE OutputErrorString END INTERFACE - !!! TODO OutputWarning + !!! TODO OutputWarningString INTERFACE - SUBROUTINE OutputLines(ID) + SUBROUTINE OutputAccumulatedLines(ID) INTEGER(KIND=4), INTENT(IN) :: ID - END SUBROUTINE OutputLines + END SUBROUTINE OutputAccumulatedLines END INTERFACE @@ -246,11 +246,11 @@ INTERFACE - FUNCTION SetDumpOn(ID,DUMP_ON) + FUNCTION SetDumpFileOn(ID,DUMP_ON) INTEGER(KIND=4), INTENT(IN) :: ID LOGICAL(KIND=4), INTENT(IN) :: DUMP_ON - INTEGER(KIND=4) :: SetDumpOn - END FUNCTION SetDumpOn + INTEGER(KIND=4) :: SetDumpFileOn + END FUNCTION SetDumpFileOn END INTERFACE @@ -264,38 +264,38 @@ INTERFACE - FUNCTION SetErrorOn(ID,ERR_ON) + FUNCTION SetErrorFileOn(ID,ERR_ON) INTEGER(KIND=4), INTENT(IN) :: ID LOGICAL(KIND=4), INTENT(IN) :: ERR_ON - INTEGER(KIND=4) :: SetErrorOn - END FUNCTION SetErrorOn + INTEGER(KIND=4) :: SetErrorFileOn + END FUNCTION SetErrorFileOn END INTERFACE INTERFACE - FUNCTION SetLogOn(ID,LOG_ON) + FUNCTION SetLogFileOn(ID,LOG_ON) INTEGER(KIND=4), INTENT(IN) :: ID LOGICAL(KIND=4), INTENT(IN) :: LOG_ON - INTEGER(KIND=4) :: SetLogOn - END FUNCTION SetLogOn + INTEGER(KIND=4) :: SetLogFileOn + END FUNCTION SetLogFileOn END INTERFACE INTERFACE - FUNCTION SetOutputOn(ID,OUT_ON) + FUNCTION SetOutputFileOn(ID,OUT_ON) INTEGER(KIND=4), INTENT(IN) :: ID LOGICAL(KIND=4), INTENT(IN) :: OUT_ON - INTEGER(KIND=4) :: SetOutputOn - END FUNCTION SetOutputOn + INTEGER(KIND=4) :: SetOutputFileOn + END FUNCTION SetOutputFileOn END INTERFACE INTERFACE - FUNCTION SetSelectedOutputOn(ID,SEL_ON) + FUNCTION SetSelectedOutputFileOn(ID,SEL_ON) INTEGER(KIND=4), INTENT(IN) :: ID LOGICAL(KIND=4), INTENT(IN) :: SEL_ON - INTEGER(KIND=4) :: SetSelectedOutputOn - END FUNCTION SetSelectedOutputOn + INTEGER(KIND=4) :: SetSelectedOutputFileOn + END FUNCTION SetSelectedOutputFileOn END INTERFACE diff --git a/include/IPhreeqc.h b/include/IPhreeqc.h index 084fde68..f7eb6312 100644 --- a/include/IPhreeqc.h +++ b/include/IPhreeqc.h @@ -6,12 +6,6 @@ #include "Var.h" -#if defined(_WINDLL) -#define DLL_EXPORT __declspec(dllexport) -#else -#define DLL_EXPORT -#endif - /*! \brief Enumeration used to return error codes. */ typedef enum { @@ -35,7 +29,7 @@ extern "C" { * @param line The line(s) to add for input to phreeqc. * @retval IPQ_OK Success * @retval IPQ_OUTOFMEMORY Out of memory - * @see OutputLines, RunAccumulated + * @see OutputAccumulatedLines, RunAccumulated * @par Fortran90 Interface: * @htmlonly * @@ -53,9 +47,9 @@ extern "C" { * \include AccumulateLine.c * * @par Fortran90 Example: - * see \ref GetDumpLine_f90 "GetDumpLine" + * see \ref GetDumpStringLine_f90 "GetDumpStringLine" */ - DLL_EXPORT IPQ_RESULT AccumulateLine(int id, const char *line); + IPQ_DLL_EXPORT IPQ_RESULT AccumulateLine(int id, const char *line); /** @@ -69,16 +63,16 @@ extern "C" { * Not implemented. * @endhtmlonly */ - DLL_EXPORT int AddError(int id, const char* error_msg); + IPQ_DLL_EXPORT int AddError(int id, const char* error_msg); /** * Clears the accumulated input buffer. Input buffer is accumulated from calls to \ref AccumulateLine. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. - * @see AccumulateLine, OutputLines, RunAccumulated + * @see AccumulateLine, OutputAccumulatedLines, RunAccumulated */ - DLL_EXPORT IPQ_RESULT ClearAccumulatedLines(int id); + IPQ_DLL_EXPORT IPQ_RESULT ClearAccumulatedLines(int id); /** @@ -104,7 +98,7 @@ extern "C" { * @par Fortran90 Example: * \include F90CreateIPhreeqc.f90 */ - DLL_EXPORT int CreateIPhreeqc(void); + IPQ_DLL_EXPORT int CreateIPhreeqc(void); /** @@ -131,7 +125,7 @@ extern "C" { * @par Fortran90 Example: * see \ref CreateIPhreeqc_f90 "CreateIPhreeqc" */ - DLL_EXPORT IPQ_RESULT DestroyIPhreeqc(int id); + IPQ_DLL_EXPORT IPQ_RESULT DestroyIPhreeqc(int id); /** @@ -163,7 +157,7 @@ extern "C" { * @par Fortran90 Example: * \include F90GetComponent.f90 */ - DLL_EXPORT const char* GetComponent(int id, int n); + IPQ_DLL_EXPORT const char* GetComponent(int id, int n); /** @@ -190,7 +184,7 @@ extern "C" { * @par Fortran90 Example: * see \ref GetComponent_f90 "GetComponent" */ - DLL_EXPORT int GetComponentCount(int id); + IPQ_DLL_EXPORT int GetComponentCount(int id); /** @@ -200,13 +194,13 @@ extern "C" { * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. * @pre \ref SetDumpStringOn must have been set to true (non-zero). - * @see GetDumpLineCount, SetDumpStringOn + * @see GetDumpStringLineCount, SetDumpStringOn * @par Fortran90 Interface: * @htmlonly * (Note: N is one-based for the Fortran interface.) * *
- *  SUBROUTINE GetDumpLine(ID,N,LINE)
+ *  SUBROUTINE GetDumpStringLine(ID,N,LINE)
  *    INTEGER(KIND=4),   INTENT(IN)   :: ID
  *    INTEGER(KIND=4),   INTENT(IN)   :: N
  *    CHARACTER(LEN=*),  INTENT(OUT)  :: LINE
@@ -215,11 +209,11 @@ extern "C" {
  *  
  *  @endhtmlonly
  *
- *  \anchor GetDumpLine_f90
+ *  \anchor GetDumpStringLine_f90
  *  @par  Fortran90 Example:
- *  \include F90GetDumpLine.f90
+ *  \include F90GetDumpStringLine.f90
  */
-	DLL_EXPORT const char* GetDumpLine(int id, int n);
+	IPQ_DLL_EXPORT const char* GetDumpStringLine(int id, int n);
 
 
 /**
@@ -227,43 +221,43 @@ extern "C" {
  *  @param id            The instance id returned from \ref CreateIPhreeqc.
  *  @return              The number of lines.
  *  @pre                 \ref SetDumpStringOn must have been set to true (non-zero).
- *  @see                 GetDumpLine, SetDumpStringOn
+ *  @see                 GetDumpStringLine, SetDumpStringOn
  *  @par Fortran90 Interface:
  *  @htmlonly
  *  
  *  
- *  FUNCTION GetDumpLineCount(ID)
+ *  FUNCTION GetDumpStringLineCount(ID)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *    INTEGER(KIND=4)               :: GetDumpLineCount
- *  END FUNCTION GetDumpLineCount
+ *    INTEGER(KIND=4)               :: GetDumpStringLineCount
+ *  END FUNCTION GetDumpStringLineCount
  *  
*
* @endhtmlonly * * @par Fortran90 Example: - * see \ref GetDumpLine_f90 "GetDumpLine" + * see \ref GetDumpStringLine_f90 "GetDumpStringLine" */ - DLL_EXPORT int GetDumpLineCount(int id); + IPQ_DLL_EXPORT int GetDumpStringLineCount(int id); /** * Retrieves the current value of the dump file switch. * @param id The instance id returned from \ref CreateIPhreeqc. * @return Non-zero if output is written to the DUMP (dump.out if unspecified) file, 0 (zero) otherwise. - * @see SetDumpOn, GetDumpLineCount, GetDumpLine, GetDumpString + * @see SetDumpFileOn, GetDumpStringLineCount, GetDumpStringLine, GetDumpString * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION GetDumpOn(DUMP_ON)
+ *  FUNCTION GetDumpFileOn(DUMP_ON)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *    LOGICAL(KIND=4)               :: GetDumpOn
- *  END FUNCTION SetDumpOn
+ *    LOGICAL(KIND=4)               :: GetDumpFileOn
+ *  END FUNCTION SetDumpFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT int GetDumpOn(int id); + IPQ_DLL_EXPORT int GetDumpFileOn(int id); /** @@ -273,13 +267,13 @@ extern "C" { * @pre \ref SetDumpStringOn must have been set to true (non-zero) in order to recieve DUMP output. * @see SetDumpStringOn * @par Fortran90 Interface: - * Not implemented. (see \ref GetDumpLineCount, \ref GetDumpLine) + * Not implemented. (see \ref GetDumpStringLineCount, \ref GetDumpStringLine) * * \anchor GetDumpString_c * @par C Example: * \include GetDumpString.c */ - DLL_EXPORT const char* GetDumpString(int id); + IPQ_DLL_EXPORT const char* GetDumpString(int id); /** @@ -299,7 +293,7 @@ extern "C" { *
* @endhtmlonly */ - DLL_EXPORT int GetDumpStringOn(int id); + IPQ_DLL_EXPORT int GetDumpStringOn(int id); /** @@ -307,62 +301,62 @@ extern "C" { * @param id The instance id returned from \ref CreateIPhreeqc. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given error line message. - * @see GetErrorLineCount, OutputError + * @see GetErrorStringLineCount, OutputErrorString * @par Fortran90 Interface: * (Note: N is one-based for the Fortran interface.) * @htmlonly * *
- *  SUBROUTINE GetErrorLine
+ *  SUBROUTINE GetErrorStringLine
  *    INTEGER(KIND=4),   INTENT(IN)   :: ID
  *    INTEGER(KIND=4),   INTENT(IN)   :: N
  *    CHARACTER(LEN=*),  INTENT(OUT)  :: LINE
- *  END SUBROUTINE GetErrorLine
+ *  END SUBROUTINE GetErrorStringLine
  *  
*
* @endhtmlonly */ - DLL_EXPORT const char* GetErrorLine(int id, int n); + IPQ_DLL_EXPORT const char* GetErrorStringLine(int id, int n); /** * Retrieves the number of lines in the current error string buffer. * @param id The instance id returned from \ref CreateIPhreeqc. * @return The number of lines. - * @see GetErrorLine, OutputError + * @see GetErrorStringLine, OutputErrorString * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION GetErrorLineCount
+ *  FUNCTION GetErrorStringLineCount
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *    INTEGER(KIND=4)               :: GetErrorLineCount
- *  END FUNCTION GetErrorLineCount
+ *    INTEGER(KIND=4)               :: GetErrorStringLineCount
+ *  END FUNCTION GetErrorStringLineCount
  *  
*
* @endhtmlonly */ - DLL_EXPORT int GetErrorLineCount(int id); + IPQ_DLL_EXPORT int GetErrorStringLineCount(int id); /** * Retrieves the current value of the error file switch. * @param id The instance id returned from \ref CreateIPhreeqc. * @return Non-zero if errors are written to the phreeqc.err file, 0 (zero) otherwise. - * @see SetErrorOn + * @see SetErrorFileOn * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION GetErrorOn(ERROR_ON)
+ *  FUNCTION GetErrorFileOn(ERROR_ON)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *    LOGICAL(KIND=4)               :: GetErrorOn
- *  END FUNCTION GetErrorOn
+ *    LOGICAL(KIND=4)               :: GetErrorFileOn
+ *  END FUNCTION GetErrorFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT int GetErrorOn(int id); + IPQ_DLL_EXPORT int GetErrorFileOn(int id); /** @@ -370,48 +364,48 @@ extern "C" { * @param id The instance id returned from \ref CreateIPhreeqc. * @return A null terminated string containing error messages. * @par Fortran90 Interface: - * Not implemented. (see \ref GetErrorLineCount, \ref GetErrorLine, \ref OutputError) + * Not implemented. (see \ref GetErrorStringLineCount, \ref GetErrorStringLine, \ref OutputErrorString) */ - DLL_EXPORT const char* GetErrorString(int id); + IPQ_DLL_EXPORT const char* GetErrorString(int id); /** * Retrieves the current value of the log file switch. * @param id The instance id returned from \ref CreateIPhreeqc. * @return Non-zero if output is written to the phreeqc.log file, 0 (zero) otherwise. - * @see SetLogOn + * @see SetLogFileOn * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION GetLogOn(ID)
+ *  FUNCTION GetLogFileOn(ID)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *    LOGICAL(KIND=4)               :: GetLogOn
- *  END FUNCTION GetLogOn
+ *    LOGICAL(KIND=4)               :: GetLogFileOn
+ *  END FUNCTION GetLogFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT int GetLogOn(int id); + IPQ_DLL_EXPORT int GetLogFileOn(int id); /** * Retrieves the current value of the output file switch. * @param id The instance id returned from \ref CreateIPhreeqc. * @return Non-zero if output is written to the phreeqc.out file, 0 (zero) otherwise. - * @see SetOutputOn + * @see SetOutputFileOn * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION GetOutputOn(ID)
+ *  FUNCTION GetOutputFileOn(ID)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *  END FUNCTION GetOutputOn
+ *  END FUNCTION GetOutputFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT int GetOutputOn(int id); + IPQ_DLL_EXPORT int GetOutputFileOn(int id); /** @@ -431,27 +425,27 @@ extern "C" { * * @endhtmlonly */ - DLL_EXPORT int GetSelectedOutputColumnCount(int id); + IPQ_DLL_EXPORT int GetSelectedOutputColumnCount(int id); /** * Retrieves the selected-output file switch. * @param id The instance id returned from \ref CreateIPhreeqc. * @return Non-zero if output is written to the selected-output (selected.out if unspecified) file, 0 (zero) otherwise. - * @see SetSelectedOutputOn + * @see SetSelectedOutputFileOn * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION GetSelectedOutputOn(SELECTED_ON)
+ *  FUNCTION GetSelectedOutputFileOn(SELECTED_ON)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *    LOGICAL(KIND=4)               :: GetSelectedOutputOn
- *  END FUNCTION GetSelectedOutputOn
+ *    LOGICAL(KIND=4)               :: GetSelectedOutputFileOn
+ *  END FUNCTION GetSelectedOutputFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT int GetSelectedOutputOn(int id); + IPQ_DLL_EXPORT int GetSelectedOutputFileOn(int id); /** @@ -471,7 +465,7 @@ extern "C" { * * @endhtmlonly */ - DLL_EXPORT int GetSelectedOutputRowCount(int id); + IPQ_DLL_EXPORT int GetSelectedOutputRowCount(int id); /** @@ -650,7 +644,7 @@ Headings * @param DVALUE Returns the numeric value when (VTYPE=\ref TT_DOUBLE) or (VTYPE=\ref TT_LONG). * @param SVALUE Returns the string variable when (VTYPE=\ref TT_STRING). When (VTYPE=\ref TT_DOUBLE) or (VTYPE=\ref TT_LONG) this variable is filled with a string equivalent of DVALUE. */ - DLL_EXPORT IPQ_RESULT GetSelectedOutputValue(int id, int row, int col, VAR* pVAR); + IPQ_DLL_EXPORT IPQ_RESULT GetSelectedOutputValue(int id, int row, int col, VAR* pVAR); /** @@ -658,52 +652,52 @@ Headings * @param id The instance id returned from \ref CreateIPhreeqc. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given warning line message. - * @see GetWarningLineCount, OutputWarning + * @see GetWarningStringLineCount, OutputWarningString * @par Fortran90 Interface: * (Note: N is one-based for the Fortran interface.) * @htmlonly * *
- *  SUBROUTINE GetWarningLine(ID,N,LINE)
+ *  SUBROUTINE GetWarningStringLine(ID,N,LINE)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
  *    LOGICAL(KIND=4),  INTENT(IN)  :: DUMP_ON
- *  END SUBROUTINE GetWarningLine
+ *  END SUBROUTINE GetWarningStringLine
  *  
*
* @endhtmlonly */ - DLL_EXPORT const char* GetWarningLine(int id, int n); + IPQ_DLL_EXPORT const char* GetWarningStringLine(int id, int n); /** * Retrieves the number of lines in the current warning string buffer. * @param id The instance id returned from \ref CreateIPhreeqc. * @return The number of lines. - * @see GetWarningLine, OutputWarning + * @see GetWarningStringLine, OutputWarningString * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION GetWarningLineCount(ID)
+ *  FUNCTION GetWarningStringLineCount(ID)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *    INTEGER(KIND=4)               :: GetWarningLineCount
- *  END FUNCTION GetWarningLineCount
+ *    INTEGER(KIND=4)               :: GetWarningStringLineCount
+ *  END FUNCTION GetWarningStringLineCount
  *  
*
* @endhtmlonly */ - DLL_EXPORT int GetWarningLineCount(int id); + IPQ_DLL_EXPORT int GetWarningStringLineCount(int id); /** * Retrieves the warning messages from the last call to \ref RunAccumulated, \ref RunFile, \ref RunString, \ref LoadDatabase, or \ref LoadDatabaseString. * @param id The instance id returned from \ref CreateIPhreeqc. * @return A null terminated string containing warning messages. - * @see GetWarningLine, GetWarningLineCount, OutputWarning + * @see GetWarningStringLine, GetWarningStringLineCount, OutputWarningString * @par Fortran90 Interface: - * Not implemented. (see \ref GetWarningLineCount, \ref GetWarningLine, \ref OutputWarning) + * Not implemented. (see \ref GetWarningStringLineCount, \ref GetWarningStringLine, \ref OutputWarningString) */ - DLL_EXPORT const char* GetWarningString(int id); + IPQ_DLL_EXPORT const char* GetWarningString(int id); /** @@ -735,7 +729,7 @@ Headings * @par Fortran90 Example: * see \ref CreateIPhreeqc_f90 "CreateIPhreeqc" */ - DLL_EXPORT int LoadDatabase(int id, const char* filename); + IPQ_DLL_EXPORT int LoadDatabase(int id, const char* filename); /** @@ -759,20 +753,20 @@ Headings * * @endhtmlonly */ - DLL_EXPORT int LoadDatabaseString(int id, const char* input); + IPQ_DLL_EXPORT int LoadDatabaseString(int id, const char* input); /** * Output the error messages normally stored in the phreeqc.err file to stdout. * @param id The instance id returned from \ref CreateIPhreeqc. - * @see GetErrorLine, GetErrorLineCount + * @see GetErrorStringLine, GetErrorStringLineCount * @par Fortran90 Interface: * @htmlonly * *
- *  SUBROUTINE OutputError
+ *  SUBROUTINE OutputErrorString
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *  END SUBROUTINE OutputError
+ *  END SUBROUTINE OutputErrorString
  *  
*
* @endhtmlonly @@ -781,9 +775,9 @@ Headings * see \ref GetComponent_c "GetComponent" * * @par Fortran90 Example: - * see \ref GetDumpLine_f90 "GetDumpLine" + * see \ref GetDumpStringLine_f90 "GetDumpStringLine" */ - DLL_EXPORT void OutputError(int id); + IPQ_DLL_EXPORT void OutputErrorString(int id); /** @@ -794,42 +788,42 @@ Headings * @htmlonly * *
- *  SUBROUTINE OutputLines
+ *  SUBROUTINE OutputAccumulatedLines
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *  END SUBROUTINE OutputLines
+ *  END SUBROUTINE OutputAccumulatedLines
  *  
*
* @endhtmlonly * * @par Fortran90 Example: - * see \ref GetDumpLine_f90 "GetDumpLine" + * see \ref GetDumpStringLine_f90 "GetDumpStringLine" */ - DLL_EXPORT void OutputLines(int id); + IPQ_DLL_EXPORT void OutputAccumulatedLines(int id); /** * Output the warning messages to stdout. * @param id The instance id returned from \ref CreateIPhreeqc. - * @see GetWarningLine, GetWarningLineCount + * @see GetWarningStringLine, GetWarningStringLineCount * @par Fortran90 Interface: * @htmlonly * *
- *  SUBROUTINE OutputWarning
+ *  SUBROUTINE OutputWarningString
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
- *  END SUBROUTINE OutputWarning
+ *  END SUBROUTINE OutputWarningString
  *  
*
* @endhtmlonly */ - DLL_EXPORT void OutputWarning(int id); + IPQ_DLL_EXPORT void OutputWarningString(int id); /** * Runs the input buffer as defined by calls to \ref AccumulateLine. * @param id The instance id returned from \ref CreateIPhreeqc. * @return The number of errors encountered. - * @see AccumulateLine, OutputLines, RunFile, RunString + * @see AccumulateLine, OutputAccumulatedLines, RunFile, RunString * @remarks * The accumulated input is cleared upon a successful run (no errors). * @pre \ref LoadDatabase/\ref LoadDatabaseString must have been called and returned 0 (zero) errors. @@ -845,7 +839,7 @@ Headings * * @endhtmlonly */ - DLL_EXPORT int RunAccumulated(int id); + IPQ_DLL_EXPORT int RunAccumulated(int id); /** @@ -874,7 +868,7 @@ Headings * @par Fortran90 Example: * see \ref CreateIPhreeqc_f90 "CreateIPhreeqc" */ - DLL_EXPORT int RunFile(int id, const char* filename); + IPQ_DLL_EXPORT int RunFile(int id, const char* filename); /** @@ -897,7 +891,7 @@ Headings * * @endhtmlonly */ - DLL_EXPORT int RunString(int id, const char* input); + IPQ_DLL_EXPORT int RunString(int id, const char* input); /** @@ -907,20 +901,20 @@ Headings * @param dump_on If non-zero turns on output to the DUMP (dump.out if unspecified) file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. - * @see GetDumpOn, GetDumpString, GetDumpLine, GetDumpLineCount, SetDumpStringOn + * @see GetDumpFileOn, GetDumpString, GetDumpStringLine, GetDumpStringLineCount, SetDumpStringOn * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION SetDumpOn(ID,DUMP_ON)
+ *  FUNCTION SetDumpFileOn(ID,DUMP_ON)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
  *    LOGICAL(KIND=4),  INTENT(IN)  :: DUMP_ON
- *  END FUNCTION SetDumpOn
+ *  END FUNCTION SetDumpFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT IPQ_RESULT SetDumpOn(int id, int dump_on); + IPQ_DLL_EXPORT IPQ_RESULT SetDumpFileOn(int id, int dump_on); /** @@ -931,7 +925,7 @@ Headings * @param dump_string_on If non-zero captures the output defined by the DUMP keyword into a string buffer. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. - * @see GetDumpStringOn, GetDumpString, GetDumpLine, GetDumpLineCount + * @see GetDumpStringOn, GetDumpString, GetDumpStringLine, GetDumpStringLineCount * @par Fortran90 Interface: * @htmlonly * @@ -948,9 +942,9 @@ Headings * see \ref GetDumpString_c "GetDumpString" * * @par Fortran90 Example: - * see \ref GetDumpLine_f90 "GetDumpLine" + * see \ref GetDumpStringLine_f90 "GetDumpStringLine" */ - DLL_EXPORT IPQ_RESULT SetDumpStringOn(int id, int dump_string_on); + IPQ_DLL_EXPORT IPQ_RESULT SetDumpStringOn(int id, int dump_string_on); /** @@ -961,20 +955,20 @@ Headings * @param error_on If non-zero turns on output to the phreeqc.err file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. - * @see OutputError, GetErrorLine, GetErrorLineCount + * @see OutputErrorString, GetErrorStringLine, GetErrorStringLineCount * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION SetErrorOn(ERROR_ON)
+ *  FUNCTION SetErrorFileOn(ERROR_ON)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
  *    LOGICAL(KIND=4),  INTENT(IN)  :: ERROR_ON
- *  END FUNCTION SetErrorOn
+ *  END FUNCTION SetErrorFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT IPQ_RESULT SetErrorOn(int id, int error_on); + IPQ_DLL_EXPORT IPQ_RESULT SetErrorFileOn(int id, int error_on); /** @@ -985,21 +979,21 @@ Headings * @param log_on If non-zero turns on output to the phreeqc.log file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. - * @see GetLogOn + * @see GetLogFileOn * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION SetLogOn(ID,LOG_ON)
+ *  FUNCTION SetLogFileOn(ID,LOG_ON)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
  *    LOGICAL(KIND=4),  INTENT(IN)  :: LOG_ON
- *    INTEGER(KIND=4)               :: SetLogOn
- *  END FUNCTION SetLogOn
+ *    INTEGER(KIND=4)               :: SetLogFileOn
+ *  END FUNCTION SetLogFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT IPQ_RESULT SetLogOn(int id, int log_on); + IPQ_DLL_EXPORT IPQ_RESULT SetLogFileOn(int id, int log_on); /** @@ -1010,21 +1004,21 @@ Headings * @param output_on If non-zero turns on output to the phreeqc.out file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. - * @see GetOutputOn + * @see GetOutputFileOn * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION SetOutputOn(ID,OUTPUT_ON)
+ *  FUNCTION SetOutputFileOn(ID,OUTPUT_ON)
  *    INTEGER(KIND=4),  INTENT(IN)  :: ID
  *    LOGICAL(KIND=4),  INTENT(IN)  :: OUTPUT_ON
- *    INTEGER(KIND=4)               :: SetOutputOn
- *  END FUNCTION SetOutputOn
+ *    INTEGER(KIND=4)               :: SetOutputFileOn
+ *  END FUNCTION SetOutputFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT IPQ_RESULT SetOutputOn(int id, int output_on); + IPQ_DLL_EXPORT IPQ_RESULT SetOutputFileOn(int id, int output_on); /** @@ -1034,21 +1028,21 @@ Headings * @param sel_on If non-zero turns on output to the SELECTED_OUTPUT (selected.out if unspecified) file. * @retval IPQ_OK Success. * @retval IPQ_BADINSTANCE The given id is invalid. - * @see GetSelectedOutputOn + * @see GetSelectedOutputFileOn * @par Fortran90 Interface: * @htmlonly * *
- *  FUNCTION SetSelectedOutputOn(ID,SEL_ON)
+ *  FUNCTION SetSelectedOutputFileOn(ID,SEL_ON)
  *    INTEGER(KIND=4),  INTENT(IN) :: ID
  *    LOGICAL(KIND=4),  INTENT(IN) :: SEL_ON
- *    INTEGER(KIND=4)              :: SetSelectedOutputOn
- *  END FUNCTION SetSelectedOutputOn
+ *    INTEGER(KIND=4)              :: SetSelectedOutputFileOn
+ *  END FUNCTION SetSelectedOutputFileOn
  *  
*
* @endhtmlonly */ - DLL_EXPORT IPQ_RESULT SetSelectedOutputOn(int id, int sel_on); + IPQ_DLL_EXPORT IPQ_RESULT SetSelectedOutputFileOn(int id, int sel_on); @@ -1063,7 +1057,7 @@ Headings * Use of the method is not normally necessary. It is called automatically * before each call to \ref LoadDatabase or \ref LoadDatabaseString. */ - DLL_EXPORT IPQ_RESULT UnLoadDatabase(int id); + IPQ_DLL_EXPORT IPQ_RESULT UnLoadDatabase(int id); // TODO 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); diff --git a/include/IPhreeqc.hpp b/include/IPhreeqc.hpp index b4305d74..eb4242df 100644 --- a/include/IPhreeqc.hpp +++ b/include/IPhreeqc.hpp @@ -80,7 +80,7 @@ public: /** * Clears the accumulated input buffer. Input buffer is accumulated from calls to \ref AccumulateLine. - * @see AccumulateLine, GetAccumulatedLines, OutputLines, RunAccumulated + * @see AccumulateLine, GetAccumulatedLines, OutputAccumulatedLines, RunAccumulated */ void ClearAccumulatedLines(void); @@ -114,32 +114,32 @@ public: * @return A null terminated string containing the given line. * Returns an empty string if n is out of range. * @pre \ref SetDumpStringOn must have been set to true. - * @see GetDumpLineCount, GetDumpStringOn, GetDumpOn, GetDumpString, SetDumpOn, SetDumpStringOn + * @see GetDumpStringLineCount, GetDumpStringOn, GetDumpFileOn, GetDumpString, SetDumpFileOn, SetDumpStringOn */ - const char* GetDumpLine(int n); + const char* GetDumpStringLine(int n); /** * Retrieves the number of lines in the current dump string buffer. * @return The number of lines. * @pre \ref SetDumpStringOn must have been set to true. - * @see GetDumpLine, GetDumpStringOn, GetDumpOn, GetDumpString, SetDumpOn, SetDumpStringOn + * @see GetDumpStringLine, GetDumpStringOn, GetDumpFileOn, GetDumpString, SetDumpFileOn, SetDumpStringOn */ - int GetDumpLineCount(void)const; + int GetDumpStringLineCount(void)const; /** * Retrieves the current value of the dump file switch. * @retval true Output is written to the DUMP (dump.out if unspecified) file. * @retval false No output is written. - * @see GetDumpLine, GetDumpLineCount, GetDumpStringOn, GetDumpString, SetDumpOn, SetDumpStringOn + * @see GetDumpStringLine, GetDumpStringLineCount, GetDumpStringOn, GetDumpString, SetDumpFileOn, SetDumpStringOn */ - bool GetDumpOn(void)const; + bool GetDumpFileOn(void)const; /** * Retrieves the string buffer containing DUMP output. * @return A null terminated string containing DUMP output. * @pre * \ref SetDumpStringOn must have been set to true in order to recieve DUMP output. - * @see GetDumpLine, GetDumpOn, GetDumpLineCount, GetDumpStringOn, SetDumpOn, SetDumpStringOn + * @see GetDumpStringLine, GetDumpFileOn, GetDumpStringLineCount, GetDumpStringOn, SetDumpFileOn, SetDumpStringOn */ const char* GetDumpString(void); @@ -147,7 +147,7 @@ public: * Retrieves the current value of the dump string switch. * @retval true Output defined by the DUMP keyword is stored. * @retval false No output is stored. - * @see GetDumpLine, GetDumpOn, GetDumpString, GetDumpLineCount, SetDumpOn, SetDumpStringOn + * @see GetDumpStringLine, GetDumpFileOn, GetDumpString, GetDumpStringLineCount, SetDumpFileOn, SetDumpStringOn */ bool GetDumpStringOn(void)const; @@ -155,29 +155,29 @@ public: * Retrieves the given error line. * @return A null terminated string containing the given error line message. * @param n The zero-based index of the line to retrieve. - * @see GetErrorLineCount, OutputError + * @see GetErrorStringLineCount, OutputErrorString */ - const char* GetErrorLine(int n); + const char* GetErrorStringLine(int n); /** * Retrieves the number of lines in the current error string buffer. * @return The number of lines. - * @see GetErrorLine, OutputError + * @see GetErrorStringLine, OutputErrorString */ - int GetErrorLineCount(void)const; + int GetErrorStringLineCount(void)const; /** * Retrieves the current value of the error file switch. * @retval true Errors are written to the phreeqc.err file. * @retval false No output is written. - * @see SetErrorOn + * @see SetErrorFileOn */ - bool GetErrorOn(void)const; + bool GetErrorFileOn(void)const; /** * Retrieves the error messages from the last call to \ref RunAccumulated, \ref RunFile, \ref RunString, \ref LoadDatabase, or \ref LoadDatabaseString. * @return A null terminated string containing error messages. - * @see GetErrorLine, GetErrorLineCount, GetErrorOn, OutputError, SetErrorOn + * @see GetErrorStringLine, GetErrorStringLineCount, GetErrorFileOn, OutputErrorString, SetErrorFileOn */ const char* GetErrorString(void); @@ -185,17 +185,17 @@ public: * Retrieves the current value of the log file switch. * @retval true Output is written to the phreeqc.log file. * @retval false No output is written. - * @see SetLogOn + * @see SetLogFileOn */ - bool GetLogOn(void)const; + bool GetLogFileOn(void)const; /** * Retrieves the current value of the output file switch. * @retval true Output is written to the phreeqc.out file. * @retval false No output is written. - * @see SetOutputOn + * @see SetOutputFileOn */ - bool GetOutputOn(void)const; + bool GetOutputFileOn(void)const; /** * Returns the number of columns currently contained within selected-output buffer. @@ -208,14 +208,14 @@ public: * Retrieves the selected-output file switch. * @retval true Output is written to the selected-output (selected.out if unspecified) file. * @retval false No output is written. - * @see GetSelectedOutputValue, GetSelectedOutputColumnCount, GetSelectedOutputRowCount, SetSelectedOutputOn + * @see GetSelectedOutputValue, GetSelectedOutputColumnCount, GetSelectedOutputRowCount, SetSelectedOutputFileOn */ - bool GetSelectedOutputOn(void)const; + bool GetSelectedOutputFileOn(void)const; /** * Returns the number of rows currently contained within the selected-output buffer. * @return The number of rows. - * @see GetSelectedOutputColumnCount, GetSelectedOutputOn, GetSelectedOutputValue, SetSelectedOutputOn + * @see GetSelectedOutputColumnCount, GetSelectedOutputFileOn, GetSelectedOutputValue, SetSelectedOutputFileOn */ int GetSelectedOutputRowCount(void)const; @@ -229,7 +229,7 @@ public: * @retval VR_INVALIDCOL The given column is out of range. * @retval VR_OUTOFMEMORY Memory could not be allocated. * @retval VR_BADINSTANCE The given id is invalid. - * @see GetSelectedOutputColumnCount, GetSelectedOutputOn, GetSelectedOutputRowCount, SetSelectedOutputOn + * @see GetSelectedOutputColumnCount, GetSelectedOutputFileOn, GetSelectedOutputRowCount, SetSelectedOutputFileOn * @remarks * Row 0 contains the column headings to the selected_ouput. * @par Examples: @@ -377,21 +377,21 @@ public: * Retrieves the given warning line. * @param n The zero-based index of the line to retrieve. * @return A null terminated string containing the given warning line message. - * @see GetWarningLineCount, OutputWarning + * @see GetWarningStringLineCount, OutputWarningString */ - const char* GetWarningLine(int n); + const char* GetWarningStringLine(int n); /** * Retrieves the number of lines in the current warning string buffer. * @return The number of lines. - * @see GetWarningLine, GetWarningString, OutputWarning + * @see GetWarningStringLine, GetWarningString, OutputWarningString */ - int GetWarningLineCount(void)const; + int GetWarningStringLineCount(void)const; /** * Retrieves the warning messages from the last call to \ref RunAccumulated, \ref RunFile, \ref RunString, \ref LoadDatabase, or \ref LoadDatabaseString. * @return A null terminated string containing warning messages. - * @see GetWarningLine, GetWarningLineCount, OutputWarning + * @see GetWarningStringLine, GetWarningStringLineCount, OutputWarningString */ const char* GetWarningString(void); @@ -426,26 +426,26 @@ public: /** * Output the error messages normally stored in the phreeqc.err file to stdout. - * @see GetErrorLine, GetErrorLineCount, GetErrorOn, SetErrorOn + * @see GetErrorStringLine, GetErrorStringLineCount, GetErrorFileOn, SetErrorFileOn */ - void OutputError(void); + void OutputErrorString(void); /** * Output the accumulated input buffer to stdout. The input buffer can be run with a call to \ref RunAccumulated. * @see AccumulateLine, ClearAccumulatedLines, RunAccumulated */ - void OutputLines(void); + void OutputAccumulatedLines(void); /** * Output the warning messages to stdout. - * @see GetWarningLine, GetWarningLineCount, GetWarningString + * @see GetWarningStringLine, GetWarningStringLineCount, GetWarningString */ - void OutputWarning(void); + void OutputWarningString(void); /** * Runs the input buffer as defined by calls to \ref AccumulateLine. * @return The number of errors encountered. - * @see AccumulateLine, ClearAccumulatedLines, OutputLines, RunFile, RunString + * @see AccumulateLine, ClearAccumulatedLines, OutputAccumulatedLines, RunFile, RunString * @remarks * The accumulated input is cleared upon a successful run (no errors). * @pre @@ -477,15 +477,15 @@ public: * Sets the dump file switch on or off. This switch controls whether or not phreeqc writes to the dump file. * The initial setting is false. * @param bValue If true, turns on output to the DUMP (dump.out if unspecified) file. - * @see GetDumpLine, GetDumpLineCount, GetDumpOn, GetDumpString, GetDumpStringOn, SetDumpStringOn + * @see GetDumpStringLine, GetDumpStringLineCount, GetDumpFileOn, GetDumpString, GetDumpStringOn, SetDumpStringOn */ - void SetDumpOn(bool bValue); + void SetDumpFileOn(bool bValue); /** * Sets the dump string switch on or off. This switch controls whether or not the data normally sent * to the dump file are stored in a buffer for retrieval. The initial setting is false. * @param bValue If true, captures the output defined by the DUMP keyword into a string buffer. - * @see GetDumpLine, GetDumpLineCount, GetDumpString, GetDumpStringOn + * @see GetDumpStringLine, GetDumpStringLineCount, GetDumpString, GetDumpStringOn */ void SetDumpStringOn(bool bValue); @@ -493,34 +493,34 @@ public: * Sets the error file switch on or off. This switch controls whether or not * error messages are written to the error file. The initial setting is false. * @param bValue If true, turns on output to the phreeqc.err file. - * @see GetErrorLine, GetErrorLineCount, GetErrorOn, OutputError + * @see GetErrorStringLine, GetErrorStringLineCount, GetErrorFileOn, OutputErrorString */ - void SetErrorOn(bool bValue); + void SetErrorFileOn(bool bValue); /** * Sets the log file switch on or off. This switch controls whether or not phreeqc * writes log messages to the log file. The initial setting is false. * @param bValue If true, turns on output to the phreeqc.log file. - * @see GetLogOn + * @see GetLogFileOn */ - void SetLogOn(bool bValue); + void SetLogFileOn(bool bValue); /** * Sets the output file switch on or off. This switch controls whether or not phreeqc * writes to the output file. This is the output that is normally generated * when phreeqc is run. The initial setting is false. * @param bValue If true, turns on output to the phreeqc.out file. - * @see GetOutputOn + * @see GetOutputFileOn */ - void SetOutputOn(bool bValue); + void SetOutputFileOn(bool bValue); /** * Sets the selected-output file switch on or off. This switch controls whether or not phreeqc writes output to * the selected-output file. The initial setting is false. * @param bValue If true, turns on output to the SELECTED_OUTPUT (selected.out if unspecified) file. - * @see GetSelectedOutputColumnCount, GetSelectedOutputOn, GetSelectedOutputRowCount, GetSelectedOutputValue + * @see GetSelectedOutputColumnCount, GetSelectedOutputFileOn, GetSelectedOutputRowCount, GetSelectedOutputValue */ - void SetSelectedOutputOn(bool bValue); + void SetSelectedOutputFileOn(bool bValue); /** * Unloads the database currently loaded into phreeqc. In addition, all @@ -553,6 +553,7 @@ protected: protected: bool DatabaseLoaded; + bool ClearAccumulatedLinesOnNextAccumulate; bool SelectedOutputOn; bool OutputOn; bool LogOn; diff --git a/include/Var.h b/include/Var.h index cdda7384..57bc1c21 100644 --- a/include/Var.h +++ b/include/Var.h @@ -7,9 +7,9 @@ #define __VAR_H_INC #if defined(_WINDLL) -#define DLL_EXPORT __declspec(dllexport) +#define IPQ_DLL_EXPORT __declspec(dllexport) #else -#define DLL_EXPORT +#define IPQ_DLL_EXPORT #endif /*! \brief Enumeration used to determine the type of data stored in a VAR. @@ -53,14 +53,14 @@ extern "C" { /** Initializes a VAR. * @param pvar Pointer to the VAR that will be initialized. */ -DLL_EXPORT void VarInit(VAR* pvar); +IPQ_DLL_EXPORT void VarInit(VAR* pvar); /** Clears a VAR. * @param pvar Pointer to the VAR that will be freed and initialized. * @retval VR_OK Success. * @retval VR_BADVARTYPE The \c VAR was invalid (probably uninitialized). */ -DLL_EXPORT VRESULT VarClear(VAR* pvar); +IPQ_DLL_EXPORT VRESULT VarClear(VAR* pvar); /** Frees the destination VAR and makes a copy of the source VAR. * @param pvarDest Pointer to the VAR to receive the copy. @@ -70,19 +70,19 @@ DLL_EXPORT VRESULT VarClear(VAR* pvar); * @retval VR_OUTOFMEMORY Memory could not be allocated for the copy. * @return The return value is one of the following. */ -DLL_EXPORT VRESULT VarCopy(VAR* pvarDest, const VAR* pvarSrc); +IPQ_DLL_EXPORT VRESULT VarCopy(VAR* pvarDest, const VAR* pvarSrc); /** Allocates a new string for use in a VAR and copies the passed string into it. * @param pSrc Pointer to the VAR that will be initialized. * @return A pointer to the string on success NULL otherwise. */ -DLL_EXPORT char* VarAllocString(const char* pSrc); +IPQ_DLL_EXPORT char* VarAllocString(const char* pSrc); /** Frees a string allocated using VarAllocString. * @param pSrc Pointer to the string to be freed. */ -DLL_EXPORT void VarFreeString(char* pSrc); +IPQ_DLL_EXPORT void VarFreeString(char* pSrc); #if defined(__cplusplus) } diff --git a/src/IPhreeqc.cpp b/src/IPhreeqc.cpp index 9648299a..baf787c2 100644 --- a/src/IPhreeqc.cpp +++ b/src/IPhreeqc.cpp @@ -37,6 +37,7 @@ int istream_getc(void *cookie) IPhreeqc::IPhreeqc(void) : DatabaseLoaded(false) +, ClearAccumulatedLinesOnNextAccumulate(false) , SelectedOutputOn(false) , OutputOn(false) , LogOn(false) @@ -282,17 +283,17 @@ const std::string& IPhreeqc::GetAccumulatedLines(void) return this->StringInput; } -void IPhreeqc::OutputError(void) +void IPhreeqc::OutputErrorString(void) { std::cout << this->GetErrorString() << std::endl; } -void IPhreeqc::OutputWarning(void) +void IPhreeqc::OutputWarningString(void) { std::cout << this->GetWarningString() << std::endl; } -void IPhreeqc::OutputLines(void) +void IPhreeqc::OutputAccumulatedLines(void) { std::cout << this->StringInput.c_str() << std::endl; } @@ -418,42 +419,42 @@ void IPhreeqc::UnLoadDatabase(void) this->PhreeqcPtr->input_error = 0; } -bool IPhreeqc::GetOutputOn(void)const +bool IPhreeqc::GetOutputFileOn(void)const { return this->OutputOn; } -void IPhreeqc::SetOutputOn(bool bValue) +void IPhreeqc::SetOutputFileOn(bool bValue) { this->OutputOn = bValue; } -bool IPhreeqc::GetSelectedOutputOn(void)const +bool IPhreeqc::GetSelectedOutputFileOn(void)const { return this->SelectedOutputOn; } -void IPhreeqc::SetSelectedOutputOn(bool bValue) +void IPhreeqc::SetSelectedOutputFileOn(bool bValue) { this->SelectedOutputOn = bValue; } -bool IPhreeqc::GetLogOn(void)const +bool IPhreeqc::GetLogFileOn(void)const { return this->LogOn; } -void IPhreeqc::SetLogOn(bool bValue) +void IPhreeqc::SetLogFileOn(bool bValue) { this->LogOn = bValue; } -bool IPhreeqc::GetDumpOn(void)const +bool IPhreeqc::GetDumpFileOn(void)const { return this->DumpOn; } -void IPhreeqc::SetDumpOn(bool bValue) +void IPhreeqc::SetDumpFileOn(bool bValue) { this->DumpOn = bValue; } @@ -468,12 +469,12 @@ void IPhreeqc::SetDumpStringOn(bool bValue) this->DumpStringOn = bValue; } -bool IPhreeqc::GetErrorOn(void)const +bool IPhreeqc::GetErrorFileOn(void)const { return this->ErrorOn; } -void IPhreeqc::SetErrorOn(bool bValue) +void IPhreeqc::SetErrorFileOn(bool bValue) { this->ErrorOn = bValue; } @@ -1025,6 +1026,12 @@ VRESULT IPhreeqc::AccumulateLine(const char *line) { try { + if (this->ClearAccumulatedLinesOnNextAccumulate) + { + this->ClearAccumulatedLines(); + this->ClearAccumulatedLinesOnNextAccumulate = false; + } + this->ErrorReporter->Clear(); this->WarningReporter->Clear(); this->StringInput.append(line); @@ -1071,11 +1078,7 @@ int IPhreeqc::RunAccumulated(void) } } - if (this->PhreeqcPtr->input_error == 0) - { - this->ClearAccumulatedLines(); - } - + this->ClearAccumulatedLinesOnNextAccumulate = true; this->PhreeqcPtr->close_output_files(); this->update_errors(); @@ -1214,45 +1217,45 @@ VRESULT IPhreeqc::GetSelectedOutputValue(int row, int col, VAR* pVAR) return v; } -int IPhreeqc::GetDumpLineCount(void)const +int IPhreeqc::GetDumpStringLineCount(void)const { return (int)this->DumpLines.size(); } -const char* IPhreeqc::GetDumpLine(int n) +const char* IPhreeqc::GetDumpStringLine(int n) { static const char empty[] = ""; - if (n < 0 || n >= this->GetDumpLineCount()) + if (n < 0 || n >= this->GetDumpStringLineCount()) { return empty; } return this->DumpLines[n].c_str(); } -int IPhreeqc::GetErrorLineCount(void)const +int IPhreeqc::GetErrorStringLineCount(void)const { return (int)this->ErrorLines.size(); } -const char* IPhreeqc::GetErrorLine(int n) +const char* IPhreeqc::GetErrorStringLine(int n) { static const char empty[] = ""; - if (n < 0 || n >= this->GetErrorLineCount()) + if (n < 0 || n >= this->GetErrorStringLineCount()) { return empty; } return this->ErrorLines[n].c_str(); } -int IPhreeqc::GetWarningLineCount(void)const +int IPhreeqc::GetWarningStringLineCount(void)const { return (int)this->WarningLines.size(); } -const char* IPhreeqc::GetWarningLine(int n) +const char* IPhreeqc::GetWarningStringLine(int n) { static const char empty[] = ""; - if (n < 0 || n >= this->GetWarningLineCount()) + if (n < 0 || n >= this->GetWarningStringLineCount()) { return empty; } diff --git a/src/IPhreeqcF.f b/src/IPhreeqcF.f index 99276033..a08350ef 100644 --- a/src/IPhreeqcF.f +++ b/src/IPhreeqcF.f @@ -49,35 +49,35 @@ GetComponentCount = GetComponentCountF(ID) END FUNCTION GetComponentCount !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetDumpLine(ID,N,LINE) + FUNCTION GetDumpStringLine(ID,N,LINE) IMPLICIT NONE INTEGER(KIND=4) :: ID INTEGER(KIND=4) :: N CHARACTER(LEN=*) :: LINE - INTEGER(KIND=4) :: GetDumpLine - INTEGER(KIND=4) :: GetDumpLineF - GetDumpLine = GetDumpLineF(ID,N,LINE) - END FUNCTION GetDumpLine + INTEGER(KIND=4) :: GetDumpStringLine + INTEGER(KIND=4) :: GetDumpStringLineF + GetDumpStringLine = GetDumpStringLineF(ID,N,LINE) + END FUNCTION GetDumpStringLine !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetDumpLineCount(ID) + FUNCTION GetDumpStringLineCount(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - INTEGER(KIND=4) :: GetDumpLineCount - INTEGER(KIND=4) :: GetDumpLineCountF - GetDumpLineCount = GetDumpLineCountF(ID) - END FUNCTION GetDumpLineCount + INTEGER(KIND=4) :: GetDumpStringLineCount + INTEGER(KIND=4) :: GetDumpStringLineCountF + GetDumpStringLineCount = GetDumpStringLineCountF(ID) + END FUNCTION GetDumpStringLineCount !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetDumpOn(ID) + FUNCTION GetDumpFileOn(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: GetDumpOn - INTEGER(KIND=4) :: GetDumpOnF - IF (GetDumpOnF(ID).EQ.0) THEN - GetDumpOn = .FALSE. + LOGICAL(KIND=4) :: GetDumpFileOn + INTEGER(KIND=4) :: GetDumpFileOnF + IF (GetDumpFileOnF(ID).EQ.0) THEN + GetDumpFileOn = .FALSE. ELSE - GetDumpOn = .TRUE. + GetDumpFileOn = .TRUE. ENDIF - END FUNCTION GetDumpOn + END FUNCTION GetDumpFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION GetDumpStringOn(ID) IMPLICIT NONE @@ -91,59 +91,59 @@ ENDIF END FUNCTION GetDumpStringOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetErrorLine(ID,N,LINE) + FUNCTION GetErrorStringLine(ID,N,LINE) IMPLICIT NONE INTEGER(KIND=4) :: ID INTEGER(KIND=4) :: N CHARACTER(LEN=*) :: LINE - INTEGER(KIND=4) :: GetErrorLine - INTEGER(KIND=4) :: GetErrorLineF - GetErrorLine = GetErrorLineF(ID,N,LINE) - END FUNCTION GetErrorLine + INTEGER(KIND=4) :: GetErrorStringLine + INTEGER(KIND=4) :: GetErrorStringLineF + GetErrorStringLine = GetErrorStringLineF(ID,N,LINE) + END FUNCTION GetErrorStringLine !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetErrorLineCount(ID) + FUNCTION GetErrorStringLineCount(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - INTEGER(KIND=4) :: GetErrorLineCount - INTEGER(KIND=4) :: GetErrorLineCountF - GetErrorLineCount = GetErrorLineCountF(ID) - END FUNCTION GetErrorLineCount + INTEGER(KIND=4) :: GetErrorStringLineCount + INTEGER(KIND=4) :: GetErrorStringLineCountF + GetErrorStringLineCount = GetErrorStringLineCountF(ID) + END FUNCTION GetErrorStringLineCount !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetErrorOn(ID) + FUNCTION GetErrorFileOn(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: GetErrorOn - INTEGER(KIND=4) :: GetErrorOnF - IF (GetErrorOnF(ID).EQ.0) THEN - GetErrorOn = .FALSE. + LOGICAL(KIND=4) :: GetErrorFileOn + INTEGER(KIND=4) :: GetErrorFileOnF + IF (GetErrorFileOnF(ID).EQ.0) THEN + GetErrorFileOn = .FALSE. ELSE - GetErrorOn = .TRUE. + GetErrorFileOn = .TRUE. ENDIF - END FUNCTION GetErrorOn + END FUNCTION GetErrorFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetLogOn(ID) + FUNCTION GetLogFileOn(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: GetLogOn - INTEGER(KIND=4) :: GetLogOnF - IF (GetLogOnF(ID).EQ.0) THEN - GetLogOn = .FALSE. + LOGICAL(KIND=4) :: GetLogFileOn + INTEGER(KIND=4) :: GetLogFileOnF + IF (GetLogFileOnF(ID).EQ.0) THEN + GetLogFileOn = .FALSE. ELSE - GetLogOn = .TRUE. + GetLogFileOn = .TRUE. ENDIF - END FUNCTION GetLogOn + END FUNCTION GetLogFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetOutputOn(ID) + FUNCTION GetOutputFileOn(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: GetOutputOn - INTEGER(KIND=4) :: GetOutputOnF - IF (GetOutputOnF(ID).EQ.0) THEN - GetOutputOn = .FALSE. + LOGICAL(KIND=4) :: GetOutputFileOn + INTEGER(KIND=4) :: GetOutputFileOnF + IF (GetOutputFileOnF(ID).EQ.0) THEN + GetOutputFileOn = .FALSE. ELSE - GetOutputOn = .TRUE. + GetOutputFileOn = .TRUE. ENDIF - END FUNCTION GetOutputOn + END FUNCTION GetOutputFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION GetSelectedOutputColumnCount(ID) IMPLICIT NONE @@ -153,17 +153,17 @@ GetSelectedOutputColumnCount = GetSelectedOutputColumnCountF(ID) END FUNCTION GetSelectedOutputColumnCount !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetSelectedOutputOn(ID) + FUNCTION GetSelectedOutputFileOn(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - LOGICAL(KIND=4) :: GetSelectedOutputOn - INTEGER(KIND=4) :: GetSelectedOutputOnF - IF (GetSelectedOutputOnF(ID).EQ.0) THEN - GetSelectedOutputOn = .FALSE. + LOGICAL(KIND=4) :: GetSelectedOutputFileOn + INTEGER(KIND=4) :: GetSelectedOutputFileOnF + IF (GetSelectedOutputFileOnF(ID).EQ.0) THEN + GetSelectedOutputFileOn = .FALSE. ELSE - GetSelectedOutputOn = .TRUE. + GetSelectedOutputFileOn = .TRUE. ENDIF - END FUNCTION GetSelectedOutputOn + END FUNCTION GetSelectedOutputFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION GetSelectedOutputRowCount(ID) IMPLICIT NONE @@ -187,23 +187,23 @@ & COL,VTYPE,DVALUE,SVALUE) END FUNCTION GetSelectedOutputValue !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetWarningLine(ID,N,LINE) + FUNCTION GetWarningStringLine(ID,N,LINE) IMPLICIT NONE INTEGER(KIND=4) :: ID INTEGER(KIND=4) :: N CHARACTER(LEN=*) :: LINE - INTEGER(KIND=4) :: GetWarningLine - INTEGER(KIND=4) :: GetWarningLineF - GetWarningLine = GetWarningLineF(ID,N,LINE) - END FUNCTION GetWarningLine + INTEGER(KIND=4) :: GetWarningStringLine + INTEGER(KIND=4) :: GetWarningStringLineF + GetWarningStringLine = GetWarningStringLineF(ID,N,LINE) + END FUNCTION GetWarningStringLine !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION GetWarningLineCount(ID) + FUNCTION GetWarningStringLineCount(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - INTEGER(KIND=4) :: GetWarningLineCount - INTEGER(KIND=4) :: GetWarningLineCountF - GetWarningLineCount = GetWarningLineCountF(ID) - END FUNCTION GetWarningLineCount + INTEGER(KIND=4) :: GetWarningStringLineCount + INTEGER(KIND=4) :: GetWarningStringLineCountF + GetWarningStringLineCount = GetWarningStringLineCountF(ID) + END FUNCTION GetWarningStringLineCount !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION LoadDatabase(ID,FILENAME) IMPLICIT NONE @@ -223,68 +223,68 @@ LoadDatabaseString = LoadDatabaseStringF(ID,INPUT) END FUNCTION LoadDatabaseString !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - SUBROUTINE OutputError(ID) + SUBROUTINE OutputErrorString(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - CALL OutputErrorF(ID) - END SUBROUTINE OutputError + CALL OutputErrorStringF(ID) + END SUBROUTINE OutputErrorString !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - SUBROUTINE OutputLines(ID) + SUBROUTINE OutputAccumulatedLines(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - CALL OutputLinesF(ID) - END SUBROUTINE OutputLines + CALL OutputAccumulatedLinesF(ID) + END SUBROUTINE OutputAccumulatedLines !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - SUBROUTINE OutputWarning(ID) + SUBROUTINE OutputWarningString(ID) IMPLICIT NONE INTEGER(KIND=4) :: ID - CALL OutputWarningF(ID) - END SUBROUTINE OutputWarning + CALL OutputWarningStringF(ID) + END SUBROUTINE OutputWarningString !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetSelectedOutputOn(ID,SELECTED_ON) + FUNCTION SetSelectedOutputFileOn(ID,SELECTED_ON) IMPLICIT NONE INTEGER(KIND=4) :: ID LOGICAL(KIND=4) :: SELECTED_ON - INTEGER(KIND=4) :: SetSelectedOutputOn - INTEGER(KIND=4) :: SetSelectedOutputOnF - SetSelectedOutputOn = SetSelectedOutputOnF(ID,SELECTED_ON) - END FUNCTION SetSelectedOutputOn + INTEGER(KIND=4) :: SetSelectedOutputFileOn + INTEGER(KIND=4) :: SetSelOutFileOnF + SetSelectedOutputFileOn = SetSelOutFileOnF(ID,SELECTED_ON) + END FUNCTION SetSelectedOutputFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetOutputOn(ID,OUTPUT_ON) + FUNCTION SetOutputFileOn(ID,OUTPUT_ON) IMPLICIT NONE INTEGER(KIND=4) :: ID LOGICAL(KIND=4) :: OUTPUT_ON - INTEGER(KIND=4) :: SetOutputOn - INTEGER(KIND=4) :: SetOutputOnF - SetOutputOn = SetOutputOnF(ID,OUTPUT_ON) - END FUNCTION SetOutputOn + INTEGER(KIND=4) :: SetOutputFileOn + INTEGER(KIND=4) :: SetOutputFileOnF + SetOutputFileOn = SetOutputFileOnF(ID,OUTPUT_ON) + END FUNCTION SetOutputFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetErrorOn(ID,ERROR_ON) + FUNCTION SetErrorFileOn(ID,ERROR_ON) IMPLICIT NONE INTEGER(KIND=4) :: ID LOGICAL(KIND=4) :: ERROR_ON - INTEGER(KIND=4) :: SetErrorOn - INTEGER(KIND=4) :: SetErrorOnF - SetErrorOn = SetErrorOnF(ID,ERROR_ON) - END FUNCTION SetErrorOn + INTEGER(KIND=4) :: SetErrorFileOn + INTEGER(KIND=4) :: SetErrorFileOnF + SetErrorFileOn = SetErrorFileOnF(ID,ERROR_ON) + END FUNCTION SetErrorFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetLogOn(ID,LOG_ON) + FUNCTION SetLogFileOn(ID,LOG_ON) IMPLICIT NONE INTEGER(KIND=4) :: ID LOGICAL(KIND=4) :: LOG_ON - INTEGER(KIND=4) :: SetLogOn - INTEGER(KIND=4) :: SetLogOnF - SetLogOn = SetLogOnF(ID,LOG_ON) - END FUNCTION SetLogOn + INTEGER(KIND=4) :: SetLogFileOn + INTEGER(KIND=4) :: SetLogFileOnF + SetLogFileOn = SetLogFileOnF(ID,LOG_ON) + END FUNCTION SetLogFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - FUNCTION SetDumpOn(ID,DUMP_ON) + FUNCTION SetDumpFileOn(ID,DUMP_ON) IMPLICIT NONE INTEGER(KIND=4) :: ID LOGICAL(KIND=4) :: DUMP_ON - INTEGER(KIND=4) :: SetDumpOn - INTEGER(KIND=4) :: SetDumpOnF - SetDumpOn = SetDumpOnF(ID,DUMP_ON) - END FUNCTION SetDumpOn + INTEGER(KIND=4) :: SetDumpFileOn + INTEGER(KIND=4) :: SetDumpFileOnF + SetDumpFileOn = SetDumpFileOnF(ID,DUMP_ON) + END FUNCTION SetDumpFileOn !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FUNCTION SetDumpStringOn(ID,DUMP_STRING_ON) IMPLICIT NONE diff --git a/src/IPhreeqcLib.cpp b/src/IPhreeqcLib.cpp index 8fc49994..7fd7f715 100644 --- a/src/IPhreeqcLib.cpp +++ b/src/IPhreeqcLib.cpp @@ -113,35 +113,35 @@ GetComponentCount(int id) } const char* -GetDumpLine(int id, int n) +GetDumpStringLine(int id, int n) { - static const char err_msg[] = "GetDumpLine: Invalid instance id.\n"; + static const char err_msg[] = "GetDumpStringLine: Invalid instance id.\n"; IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - return IPhreeqcPtr->GetDumpLine(n); + return IPhreeqcPtr->GetDumpStringLine(n); } return err_msg; } int -GetDumpLineCount(int id) +GetDumpStringLineCount(int id) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - return IPhreeqcPtr->GetDumpLineCount(); + return IPhreeqcPtr->GetDumpStringLineCount(); } return 0; } int -GetDumpOn(int id) +GetDumpFileOn(int id) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - if (IPhreeqcPtr->GetDumpOn()) + if (IPhreeqcPtr->GetDumpFileOn()) { return 1; } @@ -184,35 +184,35 @@ GetDumpStringOn(int id) } const char* -GetErrorLine(int id, int n) +GetErrorStringLine(int id, int n) { - static const char err_msg[] = "GetErrorLine: Invalid instance id.\n"; + static const char err_msg[] = "GetErrorStringLine: Invalid instance id.\n"; IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - return IPhreeqcPtr->GetErrorLine(n); + return IPhreeqcPtr->GetErrorStringLine(n); } return err_msg; } int -GetErrorLineCount(int id) +GetErrorStringLineCount(int id) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - return (int)IPhreeqcPtr->GetErrorLineCount(); + return (int)IPhreeqcPtr->GetErrorStringLineCount(); } return IPQ_BADINSTANCE; } int -GetErrorOn(int id) +GetErrorFileOn(int id) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - if (IPhreeqcPtr->GetErrorOn()) + if (IPhreeqcPtr->GetErrorFileOn()) { return 1; } @@ -237,12 +237,12 @@ GetErrorString(int id) } int -GetLogOn(int id) +GetLogFileOn(int id) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - if (IPhreeqcPtr->GetLogOn()) + if (IPhreeqcPtr->GetLogFileOn()) { return 1; } @@ -255,12 +255,12 @@ GetLogOn(int id) } int -GetOutputOn(int id) +GetOutputFileOn(int id) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - if (IPhreeqcPtr->GetOutputOn()) + if (IPhreeqcPtr->GetOutputFileOn()) { return 1; } @@ -284,12 +284,12 @@ GetSelectedOutputColumnCount(int id) } int -GetSelectedOutputOn(int id) +GetSelectedOutputFileOn(int id) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - if (IPhreeqcPtr->GetSelectedOutputOn()) + if (IPhreeqcPtr->GetSelectedOutputFileOn()) { return 1; } @@ -334,24 +334,24 @@ GetSelectedOutputValue(int id, int row, int col, VAR* pVAR) } const char* -GetWarningLine(int id, int n) +GetWarningStringLine(int id, int n) { - static const char err_msg[] = "GetWarningLine: Invalid instance id.\n"; + static const char err_msg[] = "GetWarningStringLine: Invalid instance id.\n"; IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - return IPhreeqcPtr->GetWarningLine(n); + return IPhreeqcPtr->GetWarningStringLine(n); } return err_msg; } int -GetWarningLineCount(int id) +GetWarningStringLineCount(int id) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - return (int)IPhreeqcPtr->GetWarningLineCount(); + return (int)IPhreeqcPtr->GetWarningStringLineCount(); } return IPQ_BADINSTANCE; } @@ -391,39 +391,39 @@ LoadDatabaseString(int id, const char* input) } void -OutputError(int id) +OutputErrorString(int id) { - static const char err_msg[] = "OutputError: Invalid instance id.\n"; + static const char err_msg[] = "OutputErrorString: Invalid instance id.\n"; IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - IPhreeqcPtr->OutputError(); + IPhreeqcPtr->OutputErrorString(); return; } std::cout << err_msg << std::endl; } void -OutputLines(int id) +OutputAccumulatedLines(int id) { - static const char err_msg[] = "OutputLines: Invalid instance id.\n"; + static const char err_msg[] = "OutputAccumulatedLines: Invalid instance id.\n"; IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - IPhreeqcPtr->OutputLines(); + IPhreeqcPtr->OutputAccumulatedLines(); return; } std::cout << err_msg << std::endl; } void -OutputWarning(int id) +OutputWarningString(int id) { - static const char err_msg[] = "OutputWarning: Invalid instance id.\n"; + static const char err_msg[] = "OutputWarningString: Invalid instance id.\n"; IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - IPhreeqcPtr->OutputWarning(); + IPhreeqcPtr->OutputWarningString(); return; } std::cout << err_msg << std::endl; @@ -463,12 +463,12 @@ RunString(int id, const char* input) } IPQ_RESULT -SetDumpOn(int id, int value) +SetDumpFileOn(int id, int value) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - IPhreeqcPtr->SetDumpOn(value != 0); + IPhreeqcPtr->SetDumpFileOn(value != 0); return IPQ_OK; } return IPQ_BADINSTANCE; @@ -487,48 +487,48 @@ SetDumpStringOn(int id, int value) } IPQ_RESULT -SetErrorOn(int id, int value) +SetErrorFileOn(int id, int value) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - IPhreeqcPtr->SetErrorOn(value != 0); + IPhreeqcPtr->SetErrorFileOn(value != 0); return IPQ_OK; } return IPQ_BADINSTANCE; } IPQ_RESULT -SetLogOn(int id, int value) +SetLogFileOn(int id, int value) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - IPhreeqcPtr->SetLogOn(value != 0); + IPhreeqcPtr->SetLogFileOn(value != 0); return IPQ_OK; } return IPQ_BADINSTANCE; } IPQ_RESULT -SetOutputOn(int id, int value) +SetOutputFileOn(int id, int value) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - IPhreeqcPtr->SetOutputOn(value != 0); + IPhreeqcPtr->SetOutputFileOn(value != 0); return IPQ_OK; } return IPQ_BADINSTANCE; } IPQ_RESULT -SetSelectedOutputOn(int id, int value) +SetSelectedOutputFileOn(int id, int value) { IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id); if (IPhreeqcPtr) { - IPhreeqcPtr->SetSelectedOutputOn(value != 0); + IPhreeqcPtr->SetSelectedOutputFileOn(value != 0); return IPQ_OK; } return IPQ_BADINSTANCE; diff --git a/src/fwrap.cpp b/src/fwrap.cpp index 264d8e08..b32da940 100644 --- a/src/fwrap.cpp +++ b/src/fwrap.cpp @@ -85,21 +85,21 @@ GetComponentF(int *id, int *n, char* comp, unsigned int line_length) } int -GetDumpLineCountF(int *id) +GetDumpStringLineCountF(int *id) { - return ::GetDumpLineCount(*id); + return ::GetDumpStringLineCount(*id); } void -GetDumpLineF(int *id, int* n, char* line, unsigned int line_length) +GetDumpStringLineF(int *id, int* n, char* line, unsigned int line_length) { - padfstring(line, ::GetDumpLine(*id, (*n) - 1), line_length); + padfstring(line, ::GetDumpStringLine(*id, (*n) - 1), line_length); } int -GetDumpOnF(int *id) +GetDumpFileOnF(int *id) { - return ::GetDumpOn(*id); + return ::GetDumpFileOn(*id); } int @@ -109,33 +109,33 @@ GetDumpStringOnF(int *id) } int -GetErrorLineCountF(int *id) +GetErrorStringLineCountF(int *id) { - return ::GetErrorLineCount(*id); + return ::GetErrorStringLineCount(*id); } void -GetErrorLineF(int *id, int* n, char* line, unsigned int line_length) +GetErrorStringLineF(int *id, int* n, char* line, unsigned int line_length) { - padfstring(line, ::GetErrorLine(*id, (*n) - 1), line_length); + padfstring(line, ::GetErrorStringLine(*id, (*n) - 1), line_length); } int -GetErrorOnF(int *id) +GetErrorFileOnF(int *id) { - return ::GetErrorOn(*id); + return ::GetErrorFileOn(*id); } int -GetLogOnF(int *id) +GetLogFileOnF(int *id) { - return ::GetLogOn(*id); + return ::GetLogFileOn(*id); } int -GetOutputOnF(int *id) +GetOutputFileOnF(int *id) { - return ::GetOutputOn(*id); + return ::GetOutputFileOn(*id); } int @@ -145,9 +145,9 @@ GetSelectedOutputColumnCountF(int *id) } int -GetSelectedOutputOnF(int *id) +GetSelectedOutputFileOnF(int *id) { - return ::GetSelectedOutputOn(*id); + return ::GetSelectedOutputFileOn(*id); } int @@ -204,15 +204,15 @@ GetSelectedOutputValueF(int *id, int *row, int *col, int *vtype, double* dvalue, } int -GetWarningLineCountF(int *id) +GetWarningStringLineCountF(int *id) { - return ::GetWarningLineCount(*id); + return ::GetWarningStringLineCount(*id); } void -GetWarningLineF(int *id, int* n, char* line, unsigned int line_length) +GetWarningStringLineF(int *id, int* n, char* line, unsigned int line_length) { - padfstring(line, ::GetWarningLine(*id, (*n) - 1), line_length); + padfstring(line, ::GetWarningStringLine(*id, (*n) - 1), line_length); } int @@ -250,21 +250,21 @@ LoadDatabaseStringF(int *id, char* input, unsigned int input_length) } void -OutputErrorF(int *id) +OutputErrorStringF(int *id) { - ::OutputError(*id); + ::OutputErrorString(*id); } void -OutputLinesF(int *id) +OutputAccumulatedLinesF(int *id) { - ::OutputLines(*id); + ::OutputAccumulatedLines(*id); } void -OutputWarningF(int *id) +OutputWarningStringF(int *id) { - ::OutputWarning(*id); + ::OutputWarningString(*id); } int @@ -308,9 +308,9 @@ RunStringF(int *id, char* input, unsigned int input_length) } IPQ_RESULT -SetDumpOnF(int *id, int* dump_on) +SetDumpFileOnF(int *id, int* dump_on) { - return ::SetDumpOn(*id, *dump_on); + return ::SetDumpFileOn(*id, *dump_on); } IPQ_RESULT @@ -320,27 +320,27 @@ SetDumpStringOnF(int *id, int* dump_string_on) } IPQ_RESULT -SetErrorOnF(int *id, int* error_on) +SetErrorFileOnF(int *id, int* error_on) { - return ::SetErrorOn(*id, *error_on); + return ::SetErrorFileOn(*id, *error_on); } IPQ_RESULT -SetLogOnF(int *id, int* log_on) +SetLogFileOnF(int *id, int* log_on) { - return ::SetLogOn(*id, *log_on); + return ::SetLogFileOn(*id, *log_on); } IPQ_RESULT -SetOutputOnF(int *id, int* output_on) +SetOutputFileOnF(int *id, int* output_on) { - return ::SetOutputOn(*id, *output_on); + return ::SetOutputFileOn(*id, *output_on); } IPQ_RESULT -SetSelectedOutputOnF(int *id, int* sel_on) +SetSelOutFileOnF(int *id, int* sel_on) { - return ::SetSelectedOutputOn(*id, *sel_on); + return ::SetSelectedOutputFileOn(*id, *sel_on); } int @@ -383,49 +383,49 @@ DLL_EXPORT int __stdcall GETCOMPONENTCOUNT(int *id) { return GetComponentCountF(id); } -DLL_EXPORT void __stdcall GETDUMPLINE(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void __stdcall GETDUMPSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { - GetDumpLineF(id, n, line, line_length); + GetDumpStringLineF(id, n, line, line_length); } -DLL_EXPORT int __stdcall GETDUMPLINECOUNT(int *id) +DLL_EXPORT int __stdcall GETDUMPSTRINGLINECOUNT(int *id) { - return GetDumpLineCountF(id); + return GetDumpStringLineCountF(id); } -DLL_EXPORT int __stdcall GETDUMPON(int *id) +DLL_EXPORT int __stdcall GETDUMPFILEON(int *id) { - return GetDumpOnF(id); + return GetDumpFileOnF(id); } DLL_EXPORT int __stdcall GETDUMPSTRINGON(int *id) { return GetDumpStringOnF(id); } -DLL_EXPORT void __stdcall GETERRORLINE(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void __stdcall GETERRORSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { - GetErrorLineF(id, n, line, line_length); + GetErrorStringLineF(id, n, line, line_length); } -DLL_EXPORT int __stdcall GETERRORLINECOUNT(int *id) +DLL_EXPORT int __stdcall GETERRORSTRINGLINECOUNT(int *id) { - return GetErrorLineCountF(id); + return GetErrorStringLineCountF(id); } -DLL_EXPORT int __stdcall GETERRORON(int *id) +DLL_EXPORT int __stdcall GETERRORFILEON(int *id) { - return GetErrorOnF(id); + return GetErrorFileOnF(id); } -DLL_EXPORT int __stdcall GETLOGON(int *id) +DLL_EXPORT int __stdcall GETLOGFILEON(int *id) { - return GetLogOnF(id); + return GetLogFileOnF(id); } -DLL_EXPORT int __stdcall GETOUTPUTON(int *id) +DLL_EXPORT int __stdcall GETOUTPUTFILEON(int *id) { - return GetOutputOnF(id); + return GetOutputFileOnF(id); } DLL_EXPORT int __stdcall GETSELECTEDOUTPUTCOLUMNCOUNT(int *id) { return GetSelectedOutputColumnCountF(id); } -DLL_EXPORT int __stdcall GETSELECTEDOUTPUTON(int *id) +DLL_EXPORT int __stdcall GETSELECTEDOUTPUTFILEON(int *id) { - return GetSelectedOutputOnF(id); + return GetSelectedOutputFileOnF(id); } DLL_EXPORT int __stdcall GETSELECTEDOUTPUTROWCOUNT(int *id) { @@ -435,13 +435,13 @@ DLL_EXPORT int __stdcall GETSELECTEDOUTPUTVALUE(int *id, int *row, int *col, in { return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length); } -DLL_EXPORT void __stdcall GETWARNINGLINE(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void __stdcall GETWARNINGSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { - GetWarningLineF(id, n, line, line_length); + GetWarningStringLineF(id, n, line, line_length); } -DLL_EXPORT int __stdcall GETWARNINGLINECOUNT(int *id) +DLL_EXPORT int __stdcall GETWARNINGSTRINGLINECOUNT(int *id) { - return GetWarningLineCountF(id); + return GetWarningStringLineCountF(id); } DLL_EXPORT int __stdcall LOADDATABASE(int *id, char *filename, unsigned int len) { @@ -451,17 +451,17 @@ DLL_EXPORT int __stdcall LOADDATABASESTRING(int *id, char *input, unsigned int { return LoadDatabaseStringF(id, input, len); } -DLL_EXPORT void __stdcall OUTPUTERROR(int *id) +DLL_EXPORT void __stdcall OUTPUTERRORSTRING(int *id) { - OutputErrorF(id); + OutputErrorStringF(id); } -DLL_EXPORT void __stdcall OUTPUTLINES(int *id) +DLL_EXPORT void __stdcall OUTPUTACCUMULATEDLINES(int *id) { - OutputLinesF(id); + OutputAccumulatedLinesF(id); } -DLL_EXPORT void __stdcall OUTPUTWARNING(int *id) +DLL_EXPORT void __stdcall OUTPUTWARNINGSTRING(int *id) { - OutputWarningF(id); + OutputWarningStringF(id); } DLL_EXPORT int __stdcall RUNACCUMULATED(int *id) { @@ -475,29 +475,29 @@ DLL_EXPORT int __stdcall RUNSTRING(int *id, char *input, unsigned int len) { return RunStringF(id, input, len); } -DLL_EXPORT void __stdcall SETDUMPON(int *id, int *dump_on) +DLL_EXPORT void __stdcall SETDUMPFILEON(int *id, int *dump_on) { - SetDumpOnF(id, dump_on); + SetDumpFileOnF(id, dump_on); } DLL_EXPORT void __stdcall SETDUMPSTRINGON(int *id, int *dump_string_on) { SetDumpStringOnF(id, dump_string_on); } -DLL_EXPORT void __stdcall SETERRORON(int *id, int *error_on) +DLL_EXPORT void __stdcall SETERRORFILEON(int *id, int *error_on) { - SetErrorOnF(id, error_on); + SetErrorFileOnF(id, error_on); } -DLL_EXPORT void __stdcall SETLOGON(int *id, int *log_on) +DLL_EXPORT void __stdcall SETLOGFILEON(int *id, int *log_on) { - SetLogOnF(id, log_on); + SetLogFileOnF(id, log_on); } -DLL_EXPORT void __stdcall SETOUTPUTON(int *id, int *output_on) +DLL_EXPORT void __stdcall SETOUTPUTFILEON(int *id, int *output_on) { - SetOutputOnF(id, output_on); + SetOutputFileOnF(id, output_on); } -DLL_EXPORT void __stdcall SETSELECTEDOUTPUTON(int *id, int *selected_on) +DLL_EXPORT void __stdcall SETSELECTEDOUTPUTFILEON(int *id, int *selected_on) { - SetSelectedOutputOnF(id, selected_on); + SetSelOutFileOnF(id, selected_on); } DLL_EXPORT int __stdcall UNLOADDATABASE(int *id) { diff --git a/src/fwrap.h b/src/fwrap.h index 25980c27..6ae4e771 100644 --- a/src/fwrap.h +++ b/src/fwrap.h @@ -14,35 +14,35 @@ #define DestroyIPhreeqcF FC_FUNC (destroyiphreeqcf, DESTROYIPHREEQCF) #define GetComponentCountF FC_FUNC (getcomponentcountf, GETCOMPONENTCOUNTF) #define GetComponentF FC_FUNC (getcomponentf, GETCOMPONENTF) -#define GetDumpLineCountF FC_FUNC (getdumplinecountf, GETDUMPLINECOUNTF) -#define GetDumpLineF FC_FUNC (getdumplinef, GETDUMPLINEF) -#define GetDumpOnF FC_FUNC (getdumponf, GETDUMPONF) +#define GetDumpStringLineCountF FC_FUNC (getdumpstringlinecountf, GETDUMPSTRINGLINECOUNTF) +#define GetDumpStringLineF FC_FUNC (getdumpstringlinef, GETDUMPSTRINGLINEF) +#define GetDumpFileOnF FC_FUNC (getdumpfileonf, GETDUMPFILEONF) #define GetDumpStringOnF FC_FUNC (getdumpstringonf, GETDUMPSTRINGONF) -#define GetErrorLineCountF FC_FUNC (geterrorlinecountf, GETERRORLINECOUNTF) -#define GetErrorLineF FC_FUNC (geterrorlinef, GETERRORLINEF) -#define GetErrorOnF FC_FUNC (geterroronf, GETERRORONF) -#define GetLogOnF FC_FUNC (getlogonf, GETLOGONF) -#define GetOutputOnF FC_FUNC (getoutputonf, GETOUTPUTONF) +#define GetErrorStringLineCountF FC_FUNC (geterrorstringlinecountf, GETERRORSTRINGLINECOUNTF) +#define GetErrorStringLineF FC_FUNC (geterrorstringlinef, GETERRORSTRINGLINEF) +#define GetErrorFileOnF FC_FUNC (geterrorfileonf, GETERRORFILEONF) +#define GetLogFileOnF FC_FUNC (getlogfileonf, GETLOGFILEONF) +#define GetOutputFileOnF FC_FUNC (getoutputfileonf, GETOUTPUTFILEONF) #define GetSelectedOutputColumnCountF FC_FUNC (getselectedoutputcolumncountf, GETSELECTEDOUTPUTCOLUMNCOUNTF) -#define GetSelectedOutputOnF FC_FUNC (getselectedoutputonf, GETSELECTEDOUTPUTONF) +#define GetSelectedOutputFileOnF FC_FUNC (getselectedoutputfileonf, GETSELECTEDOUTPUTFILEONF) #define GetSelectedOutputRowCountF FC_FUNC (getselectedoutputrowcountf, GETSELECTEDOUTPUTROWCOUNTF) #define GetSelectedOutputValueF FC_FUNC (getselectedoutputvaluef, GETSELECTEDOUTPUTVALUEF) -#define GetWarningLineCountF FC_FUNC (getwarninglinecountf, GETWARNINGLINECOUNTF) -#define GetWarningLineF FC_FUNC (getwarninglinef, GETWARNINGLINEF) +#define GetWarningStringLineCountF FC_FUNC (getwarningstringlinecountf, GETWARNINGSTRINGLINECOUNTF) +#define GetWarningStringLineF FC_FUNC (getwarningstringlinef, GETWARNINGSTRINGLINEF) #define LoadDatabaseF FC_FUNC (loaddatabasef, LOADDATABASEF) #define LoadDatabaseStringF FC_FUNC (loaddatabasestringf, LOADDATABASESTRINGF) -#define OutputErrorF FC_FUNC (outputerrorf, OUTPUTERRORF) -#define OutputLinesF FC_FUNC (outputlinesf, OUTPUTLINESF) -#define OutputWarningF FC_FUNC (outputwarningf, OUTPUTWARNINGF) +#define OutputErrorStringF FC_FUNC (outputerrorstringf, OUTPUTERRORSTRINGF) +#define OutputAccumulatedLinesF FC_FUNC (outputaccumulatedlinesf, OUTPUTACCUMULATEDLINESF) +#define OutputWarningStringF FC_FUNC (outputwarningstringf, OUTPUTWARNINGSTRINGF) #define RunAccumulatedF FC_FUNC (runaccumulatedf, RUNACCUMULATEDF) #define RunFileF FC_FUNC (runfilef, RUNFILEF) #define RunStringF FC_FUNC (runstringf, RUNSTRINGF) -#define SetDumpOnF FC_FUNC (setdumponf, SETDUMPONF) +#define SetDumpFileOnF FC_FUNC (setdumpfileonf, SETDUMPFILEONF) #define SetDumpStringOnF FC_FUNC (setdumpstringonf, SETDUMPSTRINGONF) -#define SetErrorOnF FC_FUNC (seterroronf, SETERRORONF) -#define SetLogOnF FC_FUNC (setlogonf, SETLOGONF) -#define SetOutputOnF FC_FUNC (setoutputonf, SETOUTPUTONF) -#define SetSelectedOutputOnF FC_FUNC (setselectedoutputonf, SETSELECTEDOUTPUTONF) +#define SetErrorFileOnF FC_FUNC (seterrorfileonf, SETERRORFILEONF) +#define SetLogFileOnF FC_FUNC (setlogfileonf, SETLOGFILEONF) +#define SetOutputFileOnF FC_FUNC (setoutputfileonf, SETOUTPUTFILEONF) +#define SetSelOutFileOnF FC_FUNC (setseloutfileonf, SETSELOUTFILEONF) #define UnLoadDatabaseF FC_FUNC (unloaddatabasef, UNLOADDATABASEF) #endif /* FC_FUNC */ @@ -56,35 +56,35 @@ extern "C" { int DestroyIPhreeqcF(int *id); int GetComponentCountF(int *id); void GetComponentF(int *id, int* n, char* line, unsigned int line_length); - int GetDumpLineCountF(int *id); - void GetDumpLineF(int *id, int* n, char* line, unsigned int line_length); - int GetDumpOnF(int *id); + int GetDumpStringLineCountF(int *id); + void GetDumpStringLineF(int *id, int* n, char* line, unsigned int line_length); + int GetDumpFileOnF(int *id); int GetDumpStringOnF(int *id); - int GetErrorLineCountF(int *id); - void GetErrorLineF(int *id, int* n, char* line, unsigned int line_length); - int GetErrorOnF(int *id); - int GetLogOnF(int *id); - int GetOutputOnF(int *id); + int GetErrorStringLineCountF(int *id); + void GetErrorStringLineF(int *id, int* n, char* line, unsigned int line_length); + int GetErrorFileOnF(int *id); + int GetLogFileOnF(int *id); + int GetOutputFileOnF(int *id); int GetSelectedOutputColumnCountF(int *id); - int GetSelectedOutputOnF(int *id); + int GetSelectedOutputFileOnF(int *id); int GetSelectedOutputRowCountF(int *id); IPQ_RESULT GetSelectedOutputValueF(int *id, int *row, int *col, int *vtype, double* dvalue, char* svalue, unsigned int svalue_length); - int GetWarningLineCountF(int *id); - void GetWarningLineF(int *id, int* n, char* line, unsigned int line_length); + int GetWarningStringLineCountF(int *id); + void GetWarningStringLineF(int *id, int* n, char* line, unsigned int line_length); int LoadDatabaseF(int *id, char* filename, unsigned int filename_length); int LoadDatabaseStringF(int *id, char* input, unsigned int input_length); - void OutputErrorF(int *id); - void OutputLinesF(int *id); - void OutputWarningF(int *id); + void OutputErrorStringF(int *id); + void OutputAccumulatedLinesF(int *id); + void OutputWarningStringF(int *id); int RunAccumulatedF(int *id); int RunFileF(int *id, char* filename, unsigned int filename_length); int RunStringF(int *id, char* input, unsigned int input_length); - IPQ_RESULT SetDumpOnF(int *id, int* dump_on); + IPQ_RESULT SetDumpFileOnF(int *id, int* dump_on); IPQ_RESULT SetDumpStringOnF(int *id, int* dump_string_on); - IPQ_RESULT SetErrorOnF(int *id, int* error_on); - IPQ_RESULT SetLogOnF(int *id, int* log_on); - IPQ_RESULT SetOutputOnF(int *id, int* output_on); - IPQ_RESULT SetSelectedOutputOnF(int *id, int* selected_output_on); + IPQ_RESULT SetErrorFileOnF(int *id, int* error_on); + IPQ_RESULT SetLogFileOnF(int *id, int* log_on); + IPQ_RESULT SetOutputFileOnF(int *id, int* output_on); + IPQ_RESULT SetSelOutFileOnF(int *id, int* selected_output_on); int UnLoadDatabaseF(int *id); #if defined(__cplusplus) diff --git a/src/fwrap2.cpp b/src/fwrap2.cpp index 678837e8..041e24da 100644 --- a/src/fwrap2.cpp +++ b/src/fwrap2.cpp @@ -35,49 +35,49 @@ DLL_EXPORT int GETCOMPONENTCOUNT(int *id) { return GetComponentCountF(id); } -DLL_EXPORT void GETDUMPLINE(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void GETDUMPSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { - GetDumpLineF(id, n, line, line_length); + GetDumpStringLineF(id, n, line, line_length); } -DLL_EXPORT int GETDUMPLINECOUNT(int *id) +DLL_EXPORT int GETDUMPSTRINGLINECOUNT(int *id) { - return GetDumpLineCountF(id); + return GetDumpStringLineCountF(id); } -DLL_EXPORT int GETDUMPON(int *id) +DLL_EXPORT int GETDUMPFILEON(int *id) { - return GetDumpOnF(id); + return GetDumpFileOnF(id); } DLL_EXPORT int GETDUMPSTRINGON(int *id) { return GetDumpStringOnF(id); } -DLL_EXPORT void GETERRORLINE(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void GETERRORSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { - GetErrorLineF(id, n, line, line_length); + GetErrorStringLineF(id, n, line, line_length); } -DLL_EXPORT int GETERRORLINECOUNT(int *id) +DLL_EXPORT int GETERRORSTRINGLINECOUNT(int *id) { - return GetErrorLineCountF(id); + return GetErrorStringLineCountF(id); } -DLL_EXPORT int GETERRORON(int *id) +DLL_EXPORT int GETERRORFILEON(int *id) { - return GetErrorOnF(id); + return GetErrorFileOnF(id); } -DLL_EXPORT int GETLOGON(int *id) +DLL_EXPORT int GETLOGFILEON(int *id) { - return GetLogOnF(id); + return GetLogFileOnF(id); } -DLL_EXPORT int GETOUTPUTON(int *id) +DLL_EXPORT int GETOUTPUTFILEON(int *id) { - return GetOutputOnF(id); + return GetOutputFileOnF(id); } DLL_EXPORT int GETSELECTEDOUTPUTCOLUMNCOUNT(int *id) { return GetSelectedOutputColumnCountF(id); } -DLL_EXPORT int GETSELECTEDOUTPUTON(int *id) +DLL_EXPORT int GETSELECTEDOUTPUTFILEON(int *id) { - return GetSelectedOutputOnF(id); + return GetSelectedOutputFileOnF(id); } DLL_EXPORT int GETSELECTEDOUTPUTROWCOUNT(int *id) { @@ -87,13 +87,13 @@ DLL_EXPORT int GETSELECTEDOUTPUTVALUE(int *id, int *row, int *col, int *vtype, { return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length); } -DLL_EXPORT void GETWARNINGLINE(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void GETWARNINGSTRINGLINE(int *id, int *n, char* line, unsigned int line_length) { - GetWarningLineF(id, n, line, line_length); + GetWarningStringLineF(id, n, line, line_length); } -DLL_EXPORT int GETWARNINGLINECOUNT(int *id) +DLL_EXPORT int GETWARNINGSTRINGLINECOUNT(int *id) { - return GetWarningLineCountF(id); + return GetWarningStringLineCountF(id); } DLL_EXPORT int LOADDATABASE(int *id, char *filename, unsigned int len) { @@ -103,17 +103,17 @@ DLL_EXPORT int LOADDATABASESTRING(int *id, char *input, unsigned int len) { return LoadDatabaseStringF(id, input, len); } -DLL_EXPORT void OUTPUTERROR(int *id) +DLL_EXPORT void OUTPUTERRORSTRING(int *id) { - OutputErrorF(id); + OutputErrorStringF(id); } -DLL_EXPORT void OUTPUTLINES(int *id) +DLL_EXPORT void OUTPUTACCUMULATEDLINES(int *id) { - OutputLinesF(id); + OutputAccumulatedLinesF(id); } -DLL_EXPORT void OUTPUTWARNING(int *id) +DLL_EXPORT void OUTPUTWARNINGSTRING(int *id) { - OutputWarningF(id); + OutputWarningStringF(id); } DLL_EXPORT int RUNACCUMULATED(int *id) { @@ -127,29 +127,29 @@ DLL_EXPORT int RUNSTRING(int *id, char *input, unsigned int len) { return RunStringF(id, input, len); } -DLL_EXPORT void SETDUMPON(int *id, int *dump_on) +DLL_EXPORT void SETDUMPFILEON(int *id, int *dump_on) { - SetDumpOnF(id, dump_on); + SetDumpFileOnF(id, dump_on); } DLL_EXPORT void SETDUMPSTRINGON(int *id, int *dump_string_on) { SetDumpStringOnF(id, dump_string_on); } -DLL_EXPORT void SETERRORON(int *id, int *error_on) +DLL_EXPORT void SETERRORFILEON(int *id, int *error_on) { - SetErrorOnF(id, error_on); + SetErrorFileOnF(id, error_on); } -DLL_EXPORT void SETLOGON(int *id, int *log_on) +DLL_EXPORT void SETLOGFILEON(int *id, int *log_on) { - SetLogOnF(id, log_on); + SetLogFileOnF(id, log_on); } -DLL_EXPORT void SETOUTPUTON(int *id, int *output_on) +DLL_EXPORT void SETOUTPUTFILEON(int *id, int *output_on) { - SetOutputOnF(id, output_on); + SetOutputFileOnF(id, output_on); } -DLL_EXPORT void SETSELECTEDOUTPUTON(int *id, int *selected_on) +DLL_EXPORT void SETSELECTEDOUTPUTFILEON(int *id, int *selected_on) { - SetSelectedOutputOnF(id, selected_on); + SetSelOutFileOnF(id, selected_on); } DLL_EXPORT int UNLOADDATABASE(int *id) { diff --git a/src/fwrap3.cpp b/src/fwrap3.cpp index f0e44b22..9e918bfb 100644 --- a/src/fwrap3.cpp +++ b/src/fwrap3.cpp @@ -34,49 +34,49 @@ DLL_EXPORT int getcomponentcount_(int *id) { return GetComponentCountF(id); } -DLL_EXPORT void getdumpline_(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void getdumpstringline_(int *id, int *n, char* line, unsigned int line_length) { - GetDumpLineF(id, n, line, line_length); + GetDumpStringLineF(id, n, line, line_length); } -DLL_EXPORT int getdumplinecount_(int *id) +DLL_EXPORT int getdumpstringlinecount_(int *id) { - return GetDumpLineCountF(id); + return GetDumpStringLineCountF(id); } -DLL_EXPORT int getdumpon_(int *id) +DLL_EXPORT int getdumpfileon_(int *id) { - return GetDumpOnF(id); + return GetDumpFileOnF(id); } DLL_EXPORT int getdumpstringon_(int *id) { return GetDumpStringOnF(id); } -DLL_EXPORT void geterrorline_(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void geterrorstringline_(int *id, int *n, char* line, unsigned int line_length) { - GetErrorLineF(id, n, line, line_length); + GetErrorStringLineF(id, n, line, line_length); } -DLL_EXPORT int geterrorlinecount_(int *id) +DLL_EXPORT int geterrorstringlinecount_(int *id) { - return GetErrorLineCountF(id); + return GetErrorStringLineCountF(id); } -DLL_EXPORT int geterroron_(int *id) +DLL_EXPORT int geterrorfileon_(int *id) { - return GetErrorOnF(id); + return GetErrorFileOnF(id); } -DLL_EXPORT int getlogon_(int *id) +DLL_EXPORT int getlogfileon_(int *id) { - return GetLogOnF(id); + return GetLogFileOnF(id); } -DLL_EXPORT int getoutputon_(int *id) +DLL_EXPORT int getoutputfileon_(int *id) { - return GetOutputOnF(id); + return GetOutputFileOnF(id); } DLL_EXPORT int getselectedoutputcolumncount_(int *id) { return GetSelectedOutputColumnCountF(id); } -DLL_EXPORT int getselectedoutputon_(int *id) +DLL_EXPORT int getselectedoutputfileon_(int *id) { - return GetSelectedOutputOnF(id); + return GetSelectedOutputFileOnF(id); } DLL_EXPORT int getselectedoutputrowcount_(int *id) { @@ -86,13 +86,13 @@ DLL_EXPORT int getselectedoutputvalue_(int *id, int *row, int *col, int *vtype, { return GetSelectedOutputValueF(id, row, col, vtype, dvalue, svalue, svalue_length); } -DLL_EXPORT void getwarningline_(int *id, int *n, char* line, unsigned int line_length) +DLL_EXPORT void getwarningstringline_(int *id, int *n, char* line, unsigned int line_length) { - GetWarningLineF(id, n, line, line_length); + GetWarningStringLineF(id, n, line, line_length); } -DLL_EXPORT int getwarninglinecount_(int *id) +DLL_EXPORT int getwarningstringlinecount_(int *id) { - return GetWarningLineCountF(id); + return GetWarningStringLineCountF(id); } DLL_EXPORT int loaddatabase_(int *id, char *filename, unsigned int len) { @@ -102,17 +102,17 @@ DLL_EXPORT int loaddatabasestring_(int *id, char *input, unsigned int len) { return LoadDatabaseStringF(id, input, len); } -DLL_EXPORT void outputerror_(int *id) +DLL_EXPORT void outputerrorstring_(int *id) { - OutputErrorF(id); + OutputErrorStringF(id); } -DLL_EXPORT void outputlines_(int *id) +DLL_EXPORT void outputaccumulatedlines_(int *id) { - OutputLinesF(id); + OutputAccumulatedLinesF(id); } -DLL_EXPORT void outputwarning_(int *id) +DLL_EXPORT void outputwarningstring_(int *id) { - OutputWarningF(id); + OutputWarningStringF(id); } DLL_EXPORT int runaccumulated_(int *id) { @@ -126,29 +126,29 @@ DLL_EXPORT int runstring_(int *id, char *input, unsigned int len) { return RunStringF(id, input, len); } -DLL_EXPORT void setdumpon_(int *id, int *dump_on) +DLL_EXPORT void setdumpfileon_(int *id, int *dump_on) { - SetDumpOnF(id, dump_on); + SetDumpFileOnF(id, dump_on); } DLL_EXPORT void setdumpstringon_(int *id, int *dump_string_on) { SetDumpStringOnF(id, dump_string_on); } -DLL_EXPORT void seterroron_(int *id, int *error_on) +DLL_EXPORT void seterrorfileon_(int *id, int *error_on) { - SetErrorOnF(id, error_on); + SetErrorFileOnF(id, error_on); } -DLL_EXPORT void setlogon_(int *id, int *log_on) +DLL_EXPORT void setlogfileon_(int *id, int *log_on) { - SetLogOnF(id, log_on); + SetLogFileOnF(id, log_on); } -DLL_EXPORT void setoutputon_(int *id, int *output_on) +DLL_EXPORT void setoutputfileon_(int *id, int *output_on) { - SetOutputOnF(id, output_on); + SetOutputFileOnF(id, output_on); } -DLL_EXPORT void setselectedoutputon_(int *id, int *selected_on) +DLL_EXPORT void setselectedoutputfileon_(int *id, int *selected_on) { - SetSelectedOutputOnF(id, selected_on); + SetSelOutFileOnF(id, selected_on); } DLL_EXPORT int unloaddatabase_(int *id) { diff --git a/tests/test_c.c b/tests/test_c.c index e6aed03a..4663872d 100644 --- a/tests/test_c.c +++ b/tests/test_c.c @@ -19,7 +19,7 @@ main(int argc, const char* argv[]) } /* Dump */ - if (TestGetSet(id, GetDumpOn, SetDumpOn)) + if (TestGetSet(id, GetDumpFileOn, SetDumpFileOn)) { return EXIT_FAILURE; } @@ -31,38 +31,38 @@ main(int argc, const char* argv[]) } /* Error */ - if (TestGetSet(id, GetErrorOn, SetErrorOn)) + if (TestGetSet(id, GetErrorFileOn, SetErrorFileOn)) { return EXIT_FAILURE; } /* Log */ - if (TestGetSet(id, GetLogOn, SetLogOn)) + if (TestGetSet(id, GetLogFileOn, SetLogFileOn)) { return EXIT_FAILURE; } /* Output */ - if (TestGetSet(id, GetOutputOn, SetOutputOn)) + if (TestGetSet(id, GetOutputFileOn, SetOutputFileOn)) { return EXIT_FAILURE; } /* Selected output */ - if (TestGetSet(id, GetSelectedOutputOn, SetSelectedOutputOn)) + if (TestGetSet(id, GetSelectedOutputFileOn, SetSelectedOutputFileOn)) { return EXIT_FAILURE; } if (LoadDatabase(id, "phreeqc.dat") != 0) { - OutputError(id); + OutputErrorString(id); return EXIT_FAILURE; } if (RunFile(id, "ex2") != 0) { - OutputError(id); + OutputErrorString(id); return EXIT_FAILURE; } @@ -80,7 +80,7 @@ main(int argc, const char* argv[]) if (DestroyIPhreeqc(id) != IPQ_OK) { - OutputError(id); + OutputErrorString(id); return EXIT_FAILURE; } diff --git a/tests/test_cxx.cxx b/tests/test_cxx.cxx index ce7605ed..c564f5b2 100644 --- a/tests/test_cxx.cxx +++ b/tests/test_cxx.cxx @@ -46,7 +46,7 @@ main(int argc, const char* argv[]) IPhreeqc iphreeqc; // Dump - TTestGetSet testDump(&iphreeqc, &IPhreeqc::GetDumpOn, &IPhreeqc::SetDumpOn); + TTestGetSet testDump(&iphreeqc, &IPhreeqc::GetDumpFileOn, &IPhreeqc::SetDumpFileOn); if (testDump.Test() != EXIT_SUCCESS) { return EXIT_FAILURE; @@ -60,28 +60,28 @@ main(int argc, const char* argv[]) } // Error - TTestGetSet testError(&iphreeqc, &IPhreeqc::GetErrorOn, &IPhreeqc::SetErrorOn); + TTestGetSet testError(&iphreeqc, &IPhreeqc::GetErrorFileOn, &IPhreeqc::SetErrorFileOn); if (testError.Test() != EXIT_SUCCESS) { return EXIT_FAILURE; } // Log - TTestGetSet testLog(&iphreeqc, &IPhreeqc::GetLogOn, &IPhreeqc::SetLogOn); + TTestGetSet testLog(&iphreeqc, &IPhreeqc::GetLogFileOn, &IPhreeqc::SetLogFileOn); if (testLog.Test() != EXIT_SUCCESS) { return EXIT_FAILURE; } // Output - TTestGetSet testOutput(&iphreeqc, &IPhreeqc::GetOutputOn, &IPhreeqc::SetOutputOn); + TTestGetSet testOutput(&iphreeqc, &IPhreeqc::GetOutputFileOn, &IPhreeqc::SetOutputFileOn); if (testOutput.Test() != EXIT_SUCCESS) { return EXIT_FAILURE; } // Selected output - TTestGetSet testSelectedOutput(&iphreeqc, &IPhreeqc::GetSelectedOutputOn, &IPhreeqc::SetSelectedOutputOn); + TTestGetSet testSelectedOutput(&iphreeqc, &IPhreeqc::GetSelectedOutputFileOn, &IPhreeqc::SetSelectedOutputFileOn); if (testSelectedOutput.Test() != EXIT_SUCCESS) { return EXIT_FAILURE; diff --git a/tests/test_f.f b/tests/test_f.f index 76375154..bc8bf2cb 100644 --- a/tests/test_f.f +++ b/tests/test_f.f @@ -19,23 +19,23 @@ INTEGER(KIND=4) EXIT_FAILURE PARAMETER (EXIT_FAILURE=1) - EXTERNAL GetDumpOn - EXTERNAL SetDumpOn + EXTERNAL GetDumpFileOn + EXTERNAL SetDumpFileOn EXTERNAL GetDumpStringOn EXTERNAL SetDumpStringOn - EXTERNAL GetErrorOn - EXTERNAL SetErrorOn + EXTERNAL GetErrorFileOn + EXTERNAL SetErrorFileOn - EXTERNAL GetLogOn - EXTERNAL SetLogOn + EXTERNAL GetLogFileOn + EXTERNAL SetLogFileOn - EXTERNAL GetOutputOn - EXTERNAL SetOutputOn + EXTERNAL GetOutputFileOn + EXTERNAL SetOutputFileOn - EXTERNAL GetSelectedOutputOn - EXTERNAL SetSelectedOutputOn + EXTERNAL GetSelectedOutputFileOn + EXTERNAL SetSelectedOutputFileOn id = CreateIPhreeqc() IF (id.LT.0) THEN @@ -44,7 +44,7 @@ ENDIF C Dump - IF (TestGetSet(id,GetDumpOn,SetDumpOn).NE.0) THEN + IF (TestGetSet(id,GetDumpFileOn,SetDumpFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF @@ -56,38 +56,38 @@ C Dump string ENDIF C Error - IF (TestGetSet(id,GetErrorOn,SetErrorOn).NE.0) THEN + IF (TestGetSet(id,GetErrorFileOn,SetErrorFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF C Log - IF (TestGetSet(id,GetLogOn,SetLogOn).NE.0) THEN + IF (TestGetSet(id,GetLogFileOn,SetLogFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF C Output - IF (TestGetSet(id,GetOutputOn,SetOutputOn).NE.0) THEN + IF (TestGetSet(id,GetOutputFileOn,SetOutputFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF C Selected output - IF (TestGetSet(id,GetSelectedOutputOn,SetSelectedOutputOn) + IF (TestGetSet(id,GetSelectedOutputFileOn,SetSelectedOutputFileOn) & .NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) F_MAIN = EXIT_FAILURE RETURN ENDIF IF (RunFile(id, "ex2").NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) F_MAIN = EXIT_FAILURE RETURN ENDIF @@ -95,7 +95,7 @@ C Selected output DO 20 r=0,GetSelectedOutputRowCount(id) DO 10 c=1,GetSelectedOutputColumnCount(id) IF (GetSelectedOutputValue(id,r,c,t,d,s).NE.IPQ_OK) THEN - CALL OutputError(id) + CALL OutputErrorString(id) F_MAIN = EXIT_FAILURE RETURN ENDIF @@ -103,7 +103,7 @@ C Selected output 20 CONTINUE IF (DestroyIPhreeqc(id).NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) F_MAIN = EXIT_FAILURE RETURN ENDIF diff --git a/tests/test_f90.f90 b/tests/test_f90.f90 index 558726df..342820bc 100644 --- a/tests/test_f90.f90 +++ b/tests/test_f90.f90 @@ -23,7 +23,7 @@ FUNCTION F_MAIN() ENDIF ! Dump - IF (TestGetSet(id,GetDumpOn,SetDumpOn).NE.0) THEN + IF (TestGetSet(id,GetDumpFileOn,SetDumpFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF @@ -35,37 +35,37 @@ FUNCTION F_MAIN() ENDIF ! Error - IF (TestGetSet(id,GetErrorOn,SetErrorOn).NE.0) THEN + IF (TestGetSet(id,GetErrorFileOn,SetErrorFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF ! Log - IF (TestGetSet(id,GetLogOn,SetLogOn).NE.0) THEN + IF (TestGetSet(id,GetLogFileOn,SetLogFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF ! Output - IF (TestGetSet(id,GetOutputOn,SetOutputOn).NE.0) THEN + IF (TestGetSet(id,GetOutputFileOn,SetOutputFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF ! Selected output - IF (TestGetSet(id,GetSelectedOutputOn,SetSelectedOutputOn).NE.0) THEN + IF (TestGetSet(id,GetSelectedOutputFileOn,SetSelectedOutputFileOn).NE.0) THEN F_MAIN = EXIT_FAILURE RETURN ENDIF IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) F_MAIN = EXIT_FAILURE RETURN ENDIF IF (RunFile(id, "ex2").NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) F_MAIN = EXIT_FAILURE RETURN ENDIF @@ -73,7 +73,7 @@ FUNCTION F_MAIN() DO r=0,GetSelectedOutputRowCount(id) DO c=1,GetSelectedOutputColumnCount(id) IF (GetSelectedOutputValue(id,r,c,t,d,s).NE.IPQ_OK) THEN - CALL OutputError(id) + CALL OutputErrorString(id) F_MAIN = EXIT_FAILURE RETURN ENDIF @@ -82,7 +82,7 @@ FUNCTION F_MAIN() IF (DestroyIPhreeqc(id).NE.0) THEN - CALL OutputError(id) + CALL OutputErrorString(id) F_MAIN = EXIT_FAILURE RETURN ENDIF diff --git a/unit/TestIPhreeqc.cpp b/unit/TestIPhreeqc.cpp index 68b249fb..4c2a715f 100644 --- a/unit/TestIPhreeqc.cpp +++ b/unit/TestIPhreeqc.cpp @@ -190,11 +190,11 @@ void TestIPhreeqc::TestRun(void) IPhreeqc obj; CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat")); CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("solution 12")); - obj.SetOutputOn(files_on); - obj.SetErrorOn(files_on); - obj.SetLogOn(files_on); - obj.SetSelectedOutputOn(files_on); - obj.SetDumpOn(files_on); + obj.SetOutputFileOn(files_on); + obj.SetErrorFileOn(files_on); + obj.SetLogFileOn(files_on); + obj.SetSelectedOutputFileOn(files_on); + obj.SetDumpFileOn(files_on); CPPUNIT_ASSERT_EQUAL(0, obj.RunAccumulated()); } @@ -223,11 +223,11 @@ void TestIPhreeqc::TestRunWithErrors(void) CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine(" Fix_H+ -10 HCl 10")); CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("END")); - obj.SetOutputOn(files_on); - obj.SetErrorOn(files_on); - obj.SetLogOn(files_on); - obj.SetSelectedOutputOn(files_on); - obj.SetDumpOn(files_on); + obj.SetOutputFileOn(files_on); + obj.SetErrorFileOn(files_on); + obj.SetLogFileOn(files_on); + obj.SetSelectedOutputFileOn(files_on); + obj.SetDumpFileOn(files_on); CPPUNIT_ASSERT_EQUAL(1, obj.RunAccumulated()); const char expected[] = @@ -254,11 +254,11 @@ void TestIPhreeqc::TestRunFile(void) IPhreeqc obj; CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat")); - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(false); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(false); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL(1, obj.RunFile("conv_fail.in")); const char expected[] = @@ -354,11 +354,11 @@ void TestIPhreeqc::TestRunString(void) } CPPUNIT_ASSERT_EQUAL(false, ::FileExists("phreeqc.out")); CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat")); - obj.SetOutputOn(1); - obj.SetErrorOn(0); - obj.SetLogOn(0); - obj.SetSelectedOutputOn(0); - obj.SetDumpOn(0); + obj.SetOutputFileOn(1); + obj.SetErrorFileOn(0); + obj.SetLogFileOn(0); + obj.SetSelectedOutputFileOn(0); + obj.SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL(false, ::FileExists("phreeqc.out")); CPPUNIT_ASSERT_EQUAL(0, obj.RunString(input)); CPPUNIT_ASSERT_EQUAL(true, ::FileExists("phreeqc.out")); @@ -380,11 +380,11 @@ void TestIPhreeqc::TestGetSelectedOutputRowCount(void) CPPUNIT_ASSERT_EQUAL(VR_OK, EQUILIBRIUM_PHASES(obj, "calcite", 0.0, 0.010)); CPPUNIT_ASSERT_EQUAL(VR_OK, USER_PUNCH(obj, "Ca", max)); - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(false); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(false); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL(0, obj.RunAccumulated()); CPPUNIT_ASSERT_EQUAL(3, obj.GetSelectedOutputRowCount()); // rows + header @@ -404,11 +404,11 @@ void TestIPhreeqc::TestGetSelectedOutputValue(void) CPPUNIT_ASSERT_EQUAL(VR_OK, EQUILIBRIUM_PHASES(obj, "calcite", 0.0, 0.010)); CPPUNIT_ASSERT_EQUAL(VR_OK, USER_PUNCH(obj, "Ca", max)); - obj.SetOutputOn(0); - obj.SetErrorOn(0); - obj.SetLogOn(0); - obj.SetSelectedOutputOn(0); - obj.SetDumpOn(0); + obj.SetOutputFileOn(0); + obj.SetErrorFileOn(0); + obj.SetLogFileOn(0); + obj.SetSelectedOutputFileOn(0); + obj.SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL(0, obj.RunAccumulated()); /* @@ -1050,7 +1050,7 @@ void TestIPhreeqc::TestAccumulateLine(void) // TODO } -void TestIPhreeqc::TestOutputError(void) +void TestIPhreeqc::TestOutputErrorString(void) { // TODO } @@ -1065,11 +1065,11 @@ void TestIPhreeqc::TestRunNoDatabaseLoaded(void) IPhreeqc obj; obj.UnLoadDatabase(); - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(false); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(false); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL( 1, obj.RunAccumulated() ); const char expected[] = @@ -1105,21 +1105,21 @@ void TestIPhreeqc::TestCase1(void) CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(obj, 1.0, 1.0, 1.0) ); CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH(obj, "Ca", 10) ); - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(true); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(true); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( 62, obj.GetSelectedOutputColumnCount() ); CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(obj, 1.0, 1.0, 1.0) ); - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(true); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(true); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( 62, obj.GetSelectedOutputColumnCount() ); @@ -1156,11 +1156,11 @@ void TestIPhreeqc::TestCase2(void) CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(obj, 1.0, 1.0, 1.0) ); CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH(obj, "Ca", 10) ); CPPUNIT_ASSERT_EQUAL( VR_OK, obj.AccumulateLine("-file case2.punch") ); // force have_punch_name to TRUE (see read_selected_ouput) - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(true); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(true); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("case2.punch") ); @@ -1182,11 +1182,11 @@ void TestIPhreeqc::TestCase2(void) CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(obj, 1.0, 1.0, 1.0) ); CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH(obj, "Ca", 10) ); - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(true); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(true); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("case2.punch") ); @@ -1223,11 +1223,11 @@ void TestIPhreeqc::TestPrintSelectedOutputFalse(void) CPPUNIT_ASSERT_EQUAL( VR_OK, obj.AccumulateLine("PRINT; -selected_output false \n") ); // run - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(true); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(true); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( 0, obj.GetSelectedOutputColumnCount() ); @@ -1244,11 +1244,11 @@ void TestIPhreeqc::TestPrintSelectedOutputFalse(void) CPPUNIT_ASSERT_EQUAL( VR_OK, SELECTED_OUTPUT(obj) ); // run - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(true); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(true); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( 11, obj.GetSelectedOutputColumnCount() ); @@ -1339,11 +1339,11 @@ void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on, CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP(obj) ); // run all off - obj.SetDumpOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetOutputOn(false); - obj.SetSelectedOutputOn(false); + obj.SetDumpFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetOutputFileOn(false); + obj.SetSelectedOutputFileOn(false); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) ); @@ -1361,11 +1361,11 @@ void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on, CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP(obj) ); // run - obj.SetDumpOn(dump_on); - obj.SetErrorOn(error_on); - obj.SetLogOn(log_on); - obj.SetOutputOn(output_on); - obj.SetSelectedOutputOn(selected_output_on); + obj.SetDumpFileOn(dump_on); + obj.SetErrorFileOn(error_on); + obj.SetLogFileOn(log_on); + obj.SetOutputFileOn(output_on); + obj.SetSelectedOutputFileOn(selected_output_on); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists(FILENAME) ); CPPUNIT_ASSERT( ::DeleteFile(FILENAME) ); @@ -1383,11 +1383,11 @@ void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on, CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP(obj) ); // run - obj.SetDumpOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetOutputOn(false); - obj.SetSelectedOutputOn(false); + obj.SetDumpFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetOutputFileOn(false); + obj.SetSelectedOutputFileOn(false); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) ); @@ -1403,11 +1403,11 @@ void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on, CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP(obj) ); // run - obj.SetDumpOn(dump_on); - obj.SetErrorOn(error_on); - obj.SetLogOn(log_on); - obj.SetOutputOn(output_on); - obj.SetSelectedOutputOn(selected_output_on); + obj.SetDumpFileOn(dump_on); + obj.SetErrorFileOn(error_on); + obj.SetLogFileOn(log_on); + obj.SetOutputFileOn(output_on); + obj.SetSelectedOutputFileOn(selected_output_on); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists(FILENAME) ); CPPUNIT_ASSERT( ::DeleteFile(FILENAME) ); @@ -1514,11 +1514,11 @@ void TestIPhreeqc::TestLongHeadings() oss << "-end" << "\n"; CPPUNIT_ASSERT_EQUAL( VR_OK, obj.AccumulateLine(oss.str().c_str()) ); - obj.SetOutputOn(0); - obj.SetErrorOn(0); - obj.SetLogOn(0); - obj.SetSelectedOutputOn(0); - obj.SetDumpOn(0); + obj.SetOutputFileOn(0); + obj.SetErrorFileOn(0); + obj.SetLogFileOn(0); + obj.SetSelectedOutputFileOn(0); + obj.SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( 2, obj.GetSelectedOutputRowCount()); @@ -1543,11 +1543,11 @@ void TestIPhreeqc::TestDatabaseKeyword() IPhreeqc obj; CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat")); - obj.SetOutputOn(false); - obj.SetErrorOn(false); - obj.SetLogOn(false); - obj.SetSelectedOutputOn(false); - obj.SetDumpOn(false); + obj.SetOutputFileOn(false); + obj.SetErrorFileOn(false); + obj.SetLogFileOn(false); + obj.SetSelectedOutputFileOn(false); + obj.SetDumpFileOn(false); CPPUNIT_ASSERT_EQUAL(1, obj.RunFile("dump")); const char *expected = @@ -1571,11 +1571,11 @@ void TestIPhreeqc::TestDumpString() CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP(obj) ); // run - obj.SetOutputOn(0); - obj.SetErrorOn(0); - obj.SetLogOn(0); - obj.SetSelectedOutputOn(0); - obj.SetDumpOn(0); + obj.SetOutputFileOn(0); + obj.SetErrorFileOn(0); + obj.SetLogFileOn(0); + obj.SetSelectedOutputFileOn(0); + obj.SetDumpFileOn(0); obj.SetDumpStringOn(1); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); @@ -1641,7 +1641,7 @@ void TestIPhreeqc::TestDumpString() CPPUNIT_ASSERT_EQUAL(std::string(expected), std::string(dump_str)); } -void TestIPhreeqc::TestGetDumpLineCount(void) +void TestIPhreeqc::TestGetDumpStringLineCount(void) { IPhreeqc obj; @@ -1654,19 +1654,19 @@ void TestIPhreeqc::TestGetDumpLineCount(void) CPPUNIT_ASSERT_EQUAL( VR_OK, ::DUMP(obj) ); // run - CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetLogOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetLogFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpFileOn() ); CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpStringOn() ); obj.SetDumpStringOn(true); CPPUNIT_ASSERT_EQUAL( true, obj.GetDumpStringOn() ); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); - CPPUNIT_ASSERT_EQUAL( 26, obj.GetDumpLineCount() ); + CPPUNIT_ASSERT_EQUAL( 26, obj.GetDumpStringLineCount() ); } -void TestIPhreeqc::TestGetDumpLine(void) +void TestIPhreeqc::TestGetDumpStringLine(void) { IPhreeqc obj; @@ -1679,88 +1679,88 @@ void TestIPhreeqc::TestGetDumpLine(void) CPPUNIT_ASSERT_EQUAL( VR_OK, ::DUMP(obj) ); // run - CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetLogOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetLogFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpFileOn() ); CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpStringOn() ); obj.SetDumpStringOn(true); CPPUNIT_ASSERT_EQUAL( true, obj.GetDumpStringOn() ); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); - CPPUNIT_ASSERT_EQUAL( 26, obj.GetDumpLineCount() ); + CPPUNIT_ASSERT_EQUAL( 26, obj.GetDumpStringLineCount() ); int line = 0; #if defined(_MSC_VER) - CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003929"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-025"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826911"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(obj.GetDumpLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003929"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-025"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826911"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(obj.GetDumpStringLine(line++)) ); #endif #if defined(__GNUC__) - CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003928"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-25"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826912"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(obj.GetDumpLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003928"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-25"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826912"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(obj.GetDumpStringLine(line++)) ); #endif // remaining lines should be empty - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpStringLine(line++)) ); // negative lines should be empty - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpLine(-1)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpLine(-2)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpLine(-3)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpLine(-4)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpStringLine(-1)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpStringLine(-2)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpStringLine(-3)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(obj.GetDumpStringLine(-4)) ); } void TestIPhreeqc::TestGetComponentCount(void) @@ -1773,11 +1773,11 @@ void TestIPhreeqc::TestGetComponentCount(void) CPPUNIT_ASSERT_EQUAL( VR_OK, ::SOLUTION(obj, 1.0, 1.0, 1.0) ); // run - CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetLogOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetLogFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpFileOn() ); CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpStringOn() ); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( (size_t)3, obj.GetComponentCount() ); @@ -1793,11 +1793,11 @@ void TestIPhreeqc::TestGetComponent(void) CPPUNIT_ASSERT_EQUAL( VR_OK, ::SOLUTION(obj, 1.0, 1.0, 1.0) ); // run - CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetLogOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetLogFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpFileOn() ); CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpStringOn() ); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( (size_t)3, obj.GetComponentCount() ); @@ -1824,11 +1824,11 @@ void TestIPhreeqc::TestListComponents(void) CPPUNIT_ASSERT_EQUAL( VR_OK, ::SOLUTION(obj, 1.0, 1.0, 1.0) ); // run - CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetLogOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputOn() ); - CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetErrorFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetLogFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetSelectedOutputFileOn() ); + CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpFileOn() ); CPPUNIT_ASSERT_EQUAL( false, obj.GetDumpStringOn() ); CPPUNIT_ASSERT_EQUAL( 0, obj.RunAccumulated() ); diff --git a/unit/TestIPhreeqc.h b/unit/TestIPhreeqc.h index 59fb3d06..1dff17f3 100644 --- a/unit/TestIPhreeqc.h +++ b/unit/TestIPhreeqc.h @@ -20,7 +20,7 @@ class TestIPhreeqc : public CppUnit::TestFixture CPPUNIT_TEST( TestGetSelectedOutputColumnCount ); CPPUNIT_TEST( TestAddError ); CPPUNIT_TEST( TestAccumulateLine ); - CPPUNIT_TEST( TestOutputError ); + CPPUNIT_TEST( TestOutputErrorString ); CPPUNIT_TEST( TestRunWithCallback ); CPPUNIT_TEST( TestRunNoDatabaseLoaded ); CPPUNIT_TEST( TestCase1 ); @@ -34,8 +34,8 @@ class TestIPhreeqc : public CppUnit::TestFixture CPPUNIT_TEST( TestLongHeadings ); CPPUNIT_TEST( TestDatabaseKeyword ); CPPUNIT_TEST( TestDumpString ); - CPPUNIT_TEST( TestGetDumpLineCount ); - CPPUNIT_TEST( TestGetDumpLine ); + CPPUNIT_TEST( TestGetDumpStringLineCount ); + CPPUNIT_TEST( TestGetDumpStringLine ); CPPUNIT_TEST( TestGetComponentCount ); CPPUNIT_TEST( TestGetComponent ); CPPUNIT_TEST( TestListComponents ); @@ -61,7 +61,7 @@ public: void TestGetSelectedOutputColumnCount(void); void TestAddError(void); void TestAccumulateLine(void); - void TestOutputError(void); + void TestOutputErrorString(void); void TestRunWithCallback(void); void TestRunNoDatabaseLoaded(void); void TestCase1(void); @@ -75,8 +75,8 @@ public: void TestLongHeadings(void); void TestDatabaseKeyword(void); void TestDumpString(void); - void TestGetDumpLineCount(void); - void TestGetDumpLine(void); + void TestGetDumpStringLineCount(void); + void TestGetDumpStringLine(void); void TestGetComponentCount(void); void TestGetComponent(void); void TestListComponents(void); diff --git a/unit/TestIPhreeqcLib.cpp b/unit/TestIPhreeqcLib.cpp index aac35199..23686cf1 100644 --- a/unit/TestIPhreeqcLib.cpp +++ b/unit/TestIPhreeqcLib.cpp @@ -237,11 +237,11 @@ void TestIPhreeqcLib::TestRunAccumulated(void) CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase(n, "phreeqc.dat")); CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::AccumulateLine(n, "solution 12")); - CPPUNIT_ASSERT_EQUAL(0, ::GetOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetErrorOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetLogOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetDumpOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetErrorFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetLogFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetDumpFileOn(n)); CPPUNIT_ASSERT_EQUAL(0, ::GetDumpStringOn(n)); CPPUNIT_ASSERT_EQUAL(0, ::RunAccumulated(n)); @@ -276,11 +276,11 @@ void TestIPhreeqcLib::TestRunWithErrors() CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::AccumulateLine(n, "EQUILIBRIUM_PHASES")); CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::AccumulateLine(n, " Fix_H+ -10 HCl 10")); CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::AccumulateLine(n, "END")); - CPPUNIT_ASSERT_EQUAL(0, ::GetOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetErrorOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetLogOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetDumpOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetErrorFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetLogFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetDumpFileOn(n)); CPPUNIT_ASSERT_EQUAL(0, ::GetDumpStringOn(n)); CPPUNIT_ASSERT_EQUAL(1, ::RunAccumulated(n)); @@ -315,11 +315,11 @@ void TestIPhreeqcLib::TestRunFile(void) CPPUNIT_ASSERT_EQUAL(true, ::FileExists("phreeqc.dat")); CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase(n, "phreeqc.dat")); - CPPUNIT_ASSERT_EQUAL(0, ::GetOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetErrorOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetLogOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetDumpOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetErrorFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetLogFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetDumpFileOn(n)); CPPUNIT_ASSERT_EQUAL(0, ::GetDumpStringOn(n)); CPPUNIT_ASSERT_EQUAL(true, ::FileExists("conv_fail.in")); CPPUNIT_ASSERT_EQUAL(1, ::RunFile(n, "conv_fail.in")); @@ -335,7 +335,7 @@ void TestIPhreeqcLib::TestRunFile(void) CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::DestroyIPhreeqc(n)); } - // Note: should this file exist since GetDumpOn is false? + // Note: should this file exist since GetDumpFileOn is false? CPPUNIT_ASSERT_EQUAL(true, ::FileExists(dump_file)); CPPUNIT_ASSERT(::DeleteFile(dump_file)); } @@ -423,11 +423,11 @@ void TestIPhreeqcLib::TestRunString(void) int n = ::CreateIPhreeqc(); CPPUNIT_ASSERT(n >= 0); CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase(n, "phreeqc.dat")); - ::SetOutputOn(n, 1); - ::SetErrorOn(n, 0); - ::SetLogOn(n, 0); - ::SetSelectedOutputOn(n, 0); - ::SetDumpOn(n, 0); + ::SetOutputFileOn(n, 1); + ::SetErrorFileOn(n, 0); + ::SetLogFileOn(n, 0); + ::SetSelectedOutputFileOn(n, 0); + ::SetDumpFileOn(n, 0); CPPUNIT_ASSERT_EQUAL(false, ::FileExists("phreeqc.out")); CPPUNIT_ASSERT_EQUAL(0, ::RunString(n, input)); CPPUNIT_ASSERT_EQUAL(true, ::FileExists("phreeqc.out")); @@ -454,11 +454,11 @@ void TestIPhreeqcLib::TestGetSelectedOutputRowCount() CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::SOLUTION(n, 1.0, 1.0, 1.0)); CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::EQUILIBRIUM_PHASES(n, "calcite", 0.0, 0.010)); CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::USER_PUNCH(n, "Ca", max)); - CPPUNIT_ASSERT_EQUAL(0, ::GetOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetErrorOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetLogOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetDumpOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetErrorFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetLogFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetDumpFileOn(n)); CPPUNIT_ASSERT_EQUAL(0, ::GetDumpStringOn(n)); CPPUNIT_ASSERT_EQUAL(0, ::RunAccumulated(n)); CPPUNIT_ASSERT_EQUAL(3, ::GetSelectedOutputRowCount(n)); // rows + header @@ -481,11 +481,11 @@ void TestIPhreeqcLib::TestGetSelectedOutputValue(void) CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::SOLUTION(n, 1.0, 1.0, 1.0)); CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::EQUILIBRIUM_PHASES(n, "calcite", 0.0, 0.010)); CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::USER_PUNCH(n, "Ca", max)); - CPPUNIT_ASSERT_EQUAL(0, ::GetOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetErrorOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetLogOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputOn(n)); - CPPUNIT_ASSERT_EQUAL(0, ::GetDumpOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetErrorFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetLogFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetSelectedOutputFileOn(n)); + CPPUNIT_ASSERT_EQUAL(0, ::GetDumpFileOn(n)); CPPUNIT_ASSERT_EQUAL(0, ::GetDumpStringOn(n)); CPPUNIT_ASSERT_EQUAL(0, ::RunAccumulated(n)); @@ -1233,7 +1233,7 @@ void TestIPhreeqcLib::TestAccumulateLine(void) // TODO } -void TestIPhreeqcLib::TestOutputError(void) +void TestIPhreeqcLib::TestOutputErrorString(void) { // TODO } @@ -1284,12 +1284,12 @@ void TestIPhreeqcLib::TestCase1(void) CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase(n, "phreeqc.dat") ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SOLUTION(n, 1.0, 1.0, 1.0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::USER_PUNCH(n, "Ca", 10) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 1) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount(n) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SOLUTION(n, 1.0, 1.0, 1.0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 1) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount(n) ); @@ -1327,7 +1327,7 @@ void TestIPhreeqcLib::TestCase2(void) CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SOLUTION(n, 1.0, 1.0, 1.0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::USER_PUNCH(n, "Ca", 10) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::AccumulateLine(n, "-file case2.punch") ); // force have_punch_name to TRUE (see read_selected_ouput) - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 1) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("case2.punch") ); @@ -1348,7 +1348,7 @@ void TestIPhreeqcLib::TestCase2(void) CPPUNIT_ASSERT_EQUAL( false, ::FileExists("case2.punch") ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SOLUTION(n, 1.0, 1.0, 1.0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::USER_PUNCH(n, "Ca", 10) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 1) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("case2.punch") ); @@ -1391,7 +1391,7 @@ void TestIPhreeqcLib::TestPrintSelectedOutputFalse(void) CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::AccumulateLine(n, "PRINT; -selected_output false \n") ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 1) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( 0, ::GetSelectedOutputColumnCount(n) ); @@ -1408,7 +1408,7 @@ void TestIPhreeqcLib::TestPrintSelectedOutputFalse(void) CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SELECTED_OUTPUT(n) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 1) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( 11, ::GetSelectedOutputColumnCount(n) ); @@ -1502,11 +1502,11 @@ void TestIPhreeqcLib::TestOnOff(const char* FILENAME, int output_on, int error_o CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::DUMP(n) ); // run all off - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) ); @@ -1522,11 +1522,11 @@ void TestIPhreeqcLib::TestOnOff(const char* FILENAME, int output_on, int error_o CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::DUMP(n) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, dump_on) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, error_on) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, log_on) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, output_on) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, selected_output_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, dump_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, error_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, log_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, output_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, selected_output_on) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, dump_string_on) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists(FILENAME) ); @@ -1543,11 +1543,11 @@ void TestIPhreeqcLib::TestOnOff(const char* FILENAME, int output_on, int error_o CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::DUMP(n) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) ); @@ -1563,11 +1563,11 @@ void TestIPhreeqcLib::TestOnOff(const char* FILENAME, int output_on, int error_o CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::DUMP(n) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, dump_on) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, error_on) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, log_on) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, output_on) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, selected_output_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, dump_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, error_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, log_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, output_on) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, selected_output_on) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, dump_string_on) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists(FILENAME) ); @@ -1603,11 +1603,11 @@ void TestIPhreeqcLib::TestLongHeadings(void) oss << "-end" << "\n"; CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::AccumulateLine(n, oss.str().c_str()) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( 2, ::GetSelectedOutputRowCount(n)); @@ -1638,11 +1638,11 @@ void TestIPhreeqcLib::TestDatabaseKeyword() CPPUNIT_ASSERT(n >= 0); CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase(n, "phreeqc.dat")); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( 1, ::RunFile(n, "dump")); const char *exp_errs = @@ -1682,11 +1682,11 @@ void TestIPhreeqcLib::TestDumpString() CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::DUMP(n) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); @@ -1757,7 +1757,7 @@ void TestIPhreeqcLib::TestDumpString() } } -void TestIPhreeqcLib::TestGetDumpLineCount(void) +void TestIPhreeqcLib::TestGetDumpStringLineCount(void) { int n = ::CreateIPhreeqc(); CPPUNIT_ASSERT(n >= 0); @@ -1771,14 +1771,14 @@ void TestIPhreeqcLib::TestGetDumpLineCount(void) CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::DUMP(n) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); - CPPUNIT_ASSERT_EQUAL( 26, ::GetDumpLineCount(n) ); + CPPUNIT_ASSERT_EQUAL( 26, ::GetDumpStringLineCount(n) ); if (n >= 0) { @@ -1786,7 +1786,7 @@ void TestIPhreeqcLib::TestGetDumpLineCount(void) } } -void TestIPhreeqcLib::TestGetDumpLine(void) +void TestIPhreeqcLib::TestGetDumpStringLine(void) { int n = ::CreateIPhreeqc(); CPPUNIT_ASSERT(n >= 0); @@ -1800,85 +1800,85 @@ void TestIPhreeqcLib::TestGetDumpLine(void) CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::DUMP(n) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, 1) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); - CPPUNIT_ASSERT_EQUAL( 26, ::GetDumpLineCount(n) ); + CPPUNIT_ASSERT_EQUAL( 26, ::GetDumpStringLineCount(n) ); int line = 0; #if defined(_MSC_VER) - CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003929"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-025"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826911"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(::GetDumpLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003929"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-025"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826911"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(::GetDumpStringLine(n, line++)) ); #endif #if defined(__GNUC__) - CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003928"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-25"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826912"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(::GetDumpLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003928"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-25"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826912"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(::GetDumpStringLine(n, line++)) ); #endif // remaining lines should be empty - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(n, line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(n, line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(n, line++)) ); // negative lines should be empty - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(n, -1)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(n, -2)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(n, -3)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(n, -4)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(n, -1)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(n, -2)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(n, -3)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(n, -4)) ); if (n >= 0) { @@ -1897,11 +1897,11 @@ void TestIPhreeqcLib::TestGetComponentCount(void) CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SOLUTION(n, 1.0, 1.0, 1.0) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( 3, ::GetComponentCount(n) ); @@ -1923,11 +1923,11 @@ void TestIPhreeqcLib::TestGetComponent(void) CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SOLUTION(n, 1.0, 1.0, 1.0) ); // run - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpStringOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated(n) ); CPPUNIT_ASSERT_EQUAL( 3, ::GetComponentCount(n) ); @@ -1948,22 +1948,22 @@ void TestIPhreeqcLib::TestGetComponent(void) CPPUNIT_ASSERT_EQUAL(IPQ_OK, ::DestroyIPhreeqc(n)); } } -void TestIPhreeqcLib::TestGetErrorLine(void) +void TestIPhreeqcLib::TestGetErrorStringLine(void) { int n = ::CreateIPhreeqc(); CPPUNIT_ASSERT(n >= 0); CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase(n, "phreeqc.dat") ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( 1, ::RunFile(n, "dump") ); - CPPUNIT_ASSERT_EQUAL( 2, ::GetErrorLineCount(n) ); - CPPUNIT_ASSERT_EQUAL( std::string("ERROR: Gas not found in PHASES data base, Amm(g)."), std::string(::GetErrorLine(n, 0)) ); - CPPUNIT_ASSERT_EQUAL( std::string("ERROR: Calculations terminating due to input errors."), std::string(::GetErrorLine(n, 1)) ); + CPPUNIT_ASSERT_EQUAL( 2, ::GetErrorStringLineCount(n) ); + CPPUNIT_ASSERT_EQUAL( std::string("ERROR: Gas not found in PHASES data base, Amm(g)."), std::string(::GetErrorStringLine(n, 0)) ); + CPPUNIT_ASSERT_EQUAL( std::string("ERROR: Calculations terminating due to input errors."), std::string(::GetErrorStringLine(n, 1)) ); if (n >= 0) { @@ -1971,25 +1971,25 @@ void TestIPhreeqcLib::TestGetErrorLine(void) } } -void TestIPhreeqcLib::TestGetWarningLine(void) +void TestIPhreeqcLib::TestGetWarningStringLine(void) { int n = ::CreateIPhreeqc(); CPPUNIT_ASSERT(n >= 0); CPPUNIT_ASSERT_EQUAL( 0, ::LoadDatabase(n, "phreeqc.dat") ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputOn(n, 0) ); - CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetErrorFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetLogFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetSelectedOutputFileOn(n, 0) ); + CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::SetDumpFileOn(n, 0) ); CPPUNIT_ASSERT_EQUAL( 1, ::RunFile(n, "dump") ); - CPPUNIT_ASSERT_EQUAL( 5, ::GetWarningLineCount(n) ); - CPPUNIT_ASSERT_EQUAL( std::string("WARNING: DATABASE keyword is ignored by IPhreeqc."), std::string(::GetWarningLine(n, 0)) ); - CPPUNIT_ASSERT_EQUAL( std::string("WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 100."), std::string(::GetWarningLine(n, 1)) ); - CPPUNIT_ASSERT_EQUAL( std::string("WARNING: No dispersivities were read; disp = 0 assumed."), std::string(::GetWarningLine(n, 2)) ); - CPPUNIT_ASSERT_EQUAL( std::string("WARNING: Could not find element in database, Amm."), std::string(::GetWarningLine(n, 3)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Concentration is set to zero."), std::string(::GetWarningLine(n, 4)) ); + CPPUNIT_ASSERT_EQUAL( 5, ::GetWarningStringLineCount(n) ); + CPPUNIT_ASSERT_EQUAL( std::string("WARNING: DATABASE keyword is ignored by IPhreeqc."), std::string(::GetWarningStringLine(n, 0)) ); + CPPUNIT_ASSERT_EQUAL( std::string("WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 100."), std::string(::GetWarningStringLine(n, 1)) ); + CPPUNIT_ASSERT_EQUAL( std::string("WARNING: No dispersivities were read; disp = 0 assumed."), std::string(::GetWarningStringLine(n, 2)) ); + CPPUNIT_ASSERT_EQUAL( std::string("WARNING: Could not find element in database, Amm."), std::string(::GetWarningStringLine(n, 3)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Concentration is set to zero."), std::string(::GetWarningStringLine(n, 4)) ); if (n >= 0) { @@ -2047,24 +2047,28 @@ void TestIPhreeqcLib::TestClearAccumulatedLines(void) CPPUNIT_ASSERT_EQUAL(::RunAccumulated(id), 1); - CPPUNIT_ASSERT_EQUAL( 3, ::GetErrorLineCount(id) ); - CPPUNIT_ASSERT_EQUAL( std::string("ERROR: A(H2O) Activity of water has not converged. Residual: 1.590343e+000"), std::string(::GetErrorLine(id, 0)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetErrorLine(id, 1)) ); - CPPUNIT_ASSERT_EQUAL( std::string("ERROR: Model failed to converge for initial solution."), std::string(::GetErrorLine(id, 2)) ); + CPPUNIT_ASSERT_EQUAL( 3, ::GetErrorStringLineCount(id) ); + +#if defined(_MSC_VER) + CPPUNIT_ASSERT_EQUAL( std::string("ERROR: A(H2O) Activity of water has not converged. Residual: 1.590343e+000"), std::string(::GetErrorStringLine(id, 0)) ); +#endif +#if defined(__GNUC__) + CPPUNIT_ASSERT_EQUAL( std::string("ERROR: A(H2O) Activity of water has not converged. Residual: 1.590343e+00"), std::string(::GetErrorStringLine(id, 0)) ); +#endif + + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetErrorStringLine(id, 1)) ); + CPPUNIT_ASSERT_EQUAL( std::string("ERROR: Model failed to converge for initial solution."), std::string(::GetErrorStringLine(id, 2)) ); CPPUNIT_ASSERT_EQUAL(::AccumulateLine(id, "SOLUTION 1"), IPQ_OK); CPPUNIT_ASSERT_EQUAL(::AccumulateLine(id, "pH 2"), IPQ_OK); CPPUNIT_ASSERT_EQUAL(::AccumulateLine(id, "END"), IPQ_OK); - CPPUNIT_ASSERT_EQUAL(::RunAccumulated(id), 1); - - CPPUNIT_ASSERT_EQUAL( 3, ::GetErrorLineCount(id) ); - CPPUNIT_ASSERT_EQUAL( std::string("ERROR: A(H2O) Activity of water has not converged. Residual: 1.590343e+000"), std::string(::GetErrorLine(id, 0)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetErrorLine(id, 1)) ); - CPPUNIT_ASSERT_EQUAL( std::string("ERROR: Model failed to converge for initial solution."), std::string(::GetErrorLine(id, 2)) ); + // RunAccumulated clears accumulated lines on next call to AccumulateLine + // + CPPUNIT_ASSERT_EQUAL(::RunAccumulated(id), 0); + CPPUNIT_ASSERT_EQUAL( 0, ::GetErrorStringLineCount(id) ); CPPUNIT_ASSERT_EQUAL( IPQ_OK, ::ClearAccumulatedLines(id) ); - CPPUNIT_ASSERT_EQUAL(::AccumulateLine(id, "SOLUTION 1"), IPQ_OK); CPPUNIT_ASSERT_EQUAL(::AccumulateLine(id, "pH 2"), IPQ_OK); CPPUNIT_ASSERT_EQUAL(::AccumulateLine(id, "END"), IPQ_OK); diff --git a/unit/TestIPhreeqcLib.h b/unit/TestIPhreeqcLib.h index 8cbc9164..32973945 100644 --- a/unit/TestIPhreeqcLib.h +++ b/unit/TestIPhreeqcLib.h @@ -23,7 +23,7 @@ class TestIPhreeqcLib : public CppUnit::TestFixture CPPUNIT_TEST( TestAddError ); CPPUNIT_TEST( TestAccumulateLine ); CPPUNIT_TEST( TestAddError ); - CPPUNIT_TEST( TestOutputError ); + CPPUNIT_TEST( TestOutputErrorString ); CPPUNIT_TEST( TestRunWithCallback ); CPPUNIT_TEST( TestRunNoDatabaseLoaded ); CPPUNIT_TEST( TestCase1 ); @@ -37,12 +37,12 @@ class TestIPhreeqcLib : public CppUnit::TestFixture CPPUNIT_TEST( TestLongHeadings ); CPPUNIT_TEST( TestDatabaseKeyword ); CPPUNIT_TEST( TestDumpString ); - CPPUNIT_TEST( TestGetDumpLineCount ); - CPPUNIT_TEST( TestGetDumpLine ); + CPPUNIT_TEST( TestGetDumpStringLineCount ); + CPPUNIT_TEST( TestGetDumpStringLine ); CPPUNIT_TEST( TestGetComponentCount ); CPPUNIT_TEST( TestGetComponent ); - CPPUNIT_TEST( TestGetErrorLine ); - CPPUNIT_TEST( TestGetWarningLine ); + CPPUNIT_TEST( TestGetErrorStringLine ); + CPPUNIT_TEST( TestGetWarningStringLine ); CPPUNIT_TEST( TestPitzer ); CPPUNIT_TEST( TestClearAccumulatedLines ); CPPUNIT_TEST_SUITE_END(); @@ -67,7 +67,7 @@ public: void TestGetSelectedOutputColumnCount(void); void TestAddError(void); void TestAccumulateLine(void); - void TestOutputError(void); + void TestOutputErrorString(void); void TestRunWithCallback(void); void TestRunNoDatabaseLoaded(void); void TestCase1(void); @@ -81,12 +81,12 @@ public: void TestLongHeadings(void); void TestDatabaseKeyword(); void TestDumpString(); - void TestGetDumpLineCount(void); - void TestGetDumpLine(void); + void TestGetDumpStringLineCount(void); + void TestGetDumpStringLine(void); void TestGetComponentCount(void); void TestGetComponent(void); - void TestGetErrorLine(void); - void TestGetWarningLine(void); + void TestGetErrorStringLine(void); + void TestGetWarningStringLine(void); void TestPitzer(void); void TestClearAccumulatedLines(void); diff --git a/unit/TestInterface.cpp b/unit/TestInterface.cpp index 4021d3fe..c7ff8f4d 100644 --- a/unit/TestInterface.cpp +++ b/unit/TestInterface.cpp @@ -174,11 +174,11 @@ void TestInterface::TestRun() int files_on = 0; CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat")); CPPUNIT_ASSERT_EQUAL(VR_OK, ::AccumulateLine("solution 12")); - ::SetOutputOn(files_on); - ::SetErrorOn(files_on); - ::SetLogOn(files_on); - ::SetSelectedOutputOn(files_on); - ::SetDumpOn(files_on); + ::SetOutputFileOn(files_on); + ::SetErrorFileOn(files_on); + ::SetLogFileOn(files_on); + ::SetSelectedOutputFileOn(files_on); + ::SetDumpFileOn(files_on); CPPUNIT_ASSERT_EQUAL(0, ::RunAccumulated()); } @@ -206,11 +206,11 @@ void TestInterface::TestRunWithErrors() CPPUNIT_ASSERT_EQUAL(VR_OK, ::AccumulateLine(" Fix_H+ -10 HCl 10")); CPPUNIT_ASSERT_EQUAL(VR_OK, ::AccumulateLine("END")); - ::SetOutputOn(files_on); - ::SetErrorOn(files_on); - ::SetLogOn(files_on); - ::SetSelectedOutputOn(files_on); - ::SetDumpOn(files_on); + ::SetOutputFileOn(files_on); + ::SetErrorFileOn(files_on); + ::SetLogFileOn(files_on); + ::SetSelectedOutputFileOn(files_on); + ::SetDumpFileOn(files_on); CPPUNIT_ASSERT_EQUAL(1, ::RunAccumulated()); const char expected[] = @@ -239,11 +239,11 @@ void TestInterface::TestRunFile() CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat")); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL(1, ::RunFile("conv_fail.in")); const char expected[] = @@ -338,11 +338,11 @@ void TestInterface::TestRunString(void) } CPPUNIT_ASSERT_EQUAL(false, ::FileExists("phreeqc.out")); CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat")); - ::SetOutputOn(1); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(1); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL(false, ::FileExists("phreeqc.out")); CPPUNIT_ASSERT_EQUAL(0, ::RunString(input)); CPPUNIT_ASSERT_EQUAL(true, ::FileExists("phreeqc.out")); @@ -362,11 +362,11 @@ void TestInterface::TestGetSelectedOutputRowCount() CPPUNIT_ASSERT_EQUAL(VR_OK, EQUILIBRIUM_PHASES("calcite", 0.0, 0.010)); CPPUNIT_ASSERT_EQUAL(VR_OK, USER_PUNCH("Ca", max)); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL(0, ::RunAccumulated()); CPPUNIT_ASSERT_EQUAL(3, ::GetSelectedOutputRowCount()); // rows + header @@ -384,11 +384,11 @@ void TestInterface::TestGetSelectedOutputValue() CPPUNIT_ASSERT_EQUAL(VR_OK, EQUILIBRIUM_PHASES("calcite", 0.0, 0.010)); CPPUNIT_ASSERT_EQUAL(VR_OK, USER_PUNCH("Ca", max)); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL(0, ::RunAccumulated()); /* @@ -1043,11 +1043,11 @@ void TestInterface::TestRunWithCallback() void TestInterface::TestRunNoDatabaseLoaded() { UnLoadDatabase(); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 1, ::RunAccumulated() ); const char expected[] = @@ -1061,11 +1061,11 @@ void TestInterface::TestRunNoDatabaseLoaded() void TestInterface::TestRunFileNoDatabaseLoaded() { UnLoadDatabase(); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 1, ::RunFile("dummy") ); const char expected[] = @@ -1102,21 +1102,21 @@ void TestInterface::TestCase1() CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) ); CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) ); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(1); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(1); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() ); CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) ); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(1); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(1); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( 62, ::GetSelectedOutputColumnCount() ); @@ -1153,11 +1153,11 @@ void TestInterface::TestCase2() 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) - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(1); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(1); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("case2.punch") ); @@ -1179,11 +1179,11 @@ void TestInterface::TestCase2() CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) ); CPPUNIT_ASSERT_EQUAL( VR_OK, USER_PUNCH("Ca", 10) ); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(1); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(1); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists("selected.out") ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists("case2.punch") ); @@ -1218,11 +1218,11 @@ void TestInterface::TestPrintSelectedOutputFalse() CPPUNIT_ASSERT_EQUAL( VR_OK, ::AccumulateLine("PRINT; -selected_output false \n") ); // run - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(1); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(1); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( 0, ::GetSelectedOutputColumnCount() ); @@ -1239,11 +1239,11 @@ void TestInterface::TestPrintSelectedOutputFalse() CPPUNIT_ASSERT_EQUAL( VR_OK, SELECTED_OUTPUT() ); // run - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(1); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(1); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( 11, ::GetSelectedOutputColumnCount() ); @@ -1409,11 +1409,11 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP() ); // run all off - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) ); @@ -1431,11 +1431,11 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP() ); // run - ::SetOutputOn(output_on); - ::SetErrorOn(error_on); - ::SetLogOn(log_on); - ::SetSelectedOutputOn(selected_output_on); - ::SetDumpOn(dump_on); + ::SetOutputFileOn(output_on); + ::SetErrorFileOn(error_on); + ::SetLogFileOn(log_on); + ::SetSelectedOutputFileOn(selected_output_on); + ::SetDumpFileOn(dump_on); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists(FILENAME) ); CPPUNIT_ASSERT( ::DeleteFile(FILENAME) ); @@ -1454,11 +1454,11 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP() ); // run - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( false, ::FileExists(FILENAME) ); @@ -1474,11 +1474,11 @@ void TestOnOff(const char* FILENAME, int output_on, int error_on, int log_on, in CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP() ); // run - ::SetOutputOn(output_on); - ::SetErrorOn(error_on); - ::SetLogOn(log_on); - ::SetSelectedOutputOn(selected_output_on); - ::SetDumpOn(dump_on); + ::SetOutputFileOn(output_on); + ::SetErrorFileOn(error_on); + ::SetLogFileOn(log_on); + ::SetSelectedOutputFileOn(selected_output_on); + ::SetDumpFileOn(dump_on); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL( true, ::FileExists(FILENAME) ); CPPUNIT_ASSERT( ::DeleteFile(FILENAME) ); @@ -1505,11 +1505,11 @@ TestInterface::TestLongHeadings() oss << "-end" << "\n"; CPPUNIT_ASSERT_EQUAL( VR_OK, ::AccumulateLine(oss.str().c_str()) ); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); CPPUNIT_ASSERT_EQUAL(2, ::GetSelectedOutputRowCount()); @@ -1533,11 +1533,11 @@ void TestInterface::TestDatabaseKeyword() { CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat")); - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); CPPUNIT_ASSERT_EQUAL(1, ::RunFile("dump")); const char *expected = @@ -1561,11 +1561,11 @@ TestInterface::TestDumpString() CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP() ); // run - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); ::SetDumpStringOn(1); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); @@ -1632,7 +1632,7 @@ TestInterface::TestDumpString() } void -TestInterface::TestGetDumpLineCount() +TestInterface::TestGetDumpStringLineCount() { CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat")); @@ -1643,19 +1643,19 @@ TestInterface::TestGetDumpLineCount() CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP() ); // run - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); ::SetDumpStringOn(1); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); - CPPUNIT_ASSERT_EQUAL( 26, ::GetDumpLineCount() ); + CPPUNIT_ASSERT_EQUAL( 26, ::GetDumpStringLineCount() ); } void -TestInterface::TestGetDumpLine() +TestInterface::TestGetDumpStringLine() { CPPUNIT_ASSERT_EQUAL(0, ::LoadDatabase("phreeqc.dat")); @@ -1666,86 +1666,86 @@ TestInterface::TestGetDumpLine() CPPUNIT_ASSERT_EQUAL( VR_OK, DUMP() ); // run - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); ::SetDumpStringOn(1); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); - CPPUNIT_ASSERT_EQUAL( 26, ::GetDumpLineCount() ); + CPPUNIT_ASSERT_EQUAL( 26, ::GetDumpStringLineCount() ); int line = 0; #if defined(_MSC_VER) - CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003929"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-025"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826911"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(::GetDumpLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003929"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-025"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826911"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(::GetDumpStringLine(line++)) ); #endif #if defined(__GNUC__) - CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003928"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-25"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826912"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(::GetDumpLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string("SOLUTION_RAW 1 "), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -temp 25"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_h 111.0132593403"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_o 55.509043478605"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -cb 0.0021723831003928"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -totals"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) 0.0010000000000376"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca 0.001000000004331"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) 1.4149476909313e-25"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na 0.001"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -Isotopes"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pH 7"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -pe 4"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mu 0.0028961089894362"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -ah2o 0.99994915105857"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -mass_water 1"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -total_alkalinity 0.00082761690826912"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -activities"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(-4) -67.370522674574"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" C(4) -6.4415889265024"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Ca -3.1040445240857"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" E -4"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" H(0) -25.15"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" Na -3.0255625287599"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" O(0) -42.080044167952"), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(" -gammas"), std::string(::GetDumpStringLine(line++)) ); #endif // remaining lines should be empty - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(line++)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(line++)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(line++)) ); // negative lines should be empty - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(-1)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(-2)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(-3)) ); - CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpLine(-4)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(-1)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(-2)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(-3)) ); + CPPUNIT_ASSERT_EQUAL( std::string(""), std::string(::GetDumpStringLine(-4)) ); } void @@ -1757,11 +1757,11 @@ TestInterface::TestGetComponentCount(void) CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) ); // run - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); ::SetDumpStringOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); @@ -1778,11 +1778,11 @@ TestInterface::TestGetComponent(void) CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(1.0, 1.0, 1.0) ); // run - ::SetOutputOn(0); - ::SetErrorOn(0); - ::SetLogOn(0); - ::SetSelectedOutputOn(0); - ::SetDumpOn(0); + ::SetOutputFileOn(0); + ::SetErrorFileOn(0); + ::SetLogFileOn(0); + ::SetSelectedOutputFileOn(0); + ::SetDumpFileOn(0); ::SetDumpStringOn(0); CPPUNIT_ASSERT_EQUAL( 0, ::RunAccumulated() ); diff --git a/unit/TestInterface.h b/unit/TestInterface.h index 183ab852..54e17ccb 100644 --- a/unit/TestInterface.h +++ b/unit/TestInterface.h @@ -37,8 +37,8 @@ class TestInterface : CPPUNIT_TEST( TestDatabaseKeyword ); CPPUNIT_TEST( TestDumpOn ); CPPUNIT_TEST( TestDumpString ); - CPPUNIT_TEST( TestGetDumpLineCount ); - CPPUNIT_TEST( TestGetDumpLine ); + CPPUNIT_TEST( TestGetDumpStringLineCount ); + CPPUNIT_TEST( TestGetDumpStringLine ); CPPUNIT_TEST( TestGetComponentCount ); CPPUNIT_TEST( TestGetComponent ); @@ -77,8 +77,8 @@ public: void TestDatabaseKeyword(void); void TestDumpOn(void); void TestDumpString(void); - void TestGetDumpLineCount(void); - void TestGetDumpLine(void); + void TestGetDumpStringLineCount(void); + void TestGetDumpStringLine(void); void TestGetComponentCount(void); void TestGetComponent(void);