X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/2546a41ad36fdc9ef6471cb35a1d56930ae1b527..5a5c578e2e358a121cdb9234a6cb11c4ecfbf323:/lock_tester.cc diff --git a/lock_tester.cc b/lock_tester.cc index ac9175b..c192128 100644 --- a/lock_tester.cc +++ b/lock_tester.cc @@ -2,18 +2,10 @@ // Lock server tester // -#include "lock_protocol.h" #include "lock_client.h" -#include "rpc/rpc.h" #include -#include -#include -#include -#include "lang/verify.h" -#include "threaded_log.h" #include #include -#include "lock.h" char log_thread_prefix = 'c'; @@ -35,8 +27,8 @@ void check_grant(lock_protocol::lockid_t lid) { lock ml(count_mutex); int x = lid[0] & 0x0f; if (ct[x] != 0) { - fprintf(stderr, "error: server granted %s twice\n", lid.c_str()); - fprintf(stdout, "error: server granted %s twice\n", lid.c_str()); + cout << "error: server granted " << lid << " twice" << endl; + cerr << "error: server granted " << lid << " twice" << endl; exit(1); } ct[x] += 1; @@ -46,7 +38,7 @@ void check_release(lock_protocol::lockid_t lid) { lock ml(count_mutex); int x = lid[0] & 0x0f; if (ct[x] != 1) { - fprintf(stderr, "error: client released un-held lock %s\n", lid.c_str()); + cerr << "error: client released un-held lock " << lid << endl; exit(1); } ct[x] -= 1; @@ -132,7 +124,7 @@ main(int argc, char *argv[]) srandom((uint32_t)getpid()); if (argc < 2) { - fprintf(stderr, "Usage: %s [host:]port [test]\n", argv[0]); + cerr << "Usage: " << argv[0] << " [host:]port [test]" << endl; exit(1); }