int modentry(int boot, Module m, void *ptr) { switch (boot) { case 0: return setup_(m); break; case 1: return boot_(m); break; case 2: return cleanup_(m); break; case 3: return finish_(m); break; case 4: return features_(m, (char ***)ptr); break; case 5: return enables_(m, (int **)ptr); break; default: zerr("bad call to modentry"); return 1; break; } }
void TestCase::Setup(void) { PrintStart(GetFormattedCaseTitle() + "Started!"); Print(GetFormattedCaseTitle() + "Setup ongoing..."); if (setup_ != NULL) setup_(GetFormattedCaseTitle()); Print(GetFormattedCaseTitle() + "Setup completed!"); }
IconLoader::IconLoader(const std::list<String>& icon_dirs) : invalid_(new QIcon()) { for(std::list<String>::const_iterator it = icon_dirs.begin(); it != icon_dirs.end(); ++it) { icon_dirs_.append(it->c_str()); } setup_(); }
IconLoader::IconLoader() : invalid_(new QIcon()) { Path p; String found = p.find("graphics/icons"); if (found != "") icon_dirs_.append(found.c_str()); setup_(); }
/** * Common suite entry * @return */ TestSuite *ubf_Badd_tests(void) { TestSuite *suite = create_test_suite(); setup_(suite, basic_setup1); teardown_(suite, basic_teardown1); add_test(suite, test_Badd_str); return suite; }
void TestSuite::Setup(void) { PrintStart(GetFormattedSuiteTitle() + "Started!"); char descri[128] = { 0 }; sprintf(descri, "%sTotally %d test cases.", GetFormattedSuiteTitle().c_str(), GetCaseCount()); string descriStr(descri); Print(descriStr); Print(GetFormattedSuiteTitle() + "Setup ongoing..."); if (setup_ != NULL) setup_(GetFormattedSuiteTitle()); Print(GetFormattedSuiteTitle() + "Setup completed!"); }
LoaderDatabaseConnection::LoaderDatabaseConnection(const LoaderConfiguration & config) : pqxx::connection(config.database().pqDatabaseConnection()), config_(new LoaderConfiguration(config)) { if ( config.loading().nameSpace.empty() ) perform ( BeginWci(config.database().user) ); else if (config.loading().nameSpace == "test" ) perform ( BeginWci(config.database().user, 999, 999, 999) ); else if (config.loading().nameSpace == "default" ) perform ( BeginWci(config.database().user, 0, 0, 0) ); else throw std::logic_error("Unknown name space specification: " + config.loading().nameSpace ); setup_(); }
void Test_Suite:: run(Test_Result & result) { for(Test_Cases::iterator it = test_cases_.begin(), end = test_cases_.end(); it != end; ++it) { try { std::cout << "" << name() << ":" << it->name() << " "; std::cout.flush(); if(setup_) { setup_(); } it->run(); std::cout << "."; } catch(Assertion_Failed const & ex) { std::cout << "F"; result.add_failure(Failure(name(), it->name(), ex.what())); } catch(std::exception const & ex) { std::cout << "E"; result.add_error(Failure(name(), it->name(), ex.what())); } catch(...) { std::cout << "E"; result.add_error(Failure(name(), it->name(), "Unknown exception")); } if(teardown_) { teardown_(); } std::cout << std::endl; } }
IconLoader::IconLoader(const QStringList& icon_dirs) : invalid_(new QIcon()), icon_dirs_(icon_dirs) { setup_(); }
//-------------------------------------------------------------------------- void Omu_IntRKsuite::ode_solve(double tstart, VECP y, const VECP u, double tend) { if (_sa) _neq = y->dim; else _neq = _n; _npar = u->dim; v_resize(_work, 32 * _neq); v_resize(_thres, _neq); v_resize(_u, _npar); v_resize(_yp, _neq); _y_head.dim = _neq; _yp_head.dim = _neq; v_set(_thres, _atol); // exclude sensitivities from error test if (!_serr) { for (int i = _n; i < (int)_thres->dim; i++) _thres[i] = 1e128; } v_zero(_yp); v_copy(u, _u); integer NEQ = _neq; // a hack to reinitialize _hnext in each simulation if (tstart < _tlast) _hnext = 0.0; _tlast = tstart; dreal TNOW = tstart; integer CFLAG; //integer METHOD = (_rtol > 5e-4)? 1: (_rtol > 5e-6)? 2: 3; integer METHOD = _method; char TASK = 'c'; logical ERRASS = 0; dreal HSTART = _hnext; integer LENWRK = _work->dim; logical MESAGE = 0; setup_(&NEQ, &tstart, y->ve, &tend, &_rtol, _thres->ve, &METHOD, &TASK, &ERRASS, &HSTART, _work->ve, &LENWRK, &MESAGE); while (TNOW < tend) { ct_(&::F, &TNOW, y->ve, _yp->ve, _work->ve, &CFLAG); if (CFLAG > 1) fprintf(stderr, "RKsuite message %d at time %g\n", CFLAG, TNOW); if (CFLAG > 4) m_error(E_CONV, "Omu_IntRKsuite::step"); } integer TOTF, STPCST, STPSOK; dreal WASTE; stat_(&TOTF, &STPCST, &WASTE, &STPSOK, &HSTART); _hnext = HSTART; }
void Tip4p_H::initialize(void){ // initialize the fortan code setup_(); tip4p_pot = new Tip4p(); return; }