Skip to content

Commit

Permalink
Fixed test so that stop time is not earlier than request_stop time
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardalee committed Oct 3, 2024
1 parent d51f98f commit eaac986
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/C/src/enclave/EnclaveRequestStop.lf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** Test that enclaves all stop at the time requested by the first enclave to request a stop. */
target C {
timeout: 10 sec
}

reactor Stop(stop_time: time = 5 s) {
preamble {=
#include "platform.h" // Defines PRINTF_TIME
=}
timer t(stop_time)

reaction(t) {=
lf_request_stop();
=}

reaction(shutdown) {=
lf_print("Stopped at tag (" PRINTF_TIME ", %d)", lf_time_logical_elapsed(), lf_tag().microstep);
if (lf_time_logical_elapsed() != 50000000LL || lf_tag().microstep != 1) {
lf_print_error_and_exit("Expected stop tag to be (50ms, 1).");
}
=}
}

main reactor {
@enclave
s1 = new Stop()
@enclave
s2 = new Stop(stop_time = 50 ms)
}

0 comments on commit eaac986

Please sign in to comment.