Skip to content

Commit

Permalink
Purged deprecated function calls (mostly in tests marked failing, but…
Browse files Browse the repository at this point in the history
… some real tests)
  • Loading branch information
edwardalee committed May 7, 2022
1 parent 94ea0bb commit 18d29a0
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion org.lflang/src/lib/c/reactor-c
2 changes: 1 addition & 1 deletion test/C/src/DeadlineAnytime.lf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ reactor A {
if (self->i == 42) {
printf("SUCCESS\n");
} else {
error_print_and_exit("Expected 42, but got %d", self->i);
lf_print_error_and_exit("Expected 42, but got %d", self->i);
}
=}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ reactor Looper(incr:int(1), delay:time(0 msec), stp_offset:time(0)) {
reaction(in) {=
instant_t time_lag = lf_time_physical() - lf_time_logical();
char time_buffer[28]; // 28 bytes is enough for the largest 64 bit number: 9,223,372,036,854,775,807
readable_time(time_buffer, time_lag);
lf_readable_time(time_buffer, time_lag);
lf_print("Received %d. Logical time is behind physical time by %s nsec.", in->value, time_buffer);
self->received_count = self->count;
=} STP (stp_offset) {=
instant_t time_lag = lf_time_physical() - lf_time_logical();
char time_buffer[28]; // 28 bytes is enough for the largest 64 bit number: 9,223,372,036,854,775,807
readable_time(time_buffer, time_lag);
lf_readable_time(time_buffer, time_lag);
lf_print("STP offset was violated. Received %d. Logical time is behind physical time by %s nsec.", in->value, time_buffer);
self->received_count = self->count;
=} deadline (10 msec) {=
instant_t time_lag = lf_time_physical() - lf_time_logical();
char time_buffer[28]; // 28 bytes is enough for the largest 64 bit number: 9,223,372,036,854,775,807
readable_time(time_buffer, time_lag);
lf_readable_time(time_buffer, time_lag);
lf_print("Deadline miss. Received %d. Logical time is behind physical time by %s nsec.", in->value, time_buffer);
self->received_count = self->count;
=}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ reactor Looper(incr:int(1), delay:time(0 msec), stp_offset:time(0)) {
reaction(in) {=
instant_t time_lag = lf_time_physical() - lf_time_logical();
char time_buffer[28]; // 28 bytes is enough for the largest 64 bit number: 9,223,372,036,854,775,807
readable_time(time_buffer, time_lag);
lf_readable_time(time_buffer, time_lag);
lf_print("Received %d. Logical time is behind physical time by %s nsec.", in->value, time_buffer);
=} STP (stp_offset) {=
instant_t time_lag = lf_time_physical() - lf_time_logical();
char time_buffer[28]; // 28 bytes is enough for the largest 64 bit number: 9,223,372,036,854,775,807
readable_time(time_buffer, time_lag);
lf_readable_time(time_buffer, time_lag);
lf_print("STP offset was violated. Received %d. Logical time is behind physical time by %s nsec.", in->value, time_buffer);
=} deadline (10 msec) {=
instant_t time_lag = lf_time_physical() - lf_time_logical();
char time_buffer[28]; // 28 bytes is enough for the largest 64 bit number: 9,223,372,036,854,775,807
readable_time(time_buffer, time_lag);
lf_readable_time(time_buffer, time_lag);
lf_print("Deadline miss. Received %d. Logical time is behind physical time by %s nsec.", in->value, time_buffer);
=}
in->c.in;
Expand Down
6 changes: 3 additions & 3 deletions test/C/src/modal_models/ModalStartup.lf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ reactor Modal {

initial mode One {
reaction(startup) -> startup1 {=
printf("Startup 1 at (%ld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep);
printf("Startup 1 at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep);
lf_set(startup1, 1);
=}

Expand All @@ -31,7 +31,7 @@ reactor Modal {
}
mode Two {
reaction(startup) -> startup2 {=
printf("Startup 2 at (%ld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep);
printf("Startup 2 at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep);
lf_set(startup2, 1);
=}

Expand All @@ -44,7 +44,7 @@ reactor Modal {

mode Three {
reaction(startup) -> startup3 {=
printf("Startup 3 at (%ld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep);
printf("Startup 3 at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep);
lf_set(startup3, 1);
=}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ reactor ImportantActuator {
(tag_t){.time=SEC(1) * self->c, .microstep=0}) == 0) {
self->success++; // Message was on-time
} else {
error_print_and_exit("Normal reaction was invoked, but current tag doesn't match expected tag.");
lf_print_error_and_exit("Normal reaction was invoked, but current tag doesn't match expected tag.");
}
self->c++;
=} STP (0) {=
Expand All @@ -65,7 +65,7 @@ reactor ImportantActuator {

reaction(shutdown) {=
if ((self->success + self->success_stp_violation) != 2) {
error_print_and_exit("Failed to detect STP violation in messages.");
lf_print_error_and_exit("Failed to detect STP violation in messages.");
} else {
info_print("Successfully detected STP violations (%d violations, %d on-time).", self->success_stp_violation, self->success);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ reactor Receiver(take_a_break_after:int(10), break_interval:time(400 msec)) {
if (self->breaks != 3 ||
(self->total_received_messages != ((SEC(1)/self->break_interval)+1) * self->take_a_break_after)
) {
error_print_and_exit("Test failed. Breaks: %d, Messages: %d.", self->breaks, self->total_received_messages);
lf_print_error_and_exit("Test failed. Breaks: %d, Messages: %d.", self->breaks, self->total_received_messages);
}
info_print("SUCCESS: Successfully received all messages from the sender. Breaks: %d, Messages: %d.", self->breaks, self->total_received_messages);
=}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ reactor Looper(incr:int(1), delay:time(0 msec)) {
// Stop the thread that is scheduling actions.
stop = true;
if (self->count != 5 * self->incr) {
error_print_and_exit("Failed to receive all five expected inputs.");
lf_print_error_and_exit("Failed to receive all five expected inputs.");
}
=}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ reactor Looper(incr:int(1), delay:time(0 msec)) {
=}
reaction(t) {=
if (self->received_count != self->count) {
error_print_and_exit("reaction(t) was invoked before reaction(in). Precedence order was not kept.");
lf_print_error_and_exit("reaction(t) was invoked before reaction(in). Precedence order was not kept.");
}
=}
reaction(shutdown) {=
info_print("******* Shutdown invoked.");
if (self->count != 6 * self->incr) {
error_print_and_exit("Failed to receive all six expected inputs.");
lf_print_error_and_exit("Failed to receive all six expected inputs.");
}
=}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ reactor Contained (incr:int(1)) {
=}
reaction(t) {=
if (self->received_count != self->count) {
error_print_and_exit("reaction(t) was invoked before reaction(in). Precedence order was not kept.");
lf_print_error_and_exit("reaction(t) was invoked before reaction(in). Precedence order was not kept.");
}
=}
}
Expand Down Expand Up @@ -57,7 +57,7 @@ reactor Looper(incr:int(1), delay:time(0 msec)) {
reaction(shutdown) {=
info_print("******* Shutdown invoked.");
if (self->count != 6 * self->incr) {
error_print_and_exit("Failed to receive all six expected inputs.");
lf_print_error_and_exit("Failed to receive all six expected inputs.");
}
=}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ reactor Looper(incr:int(1), delay:time(0 msec), stp_offset:time(0)) {
// Stop the thread that is scheduling actions.
stop = true;
if (self->count != 5 * self->incr) {
error_print_and_exit("Failed to receive all five expected inputs.");
lf_print_error_and_exit("Failed to receive all five expected inputs.");
}
=}
}
Expand Down
2 changes: 1 addition & 1 deletion test/Python/src/federated/failing/LoopDistributedDouble.lf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ reactor Looper(incr(1), delay(0 msec)) {
// Stop the thread that is scheduling actions.
stop = true;
if (self->count != 5 * self->incr) {
error_print_and_exit("Failed to receive all five expected inputs.");
lf_print_error_and_exit("Failed to receive all five expected inputs.");
}
=}
}
Expand Down

0 comments on commit 18d29a0

Please sign in to comment.