Skip to content

Commit

Permalink
Merge pull request #2343 from lf-lang/auth-fix
Browse files Browse the repository at this point in the history
Added test case for inheriting auth property
  • Loading branch information
lhstrh authored Jul 1, 2024
2 parents a7ea2a9 + 7862d0a commit 5ccb6f3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
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);
=}
}

0 comments on commit 5ccb6f3

Please sign in to comment.