PROJECT = test_cromp
TYPE = test
TARGETS = test_cromp_client.exe test_cromp_server.exe test_many_cromp.exe
-#DEFINITIONS += USE_HOOPLE_DLLS
LAST_TARGETS = create_decoder_ring
-#LOCAL_LIBS_USED = basis i_library i_communication
+LOCAL_LIBS_USED = unit_test application configuration filesystem loggers \
+ mathematics nodes octopi processes sockets structures textual timely \
+ structures basis
USE_SSL = t
-#VCPP_USE_SOCK = t
-RUN_TARGETS = $(ACTUAL_TARGETS)
+#RUN_TARGETS = $(ACTUAL_TARGETS)
include cpp/rules.def
using namespace unit_test;
#undef LOG
-#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
+#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), astring(s))
+#undef BASE_LOG
+#define BASE_LOG(s) EMERGENCY_LOG(program_wide_logger::get(), astring(s))
+
#define DEBUG_TESTER
// uncomment for noisier version.
const int CHANCE_OF_RECONSTRUCT = 14;
// how frequently a bus reconstruction occurs, in 1000.
-#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
-#define BASE_LOG(s) EMERGENCY_LOG(program_wide_logger::get(), s)
-
class cromp_client_tester : virtual public unit_base, virtual public application_shell
{
public:
//////////////
cromp_client_tester::cromp_client_tester()
-: application_shell("cromp_client_tester"),
+: application_shell(),
+//"cromp_client_tester"),
_uplink(NULL_POINTER),
_lock(new mutex),
_threads_active(0),
{
astring name = filename(application::_global_argv[0]).basename().raw();
log(a_sprintf("%s usage:", name.s()));
- log("");
+ log(astring(""));
log(a_sprintf("\
This program connects to a cromp test server and exchanges packets to test\n\
the performance of the cromp protocol. All command line flags are optional\n\
}
case cromp_client::TOO_FULL: {
//treating as failure right now.
-BASE_LOG("got too full outcome!");
+LOG("got too full outcome!");
sends--;
overall_sent -= curr_sending;
continue;
}
case cromp_client::TIMED_OUT: {
//treating as failure right now.
-BASE_LOG("got timed out outcome!");
+LOG("got timed out outcome!");
sends--;
overall_sent -= curr_sending;
continue;
}
if (! (sends % _checkpoint_count)) {
- BASE_LOG(a_sprintf("%x send #%d", originator, sends));
+ LOG(a_sprintf("%x send #%d", originator, sends));
}
}
- BASE_LOG(a_sprintf("%x final send #%d", originator, _send_count));
+ LOG(a_sprintf("%x final send #%d", originator, _send_count));
/// LOG(timestamp(true, true) + " done.");
/// LOG(a_sprintf("sent %d items.", _send_count));