int TestMain () { MinThread = min(MinThread, MaxThread); ASSERT (MinThread>=1, "Minimal number of threads must be 1 or more"); for ( int p = MinThread; p <= MaxThread; ++p ) { tbb::task_scheduler_init init(p); test_parallel_invoke(); if (p > 1) { #if __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN REPORT("Known issue: exception handling tests are skipped.\n"); #elif TBB_USE_EXCEPTIONS TestExceptionHandling(); #endif /* TBB_USE_EXCEPTIONS */ TestCancellation(); } TestCPUUserTime(p); } return Harness::Done; }
int main(int argc, char** argv) { try { if ((argc == 2) && !strcmp(argv[1], "ssl")) { #ifdef PEGASUS_HAS_SSL testSSLConnect(); #else cout << argv [0] << ": Export Client SSL tests skipped because" " PEGASUS_HAS_SSL is not defined" << endl; #endif } else if (argc == 1) { TestExceptionHandling(); TestTimeout(); testConnect(); } else { cerr << "Error: unexpected test arguments" << endl; return 1; } } catch(const Exception& e) { cerr << "Exception: " << e.getMessage() << endl; return 1; } cout << "+++++ passed all tests" << endl; return 0; }
int main() { const char* pegasusHome = getenv("PEGASUS_HOME"); if (!pegasusHome) { cerr << "PEGASUS_HOME environment variable not set" << endl; exit(1); } String repositoryRoot = pegasusHome; repositoryRoot.append("/repository"); CIMRepository* repository = new CIMRepository( repositoryRoot, CIMRepository::MODE_BIN); ConfigManager::setPegasusHome(pegasusHome); // -- Create repository and namespaces: CreateRepository(*repository); try { HandlerTable handlerTable; String handlerId = "snmpIndicationHandler"; CIMHandler* handler = handlerTable.getHandler(handlerId, repository); PEGASUS_TEST_ASSERT(handler != 0); TestExceptionHandling(handler); // // -- Clean up classes: // repository->deleteClass(NS, testClass1); repository->deleteClass(NS, testClass2); repository->deleteClass(NS, testClass3); repository->deleteClass(NS, testClass4); repository->deleteClass(NS, testClass5); repository->deleteClass(NS, testClass6); repository->deleteClass(NS, testClass7); repository->deleteClass(NS, testClass8); // // -- Delete the qualifier: // repository->deleteQualifier(NS, CIMName ("MappingStrings")); repository->deleteQualifier(NS, CIMName ("NotMappingStrings")); repository->deleteNameSpace(NS); } catch(Exception& e) { PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl); exit(1); } delete repository; cout << "+++++ passed all tests" << endl; return 0; }