-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed test so that stop time is not earlier than request_stop time
- Loading branch information
1 parent
d51f98f
commit eaac986
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |