-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
234 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#line 2 "basic.ino" | ||
#include <ArduinoUnit.h> | ||
|
||
test(correct) | ||
{ | ||
int x=1; | ||
// Use F() to store a string in flash, which saves RAM for long strings | ||
assertEqual(x,1,F("inconceivable!")); | ||
} | ||
|
||
test(incorrect) | ||
{ | ||
int x=1; | ||
// Compose a message with A << B << C << ... | ||
assertNotEqual(x,1,F("we are saying x != 1, which is false when x=") << x << F(", see?")); | ||
} | ||
|
||
test(cases) | ||
{ | ||
int x=3; | ||
for (int k=0; k<4; ++k) { | ||
assertNotEqual(x,2*k-1,"case k=" << k); | ||
} | ||
} | ||
|
||
void setup() | ||
{ | ||
Serial.begin(9600); | ||
while(!Serial) {} // Portability for Leonardo/Micro | ||
} | ||
|
||
void loop() | ||
{ | ||
Test::run(); | ||
} |
Oops, something went wrong.