Skip to content

Commit

Permalink
New tests of piping of analog node operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
sofian committed Aug 14, 2024
1 parent c8ad64a commit 1a841da
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/operations/operations.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ DigitalOut dOut1(0);
DigitalOut dOut2(1);
AnalogOut aOut1(9);
AnalogOut aOut2(10);
AnalogOut aOut3(11);

test(digital) {
Plaquette.step();
Expand Down Expand Up @@ -71,6 +72,18 @@ test(analog) {
assertEqual(dOut2*2.0f, 2.0f);
assertEqual(aOut1*2, 0.0f);
assertEqual(aOut2*2, 2.0f);

(aOut1+aOut2) >> aOut3;
assertEqual(aOut3, 1.0f);

(aOut2-aOut1) >> aOut3;
assertEqual(aOut3, 1.0f);

(aOut1*aOut2) >> aOut3;
assertEqual(aOut3, 0.0f);

(aOut2/aOut2) >> aOut3;
assertEqual(aOut3, 1.0f);
}

void setup() {
Expand Down

0 comments on commit 1a841da

Please sign in to comment.