TEST(test_magneto, all) { LOGGER_SYS_INIT("conf/log.conf") std::vector< std::pair<magneto::RoutineHandler, size_t> > routine_handlers; routine_handlers.push_back(std::make_pair(NaiveHandler, 30)); bool end=false; bool ret = server.Init("data/magneto/test_pressure/conf/", NULL, &routine_handlers, NULL, end); ASSERT_TRUE(ret); sleep(1000); end=true; }
int main() { LOGGER_SYS_INIT("conf/log.conf") xforce::ml::Conf conf; if (!conf.Init()) { std::cout << "fail_init_conf" << std::endl; return 1; } xforce::ml::Data data; if (!data.Init(conf)) { std::cout << "fail_init_data" << std::endl; return 2; } xforce::ml::Plsa plsa(conf, data); plsa.Start(); plsa.Stop(); return 0; }
int main() { LOGGER_SYS_INIT("conf/log.conf") magneto::Magneto* service = new magneto::Magneto; magneto::Magneto* client = new magneto::Magneto; magneto::RoutineItems client_handle; // init service int ret = service->Init("conf/confs_server/", &Service, NULL, service, end); MAG_FAIL_HANDLE_FATAL_LOG(magneto::magneto_logger, !ret, "fail_init_server") // init client client_handle.push_back(std::make_pair(ClientHandler, 100)); ret = client->Init("conf/confs_client/", NULL, &client_handle, client, end); MAG_FAIL_HANDLE_FATAL_LOG(magneto::magneto_logger, !ret, "fail_init_client") delete client; delete service; return 0; ERROR_HANDLE: end=true; delete client; delete service; return -1; }