Skip to content

Commit

Permalink
Merge pull request #1979 from lf-lang/fixing-cpp-unit-tests
Browse files Browse the repository at this point in the history
Minor fixes for C++ tests
  • Loading branch information
cmnrd authored Sep 8, 2023
2 parents f1921bc + 15b5144 commit a07974d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/Cpp/src/ArrayScale.lf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ reactor Scale(scale: int = 2) {
auto array = in.get().get_mutable_copy();
// NOTE: Ideally, no copy copy would be made here, as there is only
// one recipient for the value, but this is not supported yet by the C++ runtime.
for(int i = 0; i < array->size(); i++) {
for(auto i = 0; i < array->size(); i++) {
(*array)[i] = (*array)[i] * scale;
}
out.set(std::move(array));
Expand Down
2 changes: 1 addition & 1 deletion test/Cpp/src/enclave/EnclaveMultiportToPort.lf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ reactor Source {
output[2] out: int

reaction(startup) -> out {=
for(int i = 0; i < out.size(); i++) {
for(auto i = 0; i < out.size(); i++) {
std::cout << "Source sending " << i << ".\n";
out[i].set(i);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Cpp/src/enclave/EnclaveMultiportToPort2.lf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ reactor Source {
output[2] out: int

reaction(startup) -> out {=
for(int i = 0; i < out.size(); i++) {
for(auto i = 0; i < out.size(); i++) {
std::cout << "Source sending " << i << ".\n";
out[i].set(i);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Cpp/src/multiport/MultiportFromBankHierarchyAfter.lf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ reactor Destination {
state received: bool = false

reaction(in) {=
for (int i = 0; i < in.size(); i++) {
for (auto i = 0; i < in.size(); i++) {
int value = *in[i].get();
std::cout << "Destination channel " << i << " received " << value << '\n';
if (i != value) {
Expand Down
2 changes: 1 addition & 1 deletion test/Cpp/src/multiport/MultiportFromHierarchy.lf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ reactor Source {
state s: int = 0

reaction(t) -> out {=
for(int i = 0; i < 4; i++) {
for(auto i = 0; i < 4; i++) {
out[i].set(s++);
}
=}
Expand Down
2 changes: 1 addition & 1 deletion test/Cpp/src/multiport/MultiportIn.lf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ reactor Destination {

reaction(in) {=
int sum = 0;
for (int i = 0; i < in.size(); i++) {
for (auto i = 0; i < in.size(); i++) {
sum += *in[i].get();
}
std::cout << "Sum of received: " << sum << ".\n";
Expand Down
2 changes: 1 addition & 1 deletion test/Cpp/src/multiport/MultiportToMultiportArray.lf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ reactor Destination {
int sum = 0;
for (auto i : in.present_indices_unsorted()) {
const auto& a = *in[i].get();
for (int j = 0; j < a.size(); j++) {
for (auto j = 0; j < a.size(); j++) {
sum += a[j];
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/Cpp/src/multiport/MultiportToPort.lf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ reactor Source {
output[2] out: int

reaction(startup) -> out {=
for(int i = 0; i < out.size(); i++) {
for(auto i = 0; i < out.size(); i++) {
std::cout << "Source sending " << i << ".\n";
out[i].set(i);
}
Expand Down

0 comments on commit a07974d

Please sign in to comment.