Undo all the work on determinism in the driver. New plan soon.

This commit is contained in:
2022-02-21 19:28:54 -05:00
parent ba1e923b5a
commit 19b6951e0f
14 changed files with 105 additions and 1146 deletions

View File

@@ -19,6 +19,13 @@ static void dump_lines(StreamBuffer *in, StreamBuffer *out, int chid) {
}
}
// This test is the minimal possible DrivenEngine.
class DriverStubTest : public DrivenEngine {
virtual void event_init(int argc, char *argv[]) {
stop_driver();
}
};
// This test connects to a public webserver and prints
// the output from the server.
class DriverWebServerTest : public DrivenEngine {
@@ -72,15 +79,6 @@ public:
}
};
static int64_t mallocstate() {
int64_t result = 0;
for (int i = 0; i < 10; i++) {
int64_t n = int64_t(malloc(1));
result = (result * 17) + n;
}
return result;
}
// This test just prints the time.
class DriverPrintClockTest : public DrivenEngine {
public:
@@ -94,7 +92,7 @@ public:
virtual void event_update() {
double clock = get_clock();
if (clock > last_clock_ + 0.5) {
int64_t ms = mallocstate();
int ms = util::hash_of_mallocs();
stdostream() << std::fixed << std::setprecision(2) << clock << " " << std::hex << ms << " ";
count_++;
last_clock_ = clock;
@@ -120,6 +118,9 @@ private:
}
};
UniqueDrivenEngine make_DriverStubTest() {
return UniqueDrivenEngine(new DriverStubTest);
}
UniqueDrivenEngine make_DriverWebServerTest() {
return UniqueDrivenEngine(new DriverWebServerTest);