X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/5fd8cc8409d0efadc07dfe8d6774ad9ff477663d..d54215aea2a7321ab0f2dc7b0042fea2b7ff5df5:/rsm_tester.cc diff --git a/rsm_tester.cc b/rsm_tester.cc index 08034e2..469aea2 100644 --- a/rsm_tester.cc +++ b/rsm_tester.cc @@ -2,39 +2,27 @@ // RSM test client // +#include "types.h" #include "rsm_protocol.h" #include "rsmtest_client.h" -#include "rpc.h" -#include -#include -#include -#include -#include -using namespace std; -rsmtest_client *lc; +char log_thread_prefix = 't'; -int -main(int argc, char *argv[]) -{ - int r; +int main(int argc, char *argv[]) { + if(argc != 4){ + LOG_NONMEMBER("Usage: " << argv[0] << " [host:]port [partition] arg"); + return 1; + } - if(argc != 4){ - fprintf(stderr, "Usage: %s [host:]port [partition] arg\n", argv[0]); - exit(1); - } - - lc = new rsmtest_client(argv[1]); - string command(argv[2]); - if (command == "partition") { - r = lc->net_repair(atoi(argv[3])); - printf ("net_repair returned %d\n", r); - } else if (command == "breakpoint") { - int b = atoi(argv[3]); - r = lc->breakpoint(b); - printf ("breakpoint %d returned %d\n", b, r); - } else { - fprintf(stderr, "Unknown command %s\n", argv[2]); - } - exit(0); + rsmtest_client *lc = new rsmtest_client(argv[1]); + string command(argv[2]); + if (command == "partition") { + cout << "net_repair returned " << lc->net_repair(stoi(argv[3])); + } else if (command == "breakpoint") { + int b = stoi(argv[3]); + cout << "breakpoint " << b << " returned " << lc->breakpoint(b); + } else { + LOG_NONMEMBER("Unknown command " << argv[2]); + } + return 0; }