Reduced timeouts by 10x
[invirt/third/libt4.git] / rsm_tester.cc
index f172602..1a8b833 100644 (file)
@@ -2,32 +2,27 @@
 // RSM test client
 //
 
+#include "types.h"
 #include "rsm_protocol.h"
 #include "rsmtest_client.h"
-#include "rpc/rpc.h"
-#include <arpa/inet.h>
-#include <vector>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string>
 
-int
-main(int argc, char *argv[])
-{
+char log_thread_prefix = 't';
+
+int main(int argc, char *argv[]) {
     if(argc != 4){
-        fprintf(stderr, "Usage: %s [host:]port [partition] arg\n", argv[0]);
-        exit(1);
+        cerr << "Usage: " << argv[0] << " [host:]port [partition] arg" << endl;
+        return 1;
     }
 
     rsmtest_client *lc = new rsmtest_client(argv[1]);
-    std::string command(argv[2]);
+    string command(argv[2]);
     if (command == "partition") {
-        printf("net_repair returned %d\n", lc->net_repair(atoi(argv[3])));
+        cout << "net_repair returned " << lc->net_repair(stoi(argv[3]));
     } else if (command == "breakpoint") {
-        int b = atoi(argv[3]);
-        printf("breakpoint %d returned %d\n", b, lc->breakpoint(b));
+        int b = stoi(argv[3]);
+        cout << "breakpoint " << b << " returned " << lc->breakpoint(b);
     } else {
-        fprintf(stderr, "Unknown command %s\n", argv[2]);
+        cerr << "Unknown command " << argv[2] << endl;
     }
     return 0;
 }