Skip to content

Commit 77b0f3f

Browse files
committed
Cleaned up code more, added better example of memory testing.
1 parent b141582 commit 77b0f3f

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

libraries/ArduinoTestSuite/examples/ATS_Constants/ATS_Constants.pde

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//* Open source as per standard Arduino code
55
//*
66
//************************************************************************
7-
//* Oct 16, 2010 <ROA> Started on String Test
7+
//* Oct 16, 2010 <ROA> Test of Arduino Constants
88
//************************************************************************
99

1010
#include "WProgram.h"
@@ -17,12 +17,11 @@ void setup()
1717
char testName[64];
1818
int startMemoryUsage;
1919

20+
//Start memory usage must be site prior to ATS_begin
2021
startMemoryUsage = ATS_GetFreeMemory();
21-
2222
ATS_begin("Arduino", "Test of Arduino Constants");
23-
2423
/*
25-
* Run the tests
24+
* Test Run Start
2625
*/
2726

2827

@@ -57,7 +56,7 @@ void setup()
5756
ATS_PrintTestStatus( "7. Test of hexadecimal constant", (0x101 == 257));
5857

5958
/*
60-
* Test complete
59+
* Test Run End
6160
*/
6261
ATS_ReportMemoryUsage(startMemoryUsage);
6362
ATS_end();

libraries/ArduinoTestSuite/examples/ATS_Skeleton/ATS_Skeleton.pde

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,26 @@ void setup()
1616
{
1717
char testName[64];
1818
int startMemoryUsage;
19-
19+
20+
//startMemoryUsage must be set directly before ATS_begin
2021
startMemoryUsage = ATS_GetFreeMemory();
21-
2222
ATS_begin("Arduino", "Skeleton Test");
23-
24-
2523
/*
26-
* Run the tests
24+
* Test Run Start
2725
* Test one passes because result is set to true
2826
* Test two fails becuase result is set to false
2927
* You can test memory for any set of tests by using the ATS_ReportMemoryUsage test
3028
* There is also a way to print current memeory for debugging
3129
*/
32-
3330
ATS_PrintTestStatus("1. Test of true test status", true);
34-
31+
3532
ATS_PrintTestStatus("2. Test of false test status, this will fail.", false);
3633

37-
34+
ATS_ReportMemoryUsage(startMemoryUsage);
3835
/*
39-
* Test complete
36+
* Test Run End
4037
*/
41-
ATS_ReportMemoryUsage(startMemoryUsage);
38+
4239
ATS_end();
4340

4441
}

libraries/ArduinoTestSuite/examples/ATS_StringTest/ATS_StringTest.pde

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ void setup()
2222

2323
/*
2424
* Test Variable Setup
25+
* Best practive set all your test variables prior to teseting.
26+
* This is required for Memory tests.
2527
*/
2628

2729
String stringOne = String("stringThree = ");

0 commit comments

Comments
 (0)