Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test case for inheriting auth property #2343

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions test/C/src/target/InheritedAuth.lf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Test passes if it runs successfully.
// Demonstrates inheritance of "auth" target property from import.
// Also see: https://github.com/lf-lang/lingua-franca/issues/2326
target C {
timeout: 1 s
}

import R1 from "lib/R1.lf"

reactor R0 {
output out: int
state s: int = 0
timer t(0, 100 ms)

reaction(t) -> out {=
self->s ++ ;
lf_set(out, self->s);
lf_print("R0 is sending %d.", self->s);
=}
}

federated reactor {
r1 = new R1()
r0 = new R0()
r0.out -> r1.in
}
11 changes: 11 additions & 0 deletions test/C/src/target/lib/R1.lf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
target C {
auth: true
}

reactor R1 {
input in: int

reaction(in) {=
lf_print("R1 reacted to input %d", in->value);
=}
}
Loading