int main(int argc, char *argv[]) { struct Set *set = constructSet(); runTests(set); SetClose(set); return 0; }
void testEmpty() { struct Set *set = constructSet(); testTrue(empty(set) == true, "New set is empty"); add(set, 123); testTrue(empty(set) == false, "Non empty set is not empty"); SetClose(set); }
void testSize() { struct Set *set = constructSet(); testTrue(size(set) == 0, "New set is size 0"); add(set, 1); testTrue(size(set) == 1, "New set add one is size 1"); rm(set, 1); testTrue(size(set) == 0, "Old set rm one is size 0"); SetClose(set); }
PDSS_Water::PDSS_Water() : m_waterProps(&m_sub), m_dens(1000.0), m_iState(WATER_LIQUID), EW_Offset(0.0), SW_Offset(0.0), m_verbose(0), m_allowGasPhase(false) { m_pdssType = cPDSS_WATER; m_spthermo = 0; constructSet(); m_minTemp = 200.; m_maxTemp = 10000.; }
PDSS_Water::PDSS_Water(VPStandardStateTP *tp, int spindex) : PDSS(tp, spindex), m_sub(0), m_waterProps(0), m_dens(1000.0), m_iState(WATER_LIQUID), EW_Offset(0.0), SW_Offset(0.0), m_verbose(0), m_allowGasPhase(false) { m_pdssType = cPDSS_WATER; m_sub = new WaterPropsIAPWS(); m_waterProps = new WaterProps(m_sub); m_spthermo = 0; constructSet(); m_minTemp = 200.; m_maxTemp = 10000.; }
void testFullAndGrow() { struct Set *set = constructSet(); int i = 0; for (i = 0; i < STARTING_SET_SIZE * 3; i++) { add(set, i); } printf("%i %i %i\n", full(set), set->capacity, set->count); testTrue(set->count == 30, "added 30 elements"); //rm(set, 29); for (i = 0; i < STARTING_SET_SIZE * 3; i++) { rm(set, i); } printf("%i %i %i\n", full(set), set->capacity, set->count); testTrue(set->count == 0, "removed 30 elements"); SetClose(set); }
/* * constructPDSSXML: * * Initialization of a Debye-Huckel phase using an * xml file. * * This routine is a precursor to constructSet * routine, which does most of the work. * * @param infile XML file containing the description of the * phase * * @param id Optional parameter identifying the name of the * phase. If none is given, the first XML * phase element will be used. */ void PDSS_Water::constructPDSSXML(VPStandardStateTP *tp, int spindex, const XML_Node& phaseNode, std::string id) { constructSet(); }