int CC_Client::run (void) { int tests_run = 0; // Tells whether any tests have been run int success = CC_SUCCESS; // Did test succeed? if (this->run_basic_tests_ && success == CC_SUCCESS) { success = run_basic_tests (); if(success==CC_FAIL) ACE_DEBUG((LM_DEBUG, "Basic tests did not succeed\n")); tests_run = 1; } if (this->run_extended_tests_ && success == CC_SUCCESS) { success = run_extended_tests (this->extended_tests_params_); if(success==CC_FAIL) ACE_DEBUG((LM_DEBUG, "Extended tests did not succeed\n")); tests_run = 1; } if(this->use_script_file_ && success == CC_SUCCESS) { cmdlist = new CC_CommandList(); FILE *f; // Open the command file for parsing if the filename!=stdin if(ACE_OS::strcmp(this->script_file_, ACE_TEXT("stdin"))!=0) { f = ACE_OS::fopen(this->script_file_, "r"); if(f==0) ACE_ERROR_RETURN ((LM_ERROR, "Unable to open %s\n", this->script_file_), -1); ace_cc_yyin = f; } ace_cc_yyparse(); } // Other tests go here // if (other_test_flag && success == CC_SUCCESS) ... if (this->shutdown_) // @@TAO is this needed?? if (tests_run == 0) { print_usage (); ACE_ERROR_RETURN ((LM_ERROR, "No tests given\n"), -1); } return success; }
int pa__init(pa_module *m) { struct userdata *u = NULL; u = pa_xnew0(struct userdata, 1); m->userdata = u; u->mode_sink = pa_namereg_get(m->core, "sink.hw0", PA_NAMEREG_SINK); if (!u->mode_sink) { pa_log_error("sink.hw0 not found"); pa_xfree(u); m->userdata = NULL; return -1; } run_basic_tests(u); run_modifier_tests(u); pa_module_unload_request(m, TRUE); return 0; }